title: Configure Debian VPS network to work under an another Debian

text: I have a very big problem. Our VPS is under DDoS every day and now i bought a DDoS protected second vps temporary (until the main VPS get the DDoS protection). My question is how can i setup the second VPS to work as a proxy and the main VPS to work under the second VPS network? I saw an iptables rule with masquerade but that mask the source IP address, and i dont want to mask that. With a program, iptables rules or with something else?


title: After yum update is it a good idea to restart the server?

text: I'm aware that it is good to run `yum update` from time to time to keep my Centos server updated, and I even see that there is way to automate this update. My question is, is it necessary to restart the server after the update? Is it a good idea? What happens if I keep updating and never restart? * * * So from the answers, I believe it is correct to say that I need to restart the server if the Kernel, libc, glibc has been updated. Alternatively use KSplice.


title: get driver for dell wireless card

text: iam using laptop dell inspiron 15R 5537 ... using dell wireless card 1705 ... and wireless is not defined on any linux distro i tried (ubuntu , debian , elemetary OS luna , gentoo ) :( i searched google for it .. but i couldn't find any useful solution .. btw when it type ifconfig .. it displays lo and eth0 only .. and iwconfig no wireless driver ... and lspci it contain the network ethernet but no wireless defined


title: big-scale tracker alternative for server filesystems

text: I'm using 8tb RAID storage (XFS filesystem) filled witch lots of files. By default Suse had installed tracker for file indexing/searching but:   1. It's constantly reading HDDs (like for half a year now and it _always_ takes ~90% I/O) and making the OS sluggish.   2. It simply doesn't work - it found 96 videos when I have a few thousand and 80k pictures when I have few single directories with > 500k in each + many smaller ones. When I'm looking at its statistics I feel as if it scanned just few gb. Is there any better alternative? I'm mostly concerned with command-line search as many of these directories can't be even displayed properly by KDE (KDE apps throw file protocol error after opening >500k directories)


title: Installing Texlive on PC-BSD 8.2

text: How can I install TexLive on PC-BSD 8.2 and set all the environment variables?


title: Count running processes using wc and ps

text: I tried using `ps r > log | wc log` but this returns `Ambiguous output redirect.`. Can someone explain why and provide another solution?


title: Low resolution after installing 2 sata drives?

text: I installed an enclosure with 2 sata drives on my Xubuntu 12.04.4 LTS machine. To do this, I unplugged the computer, including the dvi cable. When I restarted, everything was ok except that the monitor now has a 800x600 resolution.   1. I couldn't come back to the native resolution from the Display option in settings.   2. yes, I tried turning it off and on again (several times) both the machine and the monitor. I even unplugged the monitor for a while to "forget" resolutions (it does that).   3. my xrandr says Screen 0: minimum 8 x 8, current 800 x 600, maximum 8192 x 8192 DVI-I-0 disconnected (normal left inverted right x axis y axis) VGA-0 disconnected (normal left inverted right x axis y axis) DVI-I-1 connected 800x600+0+0 (normal left inverted right x axis y axis) 0mm x 0mm 800x600 60.3*+ HDMI-0 disconnected (normal left inverted right x axis y axis)   4. My hwinfo framebuffer says 02: None 00.0: 11001 VESA Framebuffer   [Created at bios.464] Unique ID: rdCR.b_h4NC20Mi2 Hardware Class: framebuffer Model: "NVIDIA GT218 Board - a65sdr26" Vendor: "NVIDIA Corporation" Device: "GT218 Board - a65sdr26" SubVendor: "NVIDIA" SubDevice: Revision: "Chip Rev" Memory Size: 14 MB Memory Range: 0xd1000000-0xd1dfffff (rw) Mode 0x0300: 640x400 (+640), 8 bits Mode 0x0301: 640x480 (+640), 8 bits Mode 0x0303: 800x600 (+800), 8 bits Mode 0x0305: 1024x768 (+1024), 8 bits Mode 0x0307: 1280x1024 (+1280), 8 bits Mode 0x030e: 320x200 (+640), 16 bits Mode 0x030f: 320x200 (+1280), 24 bits Mode 0x0311: 640x480 (+1280), 16 bits Mode 0x0312: 640x480 (+2560), 24 bits Mode 0x0314: 800x600 (+1600), 16 bits Mode 0x0315: 800x600 (+3200), 24 bits Mode 0x0317: 1024x768 (+2048), 16 bits Mode 0x0318: 1024x768 (+4096), 24 bits Mode 0x031a: 1280x1024 (+2560), 16 bits Mode 0x031b: 1280x1024 (+5120), 24 bits Mode 0x0330: 320x200 (+320), 8 bits Mode 0x0331: 320x400 (+320), 8 bits Mode 0x0332: 320x400 (+640), 16 bits Mode 0x0333: 320x400 (+1280), 24 bits Mode 0x0334: 320x240 (+320), 8 bits Mode 0x0335: 320x240 (+640), 16 bits Mode 0x0336: 320x240 (+1280), 24 bits Mode 0x033d: 640x400 (+1280), 16 bits Mode 0x033e: 640x400 (+2560), 24 bits Mode 0x0345: 1600x1200 (+1600), 8 bits Mode 0x0346: 1600x1200 (+3200), 16 bits Mode 0x034a: 1600x1200 (+6400), 24 bits Mode 0x0360: 1280x800 (+1280), 8 bits Mode 0x0361: 1280x800 (+5120), 24 bits Config Status: cfg=new, avail=yes, need=no, active=unknown how do I go back to my native resolution? Thanks.


title: Crunchbang hibernate rebooted system?

text: I installed the latest stable 64bit Crunchbang backport. When I tried to hibernate it last night, it rebooted into the locked state - when I logged back in all my windows/apps were as they were again. Two things:   * How do I get Crunchbang to hibernate? hibernate works in my Windows7 partition. Crunchbang is installed on a separate physical drive than Windows and the bios.   * How did Crunchbang effectively shutdown and restart with the state of all my opened apps intact? If this a feature can someone tell me how to do it explicitly because it would be really useful.


title: Using DNSMasq for Local Hostname Resolution

text: I'm working on setting up a home intranet for me and my roommates. My idea is that we'll be able to store things like past utility bills in a place that's more accessible than a drawer in the kitchen etc. Anyway, I have Apache 2 running on a Raspberry Pi, on my LAN, and if I use its IP address, I can access pages being served on the Pi. Since I'm doing this project more to learn about networking as to provide a service to my apartment, I thought it would be cool if my network could provide hostname resolution for my LAN. So rather than point my browser to `192.168.1.151`, the Pi's IP address, I could point it to `oberon` (its hostname) and view the web pages served by the Pi. Now I knew I was not the first person to want to do this, so I started by Googling. This question, also on Unix & Linux, has helped me immensely: How to make a machine accessible from the LAN using its hostname. At this point, I've tried everything in the verified answer. I thought about using the `hosts` file, but that would mean I would have to tell my roommates to configure their machines, which I don't want to them to have to do. I tried to reserve a DHCP lease for the Pi on my router (a NETGEAR WNR1000v2 (aka an N150)), and while the reservation worked, hostname resolution does not. This kind of frustrates me because I told my router the IP of the Pi _and_ its hostname, yet it still does not provide this information to clients on my LAN. With these two methods not working, I decided to install `dnsmasq` on the Pi. It seemed simple to configure and I would be happy to learn a new tool. I installed and have it running just fine (it seems). I can `dig` or `nslookup` the Pi's nicknames (which I set in `/etc/hosts` to `oberon` and `homenet`) and get the correct results. I can do the same for internet names like `yahoo.com` and get correct answers because I set up Google's `8.8.8.8` and `8.8.4.4` as backup servers in `/etc/dnsmasq.conf`. See this:               me@oberon~$ dig oberon          ; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> oberon     ;; global options: +cmd     ;; Got answer:     ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10787     ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0          ;; QUESTION SECTION:     ;oberon.                                IN      A          ;; ANSWER SECTION:     oberon.                 0       IN      A       192.168.1.151          ;; Query time: 10 msec     ;; SERVER: 127.0.0.1#53(127.0.0.1)     ;; WHEN: Sun Oct  6 18:59:18 2013     ;; MSG SIZE  rcvd: 40      Note that the `SERVER` is `127.0.0.1`: `oberon` is looking up its own IP address on itself. This is what I expected to see. Output is the same if I do `dig oberon @localhost`. Because of this output, I'm thinking that `dnsmasq` is working fine. So to bring it to the next level, I want _all_ clients on my LAN to be able to be able to type `oberon` in their browser and be taken to `oberon`'s index page. For this I know I need to configure my router (apologies if this veers away from strictly Unix & Linux territory). I have a Netgear WNR1000v2 that I am fairly familiar with. I have configured port forwarding so I can SSH into the Pi, and I've poked around in other settings as well. I know that before I started this project, I was getting my DNS servers from my ISP, but now I want to use those DNS servers primarily but also use `192.168.1.151` as a last check. So I changed my router's DNS config to the following: ![My router's new DNS config. Trust me when I say the first two entries are provided by my ISP](http://i.stack.imgur.com/jA6GR.png) So with this config, I expected to be able to do `nslookup oberon` on my (Windows) desktop and get a result of `192.168.1.151`. But this does not happen. This is what does happen:               C:\Users\me>nslookup oberon     Server:  UnKnown     Address:  fe80::226:f2ff:fefa:bea          *** UnKnown can't find oberon: Non-existent domain      Resetting or `dnsflushing` the network adapter on my Windows machine does not change anything. Now here's why I'm kind of tearing my hair out here:               C:\Users\me>nslookup oberon 192.168.1.151     Server:  oberon.lan     Address:  192.168.1.151          Name:    oberon     Address:  192.168.1.151      Clearly, `dnsmasq` is working just fine. If I tell my Windows box to use `192.168.1.151` to resolve the name `oberon`, everything is fine (the `.lan` domain was part of the configuration of `dnsmasq`, so I expected to see it there). If I could just get my router to tell my Windows machine to use `192.168.1.151` when it makes DNS queries, I should be good! So it seems to me that the problem is in my router, but I just can't figure out what to do beyond changing the DNS servers to include `192.168.1.151` like I already have. Can anyone help me here? I will try to provide any further information desired.


title: use SSH tunnel to baypass Captive portal

text: I know that DNS tunneling is the good choice when we try to bypass captive portal, but i tried to do SSH tunneling instead of DNS but it doesn't works, technically speaking is that possible -bypass captive portal using SSH tunnel- ?


title: Differences between Debian and Ubuntu

text: I'm getting sick of Ubuntu's seemingly random changes. I'm thinking of switching to Debian permanently. Does anyone know if there's a list of changes between the two distros somewhere? I want to know what I'm getting myself into.


title: What's a good way to filter a text file to remove empty lines?

text: I have a .csv file (on a mac) that has a bunch of empty lines, e.g.:               "1", "2", "lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum           lorem ipsum ","2","3","4"     "1", "2", "lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum           lorem ipsum ","2","3","4"      Which I want to convert to:               "1", "2", "lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum ","2","3","4"     "1", "2", "lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum  lorem ipsum ","2","3","4"      I know there must be a one liner but I don't know awk or sed. Any tips greatly appreciated!


title: Can I change root password by sudo, without su?

text: I can sudo, but I don't have the root password so I can't `su root`. Using sudo, can I change the root password?


title: Customizing bash shell: Bold/color the command

text: There are a number of tutorials/posts online (e.g. http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt- under-linux-or-unix/) about how to customize your prompt in bash by setting PS1. Is there a way to customize the color/bolding of the command I type? In other words, as an example lets say that I wanted a green prompt, a bold blue command, and then output in whatever colors would be default. In the example below, I already know how to make "joe>" show as green, blue, bold, whatever by setting PS1. But is there a way I can I make "git status' show as bold for example?               joe> git status     # On branch master     # Your branch is ahead of 'origin/master' by 2 commits.     #     ...


title: Booting without initrd

text: Is it possible to boot linux without a initrd.img ? I am planning to add default drivers as a part-of-kernel itself and avoid initrd completely. What are the modules that should be made part-of-the-kernel instead of loadable modules ?


title: How to cancel :X encryption in vi

text: This has annoyed me for years but I've never found a solution. Instead of pressing Esc then :x to save an exit from vi, I accidentally type a capital X and press Enter. The only way to continue is to allow encryption. Surely there's a cancel command at this point?


title: Coreboot + QEMU Tutorial Request (Google has failed)

text: Can anyone point me in the direction of an end-to-end idiot-proof coreboot+qemu tutorial? I'm having trouble understanding how qemu is set up to emulate different hardware (also having trouble getting my head around the chicken and egg status of kernel cross-compilation) These tutorials have several gaps that are catching me unawares. I'm not usually an embedded guy, and my virtualisation background is more enterprise level than hardware level.


title: Map Super+[Left|Right] to Home/End

text: How do I map key "Super" so, when combined with Left/Right, it produces keycode Home/End? My current setxkbmap:               setxkbmap \       -model pc105 \       -layout 'us(dvorak-intl),us(alt-intl)' \       -option \       -option grp:lctrl_lshift_toggle \       -option compose:rwin


title: where is PCB on linux

text: PCB is process control black , this is its definitions on Wikipedia > Process Control Block (PCB, also called Task Controlling Block,[1] Task > Struct, or Switchframe) is a data structure in the operating system kernel > containing the information needed to manage a particular process. The PCB is > "the manifestation of a process in an operating system and its duty is :               Process identification data     Processor state data     Process control data      So where is PCB?


title: NSLookup how to interpret output

text: Hi can someone help me to understand what this NSLOOKUP command's output               [x]$ nslookup sample.abc.com     Server:         161.43.32.162     Address:        161.43.32.162#53<-- ???          Name:   sample.abc.com     Address: 161.43.30.72      In the address part one with arrow pointing question mark. What does the hash before 53 stands for? Thanks in advance


title: Split PDF into colour and black/white pages

text: I would like to automatically split a large PDF document into two files: one file should contain only the pages with black and white content, and the other should contain only the pages with any colour content. The colour and black/white pages do not run contiguously -- they are interspersed throughout the document. How can I do this automatically?


title: Install TFTP-Server without Internet

text: Due to some company policy, I cannot connect my Centos linux computer to the internet. However, I would like to set up a TFTP-Server, and I saw a tutorial that does this here. http://n40lab.wordpress.com/2014/01/29/centos-6-5-installing-a-tftpd-server- for-uploading-configuration-files/ Once I run yum install it goes and searches for the dependancy files on the internet. My question is : Is there any way for me to install TFTP-Server without connecting to the internet?


title: Interruption of system calls when a signal is caught

text: From reading the man pages on the `read()` and `write()` calls it appears that these calls get interrupted by signals regardless of whether they have to block or not. In particular, assume   * a process establishes a handler for some signal.   * a device is opened (say, a terminal) with the `O_NONBLOCK` **not** set (i.e. operating in blocking mode)   * the process then makes a `read()` system call to read from the device and as a result executes a kernel control path in kernel-space.   * while the precess is executing its `read()` in kernel-space, the signal for which the handler was installed earlier is delivered to that process and its signal handler is invoked. Reading the man pages and the appropriate sections in SUSv3 'System Interfaces volume (XSH)', one finds that: i. If a `read()` is interrupted by a signal before it reads any data (i.e. it had to block because no data was available), it returns -1 with `errno` set to [EINTR]. ii. If a `read()` is interrupted by a signal after it has successfully read some data (i.e. it was possible to start servicing the request immediately), it returns the number of bytes read. **Question A):** Am I correct to assume that in either case (block/no block) the delivery and handling of the signal is not entirely transparent to the `read()`? Case i. seems understandable since the blocking `read()` would normally place the process in the `TASK_INTERRUPTIBLE` state so that when a signal is delivered, the kernel places the process into `TASK_RUNNING` state. However when the `read()` doesn't need to block (case ii.) and is processing the request in kernel-space, I would have thought that the arrival of a signal and its handling would be transparent much like the arrival and proper handling of a HW interrupt would be. In particular I would have assumed that upon delivery of the signal, the process would be temporarily placed into **user mode** to execute its signal handler from which it would return eventually to finish off processing the interrupted `read()` (in kernel-space) so that the `read()` runs its course to completion after which the process returns back to the point just after the call to `read()` (in user-space), with all of the available bytes read as a result. But ii. seems to imply that the `read()` is interrupted, since data is available immediately, but it returns returns only some of the data (instead of all). This brings me to my second (and final) question: **Question B):** If my assumption under A) is correct, why does the `read()` get interrupted, even though it does not need to block because there is data available to satisfy the request immediately? In other words, why is the `read()` not resumed after executing the signal handler, eventually resulting in all of the available data (which was available after all) to be returned?


title: Web based voice chat application

text: I'm looking for a simple server-webclient voice chat software, but yet I only saw "voxli" and it's down. Is there any such software which could be run on a linux based server (raspberrypi actually)? I wanted a web based client because guys won't need to download another software, I hope this exists! Thanks for suggestions


title: Pros and cons of software Parity-RAID (e.g. RAID5)

text: I was recently told about some problems concerning Parity-RAIDs without a non- volatile cache. More exspensive HW-controllers do have battery-powered caches to finish write-operations in case of power failure. Now, some people say that such a failure, perhaps in combination with a degraded array, may kill your whole filesystem. Others claim that those issues are outdated and/or misconceptions. Unfortunately, nobody gives hard references and neither a search for _md RAID and non-volatile cache_ , nor for _bitmap caching_ gives reliable answers about if md-RAID5 is advisable or not. Any information about that?


title: Disable browser logging output to console

text: I'm currently using Ubuntu 11.04 and I'm running into a _really_ annoying issue while developing for web. I'm rather new to Ubuntu, coming from FreeBSD where I never encountered an issue like this, so I'm hoping that someone else here has and can point me in the right direction. I do all development in vim (console). Whenever a browser (in this case, either chromium or firefox) feels that it needs to log some error or assert, it dumps it out to all active consoles. Sometimes showing up over my work, sometimes not. Forcing a full screen refresh (either through changing the console to full screen or minimizing/maximizing) gets rid of the text, but it's still annoying to have to do any time I encounter this problem. Is there a way to disable either of these browsers from logging like this? Is there a compiler flag or is it something that I can set through browser options or command line parameters?


title: Filter / select folders using wildcards

text: For my mecurial ignore file I want to select all the folders that start with `dataset` in my project folder with with one 'glob statement'. Example project folder:               my_project_folder/        dataset1/        dataset2/        dataset3/        code.py      I tried `dataset*/` but that selects nothing. What would be the right statement?


title: Understanding -regex with GNU find

text: ## Background I have what I think _should_ be a simple case. I want to find all files with "cisco" in the name and do something with those files (via xargs). ### Finding files with `ls` Before I use xargs, the first step is listing all relevant files. Listing files is easy with `ls | grep cisco`...               [mpenning@Bucksnort post]$ ls | grep cisco     cisco-asa-double-nat.rst     cisco-asa-packet-capture.rst     cisco-eem-tcl.rst     cisco-ip-sla-tracking.rst     cisco_autonomous_to_lwap.rst     [mpenning@Bucksnort post]$      ### Finding files with `find` Although it's probably not required in this specific case, find is generally considered safer when piping into xargs. However, all logic seems to go out the window when I use `find -regex`.               [mpenning@Bucksnort post]$ find -regextype grep -regex ".*/cisco*" -print     [mpenning@Bucksnort post]$      However, I know I can find those files...               [mpenning@Bucksnort post]$ find | grep cisco     ./cisco-eem-tcl.rst     ./parsing-cisco-output-w-textfsm.rst     ./cisco_autonomous_to_lwap.rst     ./cisco-ip-sla-tracking.rst     ./cisco-asa-double-nat.rst     ./cisco-asa-packet-capture.rst     [mpenning@Bucksnort post]$      ## Questions I realize that `find -regex` has to match the full path that is returned, but why isn't `find -regextype grep -regex ".*/cisco*" -print` working above? Shouldn't `.*/cisco*` match the path? * * * _NOTES_ I know I could just use `find -path "*cisco*"` to solve the problem, but the point of the question is to understand why my `-regex` usage is wrong.


title: Starting certain applications fullscreen in Xfce

text: Is it possible to make Xfce window manager to open certain applications fullscreen by default? For example i want Emacs in Xfce to be always run fullscreen on start. I know how to execute specifically Emacs fullscreen, so i want an Xfce solution. I tried searching through Xfce wiki, Xfce page on Arch wiki and Unix.SE with AskUbuntu, no solution yet.


title: How to send an email to myself on the same local machine (tcp port 25)

text: Does anyone know how to sent email to myself?   I am trying to generate TCP traffic on port 25.


title: How to create a volume group, logical volume and a file system on AIX?

text: I'm getting some difficulties to create a file system on an AIX server. In Linux the task is easy and takes four commands, but I cannot figure out how to do it in AIX. On Linux I'd do the following:               lvcreate -L 6G -n oracle_rec_sei data_vg     mkfs -t ext3 /dev/data_vg/oracle_rec_sei     mkdir -p /appli/oracle/REC_SEI     mount /dev/data_vg/oracle_rec_sei /appli/oracle/REC_SEI      On AIX I am trying with the following commands but in this case there isn't a volume group defined. The commands I've found are giving me errors according to the absence of a volume group. I'm trying to create a filesystem of 0.25G with this commands:               mklv -y lvoractl01HIST -c 1 jfs2 2 --> 2 blocks of 127Mb     crfs -v jfs2 -d /dev/lvoractl01 -m /appli2/oracle/AGEV/oractl01 -a agblksize='4096'     mount /dev/lvoractl01AGEV      I obtained numerous errors with the first command (`mklv -y lvoractl01HIST -c 1 jfs2 2`) because it needs the definition of a volume group. What are the steps to create a volume group, a logical volume and a file system (all of a given size) on an AIX host?


title: solaris 10 + display 2 lines after match by grep?

text: I want to match for example: The string **e1000g0** from the **lltconfig -a list** , and then to display the two lines after the string e1000g0 so I get only the lines:                      Node   0 du1a      :   00:21:28:14:76:68            Node   1 du1b      :   00:21:28:59:72:C4  permanent      please advice how the get only the two lines after? full example from ( lltconfig -a list ):                lltconfig -a list      Link 0 (e1000g0):            Node   0 du1a      :   00:21:28:14:76:68            Node   1 du1b      :   00:21:28:59:72:C4  permanent                Link 1 (e1000g1):            Node   0 du1a      :   00:21:28:14:76:69            Node   1 du1b      :   00:21:28:59:72:C5  permanent                Link21 (e1000g2):            Node   0 du1a      :   00:21:28:14:76:49            Node   1 du1b      :   00:21:28:59:72:A5  permanent      I also try this ( but its work only for linux and not on solaris -:(                      lltconfig -a list | grep -A 4 "e1000g0"  | grep -v "e1000g0"            grep: illegal option -- A            Usage: grep -hblcnsviw pattern file . . .


title: gdm greeter configuration: Exclude all *except* for one specific user

text: I have Googled this one and tried so many combinations, with no success. I need the GDM login greeter to display one and only one username. In effect, what I need is something like this in **/etc/gdm/custom.conf** :               [greeter]     ExcludeAll=true     Include=guest      This does not work, however, because ExcludeAll is not a valid option. IncludeAll=false does nothing either. I've tried every combination that I can think of. Despite being discouraged, I modified **/etc/gdm/gdm.schemas** , trying a variety of combinations similar to the above. No go. I am aware of:               gconftool-2 --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --direct --type bool --set /apps/gdm/simple-greeter/disable_user_list true      but this is not an applicable solution, as it removes the user list completely. I need one specific username to appear. The only practical solution I can find is to, upon user login, run a script which will append that username to the "Exclude" list in **/etc/gdm/custom.conf**. This is hacky, and not preferable. This is for a public-use machine. People can log in with their LDAP accounts if they have them, or they can select "Guest" from the login screen. The people who log in with their LDAP accounts should NOT have their names visible on the login screen, but the "Guest" option must remain. Using gnome 2.28.


title: office 2007 under wine: available for all user accounts?

text: I have succesfully installed office 2007 using Wine under 1 account on my parents computer (which now runs on linux mint 13 LTS XFCE). I installed it under 1 account and normally, when you do this in windows, it is installed for all accounts. But because I have installed it under Linux using Wine, this does not apply to this situation. therefore, my question is: (How) can I make office 2007 also available for the other user? I guess activating for the 2nd time (which is needed after install) will not work. Can I install it on another drive besides the win c drive and have it shared this way? Can I also create a shortcut in the wine 'start' menu under 'programs'?


title: How to solve this memory issue gracefully?

text: I have a standard Linux (Debian testing) laptop, with a swap partition. I do a lot of experiments with it. Some of them are really memory hungry and the way Linux behaves by default is an issue for me... Let's give a stupid example:   1. Sit in front of the laptop   2. Open a terminal   3. Type `python`, then `a = [0]*100000000` Now chances are high that you won't have enough RAM to handle that big list. Linux will fill the RAM, then the swap and, a couple of minutes later, the OOM killer will be triggered off and kill (almost) random services and hopefully, if you hit Ctrl+C at the good time, `python`, and if the terminal still had focus, the computer will become responsive again. I'd like to enforce some memory limits to avoid that unwanted swapping and to refuse to a process the right to allocate more memory than I have (in RAM). If the memory demand is below a certain limit or asked by root, then just kill the most memory hungry process of any user except root. `ulimit -Sv [mem]` I hear in the back! Ho Ho! "Use `cgroups` via `cgexec`!" someone says at the first row! Yes, you are right: these are indeed very good solutions. But:   * They do not apply system-wide    * The limits are set per-process   * The limits are static, disregarding the real amount a free RAM (AFAIK)   * Here and there, they say these are not really a good solution to enforce hard limits. What I'd like is that the kernel say: "You belongs to user _foo_ (not root), you use a lot of memory and we're gonna run out of memory. Sorry dude... die now!" Or: "What the hell are you doing? You need _x_ MB and there is only _y_ MB available. Yes, SWAP is empty, but you don't intend to use the SWAP to do your dirty work, do you? No, I said no! No memory for you! If you insist, you're gonna die!"


title: How to configure SFTP so it behaves like ftp chrooting user to his home directory?

text: I have installed `vsftpd` utility on Fedora 10 to restrict users to their (chroot) home directories. It works fine when I use `ftp` prompt to connect. However it does not work when i connect using `sftp`. What changes are required in order to achieve same functionality with `sftp`?


title: How to re-enable iptables on Fedora 18?

text: FirewallD is the default firewall in Fedora 18. I have been using `iptables` for quite some time and have a custom configuration which I need for logging of ip traffic. I am not used to the new graphical interface which seems to lack many of the functionalities present in the old one, that can be loaded with ease. I tried to re-enable the old iptables with the following commands:               # systemctl stop firewalld.service     # systemctl start iptables.service     # systemctl start ip6tables.service      The messages log shows: > systemd 1 Started IPv4 firewall with iptables.   >  systemd 1 Started IPv6 firewall with ip6tables. But from `systemctl -t service -a`, I can see that both remain inactive and dead, despite being loaded. Nevertheless, I tried loading the custom configuration with               iptables-restore < iptables.conf      but got a series of warnings: > WARNING: The state match is obsolete. Use conntrack instead.   >  WARNING: The state match is obsolete. Use conntrack instead.   >  WARNING: The state match is obsolete. Use conntrack instead.   >  WARNING: The state match is obsolete. Use conntrack instead.   >  WARNING: The state match is obsolete. Use conntrack instead. What should I do to get iptables back to work?


title: Why are inotify events different on an NFS mount?

text: Some time ago I noticed that the events reported by inotify are different when the file is saved to an NFS mount vs. a local file system. Shouldn't the underlying VFS provide a uniform view of file operations? The following is the trace of VIM saving a file in Debian 7.1 (Linux 3.2) On an NFS mount:               wd=1 mask = 32 (IN_OPEN)     wd=1 mask = 16 (IN_CLOSE_NOWRITE)     wd=1 mask = 2048 (IN_MOVE_SELF)     wd=1 mask = 4 (IN_ATTRIB)     wd=1 mask = 1024 (IN_DELETE_SELF)     wd=1 mask = 32768 )      On a local file system               wd=1 mask = 32 (IN_OPEN)     wd=1 mask = 16 (IN_CLOSE_NOWRITE)     wd=1 mask = 2 (IN_MODIFY)     wd=1 mask = 32 (IN_OPEN)     wd=1 mask = 8 (IN_CLOSE_WRITE)     wd=1 mask = 4 (IN_ATTRIB)      Saving a file with EMACS also reveals different beahvior On an NFS mount:               wd=1 mask = 32 (IN_OPEN)     wd=1 mask = 16 (IN_CLOSE_NOWRITE)     wd=1 mask = 2048 (IN_MOVE_SELF)      On a local file system:               wd=1 mask = 32 (IN_OPEN)     wd=1 mask = 16 (IN_CLOSE_NOWRITE)     wd=1 mask = 2 (IN_MODIFY)     wd=1 mask = 32 (IN_OPEN)     wd=1 mask = 2 (IN_MODIFY)     wd=1 mask = 8 (IN_CLOSE_WRITE)      These tests werer run with inotify-touch.c


title: How to bind ppp0 interface (PPTP VPN) as 'external' in proxy server?

text: I'm trying to bind ppp0 interface (PPTP VPN) as 'external' interface in proxy server (Tinyproxy). Unfortunately it does not work. Using route add -net default gw 10.9.0.1 I can make all the traffic go via VPN but this is not what I want. My routes after ppp0 is up:               default         192.168.1.1     0.0.0.0         UG    0      0        0 eth0     10.9.0.1        *               255.255.255.255 UH    0      0        0 ppp0     192.168.1.0     *               255.255.255.0   U     0      0        0 eth0 216-18-212-218. 192.168.1.1     255.255.255.255 UGH   0      0  0 eth0      ifconfig:               eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500             inet 192.168.1.100  netmask 255.255.255.0  broadcast 192.168.1.255             inet6 fe80::21d:60ff:fe25:7ad6  prefixlen 64  scopeid 0x20<link>             ether 00:1d:60:25:7a:d6  txqueuelen 1000  (Ethernet)             RX packets 47533  bytes 31947804 (30.4 MiB)             RX errors 0  dropped 1  overruns 0  frame 0             TX packets 44946  bytes 6618945 (6.3 MiB)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0          lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436             inet 127.0.0.1  netmask 255.0.0.0             inet6 ::1  prefixlen 128  scopeid 0x10<host>             loop  txqueuelen 0  (Local Loopback)             RX packets 13167  bytes 1604741 (1.5 MiB)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 13167  bytes 1604741 (1.5 MiB)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0          ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1496             inet 10.9.34.125  netmask 255.255.255.255  destination 10.9.0.1             ppp  txqueuelen 3  (Point-to-Point Protocol)             RX packets 1088  bytes 568896 (555.5 KiB)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 1328  bytes 167081 (163.1 KiB)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0      Do I need to add some other, specific route? Other proxy server? What IP Tinyproxy 'external should be bound to (I've tried both gw and peer)?


title: Mouse scroll wheel issues

text: I'm been having issues with the scroll-wheel on my mouse for ages now. I've got a Silverstone Raven mouse, and the scrolling action is extremely jerky. If I scroll either up or down, at a natural speed, the scroll action will jerk in the wrong direction almost as much as it goes in the right direction. I have to scroll almost twice as much to get where I want in a page, and often I'll lose track of where I am because it's not behaving as expected. If I deliberately scroll really slowly, it will go in the correct direction, as expected, but it's really painful. So, to check that this isn't just a dodgy mouse, I rebooted into Windows - a rare occurrence for me these days - and tried it in there. Scrolling works beautifully; it's really smooth, no glitching, and is a pleasure to use. Back in Linux-land, the scroll wheel is 'orrible. In KDE System Settings, I have tried changing the number of lines the mouse wheel scrolls by, but this doesn't affect the glitchiness... The mouse section of my `/etc/X11/xorg.conf` is as configured by default and looks like:-               Section "InputDevice"         # generated from default         Identifier     "Mouse0"         Driver         "mouse"         Option         "Protocol" "auto"         Option         "Device" "/dev/psaux"         Option         "Emulate3Buttons" "no"         Option         "ZAxisMapping" "4 5"     EndSection      Anyone have any suggestions how to get my mouse working nicely? I'm on Linux 3.7.6 and this has been an issue for about two years now; I just haven't bothered to tell anyone 'til now..


title: zshell is tab-completing ambiguous options

text: I've been having an issue with zsh completion that's becoming a rather large annoyance. It's completing options beyond where there is ambiguity. For example, in a directory with these files: tilertest1x1-00_1408311424.log   tilertest1x1-00_1408311424.root   tilertest2x2-00_1408311501.log   tilertest2x2-00_1408311501.root   tilertest3x3-00_1408311527.log   tilertest3x3-00_1408311527.root If I type "less ti" and then hit tab, zsh completes to this "tilertest-00_1408311." as opposed to stopping where I want it to ("tilertest"). Strangely, if I provide any kind of path (i.e. "less ./ti") it seems to work just fine. How can I change it to stop at the very first ambiguity? If it helps I've included my .zshrc file. I should also note I'm using oh-my-zsh. I have a feeling the solution is trivial, but I can't find anything searching around. Any help would be appreciated.               # Path to your oh-my-zsh installation.     export ZSH=$HOME/.oh-my-zsh          # Set name of the theme to load.     # Look in ~/.oh-my-zsh/themes/     # Optionally, if you set this to "random", it'll load a random theme each     # time that oh-my-zsh is loaded.     ZSH_THEME="cmilke01"          # Example aliases     # alias zshconfig="mate ~/.zshrc"     # alias ohmyzsh="mate ~/.oh-my-zsh"          # Uncomment the following line to use case-sensitive completion.      CASE_SENSITIVE="true"          # Uncomment the following line to disable bi-weekly auto-update checks.     # DISABLE_AUTO_UPDATE="true"          # Uncomment the following line to change how often to auto-update (in days).     # export UPDATE_ZSH_DAYS=13           # Uncomment the following line to disable colors in ls.      # DISABLE_LS_COLORS="true"           # Uncomment the following line to disable auto-setting terminal title.      # DISABLE_AUTO_TITLE="true"           # Uncomment the following line to disable command auto-correction.       DISABLE_CORRECTION="true"           # Uncomment the following line to display red dots whilst waiting for     completion.      # COMPLETION_WAITING_DOTS="true"          # Uncomment the following line if you want to disable marking untracked files     # under VCS as dirty. This makes repository status check for large repositories     # much, much faster.     # DISABLE_UNTRACKED_FILES_DIRTY="true"          # Uncomment the following line if you want to change the command execution time     # stamp shown in the history command output.     # The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"     # HIST_STAMPS="mm/dd/yyyy"          # Would you like to use another custom folder than $ZSH/custom?     # ZSH_CUSTOM=/path/to/new-custom-folder          # Which plugins would you like to load? (plugins can be found in ~/.oh-my-  zsh/plugins/*)     # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/     # Example format: plugins=(rails git textmate ruby lighthouse)     plugins=(git)          source $ZSH/oh-my-zsh.sh          # User configuration          export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl"     # export MANPATH="/usr/local/man:$MANPATH"          # You may need to manually set your language environment     # export LANG=en_US.UTF-8          # Preferred editor for local and remote sessions     # if [[ -n $SSH_CONNECTION ]]; then     #   export EDITOR='vim'     # else     #   export EDITOR='mvim'     # fi          # Compilation flags     # export ARCHFLAGS="-arch x86_64"          # ssh     # export SSH_KEY_PATH="~/.ssh/dsa_id"


title: infinality fonts and Windows fonts emulation

text: I want to emulate Windows 7 fonts on my Ubuntu 13.10 system. I installed infinality and tried a couple of themes via `infctl.sh` (`Win7` and `OSX2` ones). Alas, none of them was fully suitable: `OSX2` theme needs to be darker and `Win7` theme needs to be thicker. I tried to modify the filter matrix via `infinality-settings.sh`. It writes the proper (modified) values to the environment variables, but nothing happens to my rendered fonts. I restarted my machine several times, but it does not help. Can anyone tell me the proper way to modify my filter settings? P.S. My antialiasing settings are here. ![A comparison between real Windows fonts and pre-defined themes of infinality](http://i.stack.imgur.com/3HjS0.png)


title: Why do all applications go to the 'Others' App Folder in Gnome Shell 3.8?

text: I just upgraded my laptop to Fedora 19, which comes with Gnome Shell 3.8. Gnome shell 3.8 has got rid of the traditional Categories in favor of something called App Folders. I have been trying to learn how to create and use them. One thing I have not been able to understand is why the 'Others' menu/app folder has all my apps. In `/etc/xdg/menus/gnome-applications.menu` it is defined like:                   <Name>Other</Name>         <Directory>X-GNOME-Other.directory</Directory>         <OnlyUnallocated/>         <Include>           <And>             <Not><Category>Core</Category></Not>             <Not><Category>Screensaver</Category></Not>                  <!-- Really Fedora ??? -->             <Not><Filename>gnome-eog.desktop</Filename></Not>             <Not><Filename>gnome-file-roller.desktop</Filename></Not>             <Not><Filename>gnome-gucharmap.desktop</Filename></Not>           </And>         </Include>       </Menu> <!-- End Other -->      I read from some spec that `<OnlyUnallocated/>` tag should only match, and add to the menu, applications that have not been matched to any other menu. I also do not see where it decides to include the apps, as `<Include></Include>` just contains apps _not_ to include. I assume it is either defined somewhere else, or the name 'Other' is just somewhat special. Am I understanding something wrong about the definition of these menus, or is Gnome Shell 3.8 doing it's own thing, and not working 100% according to these files? (I suspect the former)


title: X11 platform in Google Account Activity

text: My Google Activity Report typically shows access from "Windows", "Linux" and "Android" platforms. This month, it is also showing access from the "X11" platform. What would report as "X11"? A question here simply suggests that "X11" means "Linux". However, "Linux" has previously (and still) shows up as a seperate entry.


title: Why is sendmail appending my hostname to unknown destination domain?

text: I am testing the handling of mail bouncing. When I send a test email to a bad domain, for example: eric@blahblahfail.org, I get the following error in my log: SYSERR(root): blahblahfail.org.mydomain.org. config error: mail loops back to me (MX problem?) It seems that if dns fails on the destination domain, sendmail will append my domain to the bad domain. Why does this happen? And should I expect mail to bounce if the domain is bad? The Unknown-user @ good-domains type of bounces do work for me. Possible relevant sendmail config lines:               FEATURE(always_add_domain)dnl     FEATURE(use_cw_file)dnl      Notes: I have tried removing the always_add_domain Feature. I have my domains listed in /etc/mail/local_host/names


title: Kill and resume a rsnapshot backup properly

text: Suppose that after starting a `rsnapshot` backup on my laptop I notice that it will take too long time and that I have to shutdown the laptop in a few minutes. Is there a way to quit `rsnapshot` without messing up the running backup and resume it later (for example after rebooting the laptop) without problems?


title: How to remove a newline character in a particular line through perl?

text: I want to remove a newline character in a particular line through perl one- liner command. **Input:**               1407233497,1407233514,bar     1407233498,1407233515,foo     mingstats&fmt=n     1407233499,1407233516,foobar      **Expected output:**               1407233497,1407233514,bar     1407233498,1407233515,foomingstats&fmt=n     1407233499,1407233516,foobar      **What i tried so far?** This regex `\n(?!\d+,\d+)` matches exactly the newline that i want to remove. But i don't know how to implement it through perl one-liner command. I tried,               perl -pe 's/\n(?!\d+,\d+)//g' file      But it removes all the newline characters in that file and finally print the below in a single line,               1407233497,1407233514,bar1407233498,1407233515,foomingstats&fmt=n1407233499,1407233516,foobar      I will be so happy if the perl one-liner command uses above regex...


title: What is Darwin's 'private' directory for?

text: Darwin has a `private` directory that I don't see in the Unix documentation I've found. Is that a Mac-specific directory? What is it for? Is it preserved between system upgrades?


title: sed/awk/perl - delete spaces between two strings/words + solaris 10

text: please advice how to delete the spaces between "=" to the value/string ( after the "=" character) , should be implemented by awk or sed or perl command and command must to fit for solaris OS , ( command should be in my bash script ) I have SOLARIS 10 OS example 1 ( before update ) more file                a=2      b= 45      c=   4      d= 98      e=09      f= gdtd      g=     @7h      parameter5=    87      example 2 ( after update ) more file               a=2     b=45     c=4     d=98     e=09     f=gdtd     g=@7h     parameter5=87


title: Is there any way to play these videos in Linux?

text: I haven't been able to play videos from here. I tried Moonlight, but it doesn't show an image, just sound, and _sometimes_ some part of the image, but mostly a black canvass. Thanks.


title: Putty doesn't seem to start from python'd crontab

text: I have the following Python script, `chmod +x`'d. When I run this script from the command line and Putty has not been started, it launches putty:               #!/usr/bin/env python     from __future__ import print_function          import shlex     import subprocess          output = subprocess.check_output(['ps', 'aux'])     found = False     for line in output.split('\n'):         if line.endswith('putty -load test'):             found = True             break          if not found:         print("Starting Putty")         subprocess.Popen(['putty',                           '-load',                           'test'])     else:         print("Putty going strong")      However, if **I** don't start putty, then it will just keep saying "Starting Putty" (which I have directed to a file for logging). My _guess_ is that it has something to do with the display, but I'm not sure how to fix it or even exactly what I would look for.


title: Removing information such as soft links from an RPM package on Linux

text: I provide an RPM package that contains both 32-bit and 64-bit applications, and can be installed in either mode, i.e. on both 32-bit and 64-bit platforms. As the package contains both applications, when trying to install the RPM package on a 32-bit Linux machine it creates soft links for 64-bit applications too, along with the 32-bit application. During post-install I remove the soft-links for the 64-bit application as we cannot install it on a 32-bit machine. Unfortunately, although the package is already installed on the 32-bit machine, and I have removed the soft links for the 64-bit application as a part of the post-install, the RPM still contains info for these 64-bit application soft links, which can be seen when queried through the `rpm` command but which in reality are not present. How can I query through `rpm` and remove the extra info for a 64-bit application? This should be done during installation of the 32-bit package, but may be done in post-install.


title: Arrays and loops in zsh

text: I am trying to learn loops and array manipulation in `zsh`. Say I have two arrays in zsh with the same **unknown** # of elements and each of them containing a list of paths, e.g.               LOCAL_ARRAY=($LOCAL_PATH_1 $LOCAL_PATH_2 $LOCAL_PATH_3)     REMOTE_ARRAY=($REMOTE_PATH_1 $REMOTE_PATH_2 $REMOTE_PATH_3)      I would like to iterate through both arrays simultaneously with a common index, so that I can do something like:               cd $LOCAL_PATH_i     hg pull $REMOTE_PATH_i      in each iteration. How can I do this in zsh? Also, I have searched for loop control and arrays in the zsh documentation but had little success. Is there a good **tutorial** that introduces the basics of **loops** , **arrays** , etc. in zsh? Something for people with little bash or shell-scripting experience but with a background in programming?


title: How can I search/browse in some process's memory?

text: I'm using MacOS X 10.7 and I'm not very familiar with unix. Is there a command for a search in some process's memory for a string?


title: What is the point of sshd “UseDNS” option?

text: I know what it does, but i don't know _why_. What attack(s) does it prevent ? Is it relevant for all kind of authentication methods ? (hostbased, password, publickey, keyboard-interactive ...)


title: How to trace a java-program?

text: As a sysadmin I sometimes face situations, where a program behaves abnormally, while not creating errors at all or creating nonsense error-messages. In the past - before java came in - there were two counter-measures:   1. If nothing else helps - RTFM ;-)   2. If even 1. does not help - trace the system-calls and see what is happening I usually use `strace -f` for this task with Linux (other OS have similar trace-tools). Now while this usually works well for any old-fashioned program, the trace gets very fuzzy when doing the same on a **java** -process. There are so many system-calls seemingly unrelated to any real action, that it is terrible to search through such a dump. Are there better ways to do that (if the source-code is not available)?


title: Why do I have to restart NetworkManager.service all the time?

text: After switching to systemd, I started to use NetworkManager.service, I got connected to WIFI automatically at boot, but I got the following message when I run `nmcli con`:               ** (process:4433): WARNING **: Could not initialize NMClient /org/freedesktop/NetworkManager: Method "GetAll" with signature "s" on interface "org.freedesktop.DBus.Properties" doesn't exist          Error: nmcli (0.9.6.4) and NetworkManager (unknown) versions don't match. Force execution using --nocheck, but the results are unpredictable.      And from systemctl:               NetworkManager.service                              loaded active running       Network Manager      Now if I restart `NetworkManager.service`, it works. Why is that?


title: How to get list of members subscribed to a list - Mailman

text: I have an Ubuntu server with Postfix and the Mailman list manager. My server stopped working, so I need to find a way to list the emails registered on the list of the Mailman. Note: I was able to mount the data partition, so I have all the files.


title: Wrong emblem used for PDFs created by LibreOffice

text: If I create a test pdf file in a directory, by using something like               ls -al > testpdf.pdf      the file is shown in Caja 1.4.0 with an understandable emblem that is 'acrobat-like'. If I create a LibreOffice document in Writer and export it to PDF in the same directory, its emblem is a grey 'sheet of text' which makes it very hard to spot. How can I change the icon/emblem used by PDFs created by LibreOffice? Can I just overwrite the file used somewhere in `/usr/shr/icons`? If so, will it be overwritten by the next LibreOffice update?


title: ls on device without mounting it

text: Is it possible to run `ls` on a device without mounting it first?   Something like this:               # ls /dev/sda1


title: Cron job does not fire up after a timezone change

text: I've tried eliminating many of the common errors, 1) ensuring that the PATHs are available for cron 2) there is an endline at the end of crontab file 3) the timezone is set-up by:               cd /etc     cp /usr/share/zoneinfo/Asia/Singapore /etc/localtime      running `date` in bash, I get:               Tue Sep 17 15:14:30 SGT 2013      in order to check if cron is using the same time,               * * * * * date >> date.txt      is giving the same date output in date.txt.    This is the script I'm trying to execute: [event.sh]               #!/usr/bin/env bash     echo data > /root/data.txt      using `crontab -e`, the line below works,               * * * * * /bin/bash /root/event.sh >/tmp/debug.log 2>&1          15 * * * * /bin/bash /root/event.sh >/tmp/debug.log 2>&1      however, when i tried some other arguments, hoping it would run at 2.50pm:               50 14 * * * /bin/bash /root/event.sh >/tmp/debug.log 2>&1      or               50 14 * * * (cd /root ; ./event.sh >/tmp/debug.log 2>&1)      it will no longer work. Seems like there is a problem with my hour argument. Nothing could be found in the /tmp/debug.log file either. SOLUTION: it turned out i have to restart the cron service after making changes to TZ.


title: How to migrate files on Linux from HDD to SSD on a VDS

text: I upgraded my Dedicated Server and I was having problems finding my SSD. I found out how to MOUNT my SSD. I now have my 100 GB HDD and now 20 GB HDD.               [root@server /]# mount /dev/xvdb1 /ssd     [root@server /]# df -h     Filesystem            Size  Used Avail Use% Mounted on     /dev/xvda2             99G  6.6G   87G   8% /     tmpfs                 938M     0  938M   0% /dev/shm     /dev/xvda1            194M   50M  134M  28% /boot     /dev/xvdb1             20G  7.0M   19G   1% /ssd     [root@server /]#      My goal is to transfer everything over to `/ssd` but I need to bring services over like httpd and mysqld along with my databases and things and make them run on the SSD. How can I make this move?


title: less command and syntax highlighting

text: I need to use the `less command` with the syntax highlighting of the vim command for `python`, `C`, `bash` and other languages. How do I apply syntax highlighting colors according to `vim` colors for `less command`?


title: hosts.allow: %u not working (log username)

text: I need to keep track of all `SSH` connections on my server. In my `/etc/hosts.allow` I have something like this:               sshd: ALL : spawn ( echo "`date` from %u %a " >> /var/log/ssh/%d.log ) &      where `%a` logs the client IP, and `%u` is supposed to log the username. But instead `%u` just logs `unknown`. Is there a way to fix this? I need to log both the IP and the username for each connection.


title: How to modify mount options in an OpenBSD install?

text: How exactly can I modify different mount options for a FS at an OpenBSD install? IT's crazy, but I just can't find it. I'm at here:               W # Use (W)hole disk or (E)dit the MBR?     E # Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout?      but I just can't find it in the "?" pages of disklabel..


title: Loading a kernel driver to a specific memory address

text: How can I load a kernel driver at a specific memory address? How could it be done with the following methods?   1. commands/scripts like `insmod` or `modprobe`   2. using C code (not sure if there may exist such an option)


title: Transform a tar archive's paths without extracting it

text: GNU `tar(1)` has a neat option called `--transform`. From the man page: > **\--transform, --xform EXPRESSION**   >  use sed replace EXPRESSION to transform file names This allows transformation of path names on the fly as the archive is being extracted so that you may control where and how it will be extracted. My question is, is there a way to perform a similar transformation _in situ_ ; i.e., without extracting the archive? **Example**               [user@host]$ tar tf test.tar     ./foo/blah  ./foo/bleh     [user@host]$ some_deep_magic 's/foo/bar/' test.tar     [user@host]$ tar tf test.tar     ./bar/blah  ./bar/bleh      **Use case** I'm distributing a `tar` archive to basically clueless end users and would like it to extract into the correct path without interference from me. I'm trying to avoid the trivial solution of extracting the archive, renaming the directories and repacking as the archive is largish.


title: where is the user content on a Mac OS X disk?

text: I have a friend's Mac OS X disk that comes with an `HFS+` partition. I am supposed to recover the personal data from this disk (it's not yet clear if the FS is corrupted or the disk dying), but for the life of me I cannot understand what is the traditional file-tree structure on a `Mac OS X` disk. Where is the user content located? On Windows it's in `My Documents`, on Linux it's in `/home/user`, but where is it on `Mac OS X`? * * * **EDIT1** : If I mount the drive on Linux I get the following:               liv@liv-HP-Compaq-dc7900:/media/Macintosh HD$ cat /etc/mtab | grep -i hfsplus     /dev/sdc2 /media/Macintosh\040HD hfsplus ro,nosuid,nodev,uhelper=udisks 0 0      And doing an `ls` on the mount point doesn't contain any mention of `Users` in it:               liv@liv-HP-Compaq-dc7900:/media/Macintosh HD$ ls -lh     ls: cannot access home: Input/output error     ls: cannot access libpeerconnection.log: Input/output error     ls: cannot access net: Input/output error     ls: reading directory .: Input/output error     total 20M     drwxrwxr-x 1 root   80  53 Oct 18 22:07 Applications     drwxr-xr-x 1 root root  39 Sep 26 00:51 bin     drwxrwxr-t 1 root   80   2 Jul  9  2009 cores     dr-xr-xr-x 1 root root   2 Jul  9  2009 dev     lrwxr-xr-x 1 root root  11 Sep 24  2009 etc -> private/etc     lrwxr-xr-x 1 root   80  60 Mar 20  2010 Guides de l’utilisateur et informations -> /Library/Documentation/User Guides and Information.localized     d????????? ? ?    ?      ?            ? home     -????????? ? ?    ?      ?            ? libpeerconnection.log     drwxrwxr-t 1 root   80  58 Mar 27  2013 Library     drwxrwxrwt 1 root root   4 Sep 18  2012 lost+found     -rw-r--r-- 1 root root 20M Jun  8  2011 mach_kernel     d????????? ? ?    ?      ?            ? net     drwxr-xr-x 1 root root   2 Jul  9  2009 Network     drwxr-xr-x 1  501   80   3 Oct 26  2010 opt     drwxr-xr-x 1 root root   6 Sep 24  2009 private     drwxr-xr-x 1 root root  67 Sep 26 00:52 sbin     drwxr-xr-x 1 root root   4 Jul  3  2011 System     lrwxr-xr-x 1 root root  11 Sep 24  2009 tmp -> private/tmp      But I do see a `home`, though. Does this imply some weird `Mac OS X` configuration? Or is it likely that `Users` was deleted?


title: How to get the Installation path of binary and logic file in Daemon in Arch Linux

text: I want to know that if i install a daemon service in Arch Linux, then what will be the path of the files that will get install. also which files will be install where.


title: Debian: Create compressed Harddrive for copy

text: On my Debian system I have a box with certain configuration settings that I like but I've had to change them continuously. There have been times that I've gotten into a some-what irreversible position. Q: how do I create a compressed copy of my hard drive so that I can put it on external storage and reuse it. I think there's a way to use `dd` but then I want to compress it too to reduce the size to only have in the file that which I need.


title: gdb not launching app

text: I am trying to run a app using gdb in emulator shell. I use following command               gdb <path of exe>      However, The app does not launch and I get following error               Starting program: <path of exe>     [Thread debugging using libthread_db enabled]          Program exited normally.      However, when I attach a running process to gdb, it works fine.               gdb -pid <process_id>      What could be the reason? _**_********               (gdb) b _start     Breakpoint 1 at 0xb40     (gdb) b main     Breakpoint 2 at 0xc43     (gdb) catch syscall exit     Catchpoint 3 (syscall 'exit' [1])     (gdb) catch syscall exit_group     Catchpoint 4 (syscall 'exit_group' [252])     (gdb) r     Starting program: <exe path>     [Thread debugging using libthread_db enabled]          Breakpoint 1, 0x80000b40 in _start ()     (gdb) c     Continuing.     Breakpoint 2, 0x80000c43 in main ()     (gdb) c     Continuing.          Catchpoint 4 (call to syscall 'exit_group'), 0xb7fe1424 in __kernel_vsyscall         ()          (gdb) c     Continuing.          Program exited normally.     (gdb)       What does Catchpoint 4 (call to syscall 'exit_group'), 0xb7fe1424 in __kernel_vsyscall this mean? I probed further and i found this               Single stepping until exit from function main,     which has no line number information.     __libc_start_main (main=0xb6deb030 <main>, argc=1, ubp_av=0xbffffce4,          init=0x80037ab0 <__libc_csu_init>, fini=0x80037b10 <__libc_csu_fini>,          rtld_fini=0xb7ff1000 <_dl_fini>, stack_end=0xbffffcdc) at libc-start.c:258     258 libc-start.c: No such file or directory.         in libc-start.c      However, libc.so is present and i have exported its path also using               export LD_LIBRARY=$LD_LIBRARY:/lib      Why is not loading?


title: Add leading characters infront of string using printf or echo

text: How can I add leading characters to fill a string to a certain length? Assume I want to add zeroes infront of a string, if said string is shorter than 20 characters:               printf '%020s\n' "$line"      However, this fills the string with leading whitespaces, but not anything else e.g. zeroes. The string can be a random string containing numbers and other characters. I don't want to split the string into number + rest for `printf '%020i' $number` or `printf '%020d $number'`. My current output is:                        shortstring      My desired output is:               000000000shortstring


title: adding home directory after -M option

text: First off I'm new to Linux. I have created a new user called " **ginny** " with `-M` option. Now I'm trying to assign a home directory with `usermod -d /link/to/directory ginny` but it doesn't assign a home directory to user ginny.               % su - ginny returns an error     su: warning : cannot chance directory to /abc: No such file or directory     -bash-3.2$:       The `pwd` command returns `/root` for user ginny (maybe because i haven't created her a home directory) but is there any switch that can now allow me to assign a home directory to user ginny?


title: NTP is synced properly but still doesn't update the time?

text: I wanted to test if `ntp` was working on my machine, so I set the time back 5 minutes and restarted ntp               $ sudo service ntp stop     $ sudo date -s "9:40 AM" # This time was 5 minutes ago     $ sudo service ntp start     $ ntpq -c lpeer # Check if sync to servers is working          remote           refid      st t when poll reach   delay   offset  jitter     ==============================================================================      hachi.paina.jp  .INIT.          16 u    -   64    0    0.000    0.000   0.000      ts0.itsc.cuhk.e .INIT.          16 u    -   64    0    0.000    0.000   0.000      ns.tx.primate.n .INIT.          16 u    -   64    0    0.000    0.000   0.000      vpn.ipv4.cz     .INIT.          16 u    -   64    0    0.000    0.000   0.000      europium.canoni .INIT.          16 u    -   64    0    0.000    0.000   0.000     $ date     Mon Sep 23 09:40:50 MDT 2013      It appears that the `ntp` service can connect to its `ntp` servers just fine, but the clock on my machine still isn't updated - even after waiting 5 more minutes. How do I get `ntp` to actually update my system clock?


title: How to know recently updated files

text: If I run iostat -x 1 I saw ocassionally large 5MB to 10MB writes. What files are being written? I want to check the recently created files with size over 5MB for example. How would I do so?


title: Using autofs to mount under each users' home directory

text: _(crosspost from SF, where I wasn't getting much joy)_ I have a CentOS 6.2 box up and running and have configured autofs to automount Windows shares under a /mydomain folder, using various howtos on the internet. Specifically, I have three files: ## /etc/auto.master               # ...     /mydomain   /etc/auto.mydomain --timeout=60     # ...      ## /etc/auto.mydomain               * -fstype=autofs,-DSERVER=& file:/etc/auto.mydomain.sub      ## /etc/auto.mydomain.sub               * -fstype=cifs,uid=${UID},gid=${EUID},credentials=${HOME}/.smb/mydomain ://${SERVER}/&      This works and allows each user to specify their own credentials in a file under their home directory. However, the mounts they create are then available to everyone, with the original user's credentials, until the timeout is reached. This is less than ideal, so I've been looking at trying to do one of the following:   1. Configure autofs so that the mounts are local to each user but under the same path, so they can each simultaneously access `/mydomain/server1` with their own credentials   2. Configure autofs so that the mount points are under each users' home folder, so they can each simultaneously access `~/mydomain/server1` with their own credentials   3. Configure autofs so that the mounts are under a user-named folder, so they can simultaneously access `/mydomain/$USER/server1` with their own credentials (but I would also need to ensure that `/mydomain/$USER` is 0700 to the given $USER) So far, I can't see any way of doing #1, but for #2 or #3, I've tried changing the entry in /etc/auto.master so that the key is either `${HOME}/mydomain` or `/mydomain/${USER}`, but neither have worked (the first showed no matching entry in `/var/log/messages` and the second did not appear to do the variable substitution). Am I missing something obvious? (PS: Bonus props if you can provide a way to avoid the need for a plain-text credentials file -- maybe a straight prompt for username/domain/password, or maybe even some kerberos magic?) (PPS: I have looked briefly at smbnetfs, but I couldn't get it to configure/make -- it asks for `fuse >= 2.6` even though I have v2.8.3 according to `fusermount --version` \-- and I couldn't find a released version for `yum install`) (PPPS: I also briefly looked at the supplied `/etc/auto.smb` but it looked like it would suffer the same sharing issues?)


title: stop/restart X server

text: I want to generate xorg.conf but for that X needs to not be running. How do I stop X or start without it? I tried `ctrl` \+ `alt` \+ `F2` but the X server is still running. I'm running Lubuntu 14.10.


title: IOStat report large ocassional writes but find reports no big file

text: root@host [/home4]# find . -type f -size +2000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'     ./cuntschi/public_html/hello/cache/curl/http%3A%2F%2Ftransport01.files.wordpress.com%2F2009%2F12%2Ftransportenlogistiek.doc: 2.0M     ./newgames/public_html/hello/cache/curl/http%3A%2F%2Fwww.wincouncil.org.sg%2Fimages%2Fnewsroom%2Fnewsletter%2Fnovember-2008.pdf: 2.2M      yet iostat -x 1 shows:               Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util     sdc               0.00  1878.00    8.00  988.00   152.00 22944.00    23.19     7.24    7.27   0.08   7.90     sdb               0.00     0.00   17.00    0.00   216.00     0.00    12.71     0.01    0.35   0.18   0.30     sda               0.00     0.00    2.00   25.00    40.00   200.00     8.89     0.02    0.85   0.15   0.40     sde               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00     sdd               0.00     0.00   10.00    0.00   176.00     0.00    17.60     0.01    1.40   1.20   1.20          avg-cpu:  %user   %nice %system %iowait  %steal   %idle               57.14    0.00   16.79    0.25    0.00   25.81          Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util     sdc               0.00     0.00   20.00    0.00   528.00     0.00    26.40     0.00    0.20   0.15   0.30     sdb               0.00     0.00    8.00    0.00   152.00     0.00    19.00     0.00    0.50   0.50   0.40     sda               0.00     0.00    2.00    0.00    40.00     0.00    20.00     0.00    1.00   1.00   0.20     sde               0.00   191.00    1.00  231.00    16.00  3376.00    14.62     0.70    3.03   0.06   1.40     sdd               0.00     0.00   14.00    0.00   208.00     0.00    14.86     0.01    0.93   0.50   0.70          avg-cpu:  %user   %nice %system %iowait  %steal   %idle               68.20    0.00   22.07    0.25    0.00    9.48          Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util     sdc               0.00     0.00   31.00    0.00   736.00     0.00    23.74     0.01    0.19   0.16   0.50     sdb               0.00   121.00    7.00   46.00   136.00  1336.00    27.77     0.08    1.49   0.15   0.80     sda               0.00     0.00    0.00   34.00     0.00   272.00     8.00     0.03    1.00   0.06   0.20     sde               0.00     0.00    5.00    0.00    96.00     0.00    19.20     0.00    0.80   0.80   0.40     sdd               0.00   583.00    4.00  452.00    72.00  8280.00    18.32     3.96    8.70   0.11   5.20      So basically we got ocassional 22MB files (how else it's 22944/s but there are few files no file bigger than 2 MB               #     # /etc/fstab     # Created by anaconda on Thu Jan  3 07:08:05 2013     #     # 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=44882d5f-91fd-4409-9add-4393e7bd9f99       /       ext4    usrjquota=quota.user,jqfmt=vfsv0        1       1     UUID=ef4193db-62ef-45f0-bb56-98ab35729a7c /boot                   ext3    defaults        1 2     UUID=26eeb365-46c8-4da2-b326-908dedbf91e1 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,relatime         0 0     /dev/sdc1               /home3                  auto    auto,defaults,relatime         0 0     /dev/sdd1               /home4                  auto    auto,defaults,relatime         0 0     /dev/sde1               /home5                  auto    auto,defaults,relatime         0 0


title: Does my hard-drive have bad sectors or not?

text: I got a new drive and I'm confused if `smartctl` detects bad sectors or not. Both short and extended self-tests `completed without error`. But the `Error Log` indicates `Uncorrectable error in data` for `96 sectors`. Here's the `smartctl` output:               smartctl 5.41 2011-06-09 r3365 [i686-linux-3.2.0-52-generic] (local build)     Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net          === START OF INFORMATION SECTION ===     Model Family:     Hitachi Deskstar T7K500     Device Model:     Hitachi HDT725025VLA380     Serial Number:    VFL104R73X993Z     LU WWN Device Id: 5 000cca 316f723ca     Firmware Version: V5DOA73A     User Capacity:    250,059,350,016 bytes [250 GB]     Sector Size:      512 bytes logical/physical     Device is:        In smartctl database [for details use: -P show]     ATA Version is:   7     ATA Standard is:  ATA/ATAPI-7 T13 1532D revision 1     Local Time is:    Wed Feb  5 19:19:29 2014 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:  (0x80) Offline data collection activity                         was never started.                         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:        ( 4949) seconds.     Offline data collection     capabilities:            (0x5b) SMART execute Offline immediate.                         Auto Offline data collection on/off support.                         Suspend Offline collection upon new                         command.                         Offline surface scan supported.                         Self-test supported.                         No 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:    (   1) minutes.     Extended self-test routine     recommended polling time:    (  83) minutes.     SCT capabilities:          (0x003f) SCT Status supported.                         SCT Error Recovery Control 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     0x000b   100   100   016    Pre-fail  Always       -       0       2 Throughput_Performance  0x0005   100   100   050    Pre-fail  Offline      -       0       3 Spin_Up_Time            0x0007   110   110   024    Pre-fail  Always       -       338 (Average 340)       4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       1838       5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0       7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0       8 Seek_Time_Performance   0x0005   100   100   020    Pre-fail  Offline      -       0       9 Power_On_Hours          0x0012   099   099   000    Old_age   Always       -       11746      10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0      12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       1822     192 Power-Off_Retract_Count 0x0032   099   099   000    Old_age   Always       -       2103     193 Load_Cycle_Count        0x0012   099   099   000    Old_age   Always       -       2103     194 Temperature_Celsius     0x0002   162   162   000    Old_age   Always       -       37 (Min/Max 12/48)     196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0     197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0     198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0     199 UDMA_CRC_Error_Count    0x000a   200   253   000    Old_age   Always       -       0          SMART Error Log Version: 1     ATA Error Count: 27 (device log contains only the most recent five errors)         CR = Command Register [HEX]         FR = Features Register [HEX]         SC = Sector Count Register [HEX]         SN = Sector Number Register [HEX]         CL = Cylinder Low Register [HEX]         CH = Cylinder High Register [HEX]         DH = Device/Head Register [HEX]         DC = Device Command Register [HEX]         ER = Error register [HEX]         ST = Status register [HEX]     Powered_Up_Time is measured from power on, and printed as     DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,     SS=sec, and sss=millisec. It "wraps" after 49.710 days.          Error 27 occurred at disk power-on lifetime: 11706 hours (487 days + 18 hours)       When the command that caused the error occurred, the device was active or idle.            After command completion occurred, registers were:       ER ST SC SN CL CH DH       -- -- -- -- -- -- --       40 51 60 e4 33 e7 47  Error: UNC 96 sectors at LBA = 0x07e733e4 = 132592612            Commands leading to the command that caused the error were:       CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name       -- -- -- -- -- -- -- --  ----------------  --------------------       25 03 80 c4 33 e7 40 00      02:28:22.700  READ DMA EXT       25 03 01 00 00 00 40 00      02:28:22.200  READ DMA EXT       25 03 01 00 00 00 40 00      02:28:22.200  READ DMA EXT       25 03 01 00 00 00 40 00      02:28:22.200  READ DMA EXT       ef 03 46 c4 33 e7 00 00      02:28:22.200  SET FEATURES [Set transfer mode]          Error 26 occurred at disk power-on lifetime: 11706 hours (487 days + 18 hours)       When the command that caused the error occurred, the device was active or idle.            After command completion occurred, registers were:       ER ST SC SN CL CH DH       -- -- -- -- -- -- --       40 51 60 e4 33 e7 47  Error: UNC 96 sectors at LBA = 0x07e733e4 = 132592612            Commands leading to the command that caused the error were:       CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name       -- -- -- -- -- -- -- --  ----------------  --------------------       25 03 80 c4 33 e7 40 00      02:28:11.700  READ DMA EXT       25 03 01 00 00 00 40 00      02:28:11.200  READ DMA EXT       25 03 01 00 00 00 40 00      02:28:11.200  READ DMA EXT       25 03 01 00 00 00 40 00      02:28:11.200  READ DMA EXT       ef 03 46 c4 33 e7 00 00      02:28:11.200  SET FEATURES [Set transfer mode]          Error 25 occurred at disk power-on lifetime: 11706 hours (487 days + 18 hours)       When the command that caused the error occurred, the device was active or idle.            After command completion occurred, registers were:       ER ST SC SN CL CH DH       -- -- -- -- -- -- --       40 51 60 e4 33 e7 47  Error: UNC 96 sectors at LBA = 0x07e733e4 = 132592612            Commands leading to the command that caused the error were:       CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name       -- -- -- -- -- -- -- --  ----------------  --------------------       25 03 80 c4 33 e7 40 00      02:28:00.700  READ DMA EXT       25 03 01 00 00 00 40 00      02:28:00.200  READ DMA EXT       25 03 01 00 00 00 40 00      02:28:00.200  READ DMA EXT       25 03 01 00 00 00 40 00      02:28:00.200  READ DMA EXT       ef 03 46 c4 33 e7 00 00      02:28:00.200  SET FEATURES [Set transfer mode]          Error 24 occurred at disk power-on lifetime: 11706 hours (487 days + 18 hours)       When the command that caused the error occurred, the device was active or idle.            After command completion occurred, registers were:       ER ST SC SN CL CH DH       -- -- -- -- -- -- --       40 51 60 e4 33 e7 47  Error: UNC 96 sectors at LBA = 0x07e733e4 = 132592612            Commands leading to the command that caused the error were:       CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name       -- -- -- -- -- -- -- --  ----------------  --------------------       25 03 80 c4 33 e7 40 00      02:27:49.700  READ DMA EXT       25 03 01 00 00 00 40 00      02:27:49.200  READ DMA EXT       25 03 01 00 00 00 40 00      02:27:49.200  READ DMA EXT       25 03 01 00 00 00 40 00      02:27:49.200  READ DMA EXT       ef 03 46 c4 33 e7 00 00      02:27:49.200  SET FEATURES [Set transfer mode]          Error 23 occurred at disk power-on lifetime: 11706 hours (487 days + 18 hours)       When the command that caused the error occurred, the device was active or idle.            After command completion occurred, registers were:       ER ST SC SN CL CH DH       -- -- -- -- -- -- --       40 51 60 e4 33 e7 47  Error: UNC 96 sectors at LBA = 0x07e733e4 = 132592612            Commands leading to the command that caused the error were:       CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name       -- -- -- -- -- -- -- --  ----------------  --------------------       25 03 80 c4 33 e7 40 00      02:27:38.900  READ DMA EXT       25 03 08 7c a8 3a 40 00      02:27:38.900  READ DMA EXT       35 03 08 7c a8 3a 40 00      02:27:38.900  WRITE DMA EXT       25 03 08 7c a8 3a 40 00      02:27:38.900  READ DMA EXT       25 03 08 a4 eb 94 40 00      02:27:38.900  READ DMA EXT          SMART Self-test log structure revision number 1     Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error     # 1  Extended offline    Completed without error       00%     11746         -     # 2  Short offline       Completed without error       00%     11744         -          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.      And here's a screenshot with the `Error Log`: ![enter image description here](http://i.stack.imgur.com/aAmgQ.png) So what is going on? Does the drive have bad sectors or not? * * * **UPDATE1:**   Just to be sure I also used `badblocks` as suggested in How do you use badblocks?. First, the non-destructive, 1h-long read-only method:               root@xubuntu:/home/xubuntu# badblocks -sv /dev/sda     Checking blocks 0 to 244198583     Checking for bad blocks (read-only test): done                                                      Pass completed, 0 bad blocks found. (0/0/0 errors)      And then the destructive, 10h-long write method (use with care!):               root@xubuntu:/home/xubuntu# badblocks -wsv /dev/sda     Checking for bad blocks in read-write mode     From block 0 to 244198583     Testing with pattern 0xaa: done                                                      Reading and comparing: done                                                      Testing with pattern 0x55: done                                                      Reading and comparing: done                                                      Testing with pattern 0xff: done                                                      Reading and comparing: done                                                      Testing with pattern 0x00: done                                                      Reading and comparing: done                                                      Pass completed, 0 bad blocks found. (0/0/0 errors)      As suggested in the answers, it really doesn't look like there are bad sectors on this hard-drive. (Yay!)


title: Allow NonRoot User to Mount a Particular NTFS External Hard Drive

text: I have a 4TB external hard drive connected to an Linux server. The fstab permissions on this drive are set so that only one particular non- root user has access to it:               /dev/disk/by-uuid/CEE0476DE0388DA9/ /mnt/USBexternal ntfs-3g defaults,auto,uid=51343,gid=50432,umask=077 0 0      From a remote location, this user has been successful at doing rsync backups to this external hard drive. However, the external drive doesn't stay mounted as reliably as an internal hard drive does. Every couple of days I'm having to login as root do this command:               mount -a      I would like to give this user the ability to mount this drive, but when the non-root user does mount -a, it tells them they do not have permission to do this:               nonrootuser@server:~$ mount -a     mount: only root can do that      When the non-root user tries to mount this drive specifically, it tells them it is already mounted (even though it isn't):               nonrootuser@server:~$ mount /mnt/USBexternal/     mount: according to mtab, /dev/sdb1 is already mounted on /mnt/USBexternal      As mentioned, the drive is not actually mounted, but (because of the output above) if the non-root user tries to unmount the drive, it says their request disagrees with fstab:               nonrootuser@server:~$ umount /mnt/USBexternal/     umount: /mnt/USBexternal/ mount disagrees with the fstab      How can I permit this user the ability to mount this drive, without giving them any other administrative powers?


title: What is XDG_SESSION_COOKIE, who use it and is it useful for ssh remote login to control local x session?

text: Is it related to DISPLAY? and useful for remotely login a x server to control the local display?


title: How to achieve `losetup -a` behaviour with busybox?

text: `busybox` (at least version 1.7, which I'm bound to use) to not provide the `losetup -a` switch to obtain a list of currently used loop devices plus the associated filename. Is there any way to obtain such a list with `busybox`?


title: In Linux Fedora, How can I select files to move by time interval

text: How can I select and move files that were written in a specified time interval, such as 1530 to 1730 local time on a recent date? Background: I use Linux Fedora 12, and I have made my first, and long overdue, back up of my home directory to an external hard drive preparatory to upgrading to the latest Fedora release, on a new computer, using **rsync**. Unfortunately, although I did a lot of dry runs to check that it would work correctly, I misunderstood the destination file specification and now have all my backed up files (60000 files in 32Gb) mixed in with the original disk contents instead of in their own separate directory. So I would like to select all the files saved during the hour that the backup took, and move them to another directory.


I am using 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux Debian GNU/Linux 7.1 (wheezy) Release: 7.1. I typed "sudo apt-get upgrade" and hoped for the best (I updated all my packages just before doing that with "sudo ap-get update"). I am not aware ow any changes to grub I could have made although I am not owner of this machine, I just happen to have sudo permissions and use it. Please, what should I do? I am afraid of breaking my system:(                A new version of configuration file /etc/default/grub is available, but the version installed currently has been locally modified.                                                                       │ What do you want to do about modified configuration file grub?                                  │           │                                                                                │           │                   install the package maintainer's version                                      │           │                   keep the local version currently installed                                    │           │                   show the differences between the versions                                     │           │                   show a side-by-side difference between the versions                           │           │                   show a 3-way difference between available versions                            │           │                   do a 3-way merge between available versions (experimental)                    │           │                   start a new shell to examine the situation                                    │      Here is the screen after "show the differences between the versions" ![enter image description here](http://i.stack.imgur.com/HYtOe.png)


title: Calling java from Bash: "Cannot execute binary file"

text: I have this simple Bash script:               #!/bin/bash     java -jar ClosureCompiler/compiler.jar --js ../src/typescript.js --js ../src/ts-compiler.js --js_output_file TSCompiler.js      I'm getting this error when I try to run the script using `build.sh` in the MSYS environment under Windows ( **64-bit!** ):               ./build.sh: ./build.sh: cannot execute binary file      But the command itself works if I type it directly into the command line window!


title: Multiple XkbOptions in xorg.conf

text: how should I write multiple XkbOptions in xorg.conf? I've tried "option,option,option", "option, option, option", "option option option" and none of these worked - only the first option was executed.


title: FreeBSD source and how to build

text: A few questions about FreeBSD   1. Where/how should I obtain the source code (ex. through terminal, Download off website)   2. How (on ubuntu) should I build it?   3. Before I build it can I customize it (in other words is possible)?


title: run perl script with unknown perl location

text: I'm developing a perl script which expected to be downloaded by Mac users with a very small knowledge of shell, linux etc, let's say office managers and accountants. After the downloading the script should be executed just by double-clicking via GUI. My goal is to make this as painless as possible to non-tech-savvy user. My doubts are:   * after the downloading the script won't have the executable bit   * if the perl executable is not at the default location then I should write something instead of `#!/usr/bin/perl`. What should I write there? Is there any other way except open a console and type `perl ./script.pl` ?


title: CentOS can't use new extented space on system disc

text: I have CentOS installed in my VirtualBox and there was small HDD for the system itself(about 8-9GB). After some time of using this, this virtual disc got full and I couldn't install updates so I extended the HDD with VBoxManage and GParted to 25GB. But now, even if it has greater capacity, I can't install these updates because of not enought space left. Here is what `fdisk -l` tells me               Disk /dev/sda: 26,2 GB, 26 214 400 000 bajtů     hlav: 255, sektorů na stopu: 63, cylindrů: 3 187     Jednotky = cylindry po 16065 * 512 = 8 225 280 bajtech     Velikost sektoru (logického/fyzického): 512 bajtů / 512 bajtů     Velikost I/O (minimální/optimální): 512 bajtů / 512 bajtů     Identifikátor disku: 0x000242e1          Zařízení Zavádět   Začátek       Konec    Bloky    Id  Systém     /dev/sda1   *           1          64      512000   83  Linux     Diskový oddíl 1 nekončí na hranici cylindru.     /dev/sda2              64        3188    25086976   8e  Linux LVM      (sorry for the language). df -h               Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/VolGroup-lv_root                           6,5G  6,2G     0 100% /     tmpfs                 1,9G  324K  1,9G   1% /dev/shm     /dev/sda1             485M  114M  346M  25% /boot      I've also tried the `resize2fs /dev/sda2` but it gives me an error about bad superblock. So I've tried the `fsck -t ext4 /dev/sda` command but no success again(first error was about that the /dev/sda is currently used and when I booted into the CentOS rescue mode, the error changed to `couldn't open /etc/fstab: No such file or directory` and info about that the superblock is invalid. How can I use the newly added space?


title: match files based on an md5 using find

text: I have a bunch js and css files in a directory. Some of them have been given a name based on an md5() of their content (looks like `f10521a21bb013cb81e0909809818ad6.js`). I'd like to match these files using find. Why does this return 0 results?               find -regex "^[A-f0-9]{32}\.(?:js|css)$"


title: How to permanently disable the Insert key on Linux?

text: The `Insert` is located right next to `Backspace`. So when I am using Leafpad, Gedit, etc., I hit `Insert` by accident often, which causes the cursor to turn into a bold box which over-writes text as I type. How do I disable it?


title: Why do I get error 255 when returning -1

text: I'm new into C++ programming and I have a very basic question. I've noticed that when I return `-1` in C++ program and then check the exit status, I get `255`. Why is that? The code is the most basic:               int main()         {             return -1;         }      Then, after running the compiled code:               echo $?     255


title: How to boot Slackware from second hard disk when it was installed on first?

text: I first installed slackware with the drive in HDD1 slot, then once I got a caddy for HDD2, I reconnected the slackware drive to the HDD2 slot. (I have Windows on my HDD1). Is there a way to boot slackware from HDD2 (my system is a Dell Studio laptop) without reinstalling? Will reinstalling alone even work? Here's the last lines before hangup on boot: ![http://i.imgur.com/02XY18h.jpg](http://i.stack.imgur.com/oj66w.jpg)


title: File (products) of a kernel cross compilation

text: When the kernel is cross compiled (example. `make ARCH=arm CROSS_COMPILE=arm- linux-gnueabi-`), what are the newly created files and their meanings? I'm not looking for a detailed explanation of each new file, just looking to get a conceptual overview of the structure and purpose of special files. * * * In parallel, I'm doing a git versioned kernel build to see what new files will arrive.Will update once it's done.


title: Installing Linux on the TI-nspire

text: I am having trouble installing Linux on my TI-nspire cx cas graphing calculator. I downloaded the files and the Linux image. I have read several websites on the topic but it was not that much help, please tell me how you installed Linux on your TI-nspire calculator. Here are some websites that I used http://hackaday.com/2012/11/12/linux-on-a-nspire-cas-cx-calculator/ http://hackspire.unsads.com/wiki/index.php/Main_Page


title: Trying to create a cron to Rsync then tar the folder

text: I'm stuck at the first hurdle! I want to run a couple of commands from a bash script. First something like this to rsync some directories:               rsync -e ssh -az user-whatever@website.com:/home /location/of/local/folder      Then something like this to tar and copy the files somewhere else:               cd /location/of/local/folder     tar zcf /var/backups/home-`date +%Y%m%d`.tar.gz home      I hope this is making sense. The problem is that obviously I wish for the rsync to finish before the directory is tar'd. So is there a bit of code I can use to make sure that rsync has finished before running the `tar` command? e.g. (pseudo code)               rsync     while(is syncing){         sleep 10     }     tar      Or will my `.sh` script only run the next line after the first line has finished and exited? Thanks for your help.


title: SSH key for HTTP

text: Is it possible to set something up like SSH Keys for http traffic, so that a browser must have the matching key in order to access?