title: Changing pasword for debian live

text: I have a hooks file, in the hooks folder, that looks like this:               echo "root:rootpw" | chpasswd         echo "user:userpw" | chpasswd      After boot, Debian asks for user and password. When I type `user` along with the password above it does NOT work. But, if I type root with the password then I can login? After that I looked at the shadow file, but there is NO `user` in the shadow file.               ld config .. with username=user ..      Any solution?


title: Is it necessary to run a SSH daemon if I use Chef locally?

text: I want to write a `chef` cookbook to setup Linux desktop environments. I created a `kitchen` by `knife solo init chef-repo`, and created a cookbook `hello` and a node file `localhost.json`. Then I run:               $ knife solo cook localhost      and got this error:               Running Chef on localhost...     Checking Chef version...     ERROR: Network Error: Connection refused - connect(2) for "localhost" port 22     Check your knife configuration and network settings      Should I run a ssh daemon even if I use chef host and client in localhost? I'm using `Linux Mint 16` in a VirtualBox environments. And this is my `~/.chef/knife.rb` config file:               log_level                :info     log_location             STDOUT     node_name                'ironsand'     client_key               '/home/ironsand/.chef/ironsand.pem'     validation_client_name   'chef-validator'     validation_key           '/etc/chef-server/chef-validator.pem'     chef_server_url          'https://vm-mint:443'     syntax_check_cache_path  '/home/ironsand/.chef/syntax_check_cache'


title: Automatically restarting network connection

text: I'm having a small issue with my Synology NAS. It keeps throwing off the connection to the internet (local network works fine though). It is quite random, sometimes it doesn't happen for days, sometimes it happens every 10-20 minutes. Tried a hard reset, clean update, everything, yet even on a clean system, in a few day it continues. No other computers show such symptoms on the network. Usually this problem can be solved by an ifdown&&ifup combo, but I'm getting annoyed by it - any time I wish to use the download station, I need to open a terminal session to make sure there's network connection for those few minutes. So the question would be - is there a simple way of automatically resetting the network interface in case there's no connection to the outside? I've been thinking of a minute-poll to google.com, if the request takes longer than 10 seconds, restart the network interface. But I'd prefer something native, that does this automatically (sincerely, I do not wish to write such a script, it's a way too long and tedious process for me).


title: dropboxd hangs at `Connecting...` when started trough systemd on boot

text: I've got a systemd service file `dropbox.service` set up as follows:               [Unit]     Description=dropbox     After=local-fs.target network.target          [Service]     User=romeovs     ExecStart=/usr/bin/dropboxd          [Install]     WantedBy=multi-user.target      this succesfully starts the dropbox daemon if it is run any time after boot. Something seems to go wrong when I `enable` it to run at boot though. `dropbox status` just shows that dropbox is `Connecting...`. My guess is that the network needs to be fully up before dropbox is started. How can I force this with systemd?


title: systemd service that needs .ssh/id_dsa password

text: I have a systemctl service that starts a process `smd-loop` in a `screen` session. This process requires acces to remote SSH sources (for syncing purposes) and thus needs to be able to access my `id_dsa` private key. How can I set up the systemd service so that it will work? The following service starts the process correctly but requires me to attach to the screen session and manually type in the `id_dsa` password.               [Unit]     Description=smd loop     After=local-fs.target network.target          [Service]     User=%i     Group=users     Type=Forking     ExecStart=/usr/bin/screen -S smd-loop-win -md "smd-loop"     RemainAfterExit=yes      When I manually start `smd-loop` the `id_dsa` password is not required since I've insalled the `pam_ssh` module which starts an `ssh-agent` that holds the password at login.


title: how do I configure my RHEL5 or RHEL6 system to use ldap for authentication?

text: I have root access to a RHEL6 system and I want to use the corporate ldap server where I work for user authentication. I ran `authconfig-tui` and checked `[*] Use LDAP` and left `[*] Use Shadow Passwords` checked, then I checked `[*] Use LDAP Authentication` then click the Next button and left `[ ] Use TLS` unchecked and set `Server: ldap://ldap.mycompanysdomainname.com` and set the `Base DN` to what the ldap admin guy told me to use. But I can only log in with the password I set locally on the box for my user account and cannot log on if I use that password that is stored on the ldap server. Isn't there something I need to do in the `/etc/passwd` file of the `/etc/shadow` files ... something like change the passwd field to `red@mycompanysdomainname.com` or something like that?


title: Are sudo and gksudo safe?

text: I noticed after running a `sudo` command in terminal or running a administrative application that uses `gksudo`, it won't ask again for the password for a time (something like 5 minutes). Now let's assume one of the programs (not running as root) I'm using has a zero day exploit (like the web browser or its plugins). And an attacker manages to run arbitrary code on my behalf. Is it possible for an attacker to do `sudo` or `gksudo` without the password prompt before the password expires and take over my system?


title: How to secure Apache/MySql/PHPMyAdmin against brute force/dictionary attacks? (Fail2ban?)

text: I'm wanting to run a publicly accessible server for web hosting. I'm interested in preventing brute force attacks made against PHPMyAdmin or any other form of authentication process I may include in the site. What types of options exist for this without having to monitor every possible login method that may exist that I actually want public facing? I use Fail2ban to block things like too many ssh attempts. I also just started using it for stopping too many PHPMyAdmin login attempts. My concern are other arbitrary login pages that my web developer may create for things specific to the website. Initial thoughts were things like stopping too many requests per X seconds. That, however, would have to be a rather high number to accommodate pages with lots of images and sounds like it would have a lot of room for false positives. I would think this would be similar to how a shared hosting provider would help keep your website secure when they have no idea what content you may have (a bank would obviously not host that kind of information with a shared provider, but many less sensitive sites would still want to keep logins from being brute forced). Perhaps this is the reason for captchas?


title: How to securely allow scp, but not ssh

text: I work from a Mac Book Pro (called foo). I have a server where my customers scp large files to. (called bar). I frequently ssh into bar, and scp a file (called buzz) to my Mac.               bob@foo$ ssh bar       Last login: Fri Aug 23 14:49:32 2013 from foo       bob@bar$ scp /guest/buzz bob@foo:~     Password:       I don't want to enter my password every time I scp a file back to my Mac because I'll eventually automate this.   I know I _could_ setup ssh keys, but I am concerned that if someone hacks `bar` that they could easily access `foo`. (Correct me if I'm wrong) **Is there a way to copy a file from bar to foo, without a password, that wouldn't give someone full shell access to my Mac if the server was compromised?** Note: I'm thinking setting up a new user on my Mac and disabling shell access for that user _might_ work, but I feel like there is a better way. I'd rather not add users if possible.


title: Graphics messed up and unusable applications after gnome shell restart

text: I'm a new user of Fedora 19, which I'm very satisfied of (despite of what will follow). However, after following some advice on installing programs, changing themes and putting shortcuts on the desktop (still can't figure out how), like gnome-tweak-tool and alacarte, I started to have problems when I wanted to restart the gnome shell (`alt`+`F2` \- `r` \+ `return`): on the application menu when I go to "Utilities" or "Others", the graphics become messed up (fragments of white/yellow pixels, messed up fonts, messed up pictures... pixel chaos). There are still some graphical glitches left in the taskbar after this. But most of it, Firefox and some other applications don't work anymore. I really don't know what I've done, but I can't use the system normally anymore. And I don't know if I can reinstall it.


title: USB keyboard only works intermittently in GRUB 2 on reboots - how to make it work consistently?

text: Something weird is going on with my keyboard. The keyboard is a USB-connected Unicomp, which works absolutely flawlessly once the computer is up and running. However, GRUB 2 (specifically, 1.99-27+deb7u1 as shipped in Debian Wheezy) isn't quite so happy. The failure modes make this a little difficult to test, but here's what I've been able to deduce thus far:   * The keyboard status LEDs flash during the POST, so the keyboard is detected (I also get a report "Detected: ... 1 Keyboard"); I've got maybe one "no keyboard detected" error from the POST, nowhere near enough to deduce any pattern to that, and I've been rebooting the system quite a few times in different ways lately   * On a power on from a full power off with the front panel power button, everything seems to work great   * On a reboot (either using `reboot` or `Control`+`Alt`+`Delete` in a booted system _or in GRUB_ ), the keyboard works in GRUB maybe every other time I try   * If I hit the Reset button on the computer to reboot, the keyboard consistently does not work in GRUB when the boot loader comes back, and many times does not react to key presses during the POST either What's even more weird is that I don't recall the computer acting like this before. I'm _hoping_ it's unrelated, but it seems to have started acting up right around when I hooked up the UPS to some more things around my desk, instead of only having hooked it up to the computer and monitor. (No, the UPS is nowhere near overloaded; the load is reported as being in the range 7-20% depending on usage; around 15-16% of maximum load when the computer is up and running normally.) I've Googled and found the suggestion to load the GRUB 2 modules `uhci` and `usb_keyboard`. I added a `GRUB_PRELOAD_MODULES` declaration specifying the two of them to /etc/default/grub and re-ran `update-grub` (there is now `insmod uhci` and `insmod usb_keyboard` in my /boot/grub/grub.cfg), but that does not seem to have changed anything. I've moved the keyboard to another USB port, which does not appear to have helped. I would try an offboard USB controller if I had one handy. BIOS/UEFI setup reports legacy USB support and legacy USB 3.0 support as enabled, and even if it didn't, I don't see why it would sometimes work and sometimes not, especially when many times the only difference between the two is which side of a warm reboot it's on. The motherboard is an ASUS M5A97 Pro with UEFI version `1007 02/10/2012`. I can't think of any other configuration changes I've done that coincide with when the computer started acting up. The logs _do_ mention an upgrade of `linux-image` on Aug 1, and that I reinstalled (it's noted as `upgrade`, but the from-version and to-version are identical) `grub-pc` on Aug 2, but both of those was a week before I even bought the UPS, and two weeks before I hooked it up to more than just the computer and monitor (I take care to not change too many things at once). `uname -r` reports `3.2.0-4-amd64`. I'm running out of ideas to try. **How can I get my USB keyboard to work consistently in GRUB 2?** What else can I check?


title: list of all linux commands which are not for selection

text: I made a small interface for making some simple linux commands. The sort of commands one can enter are very limited and I'm certain no one would do anything intentionally malicious, however I want a list of all the commands in shell scripting that are not just for selection (`grep`, `zgrep`, etc). That way I can cancel execution if I detect one of these keywords that could alter something it's not supposed to. Is there a comprehensive list of all non- selection commands. Inputting `compgen -c` has given me a long list of commands, but I'm not sure if it's comprehensive. And it includes some selection statements too. How can I access execute commands so I can restrict them?


title: Edit Ubuntu ISO

text: Maybe some of you know how to add apps to an Android ROM before it is installed (put them in /system/app). So I wanted to know if there is any way to configure an Ubuntu ISO this easy. I want to add some programs, add my user account, modify the desktop environment.


title: Why does Linux require moving IP from eth interface to bridge interface

text: When a network interface (e.g., eth0) is added to a Linux bridge (e.g., br0), the IP address must be removed from eth0 and added to br0 for the networking to function properly. I recall reading in some Open vSwitch readme file (which I can't find right now) that moving the IP address is required because of how the Linux kernel is implemented. What is it about the implementation of Linux that requires the IP address be moved from the NIC to the bridge?


title: Certain fonts missing from xlsfonts in Centos 6.4

text: I have a certain software on CentOS 6.4 that gave the following error:               X Error of failed request:  BadName (named color or font does not exist)       Major opcode of failed request:  45 (X_OpenFont)       Serial number of failed request:  15       Current serial number in output stream:  30      Running `strace` shows that the error happens just about here:               writev(4, [{"-\2\21\0\4\0\240\0027\0\240\2-adobe-helvetica-bol"..., ...      I thought some fonts were missing from my system, so I went on to insall all xorg-x11-fonts-* packages on my system. The Adobe fonts should be included in the xorg-x11-fonts-75dpi package. I thought the fonts may not be in the fonts path, so I ran `xset q`. The fonts seemed to be in the X font path.               Keyboard Control:       auto repeat:  on    key click percent:  0    LED mask:  00000000       XKB indicators:         00: Caps Lock:   off    01: Num Lock:    off    02: Scroll Lock: off         03: Shift Lock:  off    04: Group 2:     off    05: Mouse Keys:  off       auto repeat delay:  65535    repeat rate:  0       auto repeating keys:  00feffffdffffbbf                             fadfffffffdfe5ef                             ffffffffffffffff                             ffffffffffffffff       bell percent:  50    bell pitch:  400    bell duration:  100     Pointer Control:       acceleration:  2/1    threshold:  4     Screen Saver:       prefer blanking:  yes    allow exposures:  yes       timeout:  0    cycle:  0     Colors:       default colormap:  0x50    BlackPixel:  0    WhitePixel:  16777215     Font Path:       /usr/NX/share/fonts/TTF,/usr/share/X11/fonts/misc/,/usr/share/X11/fonts/Type1/,/usr/share/X11/fonts/75dpi/,/usr/share/X11/fonts/100dpi/,/usr/share/X11/fonts/TTF/,/usr/NX/share/fonts/base,/usr/NX/share/fonts/base,/usr/NX/share/fonts/base     Bug Mode: compatibility mode is disabled     DPMS (Energy Star):       Standby: 0    Suspend: 0    Off: 0       DPMS is Disabled      Despite all these, the font required (any font from the Adobe family) seems not to be reported with `xlsfonts`, and the application error persists.


title: Why does diff fail when invoked from a Makefile?

text: Narrow-down of a patch problem I am trying to troubleshoot: Only two files, each with a size of 1 byte:   * file `a` (containing `'a'`)   * file `b` (containing `'b'`) and  Goal is to make and then apply a patch that will change the value of `'b'` to `'a'`. Contents of Makefile are:               patch:             diff -u b a > b2a.patch             patch -o b.corrected b < b2a.patch             diff a b.corrected          clean:             rm -f b2a.patch b.corrected      Given the above, `make` fails with the following output:               $ make     diff -u b a > b2a.patch     make: *** [patch] Error 1      If, however, I execute the commands in the Makefile one after the other on the bash shell, there is no problem at all.


title: Move files to mapped network folder

text: I was wanting to know the best or preferred way to move files from one computer to a networked hot folder. I have looked at `mv` and `cd` but all the references discuss using it locally. I would need to add this to some already existing scripts. Also, upon reading I did see SSH File Transfer Protocol and SFTP but everything pointed to a manual process. Referenced: here and here EDIT: and the mapped network folder is windows based if that helps.


title: Bucket size in tbf

text: I've read many times about Linux's token bucket filter (tbf) and still I don't fully understand how I should calculate the `burst` and `latency` parameters, shame on me :( I suppose that a reasonable latency is around 50 ms. OK, but what value should burst take? The manpage says: > The latter calculation takes into account the size of the bucket, the rate > and possibly the peakrate (if set). These two parameters are mutually > exclusive. So, how is latency related to bucket and filter? Is there a formula to calculate it? Or is it simply a matter of, "OK, X bytes of burst and Y seconds of latency is good for me"?


title: How do I run a program in a fresh shell?

text: I have a program that does a LOT of env manipulation. It sets PYTHONPATH and LD_LIBRARY_PATH and stuff like that. This program needs to run ANOTHER program, but in a fresh env, without all of the env manipulation, but WITH the base env from rc files. I thought I'd be able to do this with csh -c but that keeps the current env. Is there a good way to do this? It doesn't really matter what shell I use for this. Also note that I need the original .rc files, so env -i doesn't quite work for me. (I suppose I could hack something together with env and bash -cl, but there should be a nicer method)


title: How to ftp as root?

text: I can ftp to a linux server by doing ftp server But I can't do that with root. Need sftp or something or what?


title: How to print the first three lines and last two lines of a file using perl?

text: Through the command line I draw one or several of the patterns found text.xml file:               perl -ln0e 'while(/<PMResult.*?<\/PMResult>/gs) {       $x=$&;print $x if $x=~/BCCEL-[1-3]/}' text.xml      I need to create a new file with this pattern found; the new file will have the first three lines of Text.xml file before of pattern and have the last two lines of Text.xml file after the pattern.


title: Add Apache to Ubuntu's startup

text: I'm currently learning the Linux environment, and decided to manually install the Apache server. For educational purposes, I've compiled it into:               /server/apache      The `http.conf` location is configured correctly. It works -- I can open up a browser and navigate to `localhost` and see the "It works" message. But how does one goes about adding Apache into Ubuntu's startup so I won't have to do:               sudo /server/apache/bin/apachectl start      all the time? Can somebody explain how does one goes into adding programs to the Ubuntu startup (10.10 64 bit)?


title: What happens to data in swap when your computer hibernates?

text: When a computer goes into hibernation mode, it saves the contents of the RAM into the swap space so that it can resume exactly where it left off when it powers back on. So, what if you are currently using more memory than you have RAM. In this case, some data that would otherwise be in RAM is saved to swap. An example. A computer has 1GB of RAM and 1GB of swap space. It is currently using all but 100MB of RAM and 500MB of swap. Thus, it is needing to remember about 1.4GB of memory to save its state. However, swap is only 1GB. What will happen in this case? ~~ edit ~~ As answered below, the hibernate fails. So then a follow-up question: When this fails, where is the error reported?


title: On 13.10 mint graphic periodically freezes after recent updates

text: laptop lenovo idea pad u430p, Linux Mint 16. Like I said in the title occasionally graphic freezes while all other systems continue to work normally (music plays, for example). Sometimes it unfreezes after minute or so, sometimes not and I had to hard reset the machine. lspci -v               00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09)             Subsystem: Lenovo Device 3978             Flags: bus master, fast devsel, latency 0             Capabilities: [e0] Vendor Specific Information: Len=0c <?>          00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09) (prog-if 00 [VGA controller])             Subsystem: Lenovo Device 3800             Flags: bus master, fast devsel, latency 0, IRQ 64             Memory at b5000000 (64-bit, non-prefetchable) [size=4M]             Memory at c0000000 (64-bit, prefetchable) [size=256M]             I/O ports at 6000 [size=64]                                                                                Expansion ROM at <unassigned> [disabled]                                                                                Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-                                                                 Capabilities: [d0] Power Management version 2                                                                              Capabilities: [a4] PCI Advanced Features                                                                                Kernel driver in use: i915                                                                                00:03.0 Audio device: Intel Corporation Device 0a0c (rev 09)                                                                       Subsystem: Lenovo Device 3978                                                                                Flags: bus master, fast devsel, latency 0, IRQ 68                                                                          Memory at b5610000 (64-bit, non-prefetchable) [size=16K]                                                                   Capabilities: [50] Power Management version 2                                                                              Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit-                                                                 Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00                                                        Kernel driver in use: snd_hda_intel                                                                                00:14.0 USB controller: Intel Corporation Lynx Point-LP USB xHCI HC (rev 04) (prog-if 30 [XHCI])                                   Subsystem: Lenovo Device 3978             Flags: bus master, medium devsel, latency 0, IRQ 60             Memory at b5600000 (64-bit, non-prefetchable) [size=64K]             Capabilities: [70] Power Management version 2             Capabilities: [80] MSI: Enable+ Count=1/8 Maskable- 64bit+             Kernel driver in use: xhci_hcd          00:16.0 Communication controller: Intel Corporation Lynx Point-LP HECI #0 (rev 04)             Subsystem: Lenovo Device 3978             Flags: bus master, fast devsel, latency 0, IRQ 65             Memory at b5618000 (64-bit, non-prefetchable) [size=32]             Capabilities: [50] Power Management version 3             Capabilities: [8c] MSI: Enable+ Count=1/1 Maskable- 64bit+             Kernel driver in use: mei_me          00:1b.0 Audio device: Intel Corporation Lynx Point-LP HD Audio Controller (rev 04)             Subsystem: Lenovo Device 3978             Flags: bus master, fast devsel, latency 0, IRQ 67             Memory at b5614000 (64-bit, non-prefetchable) [size=16K]             Capabilities: [50] Power Management version 3             Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+             Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00             Capabilities: [100] Virtual Channel             Kernel driver in use: snd_hda_intel          00:1c.0 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 1 (rev e4) (prog-if 00 [Normal decode])             Flags: bus master, fast devsel, latency 0             Bus: primary=00, secondary=01, subordinate=01, sec-latency=0             I/O behind bridge: 00005000-00005fff             Memory behind bridge: b5500000-b55fffff             Capabilities: [40] Express Root Port (Slot+), MSI 00             Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-             Capabilities: [90] Subsystem: Lenovo Device 3978             Capabilities: [a0] Power Management version 3             Kernel driver in use: pcieport          00:1c.2 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 3 (rev e4) (prog-if 00 [Normal decode])             Flags: bus master, fast devsel, latency 0             Bus: primary=00, secondary=02, subordinate=02, sec-latency=0             Memory behind bridge: b5400000-b54fffff             Capabilities: [40] Express Root Port (Slot+), MSI 00             Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-             Capabilities: [90] Subsystem: Lenovo Device 3978             Capabilities: [a0] Power Management version 3             Kernel driver in use: pcieport          00:1c.3 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 4 (rev e4) (prog-if 00 [Normal decode])             Flags: bus master, fast devsel, latency 0             Bus: primary=00, secondary=03, subordinate=08, sec-latency=0             I/O behind bridge: 00004000-00004fff             Memory behind bridge: b4000000-b4ffffff             Prefetchable memory behind bridge: 00000000b2000000-00000000b2ffffff             Capabilities: [40] Express Root Port (Slot+), MSI 00             Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-             Capabilities: [90] Subsystem: Lenovo Device 3978             Capabilities: [a0] Power Management version 3             Kernel driver in use: pcieport          00:1c.4 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 5 (rev e4) (prog-if 00 [Normal decode])             Flags: bus master, fast devsel, latency 0             Bus: primary=00, secondary=09, subordinate=09, sec-latency=0             I/O behind bridge: 00003000-00003fff             Memory behind bridge: b3000000-b3ffffff             Prefetchable memory behind bridge: 00000000a0000000-00000000b1ffffff             Capabilities: [40] Express Root Port (Slot+), MSI 00             Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-             Capabilities: [90] Subsystem: Lenovo Device 3978             Capabilities: [a0] Power Management version 3             Kernel driver in use: pcieport          00:1d.0 USB controller: Intel Corporation Lynx Point-LP USB EHCI #1 (rev 04) (prog-if 20 [EHCI])             Subsystem: Lenovo Device 3978             Flags: bus master, medium devsel, latency 0, IRQ 23             Memory at b561c000 (32-bit, non-prefetchable) [size=1K]             Capabilities: [50] Power Management version 3             Capabilities: [58] Debug port: BAR=1 offset=00a0             Capabilities: [98] PCI Advanced Features             Kernel driver in use: ehci-pci          00:1f.0 ISA bridge: Intel Corporation Lynx Point-LP LPC Controller (rev 04)             Subsystem: Lenovo Device 3978             Flags: bus master, medium devsel, latency 0             Capabilities: [e0] Vendor Specific Information: Len=0c <?>             Kernel driver in use: lpc_ich          00:1f.2 SATA controller: Intel Corporation Lynx Point-LP SATA Controller 1 [AHCI mode] (rev 04) (prog-if 01 [AHCI 1.0])             Subsystem: Lenovo Device 3978             Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 61             I/O ports at 6088 [size=8]             I/O ports at 6094 [size=4]             I/O ports at 6080 [size=8]             I/O ports at 6090 [size=4]             I/O ports at 6060 [size=32]             Memory at b561b000 (32-bit, non-prefetchable) [size=2K]             Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-             Capabilities: [70] Power Management version 3             Capabilities: [a8] SATA HBA v1.0             Kernel driver in use: ahci          00:1f.3 SMBus: Intel Corporation Lynx Point-LP SMBus Controller (rev 04)             Subsystem: Lenovo Device 3978             Flags: medium devsel, IRQ 11             Memory at b5619000 (64-bit, non-prefetchable) [size=256]             I/O ports at 6040 [size=32]          01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 10)             Subsystem: Lenovo Device 3801             Flags: bus master, fast devsel, latency 0, IRQ 62             I/O ports at 5000 [size=256]             Memory at b5504000 (64-bit, non-prefetchable) [size=4K]             Memory at b5500000 (64-bit, non-prefetchable) [size=16K]             Capabilities: [40] Power Management version 3             Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+             Capabilities: [70] Express Endpoint, MSI 01             Capabilities: [b0] MSI-X: Enable- Count=4 Masked-             Capabilities: [d0] Vital Product Data             Capabilities: [100] Advanced Error Reporting             Capabilities: [140] Virtual Channel             Capabilities: [160] Device Serial Number 01-00-00-00-68-4c-e0-00             Capabilities: [170] Latency Tolerance Reporting             Capabilities: [178] #1e             Kernel driver in use: r8169          02:00.0 Network controller: Intel Corporation Wireless 7260 (rev 73)             Subsystem: Intel Corporation Wireless-N 7260             Flags: bus master, fast devsel, latency 0, IRQ 66             Memory at b5400000 (64-bit, non-prefetchable) [size=8K]             Capabilities: [c8] Power Management version 3             Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+             Capabilities: [40] Express Endpoint, MSI 00             Capabilities: [100] Advanced Error Reporting             Capabilities: [140] Device Serial Number 0c-8b-fd-ff-ff-b4-c8-41             Capabilities: [14c] Latency Tolerance Reporting             Capabilities: [154] Vendor Specific Information: ID=cafe Rev=1 Len=014 <?>             Kernel driver in use: iwlwifi          09:00.0 3D controller: NVIDIA Corporation GK208M [GeForce GT 730M] (rev a1)             Subsystem: Lenovo Device 3800             Flags: bus master, fast devsel, latency 0, IRQ 63             Memory at b3000000 (32-bit, non-prefetchable) [size=16M]             Memory at a0000000 (64-bit, prefetchable) [size=256M]             Memory at b0000000 (64-bit, prefetchable) [size=32M]             I/O ports at 3000 [size=128]             Expansion ROM at <ignored> [disabled]             Capabilities: [60] Power Management version 3             Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+             Capabilities: [78] Express Endpoint, MSI 00             Capabilities: [100] Virtual Channel             Capabilities: [128] Power Budgeting <?>             Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>             Kernel driver in use: nouveau      uname -a               Linux laptop 3.13.2-031302-generic #201402061638 SMP Thu Feb 6 21:39:32 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux      I have nouveau driver installed:                   dmesg | grep nouveau     [    1.690417] nouveau 0000:09:00.0: enabling device (0006 -> 0007)     [    1.690747] nouveau  [  DEVICE][0000:09:00.0] BOOT0  : 0x108100a1     [    1.690749] nouveau  [  DEVICE][0000:09:00.0] Chipset: GK208 (NV108)     [    1.690750] nouveau  [  DEVICE][0000:09:00.0] Family : NVE0     [    1.692604] nouveau  [   VBIOS][0000:09:00.0] checking PRAMIN for image...     [    1.693697] nouveau  [   VBIOS][0000:09:00.0] ... signature not found     [    1.693700] nouveau  [   VBIOS][0000:09:00.0] checking PROM for image...     [    1.693771] nouveau  [   VBIOS][0000:09:00.0] ... signature not found     [    1.693773] nouveau  [   VBIOS][0000:09:00.0] checking ACPI for image...     [    2.426007] nouveau  [   VBIOS][0000:09:00.0] ... appears to be valid     [    2.426012] nouveau  [   VBIOS][0000:09:00.0] using image from ACPI     [    2.426139] nouveau  [   VBIOS][0000:09:00.0] BIT signature found     [    2.426143] nouveau  [   VBIOS][0000:09:00.0] version 80.28.25.00.25     [    2.426612] nouveau  [ DEVINIT][0000:09:00.0] adaptor not initialised     [    2.426615] nouveau  [   VBIOS][0000:09:00.0] running init tables     [    2.489085] nouveau 0000:09:00.0: irq 63 for MSI/MSI-X     [    2.489095] nouveau  [     PMC][0000:09:00.0] MSI interrupts enabled     [    2.489134] nouveau  [     PFB][0000:09:00.0] RAM type: DDR3     [    2.489136] nouveau  [     PFB][0000:09:00.0] RAM size: 2048 MiB     [    2.489138] nouveau  [     PFB][0000:09:00.0]    ZCOMP: 0 tags     [    2.489204] nouveau E[   PIBUS][0000:09:00.0] GPC0: 0x4188ac 0x00000001 (0x1c70822e)     [    2.493775] nouveau  [    VOLT][0000:09:00.0] GPU voltage: 600000uv     [    2.516824] nouveau  [  PTHERM][0000:09:00.0] FAN control: none / external     [    2.516829] nouveau  [  PTHERM][0000:09:00.0] fan management: automatic     [    2.516831] nouveau  [  PTHERM][0000:09:00.0] internal sensor: yes     [    2.516856] nouveau  [     CLK][0000:09:00.0] 07: core 405 MHz memory 405 MHz      [    2.516900] nouveau  [     CLK][0000:09:00.0] 0a: core 405-875 MHz memory 810 MHz      [    2.516958] nouveau  [     CLK][0000:09:00.0] 0f: core 405-875 MHz memory 1001 MHz      [    2.517040] nouveau  [     CLK][0000:09:00.0] --: core 405 MHz memory 405 MHz      [    2.517150] nouveau  [     DRM] VRAM: 2048 MiB     [    2.517151] nouveau  [     DRM] GART: 1048576 MiB     [    2.517164] nouveau E[     DRM] Pointer to TMDS table invalid     [    2.517797] nouveau  [     DRM] DCB version 4.0     [    2.517798] nouveau E[     DRM] Pointer to flat panel table invalid     [    2.518615] nouveau  [     DRM] ACPI backlight interface available, not registering our own     [    2.518666] [drm] Initialized nouveau 1.1.1 20120801 for 0000:09:00.0 on minor 0     [  471.927416] nouveau E[   PIBUS][0000:09:00.0] GPC0: 0x4188ac 0x00000001 (0x1870822e)      What can I do to further investigate the issue?


title: What is the most advanced image editing FLOSS?

text: Is it still GIMP? Inkscape? Are they too different to compare? Does anything come close to the two? Are they more/less advanced than Photoshop? **note** : advanced = more features


title: Apache server 32 binaries vs 64 binaries? what's the difference

text: not sure if this is a silly question...apples and oranges maybe..but... For Windows I used to download either 32 bit binaries from ASF site or 64 bit binaries from Apache lounge site (for no particular reason). So - that was the way I new what version I have. I've switched to ubuntu (for educational purposes) and got used to compiling from source...well...you know...make..make install etc. mmmm 1) So - when I compile apache server from source - what binaries do i get? 32? 64? 2) Are there any benefits from having 64 bit Apache binaries? any cons? Thnaks guys:)


title: generate gateway automatic through resolvconf & can't change my gateway

text: my connection is cable ethernate , UEFI mother board i7 intel processor, direct connect no routter, aliance broad band my root process:-               #ip link set eno1 up     #ip addr add (IP)/(netmask) dev eno1     #ip route add default via (gateway)               then it happend___     [root@103 suprokash]# ip route add default via 172.17.81.129     RTNETLINK answers: File exists     [root@103 suprokash]# ip mroute add default via 172.17.81.129     Command "add" is unknown, try "ip mroute help".     [root@103 suprokash]# ip route     default via 192.168.1.1 dev eno1  proto static      172.17.81.128/25 dev eno1  proto kernel  scope link  src 172.17.81.183      192.168.1.0/24 dev eno1  proto kernel  scope link  src 192.168.1.15  metric 1      [root@103 suprokash]# ip mroute     [root@103 suprokash]# ip -s route add default via 172.17.81.129     RTNETLINK answers: File exists      now what to do? how can i change my default route oh , my IP ping 100% done gateway ping 100% done               #ping 8.8.8.8     100% loss     #ping www.google.com      100% loss


title: Can a mounted encrypted filesystem be safe from root?

text: I have access to a shared remote computer from which I would like to run some code I have written which uses an interpreter (not a compiled code). I would like to protect this source code from other users who have root access to the remote machine. There are a variety of ways to make an encrypted folder in linux. I am not writing a lot of data to the disk so I am not worried about reduced I/O speed due to the encryption process, just mainly using many CPUs and a lot of RAM on this machine. My question is, do any of these encryption options allow the data to be protected from the root user, when I am logged in and have the filesystem mounted? A main concern is if a cron job running as root does a backup, then the source codes are automatically copied to another filesystem without even realizing it and then it is no longer encrypted.


title: Search for a String inside all files inside a war

text: Where I work someone had Java project and used Eclipse to export that project into a .war package. Now I need to search for a string inside all the files that make that .war package. I know that a .war package is just a .zip file, and I have extracted its contents, however, now I have bunch of of .class java files (among images, xmls and other stuff) and I have no idea on how to search strings inside them. I am a Linux Mint user, so I tried using the "grep -R stringHere ." command without success (I am not an advanced user), this command only searches inside text files. I also searched and found the crgrep project but it is currently bugged and it does not work. Does anyone know a linux command that can search inside all the contents of a .war package and check if those contents contain a specific string or code sample? I really need to find a way to search through the content of the .class files. That is my only priority so far. I don't care about images nor about any other type of text files.


title: show parameters of running kernel

text: I would like to see with what parameters the running kernel has been started. i.e., I mean those parameters that are specified with the `append` option, such as `ipv6.disable=1` or `rootfstype=ext2` Is there a way to display these options on a running system ?


title: wget -c website's certificate verification

text: anisha@linux-dopx:~> wget -c --no-check-certificate --user abc --password xyz https://www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf          --2011-08-29 15:11:53--  https://www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf     Resolving www.smart-developer.com... 80.237.227.161     Connecting to www.smart-developer.com|80.237.227.161|:443... connected.     WARNING: cannot verify www.smart-developer.com's certificate, issued by `/C=US/O=Thawte, Inc./OU=Domain Validated SSL/CN=Thawte DV SSL CA':       Unable to locally verify the issuer's authority.     HTTP request sent, awaiting response... 200 OK     Length: unspecified [text/html]     Saving to: `SD_02.pdf'         [   <=>                                                                   ] 19,286      10.4K/s   in 1.8s         2011-08-29 15:12:00 (10.4 KB/s) - `SD_02.pdf' saved [19286]      The book that gets downloaded is in KB (actual size 20 MB), and shows error on opening too, where as on downloading through Firefox directly, I have no issues. **EDIT 1:** Seems the shell can't tolerate @ in the username! See the placements of quotes too. Scroll right.               anisha@linux-dopx:~> wget -c https://x.y.z@gmail.com:abc@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf     https://x.y.z@gmail.com:abc@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf: Bad port number.          anisha@linux-dopx:~> wget -c https://'x.y.z@gmail.com':abc@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf     https://x.y.z@gmail.com:abc@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf: Bad port number.          anisha@linux-dopx:~> wget -c https://'x.y.z@gmail.com:abc'@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf     https://x.y.z@gmail.com:abc@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf: Bad port number.          anisha@linux-dopx:~> wget -c https://x.y.z:abc@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf     --2011-08-29 16:01:38--  https://x.y.z:*password*@www.smart-developer.com/lnmshop/download/SmartDeveloperUS/203/SD_02.pdf     Resolving www.smart-developer.com... 80.237.227.161     Connecting to www.smart-developer.com|80.237.227.161|:443... connected.     ERROR: cannot verify www.smart-developer.com's certificate, issued by `/C=US/O=Thawte, Inc./OU=Domain Validated SSL/CN=Thawte DV SSL CA':       Unable to locally verify the issuer's authority.     To connect to www.smart-developer.com insecurely, use `--no-check-certificate'.     Unable to establish SSL connection.     anisha@linux-dopx:~/Desktop>


title: Delete files while excluding files using find

text: This command is not DWIM-compliant:               find . \( -name .svn -prune -false \) -o \( -empty -delete \)     find: The -delete action atomatically turns on -depth, but -prune            does nothing when -depth is in effect.  If you want to            carry on anyway, just explicitly use the -depth option.      Adding `-depth` disables the effect of `-prune`, which means `.svn` directories are also deleted. So: Which `find` syntax (if any) can be used to prune and then delete some of the non-pruned paths, without using other tools like `rm`?


title: Getting g++ to work on Mac with Xcode

text: In trying to get g++ to work in terminal I ran a command which I have now learned is outdated. I think this is why running g++ in terminal returns an error but I am unsure. If I try to run any .cpp in terminal I get the error message:               xcrun: Error: failed to exec real xcrun. (No such file or directory)      I have xcode installed and have installed command line tools. However after doing so, I ran the command below:               sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/      What have I done, and what should I do?


title: How to change the compiler settings with AutoMake?

text: I want to build a library with a specific tool instead of GCC. The regular build sequence is:               ./configure     make     make install      Where should I replace the GCC settings (I think that the configure was created with AutoMake)?


title: Multiple Unix Sessions

text: Is there any way I can open multiple Unix sessions on different servers at the same time? I don't want to use ssh, as I want to monitor the CPUs of all those servers at the same time, which will keep changing with time.


title: awk pairwise differences

text: I run into this problem a lot with data, if I have some integers, I frequently want to look at differences between adjacent integers, I usually solve this in Ruby or Python, but I think such a thing could be done in awk, and I'd prefer that. I have a table of data such as:               201309,694     201310,699     201311,700     201312,705     201401,713     201402,740      And I would like to find the adjacent differences, that is:               201310-201309,699-694     201311-201310,700-699     201312-201311,705-700     201401-201312,713-715     201402-201401,740-713      I found the function `getline` in the awk manpage, but I haven't been able to use it successfully.


title: Is there a web site to search in the file contents of default installations of different linux distributions?

text: The text string " **Network services, Internet style** " is found in the first line of the file /etc/services on a computer running Ubuntu 11.04               erik@laptop:~$ head -1 /etc/services     # Network services, Internet style      Do you know if there is some web site where you could query for the text string **"Network services, Internet style"** and then find out in which Linux distributions and in which files that text string occurs. I understand that the file tree and file contents of a Linux installation will be different dependent of how you answer the questions during the installation but it would be useful to be able to query a default installation. The usefulness of searching for the text string **"Network services, Internet style"** is hard to see, but it is just meant to be seen as an example of what such a web page should be able to search for. **Update:** Here are some use cases for such a web site: If you for instance have been editing a configuration file somewhere under /etc but you forgot how the original version of the configuration file looked like, you could use such a web site (if the web site also let you search for a filename). Most (or maybe all) Linux distributions provide a package system (e.g. rpm and deb) where you could find out the original file content of the configuration file by querying the package system. But that has a higher learning curve than it is to visit a web page. Sometimes a configuration file may be located under different paths on different Linux distributions. If you know some text string that is to be found inside the configuration file, you could easily find out the path to the filename under different Linux distribution (and also the default file content) by querying the web site.


title: How can I switch scim’s IMEs via command line?

text: I have a bunch of SCIM IMEs installed. I switch between them via hot-key. Is there a way to switch between them programmatically? Can I even switch SCIM on and off via command line? I use `Ctrl`+`Space` to do that at the moment...


title: Ocaml compilation error in AIX 6.1

text: I meet the following error when I try to compile Ocaml on my server running AIX 6.1 :               "../Makefile.shared", line 39: make: 1254-055 Dependency line needs colon or double colon operator.     "../Makefile.shared", line 40: make: 1254-055 Dependency line needs colon or double colon operator.     "../Makefile.shared", line 41: make: 1254-055 Dependency line needs colon or double colon operator.     make: 1254-058 Fatal errors encountered -- cannot continue.     make: 1254-004 The error code from the last command is 2.      This appears when I execute `make world`. This is the final output from `./configure`:               Directories where Objective Caml will be installed:             binaries.................. /usr/local/bin             standard library.......... /usr/local/lib/ocaml             manual pages.............. /usr/local/man (with extension .1)     Configuration for the bytecode compiler:             C compiler used........... gcc             options for compiling..... -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT             options for linking.......   -lm  -lcurses -lpthread             shared libraries not supported     Configuration for the native-code compiler:             (not supported on this platform)     Source-level replay debugger: supported     Additional libraries supported:             unix str num dynlink bigarray systhreads threads graph dbm     Configuration for the "num" library:             target architecture ...... generic (asm level 0)     Configuration for the "graph" library:             options for compiling .... -I/usr/X11R7/include             options for linking ...... -L/usr/X11R7/lib -lX11     The "labltk" library: not supported     ** Objective Caml configuration completed successfully **


title: List unused module

text: Is it possible to list down unused modules? `lsmod` would only list down dependency by modules, right?


title: Grabbing keyboard control in shell script

text: I have a certain shell (zsh) script which reads one character at a time and performs an action afterwards. In the shell, this is realized by "read -k" in a loop. I want to execute the script as a keyboard shortcut, without opening a shell. What is the easiest way to grab keyboard input for this? I could use dmenu if I wanted to read an entire string, but the script needs to be able to parse the characters one at a time. Thanks.


title: How to interpret cpu_idle and cpu_frequency event's trace logged by ftrace?

text: I used ftrace to trace two events, cpu_frequency and cpu_idle. I am not able to find out any documentation which states how to interpret this information. I have provided two snippets from the generated trace file below, and I need to understand how to interpret cpu_frequency & cpu_idle traced events information. I have wrote my confusion below, please answer the question and provide your own insights. **FOR CPU_Frequency:**   1\. What is the format of the timestamp?   2\. Why there are two events for each new operating frequency point, does each of the event means that the CPU started operating at that frequency or are these entry/exit pairs? **Trace output:**               # tracer: nop     #     # entries-in-buffer/entries-written: 36062/36062   #P:1       #       #                              _-----=> irqs-off     #                             / _----=> need-resched     #                            | / _---=> hardirq/softirq     #                            || / _--=> preempt-depth     #                            ||| /     delay     #           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION     #              | |       |   ||||       |         |     kworker/0:1H-27    [000] ...1  1130.362603: cpu_frequency: state=1190400 cpu_id=0     kworker/0:1H-27    [000] ...1  1130.362609: cpu_frequency: state=1190400 cpu_id=0     kworker/0:1H-27    [000] ...1  1130.411934: cpu_frequency: state=300000 cpu_id=0     kworker/0:1H-27    [000] ...1  1130.411947: cpu_frequency: state=300000 cpu_id=0     kworker/0:1H-27    [000] ...1  1131.532595: cpu_frequency: state=1190400 cpu_id=0     kworker/0:1H-27    [000] ...1  1131.532599: cpu_frequency: state=1190400 cpu_id=0     kworker/0:1H-27    [000] ...1  1131.581758: cpu_frequency: state=300000 cpu_id=0     kworker/0:1H-27    [000] ...1  1131.581768: cpu_frequency: state=300000 cpu_id=0      **FOR CPU_Idle:**   1\. What does the state=4294967295 means here, what cpu_idle state is it?   2\. Where can I get the documentation/information about what these states actually mean?                <idle>-0     [000] d..2  1960.307101: cpu_idle: state=3 cpu_id=0      <idle>-0     [000] ...2  1960.310722: cpu_idle: state=4294967295 cpu_id=0      <idle>-0     [000] d..2  1960.310741: cpu_idle: state=3 cpu_id=0      <idle>-0     [000] ...2  1960.312114: cpu_idle: state=4294967295 cpu_id=0      <idle>-0     [000] d..2  1960.312131: cpu_idle: state=3 cpu_id=0      <idle>-0     [000] .N.2  1960.314410: cpu_idle: state=4294967295 cpu_id=0      <idle>-0     [000] d..2  1960.314980: cpu_idle: state=3 cpu_id=0      <idle>-0     [000] .N.2  1960.316077: cpu_idle: state=4294967295 cpu_id=0      <idle>-0     [000] d..2  1960.316539: cpu_idle: state=3 cpu_id=0      thanks.


title: How do I eval two commands?

text: If I run this:               echo "echo 'a'; echo 'b'"      It produces a string which I can then run, and it works - echoes `a\nb\n`. However, this does not work:               $(echo "echo 'a'; echo 'b'")      Why not? It doesn't work for any comands, not just echo. How do I execute a string containing two or more commands?


title: Linux: how to get all login logs from my system

text: I want to know all the times a user logs since last year into my system?   I used `last` command but it is not useful.


title: How do I log out of all my active sessions?

text: For some reason, I have a few open sessions on an SSH server that I don't know about. I assume they're leftovers from when my pipe broke.               $ users     user1 user2 user3 me me me me      Is there a way to log me out across all sessions?


title: Script for opening corresponding pdfs for bibtex keys in Vim

text: ### Context I currently write research articles in LaTeX using Vim. I have bibtex keys in my articles like `\cite{smith2000sometopic}` and I have corresponding pdf versions of most articles in a subfolder of `~/lib` e.g., `~/lib/topica/smith2000sometopic.pdf`. ### Aim I'd like to be able to press a key in Vim when my cursor is over a bibtex key that:   1. extracts the `bibtex-key` under the cursor   2. performs a search for `bibtex-key.pdf`   3. if the file is found, opens the file in a pdf viewer   4. If the file is not found, indicate that this is the case ### Question   * Has anyone already done something like this?   * Are there any examples that would be useful to study? ### Initial thoughts I thought I could use something like:                gnome-open `find ~/lib/ -iname "smith2000sometopic.pdf" | head -1`      and then experiment with some Vimscript to fine tune the interaction; but if anyone has any examples or suggestions, that would be most appreciated.


title: Using shell's read command with live editing functionality (readline like)

text: Is there a standard (POSIX) way of asking the user some data from within a shell script, with `read` for example, while allowing live edition of the text being typed (what readline does)? I know `bash` has `read -e varname` that allows for the person launching the script to use keyboard arrows for exemple, to edit or correct what has just been typed without deleting the last entered characters with backspace. However, `read -e` is bash specific. And still, it is pretty cumbersome to delete all that has been wrote if you realise you made a mistake at the beginning of your long sentence...


title: Link a dependency in Synaptic to the one already installed from source

text: I want to install SVN version of Quantum GIS and already I have a SVN version of GRASS GIS. As instructed in QGIS Wiki here, I added the qgis repository to my sources.list file. Now I am able to see qgis1.8.0svn version in Synaptic but when I try to install it, GRASS is a dependency(older version is available in the repository and even if I add Ubuntu GIS Unstable PPA it's not the developmental version available there, i.e., version 6.5 is not available; which offers nice features). GRASS's SVN version does not show up in Synaptic as we don't add URL to `sources.list`. It has to be done through svn checkout. How can I set Synaptic to identify the already installed GRASS GIS in my `/usr/local/` directory?


title: rpcbind-"warning" on boot

text: On my debian testing system, I get these messages in my `/var/log/boot` file:               Starting rpcbind daemon...rpcbind:     Cannot open '/var/run/rpcbind/rpcbind.xdr' file for reading, errno 2 (No such file or directory)       rpcbind: Cannot open '/var/run/rpcbind/portmap.xdr' file for reading, errno 2 (No such file or directory)      Thus it is coming up - but with this annoying message. I do not know how to remove this.


title: Automate Ubuntu Provisioning

text: Could anyone point me the best application used to provision Ubuntu (Unattended installation)? If possible point me some nice tutorials.


title: /bypass folder on ArchBang - safe to delete?

text: Anyone know what is this folder for, and if it's safe to delete it? It's an ArchBang box, and this folder was there ever since install. I'm not really sure if it's just some junk left after installation, or if it genuinely has some purpose? (edit: it's empty) ![enter image description here](http://i.stack.imgur.com/CjCuc.png)


title: List the lines with the highest scores

text: I have the following problem concerning the sorting of a content of a file. I have a file called `points.txt` and it contains the following table of data:               Jim:4     Tim:8     Lin:6     Tom:1     Esko:2     Jaska:5     Erkki:7       Now how can I list the following list in numerical order (highest first) or how can I list the three names with highest scores. I have tries the following by they don't seems to work               sort -n -k 1,1 points.txt     sort -n points.txt     sort -n ^: points.txt


title: suitable openldap schema for mailserver

text: I'm currently looking for a suitable openldap schema for a mailserver. More specifically, I'm looking for a schema that includes the mailAlternateAddress and mailForwardingAddress attributes. Until now, I have used the old qmail schema. edit: not a very good question from myself, I can:               1. reuse the existing qmail schema for my mailserver     2. copy-paste the attributes etc that I want to a new schema and import that.


title: Simplest way of getting a bootable linux flash drive + VM in Windows

text: I realize tools for making a flash drive image that boots a linux system (for example ubuntu) are common enough. I'd like to get a flash drive like that that also lets me use the system inside of Windows, without administrator privileges. I don't know if that's even technically possible... In other words, if I hop onto a public computer running Windows and insert my flash drive, I want to jump into my linux system without rebooting the computer, and without administrator privileges in Windows. Is that technically possible? If so are there tools (distro-specific tools are ok) that will make me such a flash drive?


title: How to read over 4k input without new lines on a terminal?

text: So I have a lot of data **WITHOUT NEW LINES** on the clipboard (it's a large SVG file on one line). I went               $ cat >file.svg      then tried to paste (in Gnome Terminal), but only the first 4kB characters were accepted. I assume this is a readline feature/limitation. Is there a way to read from STDIN that would avoid this problem? ## EDIT Test case: Create a demo file. This one will have ~4k "=" symbols followed by "foo bar".               { printf '=%.0s' {1..4095} ; echo "foo bar" ; } > test.in      Copy that into your clipboard               xclip test.in      (if you want to middle-click to insert) or               xclip -selection clipboard test.in      (if you want to use Ctrl-Shift-Insert to past it in) Then `cat >test.out`, paste (whichever way). Press Ctrl-D to end the stream. `cat test.out` \- do you see "foo bar"? On my set-up (Ubuntu 12.04, Gnome Terminal, zsh) when I paste I only see the `=` and I don't see `foo bar`. Same when I inspect `test.out`.


title: Is there something like one-time sudo?

text: Is there a way to have a one-time sudo account? My use-case is the following. I have an Ubuntu station with no remote ssh allowed to that machine. The machine generally serves as a public-use computer. But sometimes I would like to grant root access to some people (who I know personally) based on e.g. SMS or IM communication. Of course I don't mean giving them full root access, just one restricted to some commands like `apt-get` or so. In no way do I intend to allow them to write to `/etc`. But obviously I don't want to share the root password. And I also don't want those people to have root access forever, nor do I want to delete accounts or change passwords manually. So I thought about creating a (sufficiently large) amount of root-access accounts and save their passwords to my laptop or phone. In the case I needed to provide root access to someone, I'd just send him the login information for an account that would be deleted when the sudo password-cache timout ends up. Do you think this is a good approach? And if it is, where and how to setup the deletion script?


title: "file" command confusing C & C++

text: When using `file` to check some file types, I noticed that it seems to incorrectly label C++ files as C files:               $ file User.*     User.cpp: C source, ASCII text     User.h:   C++ source, ASCII text     User.o:   ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped      ` Why is it correctly identifying the header file, but not the cpp file?


title: Can't print from fluxbox unless I first log in to a different WM

text: I'm running Linux Mint 17 with fluxbox as my WM. If I boot the machine and log in to a fluxbox session, I can't print; the printer doesn't show up in print dialogs. If I log in to a cinnamon session, then log out and log in to a fluxbox session, printing works. Clearly cinnamon is performing some initialization that causes the printer to be recognized by the OS. How can I get this initialization to happen in fluxbox?


title: Is there an easy way to background a sudo shell?

text: A bit more details, what I'm looking for is some kind of `^Z` for `sudo` shells. For instance when running a long command I can hit `^Z` to suspend the command or when I do `~^Z` in `ssh` after hitting `Enter`. Then I can simply do `fg` and get my long command/`ssh` session running again.


title: how to search case insensitively (with '*' wildcard) with 'find'?

text: The main problem is my directory has many files with uppercase _(e.g.`Foobar.txt`, `FooBar.txt`, even `FOOBAR.txt`)_. And I find it messy to find the files by exactly typing it _(if I know the exact filenames, why would I use **`find`**?)_. So I want to type just `foobar` and want all three files in result Also, I am using `*` both of the side of my string to match any number of characters preceding and appending in the file name. I want an alias or function that does this.


title: Can I determine what changed in an upgraded package using apt or dpkg on Debian 6?

text: I just did an `apt-get upgrade` on my Debian 6 development server and noticed that a certain package named `tinyproxy` was upgraded. I have a particular interest in seeing precisely _what_ changed in that package because modifying it to do some things that it currently does not do is on my list of things to do. I know that I can fire up my browser, dig a little, find the changelog and see exactly what changed in the version I just went to, but then I wondered if there's a way I could ask `apt-get` or `dpkg` to show me a changelog if one was included. Can I use either tool, or perhaps another to get a summary of what changed between versions of a package via the command line?


title: User with read access to /home

text: Pardon my ignorance but I can't seem to come up with a solution to this one. I'd like to create a user that has read access to every user's home catalog located in /home. Do I need acl's for this or can I achieve it by chmod? Thanks in advance.


title: How safe is sudo when running from root to run an application as a less privileged user?

text: Lets say I am logged in at a root terminal and I run something like the following command:               sudo -u '#1000' dbus-launch chromium        * Are there any potential security issues I should be worried about?   * Is there a safer way to do it? With the requirement that it works with GUI applications, which **runuser** does not. If I use `runuser` I get `failed to open display`. With that I can execute terminal commands from my keyboard through custom drivers (g15daemon), which can only be launched as root.


title: Are All The Packages Included On The Debian DVD/CD Images Or Just The Most Popular?

text: My understanding is that Debian and all the software available in the matching online repo (eg: https://packages.debian.org/stable/allpackages) are released together on a series of disc images (alternatively you can just download the first disc and use apt-get to download individual packages), however when I look in http://cdimage.debian.org/debian-cd/7.4.0/amd64/iso-dvd/ there are only 3 dvd images which seems a little on the small side for thousands of applications. Is the entire repo on those discs, or just the most popular applications? I have already looked at the section on cds here: www.debian.org/CD/faq/#which-cd and it simply talks about how the discs arranged with the the most popular applications first, but doesn't say if all applications are included. EDIT: I've been browsing some of the http/ftp mirrors and most of them have 3 iso, but I found some that have more. This one has 10: ftp://debian.mirror.iweb.ca/debian-cd/7.4.0/amd64/iso-dvd/ How many isos is there in total?


title: How to find a space in a text. using grep?

text: How to grep one space in text ?               cat a.txt| grep ' '      or               cat a.txt| grep '\s '


title: How can I cleanly add to $PATH?

text: I'd like a way to add things to $PATH, system-wide or for an individual user, without potentially adding the same path multiple times. One reason to want to do this is so that additions can be made in `.bashrc`, which does not require a login, and is also more useful on systems which use (e.g.) `lightdm`, which never calls `.profile`. I am aware of questions dealing with how to clean duplicates from $PATH, but **I do not want to remove duplicates**. I would like a way to _add paths only if they are not already present._


title: Add cacert certificates to kopete

text: ca-cert was recently removed from the ca-certificates bundle, and I would like to readd it, at least to kopete so I don't get the invalid certificate warnings because one of the jabber servers I connect to has a ca-cert signed certificate.


title: Compiling against a newer version of glib?

text: I'm working on a piece of software that needs to compile against a very modern version of glib, but also needs to run on Ubuntu 11.10 (which doesn't come with that version). My first thought was to just backport and replace glib, since the versions are theoretically compatible, but it causes some problems (most noticably with Unity not working right). I know that the obvious solution is to use Ubuntu 12.04, but I don't have that option right now (working on it though). Is there any sane way to handle this? Right now I'm looking at just compiling glib, `tar`ing it, and then manually setting `C_INCLUDE_PATH` and `LD_LIBRARY_PATH`. Unfortunately, I don't think I can't even package the compiled library because glib isn't very specific about its version (it's just `glib-2.0.so`). Is the `tar` method the best I can do in this situation?


title: Why should the ECN on your machine be disabled?

text: I was going through this article on iptables and there the author said that: > It's important to turn off ECN (explicit congestion notification) so that > Internet communications will work properly. Why do we need to disable the ECN?


title: How to get VIM to display 256 colors properly

text: I'm trying to get 256 color theme files to work with VIM under xterm. This is peaksea how it looks for me: ![enter image description here](http://i.stack.imgur.com/eil4k.jpg) How it should look: ![how it should look](http://i.stack.imgur.com/TJMA6.png) I've tried following the tips on the wiki page to no avail. `set t_Co=256` works fine but               set t_AB=^[[48;5;%dm     set t_AF=^[[38;5;%dm      results in the escape sequences being displayed on the terminal: EDIT: Mikel was right, I needed to type Ctrl+v+Esc to input the ^[ properly. However, that has not fixed my problem. ![enter image description here](http://i.stack.imgur.com/dvOR3.jpg) So what other changes can I try to make this work? **Additional info**               $ uname -a     Linux xxxxxxx 3.4.7-1-ARCH #1 SMP PREEMPT Sun Jul 29 22:02:56 CEST 2012 x86_64 GNU/Linux      -               $ xterm -version      XTerm(281)      -               $ vim --version     VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jul 13 2012 05:24:27)     Included patches: 1-600     Compiled by ArchLinux     Big version with GTK2 GUI.  Features included (+) or not (-):     +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent      +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments      +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff      +digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi      +file_in_path +find_in_path +float +folding -footer +fork() +gettext      -hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall      +linebreak +lispindent +listcmds +localmap +lua +menu +mksession +modify_fname      +mouse +mouseshape +mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm      -mouse_sysmouse +mouse_xterm +mouse_urxvt +multi_byte +multi_lang -mzscheme      +netbeans_intg +path_extra +perl +persistent_undo +postscript +printer -profile      +python -python3 +quickfix +reltime +rightleft +ruby +scrollbind +signs      +smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary      +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title      +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo      +vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim      +xsmp_interact +xterm_clipboard -xterm_save         system vimrc file: "/etc/vimrc"          user vimrc file: "$HOME/.vimrc"           user exrc file: "$HOME/.exrc"       system gvimrc file: "/etc/gvimrc"         user gvimrc file: "$HOME/.gvimrc"         system menu file: "$VIMRUNTIME/menu.vim"       fall-back for $VIM: "/usr/share/vim"     Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15   -I/usr/local/include  -march=x86-64 -mtune=generic -pipe -fstack-protector --param=ssp-buffer-size=4  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1           Linking: gcc   -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -rdynamic -Wl,-export-dynamic  -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE  -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0   -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE -lm -lncurses -lnsl   -lacl -lattr -lgpm -ldl  -L/usr/lib -llua  -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu -fstack-protector -L/usr/local/lib  -L/usr/lib/perl5/core_perl/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -L/usr/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic   -lruby -lpthread -lrt -ldl -lcrypt -lm  -L/usr/lib         -               $ ls -l /usr/share/terminfo/x/xterm-256color      -rw-r--r-- 1 root root 3336 Feb  8  2012 /usr/share/terminfo/x/xterm-256color      _.vimrc_               set t_Co=256      _.Xdefault_               !--------------------- XTERM ------------------------     xterm*dynamicColors:    true     xterm*background:       black     xterm*foreground:        #BBBBBB     xterm*utf8:             2     xterm*eightBitInput:    true     xterm*saveLines:        32767     xterm*scrollTtyKeypress:       true     xterm*scrollTtyOutput:  false     xterm*scrollBar:        false     xterm*loginShell:       true     xterm*faceName:         xft:Dejavu Sans Mono:size=10     xterm*jumpScroll:       true     xterm*multiScroll:      true     xterm*toolBar:          false     xterm*geometry:         100x30      **EDIT: Attempted solutions** I already installed rxvt-unicode and was using that previously. However I had the same problem. Here is a side by side comparison of the two. On the left is xterm and on the right is urxvt. The file open is the .Xdefaults which shows the settings for urxvt one of which might be the problem? ![xterm left urxvt right](http://i.stack.imgur.com/ch6i6.jpg) I also ran the color test script with seemingly positive output. Top is xterm bottom is urxvt. ![top xterm bottom urxvt](http://i.stack.imgur.com/Nlu9V.jpg)               $ echo $TERM     xterm-256color      **Workaround solution** I'm now using CSApprox and it seems to work well enough. What I'm still confused about is why the theme doesnt work even though it has the appropriate console color settings defined. Perhaps it has something to do with the way vim considers itself. It was installed as a part of the gvim package so it could be ignoring the cterm settings. **EDIT: And now everything seems to be fine..** Strangely after installing CSApprox then removing it, everything seems to work as it should. Just downloaded another colorscheme and it loaded perfectly even without the CSApprox module running. I'm not a particularly big fan of this "magically it works" so I'll test it out on a VM with a fresh install and get back to you guys.


title: File goes missing for a short period of time after saving it using VIM

text: I am having a strange problem that seams to be caused by VIM, the Linux VFS cache, ecryptfs and/or something file system related:   1. I open a file in VIM, modify it and save it.   2. I try to access the file. ## Expected behaviour The file should be accessible as soon as `:w` reports the file as written. ## Actual behaviour The file does not exist. If I wait a bit (usually less then a second) the file turns up. This is especially cumbersome when working with Python code and left over `pyc` files. I often ended up starting the old code as the new `py` file was not ready, yet. I recently added `export PYTHONDONTWRITEBYTECODE=1` to my `.bashrc` so I get a meaningful error message rather than executing the old code. It is still very awkward as any auto reloader code (e.g. from Django) fails to reload every 5-10 times because the file I changed goes missing for a short period of time. With the `pyc` files in place the auto reloader sometimes ended up loading the old `pyc` file and after that never found out that the `py` file has been modified and triggered another reload. ## System details and configuration My machine has plenty of RAM (32 GiB), an SSD and is basicly idle. Therefore I do not think that slow I/O is causing this. The file is very small (<1 KiB) and it also happens for empty files. I am using a crypted `$HOME` using ecryptfs so this might be part of the problem. I was unable to reproduce this on my `/tmp` mount which uses a `tmpfs` file system. ## VIM settings The reason why the file is moved away and replaced by a new file is caused by my VIM settings:               set backup     set backupskip=     set backupdir=$HOME/.vimbackup     set writebackup      I would expect the `new` file to be accessible right after VIM reports that the file has been written. I checked the VIM documentation for any hints of a delayed write, but did not find anything. I was unable to reproduce this using the shell commands `mv`, `cp` and `rm` so I think VIM is doing something different. * * * What else could be causing this? How can I solve this.


title: Linux big disk partition issue

text: I have a big disk around 4.8 TB (RAID) and it has following partition (created by fdisk)               [root@server1 ~]# fdisk -l /dev/sde          WARNING: The size of this disk is 4.8 TB (4796404727808 bytes).     DOS partition table format can not be used on drives for volumes     larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID     partition table format (GPT).               Disk /dev/sde: 4796.4 GB, 4796404727808 bytes     255 heads, 63 sectors/track, 583129 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes             Device Boot      Start         End      Blocks   Id  System     /dev/sde1               1      267349  2147480811   83  Linux     /dev/sde2          267350      291665   195318270   83  Linux      I am trying to create 1 more partition but it is not picking the correct cylinder number, it is starting from `24316` instead of `291666`, it looks like they are not in order. After a search with Google I found that I need to use the `parted` utility, but I don't know whether this issue is related to that or not so I need your suggestion               Command (m for help): p          Disk /dev/sde: 4796.4 GB, 4796404727808 bytes     255 heads, 63 sectors/track, 583129 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes             Device Boot      Start         End      Blocks   Id  System     /dev/sde1               1      267349  2147480811   83  Linux     /dev/sde2          267350      291665   195318270   83  Linux          Command (m for help): n     Command action        e   extended        p   primary partition (1-4)     p     Partition number (1-4): 3     First cylinder (24316-583129, default 24316):     Using default value 24316     Sector 390630929 is already allocated     First cylinder (24316-583129, default 24316):


title: Display a file's history (list of users that have modified a file)

text: Is there a command to display a list of users who modified a file providing a file history? I know that possible with svn/git etc.. but we have a config file that is not in SVN and someone modified it. My colleagues at work blame me and say "You are the criminal " :(


title: kio sftp does not work but fish works

text: If I try to initiate an `sftp` connection from dolphin (or konquerer), it tells me the password is wrong and asks me for the correct password. > Incorrect username or password Do you want to retry? I have tried 4 different servers with the same response. All 4 serevrs worked with an earlier version of KDE. If i use `fish` instead, it works. I have tried starting dolphin from a consle, but got no error messages there.   1. If there is a real error message, where/how do i find it?   2. How can I get `sftp` to start working again? Info about my KDE:               $ uname -a      > Linux rito.work.puggan.se 2.6.38-gentoo-r6 #2 SMP Thu Jul 14 14:36:14 CEST > 2011 i686 AMD Athlon(tm) II X2 245 Processor AuthenticAMD GNU/Linux               equery list kdelibs kdebase-kioslaves kioclient dolphin -p     (I = Installed, P = Avaible in Portage)           * Searching for kdelibs ...     [-P-] [  ] kde-base/kdelibs-4.7.4:4     [-P-] [ ~] kde-base/kdelibs-4.7.4-r12:4     [IP-] [  ] kde-base/kdelibs-4.8.3:4     [-P-] [ ~] kde-base/kdelibs-4.8.4:4           * Searching for kdebase-kioslaves ...     [-P-] [  ] kde-base/kdebase-kioslaves-4.7.4:4     [IP-] [  ] kde-base/kdebase-kioslaves-4.8.3:4     [-P-] [ ~] kde-base/kdebase-kioslaves-4.8.4:4           * Searching for kioclient ...     [-P-] [  ] kde-base/kioclient-4.7.4:4     [IP-] [  ] kde-base/kioclient-4.8.3:4     [-P-] [ ~] kde-base/kioclient-4.8.4:4           * Searching for dolphin ...     [-P-] [  ] kde-base/dolphin-4.7.4:4     [IP-] [  ] kde-base/dolphin-4.8.3-r1:4     [-P-] [ ~] kde-base/dolphin-4.8.4:4          emerge -pv          [ebuild   R    ] kde-base/kdelibs-4.8.3  USE="3dnow acl alsa bzip2 fam handbook mmx nls opengl (policykit) semantic-desktop spell sse sse2 ssl udev udisks upower (-altivec) (-aqua) -debug -doc -jpeg2k -kerberos -lzma -openexr -test (-upnp) -zeroconf" 0 kB     [ebuild   R    ] kde-base/kdebase-kioslaves-4.8.3  USE="bzip2 exif handbook sftp (-aqua) -debug -lzma -openexr -samba" 0 kB     [ebuild   R    ] kde-base/kioclient-4.8.3  USE="(-aqua) -debug" 0 kB     [ebuild   R    ] kde-base/dolphin-4.8.3-r1  USE="handbook semantic-desktop (-aqua) -debug -thumbnail" 0 kB


title: postgresql service start issues

text: I'm attempting to build a box via Fabric on Openstack. Part of the install involves installing and running PostgreSQL. This command works fine:               $ sudo service postgresql initdb       This command fails:               $ sudo service postgresql start      Log output of failure shows no issues when I run this command:               $ cat /var/lib/pgsql/pgstartup.log        This command shows the following messages:               $ cat /var/lib/pgsql/data/pg_log/postgresql-Wed.log      > LOG: could not open configuration file "/var/lib/pgsql/data/pg_hba.conf": > Permission denied FATAL: could not load pg_hba.conf My user while executing these commands has the following groups:               vagrant, wheel      My user is in the `sudoers` list under `/etc/sudoers` with these permissions:               vagrant  ALL=(ALL) NOPASSWD: ALL      perms on `pgsql`:               [root@integration ~]# ls -ltr /var/lib/pgsql/     total 12     drwx------.  2 postgres postgres 4096 Sep 13  2012 backups     -rw-------.  1 postgres postgres 1152 Jun 19 20:17 pgstartup.log     drwx------. 12 postgres postgres 4096 Jun 19 20:19 data      and sub dir `data`:               [root@integration ~]# ls -ltr /var/lib/pgsql/data/     total 76     -rw-------. 1 postgres postgres     4 Jun 19 20:17 PG_VERSION     drwx------. 2 postgres postgres  4096 Jun 19 20:17 pg_twophase     drwx------. 2 postgres postgres  4096 Jun 19 20:17 pg_tblspc     drwx------. 2 postgres postgres  4096 Jun 19 20:17 pg_stat_tmp     drwx------. 4 postgres postgres  4096 Jun 19 20:17 pg_multixact     -rw-------. 1 postgres postgres 16886 Jun 19 20:17 postgresql.conf     -rw-------. 1 postgres postgres  1631 Jun 19 20:17 pg_ident.conf     drwx------. 3 postgres postgres  4096 Jun 19 20:17 pg_xlog     drwx------. 2 postgres postgres  4096 Jun 19 20:17 pg_subtrans     drwx------. 2 postgres postgres  4096 Jun 19 20:17 pg_clog     drwx------. 5 postgres postgres  4096 Jun 19 20:17 base     drwx------. 2 postgres postgres  4096 Jun 19 20:17 global     -rw-------. 1 postgres postgres   241 Jun 19 20:17 pg_hba.conf     drwx------. 2 postgres postgres  4096 Jun 19 20:17 pg_log     -rw-------. 1 postgres postgres    57 Jun 19 20:19 postmaster.opts


title: A couple arithmetic related commands, Dash, POSIX shell, sh, Increment

text: When pre/post incrementing a variable, in POSIX Shell, what is the difference between these two examples. They seem like they would have the same consequences, but would they be used differently? When would you prefer one over the other?               X=$((X+1))          : $((X=X+1))


title: Giving apache user same permissions as root only on specific folders

text: Not sure if this is possible but is there a way to grant the Apache user same level of permissions (ownership) as root only on specific folder(s). Why I need this: We have a CentOS 6.2 server with apache setup as our development server, and we use only the root user because the server is an internal server and doesn't have any outside access, every day we upload quite a lot of files and setup new folder, but because we are using the root user the ownership of the files belongs to the root user and for the apache user to create files (upload images, create log files and create folders) we need to grant 777 permissions. Of course we can go in and update the ownership of all the files to Apache but not everyone in the team knows how to do this, so if it would be possible to grant the apache user root permissions on the "/var/www/*" folder and what's inside it would solve all of the issues. Thanks


title: How do i change the password for root using webmin, where i have no more access as root?

text: I changed the root password, using `webmin` it shows me successfully done.               $ uname -a     Linux .com 2.6.18-194.11.4.el5 #1 SMP Tue Sep 21 05:04:09 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux          $ echo -e "newPassword\nnewPassword" | passwd root      now i am logged in via ssh and trying to sudo -s or sudo - it says `Sorry, try again.` Why i cant sudo -s login as root with valid password? or sudo root commands? EDIT:               > cat /etc/sudoers     /sbin/iwconfig, /sbin/mii-tool     Defaults    requiretty     Defaults    env_reset     Defaults    env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR \                             LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \                             LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION \                             LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC \                             LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS \                             _XKB_CHARSET XAUTHORITY"     root    ALL=(ALL)   ALL


title: suexec with chrooted environment

text: I'm trying to get a chrooted Apache environment working running mod_fcgid with suexec. Looking at suexec log inside jail, the wrapper scripts are being executed with no problems, however, when I look at Apache's error log I'm seeing the errors below;               suexec failure: could not open log file     fopen: Permission denied      suexec.log;               [2013-06-20 01:15:39]: uid: (500/user) gid: (500/user) cmd: php-fcgi-starter     [2013-06-20 01:16:30]: uid: (500/user) gid: (500/user) cmd: php-fcgi-starter     [2013-06-20 01:16:39]: uid: (500/user) gid: (500/user) cmd: php-fcgi-starter     [2013-06-20 01:18:07]: uid: (500/user) gid: (500/user) cmd: php-fcgi-starter     [2013-06-20 01:22:21]: uid: (500/user) gid: (500/user) cmd: php-fcgi-starter      When I `strace` both `php` and `suexec`, they do not complain about any missing library or file. The log says "could not open log file" but it obviously logs into the error log file inside the jail. What's wrong with this setup? What may trigger this error? edit : strace results;               [pid  9912] rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTORER|SA_INTERRUPT, 0x7fca687fe500}, {SIG_DFL, [], 0}, 8) = 0     [pid  9912] chdir("/var/www/username/cgi-bin/") = 0     [pid  9912] execve("/usr/sbin/suexec", ["/usr/sbin/suexec", "500", "500", "php-fcgi-starter"], [/* 1 var */]) = 0     [pid  9912] brk(0)                      = 0x7f2d71e91000     [pid  9912] fcntl(0, F_GETFD)           = 0     [pid  9912] fcntl(1, F_GETFD)           = 0     [pid  9912] fcntl(2, F_GETFD)           = 0     [pid  9912] access("/etc/suid-debug", F_OK) = -1 ENOENT (No such file or directory)     [pid  9912] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2d715f2000     [pid  9912] access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)     [pid  9912] open("/etc/ld.so.cache", O_RDONLY) = 3     [pid  9912] fstat(3, {st_mode=S_IFREG|0644, st_size=13704, ...}) = 0     [pid  9912] mmap(NULL, 13704, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f2d715ee000     [pid  9912] close(3)                    = 0     [pid  9912] open("/lib64/libc.so.6", O_RDONLY) = 3     [pid  9912] read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\355\1\0\0\0\0\0"..., 832) = 832     [pid  9912] fstat(3, {st_mode=S_IFREG|0755, st_size=1916568, ...}) = 0     [pid  9912] mmap(NULL, 3745960, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f2d71041000     [pid  9912] mprotect(0x7f2d711cb000, 2093056, PROT_NONE) = 0     [pid  9912] mmap(0x7f2d713ca000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x189000) = 0x7f2d713ca000     [pid  9912] mmap(0x7f2d713cf000, 18600, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f2d713cf000     [pid  9912] close(3)                    = 0     [pid  9912] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2d715f9000     [pid  9912] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2d715ed000     [pid  9912] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2d715ec000     [pid  9912] arch_prctl(ARCH_SET_FS, 0x7f2d715ed700) = 0     [pid  9912] mprotect(0x7f2d713ca000, 16384, PROT_READ) = 0     [pid  9912] mprotect(0x7f2d715f3000, 4096, PROT_READ) = 0     [pid  9912] munmap(0x7f2d715ee000, 13704) = 0     [pid  9912] brk(0)                      = 0x7f2d71e91000     [pid  9912] brk(0x7f2d71eb2000)         = 0x7f2d71eb2000     [pid  9912] getuid()                    = 48     [pid  9912] socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3     [pid  9912] connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)     [pid  9912] close(3)                    = 0     [pid  9912] socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3     [pid  9912] connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)     [pid  9912] close(3)                    = 0     [pid  9912] open("/etc/nsswitch.conf", O_RDONLY) = 3     [pid  9912] fstat(3, {st_mode=S_IFREG|0644, st_size=1688, ...}) = 0     [pid  9912] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2d715f1000     [pid  9912] read(3, "#\n# /etc/nsswitch.conf\n#\n# An ex"..., 4096) = 1688     [pid  9912] read(3, "", 4096)           = 0     [pid  9912] close(3)                    = 0     [pid  9912] munmap(0x7f2d715f1000, 4096) = 0     [pid  9912] open("/etc/ld.so.cache", O_RDONLY) = 3     [pid  9912] fstat(3, {st_mode=S_IFREG|0644, st_size=13704, ...}) = 0     [pid  9912] mmap(NULL, 13704, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f2d715ee000     [pid  9912] close(3)                    = 0     [pid  9912] open("/lib64/libnss_files.so.2", O_RDONLY) = 3     [pid  9912] read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360!\0\0\0\0\0\0"..., 832) = 832     [pid  9912] fstat(3, {st_mode=S_IFREG|0755, st_size=65928, ...}) = 0     [pid  9912] mmap(NULL, 2151824, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f2d70e33000     [pid  9912] mprotect(0x7f2d70e3f000, 2097152, PROT_NONE) = 0     [pid  9912] mmap(0x7f2d7103f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7f2d7103f000     [pid  9912] close(3)                    = 0     [pid  9912] mprotect(0x7f2d7103f000, 4096, PROT_READ) = 0     [pid  9912] munmap(0x7f2d715ee000, 13704) = 0     [pid  9912] open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3     [pid  9912] fcntl(3, F_GETFD)           = 0x1 (flags FD_CLOEXEC)     [pid  9912] fstat(3, {st_mode=S_IFREG|0644, st_size=952, ...}) = 0     [pid  9912] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2d715f1000     [pid  9912] read(3, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 952     [pid  9912] close(3)                    = 0     [pid  9912] munmap(0x7f2d715f1000, 4096) = 0     [pid  9912] open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3     [pid  9912] fstat(3, {st_mode=S_IFREG|0644, st_size=952, ...}) = 0     [pid  9912] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2d715f1000     [pid  9912] read(3, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 952     [pid  9912] close(3)                    = 0     [pid  9912] munmap(0x7f2d715f1000, 4096) = 0     [pid  9912] socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3     [pid  9912] connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)     [pid  9912] close(3)                    = 0     [pid  9912] socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3     [pid  9912] connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)     [pid  9912] close(3)                    = 0     [pid  9912] open("/etc/group", O_RDONLY|O_CLOEXEC) = 3     [pid  9912] fstat(3, {st_mode=S_IFREG|0644, st_size=520, ...}) = 0     [pid  9912] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2d715f1000     [pid  9912] read(3, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 520     [pid  9912] close(3)                    = 0     [pid  9912] munmap(0x7f2d715f1000, 4096) = 0     [pid  9912] open("/var/log/httpd/suexec.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = 3     [pid  9912] fstat(3, {st_mode=S_IFREG|0644, st_size=17043, ...}) = 0     [pid  9912] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2d715f1000     [pid  9912] fstat(3, {st_mode=S_IFREG|0644, st_size=17043, ...}) = 0     [pid  9912] lseek(3, 17043, SEEK_SET)   = 17043     [pid  9912] gettimeofday({1371690955, 897472}, NULL) = 0     [pid  9912] open("/etc/localtime", O_RDONLY) = 4     [pid  9912] fstat(4, {st_mode=S_IFREG|0644, st_size=2102, ...}) = 0     [pid  9912] fstat(4, {st_mode=S_IFREG|0644, st_size=2102, ...}) = 0     [pid  9912] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2d715f0000     [pid  9912] read(4, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\0\4\0\0\0\0"..., 4096) = 2102     [pid  9912] lseek(4, -1337, SEEK_CUR)   = 765     [pid  9912] read(4, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\0\4\0\0\0\0"..., 4096) = 1337     [pid  9912] close(4)                    = 0     [pid  9912] munmap(0x7f2d715f0000, 4096) = 0     [pid  9912] write(3, "[2013-06-20 03:15:55]: uid: (500"..., 77) = 77     [pid  9912] setgid(500)                 = 0     [pid  9912] open("/proc/sys/kernel/ngroups_max", O_RDONLY) = -1 ENOENT (No such file or directory)     [pid  9912] open("/etc/group", O_RDONLY|O_CLOEXEC) = 4     [pid  9912] fstat(4, {st_mode=S_IFREG|0644, st_size=520, ...}) = 0     [pid  9912] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2d715f0000     [pid  9912] lseek(4, 0, SEEK_CUR)       = 0     [pid  9912] read(4, "root:x:0:root\nbin:x:1:root,bin,d"..., 4096) = 520     [pid  9912] read(4, "", 4096)           = 0     [pid  9912] close(4)                    = 0     [pid  9912] munmap(0x7f2d715f0000, 4096) = 0     [pid  9912] setgroups(1, [500])         = 0     [pid  9912] setuid(500)                 = 0     [pid  9912] getcwd("/var/www/username/cgi-bin", 4096) = 22     [pid  9912] chdir("/var/www")           = 0     [pid  9912] getcwd("/var/www", 4096)    = 9     [pid  9912] chdir("/var/www/username/cgi-bin") = 0     [pid  9912] lstat("/var/www/username/cgi-bin", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0     [pid  9912] lstat("php-fcgi-starter", {st_mode=S_IFREG|0755, st_size=128, ...}) = 0     [pid  9912] close(3)                    = 0     [pid  9912] munmap(0x7f2d715f1000, 4096) = 0     [pid  9912] execve("php-fcgi-starter", ["php-fcgi-starter"], [/* 1 var */]) = -1 ENOENT (No such file or directory)     [pid  9912] open("/var/log/httpd/suexec.log", O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EACCES (Permission denied)     [pid  9912] write(2, "suexec failure: could not open l"..., 40) = 40     [pid  9912] write(2, "fopen: Permission denied\n", 25) = 25     [pid  9912] exit_group(1)               = ?      the last ~20 lines is where the server throws the error.


title: Upstart on Debian?

text: I created an upstart script in Ubuntu, thinking it would be the same for Debian. But Debian doesn't have a `/etc/init` folder that Ubuntu has. I went to the upstart download page and seeing that they have packages, did a `apt- get install upstart`, but it asks to remove sysvinit, which I know will/might screw up my system. So how do I make my Ubuntu script work on Debian?


title: What distro for an old HP (Celeron/384MB)

text: An old HP desktop just came my way for service. Was running XP, but the install is trashed. User would like to switch to Linux, but the box it's only a 950mhz Celeron with 384MB RAM. It does have a decent sized hard drive though (40GB), so something should fit. I tried OpenSuSE 11.3, but it just goes to a black screen part way through the installer. What's the fullest featured distro I can squeeze onto this box?


title: Where can I find a log file that logs ports error messages in FreeBSD?

text: I looked in /var/log/ but there isn't any log files that records ports log, and I just found this person asking the same thing in other forum and get an answer which stating there is no such file. If that's the case how should I read error messages? with more?


title: Running several commands in a screen-split

text: I have a few long running commands that I would like to run together in the same screen (same tab in the terminal app). My current setup is like this:               tmux new-session -d 'cmd1'     tmux split-window 'cmd2'     tmux split-window 'cmd3'     tmux attach      However, it seems that `tmux split-window` actually splits the last split, so if I run several command this way, the first command gets half the screen, and the other commands get progressively smaller and smaller parts. Is there a simpler way that runs all commands in equal-sized splits?


title: Live-Build Debian blank desktop

text: Following the example in the live-build manual, I build the iso, and run it with qemu. The _only_ difference between what I did and what it says to do is in the package list, where vim and tmux replaced xchat. I'm at the test step, before the git initialization. It boots, and gets to the debian desktop image. Nothing more shows up. I had assumed it hung, and left if for an hour to see if it got better, with no change. I can get the run prompt with `alt`+`F2` and can get xterm from there. On the desktop, I can right click, and create a file or directory, but they don't show up on the desktop. They are created however, and can be seen with xterm in `~/Desktop` It also does do the default screensaver rotation. I also know that the packages I installed (Vim, tmux) got installed by checking with xterm. What am I doing wrong? Would choosing a different desktop environment help? (Currently trying with xfce, just takes quite a bit of time to build the iso, and I'm doubtful it's the correct solution)


title: virt-install cpu0 unhandled rdmsr

text: I'm trying to install a guest VM using KVM on a partition. I use `virt- install`. I call the following command:               virt-install -n centos --ram=1536 --vcpus=1 --cdrom=/var/lib/libvirt/CentOS-6.5-x86_64-minimal.iso --disk /dev/mapper/vg_vmhost-lv_centos      The VM boots up to install - the Welcome to CentOS 6.5! screen with the five options to install or upgrade, install with basic video drive, rescue, boot from local drive, or do a memory test shows up. Then the following messages display:               Loading vmlinuz     Probing EDD (edd=off to disable)... ok...............ready.     kvm: 2617: cpu0 unhandled rdmsr: 0xc0010001      And then it hangs without installing CentOS. I've searched for this error and the pages I've read haven't been helpful at all. This one, for example, indicates that the messages are harmless. My host machine is a headless CentOS 6.5 minimal install, and I'm trying to install the same on the intended VM.