title: Myth or reality: SELinux can confine the root user?

text: I read or heard somewhere (maybe in LinuxCBT's SELinux course; but I'm not sure) that there are online Linux servers, for which the password of the root user is also given. The Linux server is hardened using SELinux rules, such that everyone can login with the root user, but cannot make any harm to the OS. It seems like a myth to me, but I wanted to make sure: Is it possible to harden a Linux box (possibly with SELinux), such that even the root user cannot do specific malicious activities on it? (Examples: deleting system files, clearing log files, stopping critical services, etc.) Such a Linux box will be a great starting point for building a honeypot. **Edit:** Based on an answer (now deleted), and a little Googling, I got at least two links which pointed out to such hardened Linux servers. Unfortunately, both servers are down. For the record, I'll copy-paste the descriptions here: 1) From http://www.coker.com.au/selinux/play.html: > Free root access on a SE Linux machine! > > To access my Debian play machine ssh to **play.coker.com.au** as root, the > password is ... > > Note that such machines require a lot of skill if you are to run them > successfully. If you have to ask whether you should run one then the answer > is "no". > > The aim of this is to demonstrate that all necessary security can be > provided by SE Linux without any Unix permissions (however it is still > recommended that you use Unix permissions as well for real servers). Also it > gives you a chance to login to a SE machine and see what it's like. > > When you login to a SE Linux play machine make sure that you use the **-x** > option to disable X11 forwarding or set **ForwardX11** no in your > /etc/ssh/ssh_config file before you login. Also make sure that you use the > -a option to disable ssh agent forwarding or set **ForwardAgent no** in your > /etc/ssh/ssh_config file before you login. If you don't correctly disable > these settings then logging in to the play machine will put you at risk of > being attacked through your SSH client. > > There is an IRC channel for discussing this, it is **#selinux** on > **irc.freenode.net**. > > Here is a quick FAQ 2) From http://www.osnews.com/comments/3731 > Hardened Gentoo's purpose is to make Gentoo viable for high security, high > stability production server environments. This project is not a standalone > project disjoined from Gentoo proper; it is intended to be a team of Gentoo > developers which are focused on delivering solutions to Gentoo that provide > strong security and stability. This machine is Hardened Gentoo's SELinux > demo machine. The primary use of it is to test and audit SELinux > integration, and policy.


title: Run xterm with login shell or not?

text: Per default `xterm` starts an interactive shell. But you can also configure it to start an interactive **login-shell**. That means that with starting an `xterm` you get the same kind of shell like logging in via ssh/virtual console/su. What are the advantages/disadvantages configuring a _login-shell_ in xterm? I can think of:   * `uptime`, `w`, `last` etc. report as many users as `xterm`'s are open. (advantage?)   * `bash` only sources `.login`, `.profile`, `/etc/profile.d` when started as _login-shell_   * `zsh` has similar files which it reads when started as _login-shell_ \- but on my system they are empty by default Related `xterm` man page section: > >        -ls     This  option  indicates  that  the shell that is started in > the >                xterm window will be a login shell (i.e., the  first > character >                of  argv[0]  will  be  a  dash, indicating to the shell that > it >                should read the user's .login or .profile). >   There is also a resource: > >       loginShell (class LoginShell) >                Specifies whether or not the shell to  be  run  in  the > window >                should be started as a login shell.  The default is “false.” >


title: ls taking long time in small directory

text: Running Ubuntu, I open a terminal and do               sudo bash     cd /     ls | head -n 1000      And predictably about 20 directories are returned. However, if I do an ls, and don't pipe it into anything, the ls just hangs there until I kill it from another terminal. What could be happening? **EDIT:**               > type ls     ls is aliased to `ls --color=auto`      **EDIT:**               > /bin/ls /     <normal response>     > /bin/ls --color=auto     <hangs indefinitely>      Why is coloring the output of ls causing this command to hang?


title: Granting all users access to mounted CIFS shares

text: I'm trying to set up a debian server that will run several network-based services. These services need access to an external network drive to store their data. For security reasons, I have set up each service to run under it's own user. To allow them all to access the network share, I created a new group, `driveaccess`, with gip 1003 I then set up the network share by adding the following to /ets/fstab               //192.168.42.2/Data/ /media/Data cifs guest,rw,mand,gid=1003,forcegid,user=duckies%swordfish 0 0      After mounting the drive, the service accounts see the premissions as               -rwxr-xr-x 1 root driveaccess   1544704 Jun  1  2013 AppData1.dat      And the processes can read the data with no problems, but any attempt to write to the drive fails               touch: cannot touch `test.txt': Permission denied      What do I need to add to the fstab to let everything in the driveaccess group write to the share?


title: Making USB drives readonly on an specific USB port or for an user account

text: I have a Multiseat machine and the second seat has USB access from a signle port by HUB (a Keyboard and a mouse are connected to it).   I need make all storages drives that is connected to to this HUB be read-only.   This seat logins only by one user account. How can I make a USB port read-only for one Account or one port (without makeing problem for Input devices that are connected it that port)? I'm using Ubuntu 12.04 Thanks


title: Using a APC Smart-UPS to shutdown a Ubuntu Server Cluster

text: I'm currently in the process of designing a solution to shutdown a two Ubuntu Server cluster that uses heartbeat and DRBD to replicate storage and offer a NFS share to some IP cameras. We want to integrate a UPS into the system so the servers will shutdown gracefully. I'm currently looking into the APC Smart-UPS C 1000VA 2U LCD 120V UPS and using Apcupsd to shutdown the servers in the event of a power outage. Is this idea possible? I'm reading through the documentation right now. If you guys have any better ideas I'm open for suggestions.


title: Server down and require manual fsck. I saw this error in dmesg

text: I saw this in `dmesg`. What does it mean? > EXT4-fs error (device sdb1): htree_dirblock_to_tree: bad entry in directory > #763 3575: rec_len is smaller than minimal - block=30429885offset=0(671744), > inode=0,   >  rec_len=0, name_len=0 How in the earth this happen? Is this because SDB is bad? This is what /var/messages say               Sep 26 17:15:40 host pure-ftpd: (?@175.44.11.232) [INFO] New connection from 175.44.11.232     Sep 26 17:15:40 host pure-ftpd: (?@27.150.198.182) [INFO] Logout.     Sep 26 17:15:41 host pure-ftpd: (?@216.244.84.165) [WARNING] Authentication failed for user [solarromancecom]     Sep 26 17:15:41 host pure-ftpd: (?@216.244.84.165) [INFO] Logout.     Sep 26 17:15:41 host pure-ftpd: (?@27.150.198.182) [INFO] New connection from 27.150.198.182     Sep 26 17:15:41 host pure-ftpd: (?@216.244.84.165) [INFO] New connection from 216.244.84.165     Sep 26 17:15:43 host pure-ftpd: (?@202.100.206.34) [WARNING] Authentication failed for user [admSep 27 04:17:49 host kernel: imklog 5.8.10, log source = /proc/kmsg started.     Sep 27 04:17:49 host rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="1708" x-info="http://www.rsyslog.com"] start     Sep 27 04:17:49 host kernel: Initializing cgroup subsys cpuset     Sep 27 04:17:49 host kernel: Initializing cgroup subsys cpu     Sep 27 04:17:49 host kernel: Linux version 2.6.32-358.18.1.el6.i686 (mockbuild@c6b10.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Wed Aug 28 14:27:42 UTC 2013     Sep 27 04:17:49 host kernel: KERNEL supported cpus:     Sep 27 04:17:49 host kernel:  Intel GenuineIntel     Sep 27 04:17:49 host kernel:  AMD AuthenticAMD     Sep 27 04:17:49 host kernel:  NSC Geode by NSC     Sep 27 04:17:49 host kernel:  Cyrix CyrixInstead     Sep 27 04:17:49 host kernel:  Centaur CentaurHauls     Sep 27 04:17:49 host kernel:  Transmeta GenuineTMx86     Sep 27 04:17:49 host kernel:  Transmeta TransmetaCPU     Sep 27 04:17:49 host kernel:  UMC UMC UMC UMC     Sep 27 04:17:49 host kernel: BIOS-provided physical RAM map:      That's it. So the system reboot and before it reboot it doesn't tell why or anythign.


title: Transfer a Fedora system to another computer

text: I'd like to transfer my Fedora to a remote machine. Fedora is under Grub 2.0 and on the remote machine there is a Centos system and Grub 0.97. In fact, I have two questions. First is how to properly add an entry to the hosting grub. The second one is how to copy Fedora filesystem to the machine on which Centos is running. Fedora's `lsblk` output is:               sda                      8:0    0 232.9G  0 disk      ├─sda1                   8:1    0   500M  0 part /boot     └─sda2                   8:2    0 231.8G  0 part        ├─fedora-usr (dm-0)  253:0    0  14.7G  0 lvm  /usr       ├─fedora-swap (dm-1) 253:1    0     4G  0 lvm  [SWAP]       ├─fedora-root (dm-2) 253:2    0  30.5G  0 lvm  /       ├─fedora-tmp (dm-3)  253:3    0     4G  0 lvm  /tmp       └─fedora-home (dm-4) 253:4    0 178.7G  0 lvm  /home      How could I add this structure to the remote machine while keeping the existing Centos partition schema?               ├─sda1                         8:1    0    25G  0 part      ├─sda2                         8:2    0 279.5G  0 part      ├─sda3                         8:3    0 198.9G  0 part      ├─sda4                         8:4    0     1K  0 part      ├─sda5                         8:5    0   500M  0 part /boot     └─sda6                         8:6    0 194.8G  0 part        ├─vg_centos-lv_root (dm-0) 253:0    0    50G  0 lvm  /       ├─vg_centos-lv_swap (dm-1) 253:1    0   3.8G  0 lvm  [SWAP]       └─vg_centos-lv_home (dm-2) 253:2    0   141G  0 lvm  /home      Can I add `/dev/sda7` and so on? UPD#1 the both systems aren't RAID disk the both have lvm disks and the master boot is MBR not GPT


title: Firefox not rendering some pages well

text: I recently installed ArchLinux on my macbook Alu. I've installed the nvidia proprietary graphics, and Gnome3. I have Firefox 10 installed with pacman. However Firefox is not rendering some pages well (like in MacOs). The page width outfit the screen size and elements not appearing where they should. Can someone tells me if it comes from my installation or from firefox in general? (I've also tried to disable hardware accelaration but same result). Thank you.


title: How to set and read time w/o language barrier in linux?

text: Currently when you run the command                date      the output is               Wed Sep 18 07:23:28 EDT 2013      and if you want to change the date you'd have to run               date -s "18 SEP 2013 07:15:00"      if you try to change `SEP` to `9` ( month of the year ) as in run :               date -s "18 9 2013 07:15:00"      the result is:               date: invalid date `18 9 2013 07:15:00'      is it possible to simply use numbers instead of month names this way if i move to a different country i do not have to think extra in order to figure out what "SEP" means. etc.. ?


title: Background script run at login interrupted when I run tmux in terminal

text: In `~/.profile` I run a script in the background (`redshift` for changing the screen temperature at night time). After logging in, I can open a terminal, and run `tmux`. However, at this point, redshift visibly gets interrupted as the screen temperature resets and it seems that redshift starts again in this terminal. What's happening here? I get the impression that `~/.profile` is for each shell, and gets parsed again when I run tmux. Could this be?


title: Grub change loopback amount?

text: I'm having an issue with loopback. It looks like there is only 8. I did a search and apparently the problem is grub by default only has 8 loopback (devices?). If i look in /dev/ i see loop 0-7 so that does seem to make sense. How do i change the amount of loopbacks?


title: How do i WGET an image from a webaddress and store it on a remote ftp location as a cronjob on dd-wrt

text: From a DD-WRT router I want to create a cron-job that wget's an image from a remote location. This image is to be passed on to a remote FTP server for storage. The process is to be repeated every minute, naming the destination image on the ftp with the current time :               wget: get file from -> http://37.***.9.95/fullsize.jpg           ftp: put fullsize.jpg -> ftp://83.***.151.224/shares/camera/dateTimeNow.jpg      Where dateTimeNow is the current time. The ftp server for storage is not smart enough to have either cron nor something else than just FTP. the DD-WRT device however, has cron!


title: How can I list subdirectories recursively?

text: The obvious               ls -dR      does not work. I am currently using               find /path/ -type d -ls      but the output is not what I need (plain listing of sub-folders) Is there a way out?


title: How to prevent users from deleting a directory?

text: I tried "chattr +i DIRNAME", it's great, but I cannot create files in the DIR after chattr. What else are there to prevent users from deleting a Directory?               root@HOST ~] mkdir test     [root@HOST ~] chattr +i test     [root@HOST ~] cd test     [root@HOST ~/test] touch sth     touch: cannot touch `sth': Permission denied     [root@HOST ~/test] cd ..     [root@HOST ~] chattr -i test     [root@HOST ~] cd test     [root@HOST ~/test] touch sth     [root@HOST ~/test]       UPDATE: only the directory deletion is important, so I still need the files to be deleted in it


title: How to disable playlist song hover info in Amarok?

text: Anyone know how to disable this annoying hover info in Amarok 2.4? I browsed through all the options (not that there is much of them), but couldn't find how to turn that feature off... It's getting in the way when hovering over songs with your mouse and really is not necessary. Thank you.


title: What are some excellent Emacs utter beginner resources?

text: I administrate a couple of servers and do automation with both python and ruby at times. I've seen some awesome Youtube videos of users with multiple open windows, logged in background chats, and deep code completion, all done with emacs. I'm currently using vi and would like to learn emacs. Altogether doing away with any and all forms of GUI (suggestions for text browsing in emacs welcome) would be perfect in my current environment, especially for decluttering and focus. Content similar to http://platypope.org/yada/emacs-demo/tutorial.swf would be perfect.


title: Why isn't GNU/Linux SUS v3+ compliant?

text: I am looking for specific details as to why isn't GNU/Linux currently SUS(Single UNIX Specification) v3 or even better SUS v4 compliant? What application apis and user utilities does it miss or implement in a non-SUS compliant way?


title: Moving compiled assembly code to the boot sector of a USB device

text: I have written a simple operating system and I am trying to test it. I have VirtualBox installed and an eight GB flash drive, so I thought I would just use those. I am not sure how to make the USB drive bootable, however. I have followed a lot of tutorials on making a bootable iso image, but neither VirtualBox nor Disk Utility can read it. Can somebody give me a proven method to setup the USB drive to be bootable? **What I have**   * An eight GB flash drive   * A VirtualBox VM   * A .bin made from assembly code compiled with nasm.  **What I need**   * Simple, clear information on how to fill the boot sector of a USB device   * A nudge in the right direction if I need something in addition to the .bin **Existing Code**               ;*********************************************     ;   Boot1.asm     ;       - A Simple Bootloader     ;     ;   Operating Systems Development Tutorial     ;*********************************************          org     0x7c00              ; We are loaded by BIOS at 0x7C00          bits    16                  ; We are still in 16 bit Real Mode          Start:              cli                 ; Clear all Interrupts         hlt                 ; halt the system          times 510 - ($-$$) db 0             ; We have to be 512 bytes. Clear the rest of the bytes with 0          dw 0xAA55                   ; Boot Signature      **Tutorials I have followed** http://www.quilime.com/code/bootable_iso http://www.acm.uiuc.edu/sigops/roll_your_own/ http://www.brokenthorn.com/Resources/OSDevIndex.html http://www.brokenthorn.com/Resources/OSDev1.html http://www.brokenthorn.com/Resources/OSDev2.html http://www.brokenthorn.com/Resources/OSDev3.html


title: BCM43228 does not work since kernel 3.15.xx

text: Since `yum update`, my WiFi is disconnected. The command `rfkill list` returns:               0: phy0: Wireless LAN         Soft blocked: yes         Hard blocked: no      I saw that I have to `rmmod hp-wmi` and I did it and the Soft (seen in the output above) was not blocked after doing this, but the problem remains. Details:               $ uname -a     3.15.10-200.fc20.x86_64 #1 SMP Thu Aug 14 15:39:24 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux          $ iwconfig      lo        no wireless extensions.          em1       no wireless extensions.          wlo1      IEEE 802.11abg  ESSID:off/any                 Mode:Managed  Access Point: Not-Associated                  Retry short limit:7   RTS thr:off   Fragment thr:off               Power Management:off               $ ifconfig      em1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500             inet 88.177.227.149  netmask 255.255.255.0  broadcast 88.177.227.255             inet6 fe80::a65d:36ff:fe99:86e6  prefixlen 64  scopeid 0x20<link>             ether a4:5d:36:99:86:e6  txqueuelen 1000  (Ethernet)             RX packets 2307  bytes 1166280 (1.1 MiB)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 2666  bytes 364291 (355.7 KiB)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0             device interrupt 17  memory 0xd0400000-d0420000            lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536             inet 127.0.0.1  netmask 255.0.0.0             inet6 ::1  prefixlen 128  scopeid 0x10<host>             loop  txqueuelen 0  (Boucle locale)             RX packets 88  bytes 6968 (6.8 KiB)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 88  bytes 6968 (6.8 KiB)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0          wlo1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500             inet6 fe80::3623:87ff:fe49:df30  prefixlen 64  scopeid 0x20<link>             ether 34:23:87:49:df:30  txqueuelen 1000  (Ethernet)             RX packets 0  bytes 0 (0.0 B)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 0  bytes 0 (0.0 B)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0             device interrupt 19                $ lspci -k | grep -A 3 -i network     00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)         Subsystem: Hewlett-Packard Company Device 176b         Kernel driver in use: e1000e         Kernel modules: e1000e     --     04:00.0 Network controller: Broadcom Corporation BCM43228 802.11a/b/g/n         Subsystem: Hewlett-Packard Company BCM943228HM4L 802.11a/b/g/n 2x2 Wi-Fi Adapter         Kernel driver in use: wl         Kernel modules: bcma, wl      NB : After booting `ifconfig` returns:               em1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500             inet 172.20.110.67  netmask 255.255.192.0  broadcast 172.20.127.255             inet6 fe80::a65d:36ff:fe99:86e6  prefixlen 64  scopeid 0x20<link>             ether a4:5d:36:99:86:e6  txqueuelen 1000  (Ethernet)             RX packets 12485  bytes 3839676 (3.6 MiB)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 4671  bytes 974683 (951.8 KiB)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0             device interrupt 17  memory 0xd0400000-d0420000            lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536             inet 127.0.0.1  netmask 255.0.0.0             inet6 ::1  prefixlen 128  scopeid 0x10<host>             loop  txqueuelen 0  (Boucle locale)             RX packets 16  bytes 1504 (1.4 KiB)             RX errors 0  dropped 0  overruns 0  frame 0             TX packets 16  bytes 1504 (1.4 KiB)             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0      I need to do `ifconfig wlo1 up`. Whatever it does not work. the command `dmesg | grep wl` returns:               [    7.751232] wl: module license 'MIXED/Proprietary' taints kernel.     [    7.801938] systemd-udevd[494]: renamed network interface eth0 to wlo1     [  106.820202] ERROR @wl_dev_intvar_get : error (-1)     [  106.820208] ERROR @wl_cfg80211_get_tx_power : error (-1)


title: Passing binary data to curl without using a @file

text: Is it possible to use curl and post binary data without passing in a file name? For example, you can post a form using binary via --data-binary:               curl -X POST --data-binary @myfile.bin http://foo.com      However, this requires that a file exists. I was hoping to be able to log HTTP calls (such as to rest services) as the text of the curl command to reproduce the request. (this greatly assists debugging these services, for example) However, logging curl commands that reference a file would not be useful, so I was hoping I could actually log the raw binary data, presumably base64 encoded, and yet still allow you to copy and paste the logged curl command and execute it. So, is it possible to use curl and post binary data without referencing a file? If so, how would that work? What would an example look like?


title: How to turn off smooth scrolling in KDE4

text: I want to turn off smooth scrolling in KDE4 applications. By smooth scrolling, I mean the visual effect that causes the contents of a scrollable area to shift a bit at a time when I scroll with `PageUp`/`PageDown`: I want the transition between one page and the previous/next to be instantaneous. I'm running KDE 4.4.5 on Debian right this minute and my test application is the help browser, but I'd prefer a method that works accross all versions on all systems. I didn't find anything in the System Settings application (of course, there are a lot of them, so I might just not have found the right tab). I switched Appearance/Style/Fine_Tuning/Graphical_effects to “high display resolution and low CPU” but it didn't help. If smooth scrolling is part of some other larger collection of visual effects that I'd have to turn off all at once, I probably won't mind.


title: Regenerating Initrd.img on a different platform

text: **Background:** I have a QNAP TS-219PII NAS which has been setup to run the Debian Wheezy (the ARM Marvell Kirkwood flavour) following the instructions from http://www.cyrius.com/debian/kirkwood/qnap/ts-219/ . I installed Debian onto a 16 USB Flash drive - with partitions for boot (sda2), swap (sda5), home(sda6) and everything else (sda2). The drives themselves are setup as a RAID1 (md0). **The problem:** Unfortunately the boot ext2 partition (sda2) which holds `initrd.img-3.2.0-4-kirkwood` and `vmlinuz-3.2.0-4-kirkwood` suffered some corruption and I found the device running in a read-only state. Running an `fsck` from an x64 install of Ubuntu pulled up and fixed number of problems - but NAs device didn't want to boot. I checked the md5sum for the `vmlinuz-3.2.0-4-kirkwood` and found it was completely different - so I replaced the file from the .deb package and double checked the md5sum matched. However `initrd.img-3.2.0-4-kirkwood` is more problematic - as it appears it is usually generated on the device itself when a new kernel is installed. I've attempted to rebuild it by mounting the other partitions on the flash drive and running the following command as root, and though the device appears to boot it never shows up on the network: `mkinitramfs -d /[part to root]/etc/initramfs-tools/ -o /[path to boot]/initrd.img -r /[path to root]/`. FWIW It appears that the new initrd.img is 2.7mb in size, whilst the old one was 3.6mb. **The question:** Is there a better way to regenerate the initrd file on a different platform (x64 vs armel)? Short of running the recovery-mode for the NAS and reinstalling everything - am I missing something obvious as far as getting this device to boot again?


title: Can TCP provide more than 65535 ports?

text: Is it possible to setup a Linux system so that it provides more than 65,535 ports? The intent would be to have more than 65k daemons listening on a given system. Clearly there are ports being used so this is not possible for those reasons, so think of this as a theoretical exercise in trying to understand where TCP would be restrictive in doing something like this.


title: What does "Reserve Distribution" means?

text: I'm going to install a Linux Mint on a VM under VirtualBox from this site. I found that LinuxMint 16 Cinnamon 32bit VirtualBox VDI Virtual Computer is not "Distribution Release" but a "Reserve Distribution". ### Questions   * What does "Reserve Distribution" mean   * Like "Release Candidate", is it a little more buggy than "Distribution Release"?


title: Nginx returning 502 Bad Gateway

text: I'm trying to set up an Nginx webserver generally following this guide but using perusio's configuration. When I try to access the site, I get a 502 Bad Gateway page. Searching on the error I've seen a few people report that setting the fastcgi buffer size has fixed their problem. However, this did not work for me. Though the messages in my error log are different than those stated:               2013/06/11 10:21:24 [info] 32684#0: Using 32768KiB of shared memory for push module in /etc/nginx/nginx.conf:181     2013/06/11 10:21:24 [alert] 32692#0: epoll_ctl(1, 0) failed (1: Operation not permitted)     2013/06/11 10:21:24 [alert] 32692#0: failed to register channel handler while initializing push module worker (1: Operation not permitted)     2013/06/11 10:21:24 [alert] 32691#0: epoll_ctl(1, 0) failed (1: Operation not permitted)     2013/06/11 10:21:24 [alert] 32691#0: failed to register channel handler while initializing push module worker (1: Operation not permitted)     2013/06/11 10:21:25 [alert] 32686#0: cache manager process 32691 exited with fatal code 2 and cannot be respawned      Searching on this error, it seems that `nginx` is not communicating with `php5-fpm`. I've verified that `php5-fpm` is running:               $ ps auxw | grep php     root       853  0.0  0.8 290416  4504 ?        Ss   10:21   0:00 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)     www-data   854  0.0  0.6 290416  3488 ?        S    10:21   0:00 php-fpm: pool www           www-data   855  0.0  0.6 290416  3488 ?        S    10:21   0:00 php-fpm: pool www           kyle       973  0.0  0.2   3824  1072 pts/0    S+   10:42   0:00 grep php      And listening:               $ netstat --unix -l     Active UNIX domain sockets (only servers)     Proto RefCnt Flags       Type       State         I-Node   Path     unix  2      [ ACC ]     STREAM     LISTENING     43115    /var/run/mysqld/mysqld.sock     unix  2      [ ACC ]     SEQPACKET  LISTENING     2674     /run/udev/control     unix  2      [ ACC ]     STREAM     LISTENING     4772     /var/run/fail2ban/fail2ban.sock     unix  2      [ ACC ]     STREAM     LISTENING     43450    /var/run/php5-fpm.sock     unix  2      [ ACC ]     STREAM     LISTENING     4792     @/tmp/fam-root-      And my `nginx.conf` includes `upstream_phpcgi_unix.conf` so it should be trying to connect to `php5-fpm` via Unix sockets:               ## Add as many servers as needed. Cf. http://wiki.nginx.org/HttpUpstreamModule.     upstream phpcgi {         ## If your version of Nginx doesn't have the fair load balancer:         ## https://github.com/gnosek/nginx-upstream-fair comment out the         ## following line.         fair;         server unix:/var/run/php-fpm.sock;         server unix:/var/run/php-fpm-zwei.sock;         ## Create a backend connection cache. Note that this requires         ## Nginx version greater or equal to 1.1.4.         ## Cf. http://nginx.org/en/CHANGES. Comment out the following         ## line if that's not the case.         keepalive 5;     }          ## Add a third pool as a fallback.     upstream phpcgi_backup {         server unix:/var/run/php-fpm-bkp.sock;         ## Create a backend connection cache. Note that this requires         ## Nginx version greater or equal to 1.1.4.         ## Cf. http://nginx.org/en/CHANGES. Comment out the         ## following line if that's not the case.         keepalive 1;     }      What else should I be looking at?


title: find command with -execdir not reading flags?

text: I am trying to locate all .jpg picture files in my current directory and sub- directories and move them to another directory. I want the source files to overwrite the destination files, but that is not happening. When I run my command, I am getting the following output for some files (but others were moved):               mv: cannot move './file' to '/destination': File exists      Here is the command I am using:               find . -iname *jpg -execdir mv -f {} \;      It seems like the -f (force) option is not working? When I went back and did `mv -f ./source/file /dest` on a single file, it did overwrite properly. What's the deal? Why is the file not being moved? * * * UPDATE: The command listed above is not what I actually passed (sheepishly sighs). The actual command _did_ include a destination (as previously suggested in the answer from @Gilles):               find . -iname '*jpg' -execdir mv -f {} /destination \;      I passed this command again to make sure I actually included the /destination directory, and I received the same error:               mv: cannot move './file' to '/destination': File exists      Are there any possible answers to why this error would show, even with a /destination directory in the mv command?


title: Remote dbus-send error: Error org.freedesktop.DBus.Error.ServiceUnknown: The name project.AppManager.Service was not provided by any .service files

text: I'm trying to execute `dbus-send` over a `ssh` sesion[in remote target].The `dbus` service is already launched by the `systemd` and I just want to call a method of that service through `dbus-send` command.Locally the the same `dbus- send` command is executing properly.But if I execute it from the remote system it's failing with the following error. `Error org.freedesktop.DBus.Error.ServiceUnknown: The name project.AppManager.Service was not provided by any .service files` I exported the `DBUS_SESSION_BUS_ADDRESS` from `/proc/pid/environ` of my dbus service and the display to `export DISPLAY=":0"`. My `dbus-send` command is a part of shell script written by me and residing in `/usr/local/bin/` and I'm exporting those variables also in the same shell script.Am I missing any other steps? Please do help me to resolve this? **COMMAND:** `sudo dbus-send --print-reply --dest=project.AppManager.Service /project/AppManager/Service project.AppManager.Service.SetInstalledApplicationManifest string:"org.project.appname"` **Exported Variables:** `export DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-7maQPwpqF5,guid=c276e791ae4ce09ca14d5fd4540801ac"` `export DISPLAY=":0"` **System Info** `Linux 3.13.0-29-generic #53rb1-Ubuntu i686 GNU/Linux`


title: Perl - /etc/shadow - Permission Denied

text: The following command is being executed by a non root user :               perl -pi -e 's/^an24:/an24:\*LK*/g' /etc/shadow      A permission denied is being issued. This indicates some privileges issues. Can such command be executed? I tried to set the setuid and group id on the script executing this command with no success. The Operating System is Solaris 10.


title: Kill all processes related to an application

text: I have two processes that are temporarily spawned and I need to kill them. Here are the processes from `ps aux`               david  38329   0.0  5.0  3916476 104624 s002  S    11:33AM   0:17.43 /Applications/Firefox.a     david  38319   0.0  0.0  2442472   1028 s002  S    11:33AM   0:00.10 Xvfb -br -screen 0 800x     david  38268   0.0  0.2  3012352   4960   ??  S    11:02AM   0:00.24 /System/Library/Framewo     david  38261   0.0  3.4  3913364  70724 s002  S    11:02AM   0:08.51 /Applications/Firefox.a      How would I kill all processes that are either `Xvfb` or `Firefox` ? **Update:** I was able to use `$ sudo killall Xvfb` to kill that process, but am still having trouble doing the same with Firefox:               davids-Mac-mini:financials david$ ps aux|grep firefox     david          /Applications/Firefox.app/Contents/MacOS/firefox-bin -foreground     david          /Applications/Firefox.app/Contents/MacOS/firefox-bin -foreground     david          grep firefox     davids-Mac-mini:financials david$ sudo killall firefox     No matching processes were found


title: Is there MD5 (or similar) to a folder? How to verify if two folders are equal?

text: I'd like to find an `md5sum` (or similar calculation) of a folder without compressing it into an archive. For example, if in the folder `MyFolder` we have the files `1.txt`, `2.txt` and `3.txt`, containing: * * * ### 1.txt The text into 1.txt ### 2.txt The text into 2.txt ### 3.txt The text into 3.txt * * * How can I calculate the `md5sum` of this entire `MyFolder`? Is there a way? I want to use this to verify if two folders have the same contents. This can be util to verify if two cds or folders are equal. I'd like a easy way to do it.


title: sed - how to replace a single quote?

text: This works fine:               sed -i 's#    @driver.find_element(:xpath, "//a\[contains(@href,##' temp_spec.rb      against a source of               @driver.find_element(:xpath, "//a[contains(@href,'change_district')]").click      I am just left with               'change_district')]").click`      but when I try to add a single quote at the end it fails:               sed -i 's#    @driver.find_element(:xpath, "//a\[contains(@href,\'##' temp_spec.rb          syntax error near unexpected token `('      I am using `\'` to escape the single quote. Note that I am using a `#` as a delimiter instead of the normal `/` delimiter as there are `/`'s in the text.


title: Making a Linux audio recording device available on a Windows 7 PC over network

text: I would like to use my headset's microphone both on my Linux laptop and a Windows 7 PC simultaneously, for different VoIP applications. I'm currently running Ubuntu with PulseAudio on the laptop to which the headset is connected and I've heard that there are Windows implementations of PulseAudio. Therefore it should theoretically be possible to make the microphone available over my LAN as an PCM stream. I'm asking now if someone has more detailed insights if this is actually doable with current software or opinions from people with more knowledge about the PulseAudio system if further investigation is likely to pay off. Ideas on doing it in any way without PulseAudio are also acceptable.


title: How synchronize two disks (or folders) using symbolic (or hard) links (like rsync)?

text: I'm searching a **tool** or a **shell script** or **another program** to synchronize two or more folders or disks. But it differs of rsync tool, because, I don't want to duplicate the missing file, but do a symbolic link of it in the other folder, for example: If in folder **_A_** we have the files **_a_** and **_b_** and other folder **_c_** with a file **_d_** : > A > >> a >> >> b >> >> c >> >>> d And in folder **_B_** we have the file **_1_** and a folder **_2_** with a file **_3_** : > B > >> 1 >> >> 2 >> >>> 3 I would like program, for example, _ssync_ (symbolic synchronize, just a invention name), called by a command, for example, **_ssync /A /B_** to change these folders like showed below: > A > >> a >> >> b >> >> c >> >>> d >> >> 1 (ln -s) >> >> 2 (ln -s) >> >>> 3 (ln -s) and > B > >> 1 >> >> 2 >> >>> 3 >> >> a (ln -s) >> >> b (ln -s) >> >> c (ln -s) >> >>> d (ln -s) where **_ln -s_** indicates that in this folder was created a symbolic link to this corresponding file, for example, **_a (ln -s)_** indicates the command **_ln -s /A/a /B/a_** was used. I will appreciate so much if someone help me. Thanks.


title: Trouble with dbus and systemd/user

text: I have systemd set up so that using `systemctl start user@me` will start my user services as I expect, but my dbus one just won't go (which I need for PulseAudio). Is there some way I can check dbus or systemd to figure out what I'm doing wrong? At this point I'm out of ideas for things to try. Please let me know if there's anything else I can provide that might be relevant. * * * **Additional Info/Resolution Attempt** I'm using Arch Linux, systemd 204-1, and dbus 1.6.10-1 Starting user systemd through `# systemctl start user@me` gives me this:               ├─systemd─┬─(sd-pam)     │         ├─mpd───5*[{mpd}]     │         └─pulseaudio─┬─gconf-helper     │                      └─2*[{pulseaudio}]      Starting `systemd --user &` manually as my user produces:               ├─bash─┬─pstree     │      └─systemd─┬─2*[dbus-daemon]     │                ├─dbus-launch <<< X only     │                ├─gconfd-2    <<< X only     │                ├─mpd───5*[{mpd}]     │                └─pulseaudio─┬─gconf-helper     │                             └─2*[{pulseaudio}]      And spits out the following error if I'm not in X, despite the fact that I did enable my user dbus.service:               Failed to open private bus connection: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11     Failed to open private bus connection: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11      * * * **Related Links:**   1. http://superuser.com/questions/476379/how-do-i-setup-a-systemd-service-to-be-started-by-a-non-root-user-as-a-user-daem   2. https://github.com/sofar/user-session-units   3. https://github.com/grawity/systemd-user-units The first two mention a problem with dbus, but at link 2 it says that the problem is fixed in dbus-1.6.9, so I think the problem is with my implementation rather than this bug. I used example user services from links 2 & 3.


title: Update different dropbox instances

text: I am using dropbox on my redhat linux kernel. Right now we have a dummy user set up, with it's own dropbox account. Everyone can access and dump their files into it while on the machine and then everyone has access to the share folder, for when they are not on the machine. This is in no way optimal but no one wanted to give up any space on their own dropbox accounts and I am working with what I am given. Right now, when I update my own dropbox account I use: `~/.dropbox- dist/dropboxd`. I do this only when I know that I have actually put something different in my folder. This really won't work for the dummy account because I don't know when it is updated and I can't trust anyone else to actually go through with it. I REALLY don't want to have to log in as this dummy user everyday and update it. My question is: Is there a way to automatically have dropbox update (i.e. I don't have to log in everyday, multiple times a day to make sure the dropbox is up to date)?


title: Yum Check Available Package Updates

text: Red Hat docs say: > To see which installed packages on your system have updates available, use > the following command: `yum check-update` What command must I run to view all `available` versions for a package installed on my system? Example: `yum check-update` tells me `java6` update `#43` is available, but what if I want update `#40`?


title: Windows 7 not working correctly after partition resize

text: I resized the Windows partition from Linux in order to be able to install Elementary OS.   After resizing I tried booting to Windows, however it asks to boot normally or in recovery mode. When I select normal, it returns to GRUB, and when I select Recovery Mode it tells me that an installed program isn't working. I'd like to be able to use Windows 7, as certain websites won't work with Debian. Partition layout after resize:               sda1 - bootloader (GRUB)     sda2 - windows partition     sda3 - windows recovery partition     sda4 - extended partition?     sda5 - linux-swap     sda6 - Debian 7.5


title: UART0 Access in AM1808 using Embedded Linux

text: I am trying to interface GSM module with my AM1808 processor. I am using `gcc` compiler as well as UBUNTU 10.04 Lucid. I have configured the TXD and RXD pins of UART0 but i can not access the RTS and CTS pins properly. Actually i need to check the RTS and CTS line for proper communication.   So I need to access this pins from the User Application. How can I do this?


title: What does the noeol indicator at the bottom of a vim edit session mean?

text: I open a file using vim in ubuntu, and this is displayed at the bottom of the screen.               "file.py" [noeol] 553L, 16620C      What does noeol indicate ?


title: Archlinux VGA video problem

text: I have an old HP DL380 G4 server that I'm trying to load Archlinux onto, but I've run into a bit of a snag. I went all the way through this guide, and everything seemed to go smoothly, but when I reboot into the actual system itself (as opposed to a chroot from the disk), I get a brief flash of a screen that says "welcome to grub", then the monitor gives me "cannot display this video mode". The monitor is an old Dell 1280x1024 monitor connected by VGA. I tried with another old monitor, and it gave me an out of range error. The thing is that the disk worked fine with the monitor, even the graphical Arch selection screen was displayed properly. I have done some research and tried a couple of things: I added `nomodeset` to the kernel config line in /etc/default/grub I added `i915.modeset=0` I installed X and ran startx from chroot, but then the display error happened immediately. Any ideas? UPDATE: I've had partial success by looking up the monitor config and entering it manually into the xorg.conf file. Also, I changed to the mach64 driver, and now there's no monitor error, just a black screen when I run startx. However, when I try to boot to the disk itself, instead of the arch dvd, I still get the "can't display this video mode" error. So, it would seem that the two errors do not have the same cause.


title: Where can I find the user documentation for my old Freenas 0.7?

text: Every document links seem to have been replaced with the notice (to force me) to upgrade. I know that I am supposed to upgrade but I would like to get hands on the old FreenNAS 0.7 Khasadar user documentation (setup and installation) in any form or kind, none the less. I am especially interested in the instructions regarding the embedded installation (setup and user guide). Where can I get this legacy document?


title: Themed Tabs in Gnome Terminal

text: I've created a custom desktop session which upon login presents the user with a full screen gnome-terminal session. The idea is to have a TTY-like session but with the added advantages provided by X available to the user, such as video playback. The terminal tabs however ruin the effect somewhat because for some reason they are not using the dark theme I have defined. When I have any tabs open a white box is drawn around the window edges with the tabs at the top. How can I get these gnome-terminal tabs to accept the dark theme? For reference I'm running Ubuntu 13.04.


title: Running a bash script within a bash script

text: I am writing a bash script for the installation of an environment manager but it means that I have to install something within multiple directories. See my other question for more details. But this led me to rethink my approach. I was now thinking of making it 3 separate bash scripts. Then the one will just call the other. Here is the thing: I need to some how `source .bash_profile` within the parent shell. The question is, would a bash script that has been called within a bash script be running in a new shell or the parent shell or would it be in a new shell within the host bash script shell within the parent shell? 'shell-ception' I know its cooking my brain. i would really like to automate this process and this is the wall I am facing.


title: "Permission denied" trying to get a file using TFTP

text: I started `tftp-server`, but I'm confused by this error:               nisemono ncdy # chmod 777 /tftproot/test      mode of `/tftproot/test' changed to 0777 (rwxrwxrwx)     nisemono ncdy # tftp 192.168.0.2             tftp> get test     Error code 0: Permission denied      0 bytes file is copied... But for what Permission denied??? I don't like the message.               cat /etc/xinetd.d/tftp     service tftp     {         disable = no         socket_type     = dgram         protocol        = udp         wait            = yes         user            = root         server          = /usr/sbin/in.tftpd         server_args     = -s /tftproot         per_source      = 11         cps             = 100 2         flags           = IPv4     }      Why is this failing? What am I doing wrong?


title: Fix "Route hash chain too long" without restart

text: On our production server (ubuntu 12.04, 3.2.0-63 kernel) routing cache reached its capacity. Modifying `rhash_entries` is out of the question, since it is a kernel boot param, and we can not restart the server. What are our options? Machine has 8gb if ram (I know, very little, but it's an old one...). Output of `grep . /proc/sys/net/ipv4/route/*` looks like this:               /proc/sys/net/ipv4/route/error_burst:1250     /proc/sys/net/ipv4/route/error_cost:250     /proc/sys/net/ipv4/route/gc_elasticity:1     /proc/sys/net/ipv4/route/gc_interval:60     /proc/sys/net/ipv4/route/gc_min_interval:0     /proc/sys/net/ipv4/route/gc_min_interval_ms:0     /proc/sys/net/ipv4/route/gc_thresh:262144     /proc/sys/net/ipv4/route/gc_timeout:300     /proc/sys/net/ipv4/route/max_size:4194304     /proc/sys/net/ipv4/route/min_adv_mss:256     /proc/sys/net/ipv4/route/min_pmtu:552     /proc/sys/net/ipv4/route/mtu_expires:600     /proc/sys/net/ipv4/route/redirect_load:5     /proc/sys/net/ipv4/route/redirect_number:9     /proc/sys/net/ipv4/route/redirect_silence:5120


title: Debian jessie cannot suspend anymore

text: I'm using Crunchbang Waldorf with the Jessie repositories, and suspend functionality has recently been broken. It seems that UPower, the tool Crunchbang used to suspend, just removed suspend functionality. The suspend command executes like this:               jaapz at jipjip in ~       $ dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend        Error org.freedesktop.DBus.Error.UnknownMethod: Method "Suspend" with signature "" on interface "org.freedesktop.UPower" doesn't exist      I cannot find why the suspend functionality has just disappeared, does anyone know a solution?


title: how to track down an internal port redirection?

text: I'm trying to understand something with X11 and one fact that I discovered is that the X display stuff seems to be sent through a port called "localhost:11" So I tried the netstat -n | grep ':11' but no results were matched. What am I missing? Isn't this supposed to be something called internal port redirecting(or something similar...)? Hope someone could enlighten me...


title: Temporary redirect ports

text: I need a temporary redirection of some ports to another machine. I've tried:               iptables -t nat -A PREROUTING -p tcp --dport 4321 -j DNAT --to-destination 192.168.121.4:80      But shorewall blocks all packages. So I've tried:                iptables -A FORWARD -d 192.168.121.4 -p tcp --dport 80 -j ACCEPT      Which is also not working. So how can I redirect/forward the port 4321 proberly to port 80 on machine 192.168.121.4? And how can I afterwards unredirect/unforward this? I've also set:               sysctl net.ipv4.ip_forward=1      I'm on Linux/Ubuntu 12.04 iptables-save:               # Generated by iptables-save v1.4.12 on Mon Jun 23 12:53:49 2014     *raw     :PREROUTING ACCEPT [5287371:7459454675]     :OUTPUT ACCEPT [4550885:6177804756]     COMMIT     # Completed on Mon Jun 23 12:53:49 2014     # Generated by iptables-save v1.4.12 on Mon Jun 23 12:53:49 2014     *nat     :PREROUTING ACCEPT [227:17856]     :INPUT ACCEPT [33:2188]     :OUTPUT ACCEPT [53:3832]     :POSTROUTING ACCEPT [53:3832]     :eth0_masq - [0:0]     -A PREROUTING -p tcp -m tcp --dport 4321 -j DNAT --to-destination 192.168.121.4:80     -A PREROUTING -p tcp -m tcp --dport 4321 -j DNAT --to-destination 192.168.121.4:80     -A POSTROUTING -o eth0 -j eth0_masq     -A eth0_masq -s 169.254.0.0/16 -j MASQUERADE     -A eth0_masq -s 192.168.121.0/24 -j MASQUERADE     COMMIT     # Completed on Mon Jun 23 12:53:49 2014     # Generated by iptables-save v1.4.12 on Mon Jun 23 12:53:49 2014     *mangle     :PREROUTING ACCEPT [5287371:7459454675]     :INPUT ACCEPT [5081977:7360915410]     :FORWARD ACCEPT [205394:98539265]     :OUTPUT ACCEPT [4550885:6177804756]     :POSTROUTING ACCEPT [4756960:6276393466]     :tcfor - [0:0]     :tcin - [0:0]     :tcout - [0:0]     :tcpost - [0:0]     :tcpre - [0:0]     -A PREROUTING -j tcpre     -A INPUT -j tcin     -A FORWARD -j MARK --set-xmark 0x0/0xff     -A FORWARD -j tcfor     -A OUTPUT -j tcout     -A POSTROUTING -j tcpost     COMMIT     # Completed on Mon Jun 23 12:53:49 2014     # Generated by iptables-save v1.4.12 on Mon Jun 23 12:53:49 2014     *filter     :INPUT DROP [0:0]     :FORWARD DROP [0:0]     :OUTPUT DROP [0:0]     :%Invalid - [0:0]     :Broadcast - [0:0]     :Drop - [0:0]     :Invalid - [0:0]     :NotSyn - [0:0]     :Reject - [0:0]     :dynamic - [0:0]     :eth0_fwd - [0:0]     :eth0_in - [0:0]     :fw2net - [0:0]     :fw2sky - [0:0]     :logdrop - [0:0]     :logflags - [0:0]     :logreject - [0:0]     :net2fw - [0:0]     :net2sky - [0:0]     :net_frwd - [0:0]     :reject - [0:0]     :shorewall - [0:0]     :sky2fw - [0:0]     :sky2net - [0:0]     :smurflog - [0:0]     :smurfs - [0:0]     :tcpflags - [0:0]     :wlan0_fwd - [0:0]     :wlan0_in - [0:0]     -A INPUT -m conntrack --ctstate INVALID,NEW -j dynamic     -A INPUT -i eth0 -j eth0_in     -A INPUT -i wlan0 -j wlan0_in     -A INPUT -i eth1 -j sky2fw     -A INPUT -i lo -j ACCEPT     -A INPUT -j Reject     -A INPUT -j LOG --log-prefix "Shorewall:INPUT:REJECT:" --log-level 6     -A INPUT -g reject     -A FORWARD -i eth0 -j eth0_fwd     -A FORWARD -i wlan0 -j wlan0_fwd     -A FORWARD -i eth1 -o wlan0 -j sky2net     -A FORWARD -i eth1 -o eth0 -j sky2net     -A FORWARD -j Reject     -A FORWARD -j LOG --log-prefix "Shorewall:FORWARD:REJECT:" --log-level 6     -A FORWARD -g reject     -A FORWARD -d 192.168.121.4/32 -p tcp -m tcp --dport 4242 -j ACCEPT     -A FORWARD -d 192.168.121.4/32 -p tcp -m tcp --dport 80 -j ACCEPT     -A OUTPUT -o eth0 -j fw2net     -A OUTPUT -o wlan0 -j fw2net     -A OUTPUT -o eth1 -j fw2sky     -A OUTPUT -o lo -j ACCEPT     -A OUTPUT -j ACCEPT     -A %Invalid -m conntrack --ctstate INVALID -j DROP     -A Broadcast -m addrtype --dst-type BROADCAST -j DROP     -A Broadcast -m addrtype --dst-type MULTICAST -j DROP     -A Broadcast -m addrtype --dst-type ANYCAST -j DROP     -A Broadcast -d 224.0.0.0/4 -j DROP     -A Drop     -A Drop -p tcp -m tcp --dport 113 -m comment --comment Auth -j reject     -A Drop -j Broadcast     -A Drop -p icmp -m icmp --icmp-type 3/4 -m comment --comment "Needed ICMP types" -j ACCEPT     -A Drop -p icmp -m icmp --icmp-type 11 -m comment --comment "Needed ICMP types" -j ACCEPT     -A Drop -j Invalid     -A Drop -p udp -m multiport --dports 135,445 -m comment --comment SMB -j DROP     -A Drop -p udp -m udp --dport 137:139 -m comment --comment SMB -j DROP     -A Drop -p udp -m udp --sport 137 --dport 1024:65535 -m comment --comment SMB -j DROP     -A Drop -p tcp -m multiport --dports 135,139,445 -m comment --comment SMB -j DROP     -A Drop -p udp -m udp --dport 1900 -m comment --comment UPnP -j DROP     -A Drop -p tcp -j NotSyn     -A Drop -p udp -m udp --sport 53 -m comment --comment "Late DNS Replies" -j DROP     -A Invalid -m conntrack --ctstate INVALID -j DROP     -A NotSyn -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -j DROP     -A Reject     -A Reject -p tcp -m tcp --dport 113 -m comment --comment Auth -j reject     -A Reject -j Broadcast     -A Reject -p icmp -m icmp --icmp-type 3/4 -m comment --comment "Needed ICMP types" -j ACCEPT     -A Reject -p icmp -m icmp --icmp-type 11 -m comment --comment "Needed ICMP types" -j ACCEPT     -A Reject -j Invalid     -A Reject -p udp -m multiport --dports 135,445 -m comment --comment SMB -j reject     -A Reject -p udp -m udp --dport 137:139 -m comment --comment SMB -j reject     -A Reject -p udp -m udp --sport 137 --dport 1024:65535 -m comment --comment SMB -j reject     -A Reject -p tcp -m multiport --dports 135,139,445 -m comment --comment SMB -j reject     -A Reject -p udp -m udp --dport 1900 -m comment --comment UPnP -j DROP     -A Reject -p tcp -j NotSyn     -A Reject -p udp -m udp --sport 53 -m comment --comment "Late DNS Replies" -j DROP     -A eth0_fwd -m conntrack --ctstate INVALID,NEW -j dynamic     -A eth0_fwd -m conntrack --ctstate INVALID,NEW -j smurfs     -A eth0_fwd -p tcp -j tcpflags     -A eth0_fwd -j net_frwd     -A eth0_in -m conntrack --ctstate INVALID,NEW -j dynamic     -A eth0_in -m conntrack --ctstate INVALID,NEW -j smurfs     -A eth0_in -p udp -m udp --dport 67:68 -j ACCEPT     -A eth0_in -p tcp -j tcpflags     -A eth0_in -j net2fw     -A fw2net -p udp -m udp --dport 67:68 -j ACCEPT     -A fw2net -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT     -A fw2net -p udp -m udp --dport 53 -m comment --comment DNS -j ACCEPT     -A fw2net -p tcp -m tcp --dport 53 -m comment --comment DNS -j ACCEPT     -A fw2net -p icmp -j ACCEPT     -A fw2net -j ACCEPT     -A fw2sky -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT     -A fw2sky -j ACCEPT     -A logdrop -j DROP     -A logflags -j LOG --log-prefix "Shorewall:logflags:DROP:" --log-level 6 --log-ip-options     -A logflags -j DROP     -A logreject -j reject     -A net2fw -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT     -A net2fw -j %Invalid     -A net2fw -p tcp -m tcp --dport 22 -m comment --comment SSH -j ACCEPT     -A net2fw -p tcp -m multiport --dports 4242,4243,24800 -j ACCEPT     -A net2fw -p icmp -m icmp --icmp-type 8 -m comment --comment Ping -j ACCEPT     -A net2fw -p icmp -m icmp --icmp-type 8 -m comment --comment Ping -j DROP     -A net2fw -p tcp -m tcp --dport 80 -j ACCEPT     -A net2fw -j Drop     -A net2fw -j LOG --log-prefix "Shorewall:net2fw:DROP:" --log-level 6     -A net2fw -j DROP     -A net2sky -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT     -A net2sky -j %Invalid     -A net2sky -j Drop     -A net2sky -j LOG --log-prefix "Shorewall:net2sky:DROP:" --log-level 6     -A net2sky -j DROP     -A net_frwd -o eth0 -j ACCEPT     -A net_frwd -o wlan0 -j ACCEPT     -A net_frwd -o eth1 -j net2sky     -A reject -m addrtype --src-type BROADCAST -j DROP     -A reject -s 224.0.0.0/4 -j DROP     -A reject -p igmp -j DROP     -A reject -p tcp -j REJECT --reject-with tcp-reset     -A reject -p udp -j REJECT --reject-with icmp-port-unreachable     -A reject -p icmp -j REJECT --reject-with icmp-host-unreachable     -A reject -j REJECT --reject-with icmp-host-prohibited     -A sky2fw -m conntrack --ctstate INVALID,NEW -j dynamic     -A sky2fw -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT     -A sky2fw -j ACCEPT     -A sky2net -m conntrack --ctstate INVALID,NEW -j dynamic     -A sky2net -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT     -A sky2net -j ACCEPT     -A smurflog -j LOG --log-prefix "Shorewall:smurfs:DROP:" --log-level 6     -A smurflog -j DROP     -A smurfs -s 0.0.0.0/32 -j RETURN     -A smurfs -m addrtype --src-type BROADCAST -g smurflog     -A smurfs -s 224.0.0.0/4 -g smurflog     -A tcpflags -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,PSH,URG -g logflags     -A tcpflags -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -g logflags     -A tcpflags -p tcp -m tcp --tcp-flags SYN,RST SYN,RST -g logflags     -A tcpflags -p tcp -m tcp --tcp-flags FIN,SYN FIN,SYN -g logflags     -A tcpflags -p tcp -m tcp --sport 0 --tcp-flags FIN,SYN,RST,ACK SYN -g logflags     -A wlan0_fwd -m conntrack --ctstate INVALID,NEW -j dynamic     -A wlan0_fwd -m conntrack --ctstate INVALID,NEW -j smurfs     -A wlan0_fwd -p tcp -j tcpflags     -A wlan0_fwd -j net_frwd     -A wlan0_in -m conntrack --ctstate INVALID,NEW -j dynamic     -A wlan0_in -m conntrack --ctstate INVALID,NEW -j smurfs     -A wlan0_in -p udp -m udp --dport 67:68 -j ACCEPT     -A wlan0_in -p tcp -j tcpflags     -A wlan0_in -j net2fw     COMMIT     # Completed on Mon Jun 23 12:53:49 2014


title: How to run executable program with filter

text: I want to run a shell script. This script have a long name. So I want to use filter for file. ex: `ls | grep myfile | ./` Is it possible to execute a file with filter.


title: Using git to manage /etc?

text: I am thinking on a system, where `/etc` were tracked on a remote git repository. I am thinking on a git workflow, where every host machine where a different branch. Every previous versions on every machine could be easily tracked, compared, merged. If a `/etc` modification had to be committed on many machines, it could be easily done by some merging script. In case of an "unwanted" `/etc` change, this could be good visible (even alarm scripts could be tuned to watch that). Anybody used already a such configuration? Are there any security problems with it?


title: ACL, ls, "permission denied" and a lot of questionmarks

text: I have two users, Alice and Bob. Bob should be allowed to list, `ls`, Alice's home directory. Alice also has a file in her home directory that Bob should also be allowed to read. I run these commands as root:               [root@corvatsch ~]# setfacl -m user:bob:r /home/alice/     [root@corvatsch ~]# setfacl -m user:bob:r /home/alice/file      This yields the following result in the ACLs:               [root@corvatsch ~]# getfacl -c /home/alice/     user::rwx     user:bob:r--     group::---     mask::r--     other::---      and               [root@corvatsch ~]# getfacl -c /home/alice/file     getfacl: Removing leading '/' from absolute path names     user::rw-     user:bob:r--     group::r--     mask::r--     other::r--      It looks as if Bob should now be able to read Alice's home folder as well as the content of the her file. When Bob tries that, he gets:               [bob@corvatsch ~]$ ls -l /home/alice/     ls: cannot access /home/alice/file: Permission denied     total 0     -????????? ? ? ? ?            ? file      ( **Note the questionmarks!** ) and               [bob@corvatsch ~]$ cat /home/alice/file     cat: /home/alice/file: Permission denied      Looks like Bob can read the home directory, although in a weird way. Ls lists the file but seems to have problems with the ACLs? And `cat`ing the file seems to not work at all. Can somebody explain what i am missing? **NOTE:** (I'm running CentOS 6.4)


title: How to get MTPFS working on Scientific Linux 6.4?

text: I tried to get MTPFS working on a Scientific Linux 6.4 desktop because of a phone               [root@notebook mtpfs-read-only]# sh autogen.sh      checking for a BSD-compatible install... /usr/bin/install -c     checking whether build environment is sane... yes     checking for a thread-safe mkdir -p... /bin/mkdir -p     checking for gawk... gawk     checking whether make sets $(MAKE)... yes     checking for gcc... gcc     checking for C compiler default output file name... a.out     checking whether the C compiler works... yes     checking whether we are cross compiling... no     checking for suffix of executables...      checking for suffix of object files... o     checking whether we are using the GNU C compiler... yes     checking whether gcc accepts -g... yes     checking for gcc option to accept ISO C89... none needed     checking for style of include used by make... GNU     checking dependency style of gcc... gcc3     checking whether gcc and cc understand -c and -o together... yes     checking for a BSD-compatible install... /usr/bin/install -c     checking for pkg-config... /usr/bin/pkg-config     checking pkg-config is at least version 0.9.0... yes     checking for FUSE... yes     checking for MTP... configure: error: Package requirements (libmtp >= 1.1.0) were not met:          Requested 'libmtp >= 1.1.0' but version of libmtp is 1.0.1          Consider adjusting the PKG_CONFIG_PATH environment variable if you     installed software in a non-standard prefix.          Alternatively, you may set the environment variables MTP_CFLAGS     and MTP_LIBS to avoid the need to call pkg-config.     See the pkg-config man page for more details.          [root@notebook mtpfs-read-only]# cd     [root@notebook ~]# ls     libmtp-1.1.0-1.fc16.x86_64.rpm  mtpfs-read-only  rts     [root@notebook ~]# rpm -i libmtp-1.1.0-1.fc16.x86_64.rpm      warning: libmtp-1.1.0-1.fc16.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID a82ba4b7: NOKEY     error: Failed dependencies:         libc.so.6(GLIBC_2.14)(64bit) is needed by libmtp-1.1.0-1.fc16.x86_64     [root@notebook ~]#       I don't have enough courage to upgrade `libc.so.6`. So, how to proceed?


title: Build an Affordable Linux Tablet

text: I have 3 young children and my wife has asked that the girls get a tablet, for basic gaming, and online web tutorials (school work usually). Has anyone created or built a good affordable Linux tablet? Could anyone provide advice on good cheaper hardware that I could use to build their tablets. What OS would I use to create the tablet Fedora, Ubuntu or Meego https://meego.com/ ? Looking for ideas on how best to go about achieving the project, any ideas welcome.


title: Troubles with Wifi and ethernet Aspire One AO725

text: I'm use Debian wheezy on a Acer Aspire One AO725. It has the following kernels:               3.2.0.4-amd64     3.7-trunk-amd64      The command `lscpi | grep Network`: > 02:00:0 Network controller: Atheros Comunications Inc. AR9485 Wireless > Network Adapter (rev 01) The computer must have the following settings (IP Static):               allow-hotplug wlan0     iface wlan0 inet static     address 192.168.0.68     netmask 255.255.255.0     gateway 192.168.0.1      Some times the computer works fine with WIFI, in other times not works WIFI and Ethernet (with the same settings). What happened? How can I fix my problem?


title: bash: syntax error near unexpected token `('

text: I am trying to concatenate some files side by side. I use the `pr` command in the terminal. It works well, but when I use it in a shell script, I get the following error message:               syntax error near unexpected token `('      Here is the script:               #!/bin/sh     myfile1=toto1.dat     myfile1=toto2.dat     file_out=mytoto_out.dat     touch ${file_out}     /usr/bin/pr -mts' ' <( /usr/bin/cut -d' ' -s -f1,2,3,4,5,6,7,8,9,10,11 ${myfile1}) <( /usr/bin/cut -d' ' -s -f8 $myfile2) >>${file_out}     echo ${file_out} " is done"


title: Subsetting a file's contents based on value in a column

text: I have a text file as (for example):               apple   V$NFY_Q6_rc V=0.741     apple   V$HOXA7_01_rc   V=0.454     apple   V$ALPHACP1_01_rc    V=0.695     orange  V$SP4_Q5    V=0.747     grapes  V$SP1_Q2_01 V=0.677     grapes  V$SP1_Q6_01_rc  V=0.685     grapes  V$SP1_Q6_rc V=0.884      I want to extract the rows that have the highest V value (in column 3) for each fruit. My output should look like:               apple   V$NFY_Q6_rc V=0.741     orange  V$SP4_Q5    V=0.747     grapes  V$SP1_Q6_rc V=0.884      I have several files like this in different subdirectories. After subsetting, I would use the following code to get the number of occurences of a particular string in column 2.                       perl -lanE '$str=$F[1];  $f="/home/$str/list/$str.txt"; $c=`grep -c "$str" "$f"`;chomp($c);$x=0;$x++ if $c;say "$str\t$x\t$c"' file2      this would result in the following output. Let's assume I am searching for the string "SP4" in column 2 of this file:                        X       X in file?  number of times it occurs             NFA            0                            0             SP4            1                            2             NFATC1         0                            0      I want the V value (from above to be included along with this table)                         X       X in file?  number of times it occurs      V value             NFA            0                            0             SP4            1                            2         0.747             NFATC1         0                            0      P.S.: For further details on the perl program in between, please refer to this link:                        http://stackoverflow.com/questions/23109490/search-for-occurrence-of-a-string-in-another-file-in-a-particular-column


title: Program that passes STDIN to STDOUT with color codes stripped?

text: I have a command that produces output in color, and I would like to pipe it into a file with the color codes stripped out. Is there a command that works like `cat` except that it strips color codes? I plan to do something like this:               $ command-that-produces-colored-output | stripcolorcodes > outfile


title: How do you highlight ops' messages in Irssi?

text: I'm watching a large IRC channel with a lot of noise and precious few ops. How can I have all messages from ops highlighted?


title: Is it possible to implement IPSec with failover between one pfSense firewall and Amazon VPC (no BGP)

text: I'm trying to create a VPN connexion between my firewall (a pfsense 2.0.1) and my Amazon Virtual Private Cloud (VPC). Amazon provides two peers endpoints to mount two IPsec tunnels on the same VPC. At this moment, I'm able to mount an IPSec tunnel between my public IP and one of the Amazon endpoints. The idea is to avoid a "disconnection" on Amazon side in case of the main tunnel fails and to switch on a backup tunnel (failover on our side is managed with CARP). I'm trying to mount two IPsec tunnels on the same pfsense gateway (one public IP), just like the following graph: ![a VPC](http://i.stack.imgur.com/PLd8Q.jpg) Is it possible to do so with pfSense? ![a VPC](http://docs.aws.amazon.com/AmazonVPC/latest/NetworkAdminGuide/images/HighLevel_Cisco_NoBGP.png) The full scenario with a cisco router example is available here: http://docs.aws.amazon.com/AmazonVPC/latest/NetworkAdminGuide/Cisco_NoBGP.html


title: iptables couldn't load target allow

text: I am using the command below to allow all traffic from hosts on my internal network but it says "iptables v1.4.18: Couldn't load target `ALLOW':No such file or directory". What is the problem here?               iptables -A input -s 192.168.1.0/24 -j ALLOW


title: Install SSL Certificate in Iceweasel

text: I'm using Kali on Windows. I downloaded the Burp Suite and I'm trying to install its SSL certificate onto the Iceweasel browser. > Burp Suite, the leading toolkit for web application security testing But when I go to import the certificate file, it doesn't show up. I saved the file onto the desktop. Here's a screenshot:    ![enter image description here](http://i.stack.imgur.com/Q3Lue.jpg)


title: System cannot boot, continiously scanning btrfs filesystem

text: On the previous boot I installed HAL to make amazon prime video streaming work, which it did (mostly), but after reboot the system could not pull itself up all the way to BASH and drops to a failed busybox. It is entirely possible the failure to boot and HAL are not related. It drops down after repeatedly saying it is scanning, and then listing tons of I/O errors. I am pretty sure that the partition is an ext4 and not btrfs, but I could be wrong as I don't recall which one I clicked during install. Not to mention I've heard btrfs is good for old HDDs. It could be the aging hard drive. I'm not sure. The system is an old Dell laptop from circa 2006 running Linux Mint 15 64bit, using xfce. I don't mind reinstalling at all, but I would like to be able to save my files if possible. I tried mounting the drive from the Linux Mint install CD, but it failed hard too. Telling me it couldn't even run the install program. Note that I am writing this from Windows Vista 32bit which came with the laptop and is located on another partition on the same drive - and does not show any signs of errors (I hope...).


title: scp from one remote server to another remote server

text: I have one _big_ file on server `one` and I want to copy it to server `two` using `scp`. I have the keys setup properly and I can ssh/scp to both servers from my desktop. The file I need to copy is larger then the free space on my workstation's hdd, so I wanted to do:               scp one:/opt/bigfile.tar.gz two:/opt/bigfile.tar.gz      but I got:               ssh: Could not resolve hostname one: Name or service not known      We do not have DNS here (don't ask me why), so I have this in my ~/.ssh/config:               Host one         Hostname        <IP address of server one>         User            jspurny          Host two         Hostname        <IP address of server two>         User            jspurny      If I try with a smaller file and transfer it from `one` to my workstation and then to `two`, it works fine:               scp one:/opt/smallerfile.tar.gz .     scp smallerfile.tar.gz two:/opt/      When using IP addresses directly as suggested in comment, I got:               $ scp jspurny@<one's IP>:bigfile.tar.gz jspurny@<two's ip>:bigfile.tar.gz     Host key verification failed.     lost connection      **Not an issue:** The size is not an issue here - it was only a "trigger" to this problem as there was no way to store `bigfile.tar.gz` on my workstation. The problem occurs regardless of the file size. **Question:** Why does the command:               scp oneremote:file secondremote:file      throws an error regardless if using `.ssh/config` aliases or directly using ip addresses? **Solved - sort of - still looking for explanation** \- I've split the bigfile into smaller files and transfered them one by one through my workstation. I'm still wondering why it didn't work. So I would still appreciate some explanation of what was wrong .. **Found a reason why it fails:** It seems I was being foolish. I _thought_ that the command               scp one:file two:file      was creating two connections to each server and then receive data from **one** and immediately send them to **two** and thus acting like a relay. This is clearly not the case, because a simple `-v` option revealed that it in fact just connects to **one** and from **one** it tries to connect to **two**. Which obviously isn't possible because server **one** is not supposed to connect to **two**.


title: Linux distro with PREEMPT_RT patch

text: I want to know if there is any Linux distribution with PREEMPT_RT kernel patch? If not, is there any good tutorial on how to patch and compile a kernel with RT patch and how can I create kind of a dual boot of default Arch Linux kernel and my own kernel to boot into the same Linux instalation? By the way, checking on my Android phone, I noticed that my Linux is `Linux localhost 2.6.32.9-FXP #1 PREEMPT Sat Apr 6 01:32:41 EEST 2013 armv7l GNU/Linux`, but I have a custom ROM installed on my phone, but I was wondering, are all Android phones patched with Linux PREEMPT kernel installed? Edit: so, I have found a distribution with real time kernel called AP-Linux. Haven't tested it yet.


title: Make a directory for each row within the given text file?

text: I'm trying to write a bash shell script that will read the data from a given (as an argument) file, and for each row in the file, make a sub-directory under the given (as an argument) directory. The script is named `studentDir` and the input file is named `studentInfo.txt`.   Here is two lines from it:               Sara Smith Freshman Marketing     James Lucas Junior Engineering      On the command line the user would write the script name, the txt file name, and the directory where the new directories should be stored. I think it would be like this:               $ studentDir studentInfo.txt .      Which will create the sub-directories in the current directory. The directories should be named _LLLLFF_.   For example:               SmitSa     LucaJa      (The other info from the input file is not needed) I think to get the names I would use:               DIRNAME=$(cut -d' ' -f2 | cut -c1-4 ; cut -d' ' -f1 | cut -c1-2)      mkdir "$DIRNAME"       But I'm not sure what command would create a directory for each row, and how I could do it recursively for each one.


title: Minimal Linux, stuck at building GRUB

text: I am trying to build a minimal linux, for experimenting out with drivers (LLD 3 book refers kernel version 2.6.10). LFS looks out to be a hell of a task, and I am not sure of if I would be able to build 2.6.10 looking at the latest documents. I am following this blog to build a minimal image that can run on qemu (I don't want to mess up my existing system, that why I chose virtualization). I am stuck at the point of building grub. I was able to build the latest version of grub i,e 2.0, but I was unable to locate required files `stage1, stage2, e2fs_stage1_5` (mentioned in the blog). Taking the old version 0.97 as per the blog, surprising the build is failing, during configure `configure: error: GRUB requires a working absolute objcopy; upgrade your binutils` Upgrade your binutils ? I am using quiet latest Ubuntu.               grub-0.97$ lsb_release -a     No LSB modules are available.     Distributor ID: Ubuntu     Description:    Ubuntu 12.04.3 LTS     Release:        12.04     Codename:       precise          grub-0.97$ ld -version     GNU ld (GNU Binutils for Ubuntu) 2.22      I also found this link mentioning something about binutil upgrade (2.9.1.0.23 or later) for building GRUB. Am I doing anything wrong ?


title: Debian 6 and the old Pentium II

text: I have an old Pentium II with 300 Mhz computer just to run/test old DOS applications. It have two hard drives, a 2 GB for DOS and a 40 GB for Linux. First I installed Debian 6 with GRUB, but it failed to boot due to the old BIOS can't see hard drives that are greater then 8 GB. Then I remembered that good old LILO boot manager had a solution for this problem. So I reinstalled Debian 6 with LILO. I changed LILO's settings to see the DOS's partition/harddrive. DOS always boots...but Linux just sometimes(1/5) why is that? Error messages are:               Can't mount /dev     Can't mount /tmp     Can't mount ....      Looks like it cannot find the root partition, however I added line to the Linux section `root=/dev/sda1` in `lilo.conf`. Maybe it's a LILO configuration problem or a bug or the BIOS Did anyone else have this problem?


title: 6.0.7 Debian timeout if more connections at once

text: We are a some devs working on a Debian server. We are all connecting from one IP. So basically the server handles a lot of requests from the same IP. Now what happens from time to time, is that we get a timeout. It feels like fail2ban, if you input the wrong password for several times. But it's not. There is no firewall restriction on ports or sockets. Could it be some kind of kernel maximum to TCP/IP connections? **top** says that there is no strain at all. (cpu, ram etc...). The web-server is an AOLServer. There are definitely no issues with it. Version: **6.0.7 Debian** The same goes for SSH as you can see it's not application related but rather OS related. **We all use Debian as clients as well. If people connect from a windows machine there aren't problems.** Thankful for all suggestions. Let me know if you need more information.


title: NSD Zone file wrong resolution

text: I've set up NSD with the following zone file:               $ORIGIN     ldom. ; my "Local DOMain"     @   IN      SOA         lserver         root.lserver (                                             44         ;serial                                             7200       ;refresh                                             600        ;retry                                             3600000    ;expire                                             1200 )     ;minimum          @                   IN  NS              192.168.1.64      ; authority     ldom.               IN  A               192.168.1.64      and no matter where on the LAN I ping/dig it, I get the following output which is obviously wrong: Ping:               [user@laptop ~]$ ping ldom     PING ldom (127.0.0.1) 56(84) bytes of data.     64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.016 ms     64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.027 ms     64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=3 ttl=64 time=0.037 ms     ^C     --- ldom ping statistics ---     3 packets transmitted, 3 received, 0% packet loss, time 1998ms     rtt min/avg/max/mdev = 0.016/0.026/0.037/0.010 ms     [user@laptop ~]$      Dig:               [user@laptop ~]$ dig ldom          ; <<>> DiG 9.9.2-P2 <<>> ldom     ;; global options: +cmd     ;; Got answer:     ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23335     ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1     ;; WARNING: recursion requested but not available          ;; OPT PSEUDOSECTION:     ; EDNS: version: 0, flags:; udp: 4096     ;; QUESTION SECTION:     ;ldom.                                IN      A          ;; ANSWER SECTION:     ldom.                 3600    IN      A       127.0.0.1          ;; AUTHORITY SECTION:     ldom.                 3600    IN      NS      localhost.ldom.          ;; Query time: 1 msec     ;; SERVER: 192.168.1.64#53(192.168.1.64)     ;; WHEN: Wed Apr  2 12:04:33 2014     ;; MSG SIZE  rcvd: 75          [user@laptop ~]$      the `laptop` is "192.168.1.65" (DHCP) and the NSD server is "192.168.1.64" and the switch is the DSL router (192.168.1.1) with DNS1=192.168.1.64 and DNS2=ISP's Why am I getting 127.0.0.1? I want "192.168.1.64"! What part am I doing wrong? I've tried changing the "lserver" in SOA with 192.168.1.64 but there's no difference. Any change I tried results in the exact same response, even changing the NS and A record destinations.


title: How can I add Chinese character support to Emerald?

text: I'm running Arch Linux, using the Emerald window decorator. Emerald crashes in the following situations:   * A window with at least one Chinese character in the title is opened.   * An open window's title changes to something with at least one Chinese character When it crashes, it gives the following `stderr`:               emerald: cairo-scaled-font.c:459: _cairo_scaled_glyph_page_destroy: Assertion `!scaled_font->cache_frozen' failed.      Which is immediately followed with what seems to be a standard C++ error on `stdout`:               Aborted (core dumped)      * * * A few extra notes:   * I initially thought this was some problem with CJK encoding. However, it doesn't seem to happen when I load a page with Korean or Japanese in the title. Only Chinese. Of course, it's still entirely possible that some CJK package will fix my problems.   * Emerald version: 0.8.8   * Compiz version: 0.8.9   * Desktop Environment: Mate Desktop 1.6.1   * Linux Kernel: 3.12.1   * Nvidia driver version: 331.20


title: How to configure Squid for Microsoft Outlook?

text: I have configured a Squid proxy server on RedHat Enterprise Linux 5.4. All my Windows clients have been configured to use the proxy at `192.168.5.100`, port `3128` when accessing the Internet. However, Microsoft Outlook email clients are unable to access the Internet when sending or receiving email. My `iptables -P` output is as follows:               iptables -t nat -A POSTROUTING -p TCP --dport 25 -j MASQUERADE     iptables -t nat -A POSTROUTING -p TCP --dport 110 -j MASQUERADE INPUT DROP       iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT     iptables -A INPUT -i 192.168.5.100 -p tcp -m tcp --dport 22 -j ACCCEPT     iptables -A INPUT -i 192.168.5.100 -p tcp -m tcp --dport 3128 -j ACCCEPT     iptables -A INPUT -i 192.168.5.100 -p tcp -m tcp --dport 25 -j ACCCEPT     iptables -A INPUT -i 192.168.5.100 -p tcp -m tcp --dport 110 -j ACCCEPT     iptables -A INPUT -i lo -j ACCEPT     iptables -t nat -A POSTROUTING -i 192.168.5.100 -o 192.168.1.100 -j MASQUERADE      My `iptables -L` output is as follows:               Chain INPUT (policy ACCEPT)     target     prot opt source               destination          Chain FORWARD (policy ACCEPT)     target     prot opt source               destination     ACCEPT     all  --  anywhere             anywhere          Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination     `      Why is Outlook not working with the Squid proxy configuration?


title: Debian/Grub2: Moving root partition to new drive?

text: Does anybody have a suggestion for how to move the root partition to a new drive and set up grub2 to boot on that drive? I seem to have no luck instructing grub-mkconfig what it is I want to do (e.g. chroot'int into my new root just confuses all the scripts). **Background** I am running Debian Squeeze on a headless low-power NAS. My current setup is `/` on `sda0` and `/boot` on `sde0` (a CF card): I needed the separate `/boot` because `sd[a-d]` need to do a delayed spin-up. Now I've found an old 2.5" IDE disk to use as `/` including `/boot` to allow me to spin all the big disks down. **What I've tried** Basically I went               mount -o rw /dev/sdf5 /mnt/newroot     cp -ax / /mnt/newroot     cp -ax /boot /mnt/newroot/boot      Then I tried               chroot /mnt/newroot     update-grub      But that failed with grub asking if root was mounted. Then I did a half- hearted attempt at setting up `/mnt/newroot/grub/grub.cfg` to find the kernel image on `sdf5`, followed by a `grub-install --root-directory=/mnt/newroot /dev/sdf`. But this just landed me a grub rescue prompt when I tried booting from `sdf`. My backup plan is to just reinstall, so a bonus question (no checkmarks for this one): What do I have to do to get my lvm2 and mdadm config across? Is it all stored in the filesystems (and will it be automatically discovered), or do I need to take of it myself? **Solution** (thanks to Maciej Piechotka): As Maciej points out, I need to to a proper chroot for all the grub tools to work. For reference, this is how I did it:               janus@nasguld:/mnt/newroot$ sudo cp -ax / /mnt/newroot     janus@nasguld:/mnt/newroot$ sudo cp -ax /boot /mnt/newroot      All the files are now copied (see here for a discussion of copy strategies). Fix the new `etc/fstab` to point to new root:               janus@nasguld:/mnt/newroot$ diff -u etc/fstab.old  etc/fstab         -UUID=399b6a6d-c067-4caf-bb3e-85317d66cf46 /     ext3 errors=remount-ro         0 1         -UUID=b394b614-a977-4860-bbd5-7862d2b7e02a /boot ext3 defaults                  0 2         +UUID=b9d62595-e95c-45b1-8a46-2c0b37fcf153 /     ext3 noatime,errors=remount-ro 0 1      Finally, mount `dev`,`sys` and `proc` to the new root and chroot:               janus@nasguld:/mnt/newroot$ sudo mount -o bind /dev /mnt/newroot/dev     janus@nasguld:/mnt/newroot$ sudo mount -t proc none  /mnt/newroot/proc     janus@nasguld:/mnt/newroot$ sudo mount -t sysfs none /mnt/newroot/sys     janus@nasguld:/mnt/newroot$ sudo parted /dev/sdb set 5 boot on      janus@nasguld:/mnt/newroot$ sudo chroot .      We are now chrooted to the future root exactly as it will look. According to Maciej, it should be ok to just call `grub-install`, but I did an `update- grub` first to get a look at the generated `/boot/grub/grub.cfg` before installing the bootloader. I am not sure it will be automatically updated?               root@nasguld:/# update-grub     root@nasguld:/# grub-install /dev/sdb


title: Why change the owner of a symbolic link in linux?

text: In linux it's possible to change the owner or the group owner of a symbolic link (symlink). I was wondering why someone would want to do that, since permissions of a symlink are not used when accessing a file through it. I can only imagine one use case where it could be useful: to allow a user to delete a symlink in a directory with sticky bit. Do you know other cases where it might be useful to change the owner or group owner of a symlink ?


title: limiting a user's TCP transfer quota

text: I've been researching how to limit a user's monthly TCP download plus upload quotas. The total transfer limit is 1 TB / month . There are 50 users, so I wish to limit each user to a maximum of 20 GB / month . I've looked up iptables rules and bandwith limiting. If it makes a difference, the users will connect through an ssh client and dynamically forward their ports. Is there a solution for doing a total transfer quota per month per user for 20 GB ? Perhaps there is a way of creating an interface for everyone and limiting it ? Or perhaps I can poll RX/TX and stop the user when limit is reached ? Update This is for debian linux. I finally stumbled upon /proc/:pid/net/dev (pretty much by accident) which shows a total receive/transmit bytes by process. I can use this with process user information to find out total sshd process network usage for each user. Update Apparently all pids show the same net/dev stats.


title: Where do I master the most useful linux commands for programmers?

text: The power of combining `xargs, cut, tail, grep, seq`, amazes me. What resource should I look at for a tutorial on the most useful linux commands for programmers? I'm interested in just the ones programmers use most frequently, that will make my life easier.


title: How do I jump to the next or previous word with CTRL + arrow keys in a console?

text: In terminal emulation applications, pressing `CTRL` \+ `Left` / `Right` arrows jumps from one word to the previous or next one. Is it possible to have the same functionality in a Linux console, whether it is in text or in framebuffer modes? In my configuration, the `CTRL` \+ arrow keys are transformed into escaped character sequences and not interpreted.


title: Is there any Project Management FLOSS that has Resource leveling?

text: An explanation of what Resource leveling is.


title: Screen blinks when unauthorized action is attempted

text: I'm running Fedora 16. When I'm using vim or the terminal and I mistakenly direct the cursor to an inaccessible place, eg when the cursor is all the way to the top or left of the screen, the whole screen blinks. How can I disable this? I really like fedora but this setting drives me nuts.


title: List of available fonts with samples

text: I want to list all installed fonts on my system and view them to choose one for some purpose. How is that possible? Is there a program, which can provide sort of gallery of installed fonts?


title: mdadm raid0 with disks of different size?

text: Currently I'm using LVM just to merge a few disks of different size. I want to know if it is possible to use `mdadm` with stripes instead of LVM? Will it give me additional performance? Will it use all the space across disks of different size?


title: How do I run IRSSI as non-root user?

text: I am completely new to linux, and I'm trying to get in the world of command lines as it fancies my curiosity. Anyhows, I've got a NAS and Optware installed. I was able to install irssi script (via root) though I'd wanted to use it/log in/connect on servers using non-root user. I couldn't figure how to access/run the script when I'm not logged in as root.


title: How can I configure /etc/hosts file to point to apache web server?

text: I have installed apache web server and I need to point 127.1.1.1 with alias (www.someaddress.lan) to local apache. What is the proper way to do it? How to point someaddress.lan to default apache page and www.someaddress.lan to /var/www/wordpress/?


title: Why did CentOS 6.4 set up sendmail-related stuff up this way?

text: After my CentOS 6.4 install, sendmail-related components were set up as follows: `mail:x:12:mail,postfix` in /etc/group `drwx------ 2 root mail 4096 Sep 6 14:06 /var/spool/mqueue` And I was getting these errors when invoking a shell script to send email with an attachment, but not a plain `mail -s "subject" recipient < /dev/null` on the command line               Sep  6 12:46:08 localhost sendmail[3554]: NOQUEUE: SYSERR(ics): can not chdir(/var/spool/mqueue/): Permission denied      This is what I did to fix the problem, but why did I have to do it, and what else could I have done? Those are my questions. `mail:x:12:mail,postfix,smmsp` in /etc/group `drwxrwx--- 2 root smmsp 4096 Sep 6 14:06 /var/spool/mqueue` ## Edit: To make matters stranger, a CentOS 5.9 system set up just the way my system **was** set up works fine without the error.


title: bind9 problem with mail server address

text: I had installed postfix but since I didn't needed it anymore I removed it. So now the dns is broken and every time I type localhost:8080 in my address bar the browser redirects me to https://mail.example.com/ though apache is installed and properly running. I checked named.conf.local and also other files in /etc/bind folder but they didn't contain string main.example.com Here is my named.conf.local contents:               //     // Do any local configuration here     //          // Consider adding the 1918 zones here, if they are not used in your     // organization     //include "/etc/bind/zones.rfc1918";      What could be broken in my DNS server?


title: JRE in Kubuntu doesn't allow me to run .jar file

text: I am having trouble trying to run a .jar application on Kubuntu. I created an application in NetBeans in Windows and compiled it into a .jar file. First Windows couldn't find the main class. I searched the internet and fixed some registry values for the JRE and everything works fine now. However, the same problem has arised in Kubuntu, but I can't find anything of help. I've even tried uncompressing the .jar file and modifing the class path in the manifest file with many different path addresses, but nothing works. Since the problem in Windows was on the JRE and not on my application, I think the same is happening in Kubuntu. An important note is that I've installed NetBeans on Kubuntu too and when I debug or run the application under Netbeans, it works fine, but when I compile it and try to run it with: > java -jar "MBoxTest.jar" I get the same errors I got on Windows including the final one that says it cannot find the main class:               Exception in thread "main" java.lang.UnsupportedClassVersionError: my/mboxtestui/MBoxTestUI : Unsupported major.minor version 51.0         at java.lang.ClassLoader.defineClass1(Native Method)         at java.lang.ClassLoader.defineClass(ClassLoader.java:634)         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)         at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)         at java.net.URLClassLoader.access$000(URLClassLoader.java:73)         at java.net.URLClassLoader$1.run(URLClassLoader.java:212)         at java.security.AccessController.doPrivileged(Native Method)         at java.net.URLClassLoader.findClass(URLClassLoader.java:205)         at java.lang.ClassLoader.loadClass(ClassLoader.java:321)         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)         at java.lang.ClassLoader.loadClass(ClassLoader.java:266)     Could not find the main class: my.mboxtestui.MBoxTestUI. Program will exit.


title: ffmpeg with mp3 support: How to install (use) in user mode?

text: I want to use ffmpeg and libmp3lame on a stable Debian box. Alas, Debian does not support the libmp3lame package. So, I downloaded the sources for ffmpeg and the lame encoder, configured and installed them manually (on a testing machine). But I do not want to install ffmpeg and libmp3lame on the machine for all users (also because the built is not stable). I only want to use it for a single project with a single user. When I run ./ffmpeg/ffmpeg I get following error message:               # cd ffmpeg     # ./configure --enable-libmp3lame     # make     # ./ffmpeg     ./ffmpeg: error while loading shared libraries: libmp3lame.so.0: cannot open shared object file: No such file or directory.      So I simply tried to link the required library to the local directory:               # ln -s ../lame-3.99.5/libmp3lame/libmp3lame.so ./libmp3lame.so.0      But "./" seems to be not in the shared library search path so ffmpeg doesn't find it. I tried following bash script:               #!/bin/bash     PATH="$PATH:./"     LIB_PATH="$LIB_PATH:./"     LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./"     ./ffmpeg      But it still does not work. I do not want to install the library as root (e.g. into /usr/lib) because I do not want to install anything without the official package manager + trusted Debian package sources. So is there any way to tell ffmpeg to use the libmp3lame.so.0 in the "./" directory so I can use it without installing?


title: remote execution via ssh doesn't follow links?

text: `ssh server ls /var/lib/edumate/backup/weekly/*DBB*` returns one file               /var/lib/edumate/backup/weekly/DBB.0.db2inst1.NODE0000.CATN0000.20120610020013.001       but `ssh server ls /data/backup/weekly/*DBB*` returns what is in mounted linked directory               /data/backup/weekly/DBB.0.db2inst1.NODE0000.CATN0000.20120513020022.001     /data/backup/weekly/DBB.0.db2inst1.NODE0000.CATN0000.20120520020018.001     /data/backup/weekly/DBB.0.db2inst1.NODE0000.CATN0000.20120527020019.001     /data/backup/weekly/DBB.0.db2inst1.NODE0000.CATN0000.20120603020028.001     /data/backup/weekly/DBB.0.db2inst1.NODE0000.CATN0000.20120610020013.001     /data/backup/weekly/DBB.0.db2inst1.NODE0000.CATN0000.20120710120854.001      Where `/data` is on another partition               /dev/sdb2 on /data type ext3 (rw,acl,user_xattr)      and backup is a symlink to `/data/backup`               lrwxrwxrwx 1 root     root       12 Jul 10 14:27 backup -> /data/backup/      Of course I am after the list of files from the mounted/linked directory. Is there any way **how I can use`/var/lib/edumate/backup` in `ls`** and not the linked one? Is `scp` going to behave the same?


title: How to downgrade USB 3.0 to USB 2.0?

text: I have USB 2.0 device when I plugged this device into the USB 3.0 port of my system then system gets hanged, after researching many of the solutions says that you can downgrade USB 3.0 to USB 2.0. But I didn't get any specific documentation for related to downgrading process. How can I downgrade USB 3.0 to USB 2.0. I am using Ubuntu 12.04


title: How does one create a directory that can't be seen and can only be accessed via its absolute path name?

text: I'm working on an assignment on adding time support to a standard UNIX system. Part of it, however, involves securing the location of backup files (which we've set to be at the system root by default) by making them invisible, even through a command like "ls -al" and can only be accessed by specifying its absolute path name. Here's the original quote: > Finally, historical directories should be "virtual", in the sense that they > do not appear when examining the contents of the inode representing the root > directory or when performing a command like "ls -al /", and are only > accessible through a direct chdir() ("cd") operation to a historical > pathname. I've been prowling through the UNIX file system API but I haven't come up with a way to enforce this (I'm thinking a command line program or a combination of these in a bash script might do the job). Am I thinking in the wrong direction? Would appreciate any pointers or tips in the right direction, thanks :)


title: linux watchdog and systemd watchdog

text: I'm in trouble with watchdog :( Is there any way to register application into systemd watchdog at runtime? Does linux watchdog only use for system reset or it can be use for application reset?


title: Activating colors in links2 (text mode)

text: I can't seem to see colors in links2 (text mode), even after playing with my TERM settings. The links2 manpage and README.Debian don't specifically address this issue. Also, command-line options like -html-t-text-color are not recognized in my links2. But I can start and see colors in graphics mode (-g). My eventual goal is to convert HTML syntax-highlighted document (e.g. JSON or Perl, Javascript, etc) and display them in terminals using ANSI codes for colors. My platform: Debian Wheezy+Sid AMD64. Terminal emulators used: Konsole (4.6.5). Colors (including 256 colors) work normal for other programs, including emacs and mc. Any pointers? Thanks in advance. I don't mind using other text-based browsers which support color.


title: How the network packets are transferred to the memory on linux?

text: Is there some command or tool for monitoring network packets and how those packets are handled by the memory and than proceeded to the CPU on linux platform? Using tcpdump I can capture many apache requests for example but I don't know how those packages are assigned to some process id.


title: STIG (Security Technical Implementation Guides) automation

text: Has anyone here found the best way to STIG a version of RHEL 6.x automatically? The other answers I have found are either out of date or do not completely STIG the machine. Even an image that has a STIG of RHEL will help.


title: Is there any common meaning to a `collects` directory?

text: I'm under the impression that there are a bunch of directory names that have common semantics, like (in no particular order):   * `usr`   * `tmp`   * `src`   * `lib`   * `etc`   * `share`   * `opt`   * `bin`   * `sbin`   * `var`   * `data`   * `include` There are others that may or may not be UNIX-y (e.g. `libexec`) but they show up frequently enough to imply that conventions exist. I noticed that Racket uses a `collects` directory. Is there any other software that uses a `collects` directory?


title: Can I use yum to manage a "package" installed from source

text: I am running CentOS 5.5. I need to upgrade some packages to newer versions, unfortunately they're not available. I am stuck building from source. Is there a simple way to use yum to manage something that I've built from source, so if a package does become available at a later point, I can uninstall the built-from-source version and replace it with the package?