Script for opening emacs in two different ways

I've attempted to write a small script that will by default open emacs with               emacs -nw foo      by simply typing               emacs foo      and when I want a window typing               emacs foo &      The script I attempted to write looks like this               #!/bin/bash          if [ -z $2 ]; then         emacs -nw $1     else         emacs $1 &     fi      The problem I'm running into is that when I try to run the script nothing happens, as if I just hit enter. Would a more experienced person please advice how to make this script properly?


Building an appliance

I want to build an appliance for the kitchen. It is supposed to play music (files, streams, CDA), surf the web (recipe sites!), maybe play video (files and streams) display todays agenda during breakfast. Because I do not want it to run 24/7, it should boot up really fast. I am thinking about a small SSD for the OS. I also want to use a touch screen. I will probably use NetBSD or Linux (not sure yet). It really should get the feel of an appliance like a car GPS system or a smart phone. Now here is the question: Is there some kind of interface that can be operated by touch screen (on screen keyboard?) and that can be tweaked to what I want to do with it? Bonus question: Did you build such a system yourself? How?


how to create debian package to install files to /home/user

I created a debian package, I want to install the files to the directory /home/user/myapp instead of /usr/bin but after install the deb, the owner of /home/user/myapp is root I hope after install the deb, the owner should be user, so I add postinst to do the post-work:               #postinst     chown -R user /home/user/myapp      but I always got an error "chown: ... Operation not permitted" any helps? Thanks


How to easily install and uninstall unix packages

Hey everyone. I'm using the Ubuntu server for some time now. Everything is working fine, installing packages is a piece of cake. Usually I use aptitude or apt-get for package management. But...! There are cases when I need to install a package from a source. No problem usually I do ./configure, make install and so on. But...! There are also cases I want to upgrade a package I manually installed from a source. This is where things get blured :). My question: What is a proper way to install custom packages. I'm thinking of install/uninstall process like on Windows. I would like to remove all the package files after the package was manually installed using make/install command. I know there is a script through which you can run make commands and later it knows how to remove the package and all related files/paths but can not remember the name. Please help! Thx 10x!


CUPS: Spooling to printer is slow

Spooling to my PostScript printer is terrible slow. Today I printed a simple webpage where the .ps-file was 55kb. Sending it to the printer took 5 minutes. I have the feeling that CUPS is generating a 2400 DPI bitmap and sending that instead of just sending the .ps-file. The file in /var/spool/cups is 55kb, so if the above happens, then it is done one the fly. How do I debug this?


Configure a bridged Ethernet adapter in a VirtualBox guest running Scientific Linux

I installed Scientific Linux 6.2 x86 in VirtualBox on Windows 7 x64. The adapter is               Adapter 1: Paravirtualized Network (Bridged adapter, Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller)     promiscuous mode: Deny      But this adapter does not get ip address.               [root@server ~]# ifconfig -a     eth1      Link encap:Ethernet  HWaddr 00:40:5A:33:F2:92                 inet6 addr: fe80::240:5aff:fe33:f292/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:5 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 b)  TX bytes:398 (398.0 b)          lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:16 errors:0 dropped:0 overruns:0 frame:0               TX packets:16 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:960 (960.0 b)  TX bytes:960 (960.0 b)      The list of `/etc/sysconfig/network-scripts`               [root@server network-scripts]# ls     ifcfg-eth0   ifdown-eth   ifdown-ppp     ifup-aliases  ifup-isdn   ifup-routes       net.hotplug     ifcfg-eth1   ifdown-ippp  ifdown-routes  ifup-bnep     ifup-plip   ifup-sit          network-functions     ifcfg-lo     ifdown-ipv6  ifdown-sit     ifup-eth      ifup-plusb  ifup-tunnel       network-functions-ipv6     ifdown       ifdown-isdn  ifdown-tunnel  ifup-ippp     ifup-post   ifup-wireless     ifdown-bnep  ifdown-post  ifup           ifup-ipv6     ifup-ppp    init.ipv6-global      And `ifcfg-eth1` is               DEVICE=eth1     HWADDR=00:40:5a:33:f2:92     NM_CONTROLLED=yes     ONBOOT=no     BOOTPROTO=dhcp     TYPE=Ethernet     USERCTL=no     PEERDNS=yes     IPV6INIT=no      Please let me know how to get eth1's IP address 192.168.0.x.


How to run a script as soon as the week number changes?

I would like to keep my download folder sorted. My goal is to have the files of the current week in the download folder, and the older files in a folder named after week number and year (eg 2013.09, lexicographically sortable) of the creation date of these files. I only want this to apply to the files and folders found at the root of download folder; `tar` archives and others archives are sometimes automatically expanded by the browser when the download is complete. Files and folders currently at the root of the download folder are assumed to be the ones of the current week. However, mtime and ctime don't tell when the file actually finished downloading. If the machine was always on, I could set a cron task to run as soon as the week number changes, but this is a laptop, and I put it in stand by mode when I don't use it.


Get the number of inode in a tree

How can I get the number of inodes used by files in a given directory tree? Important: including hidden directories under it, like `.git`


Upgrading VirtualBox Guest Additions

I have been running a Debian (Wheezy) guest on a Window 7 host with Oracle VirtualBox. I was recently prompted to upgrade the VirtualBox and did so to version 4.3. Now I cannot get the guest additions upgraded. When I run through the install of guest additions I get the following error:               Installing the windows systems drivers... fail!!!     Could not find x.org or XFree86 Windows System


Break In Attempt

mysql service has vanished from my vps and service is down since yesterday where can see from /var/log/secure file it says break in attempt from an ip that is not known to me but cannot tell if the break in was accomplished by the file except by the fact my server is down. Under what circumstances does the mysql service disappear? Could that possibly happen when dedicated server my vps is on has maintenance upgrade as they did yesterday? Also with the secure file message :               Jan 12 04:16:51 foo sshd[26725]: Failed password for root from            61.174.51.207 port 1076 ssh2     Jan 12 04:16:54 foo sshd[26822]: Disconnecting: Too many authentication     failures for root     Jan 12 04:16:54 foo sshd[26825]: Failed password for root from     61.174.51.207 port 1076 ssh2     Jan 12 04:16:54 foo sshd[27324]: PAM 5 more authentication failures;    logname= uid=0 euid=0 tty=ssh ruser= rhost=61.174.51.207  user=root      Am I reading this correctly that last attempt was successful? Checking the IP it is in China.


Finding gEDA installation directory

I installed gEDA and I am trying to find it's installation directory/path. I've searched Google for many strings and entered a lot of the results it returned but didn't find anything about that. So how can I find gEDA's installation directory/path? * * * _Edit (24 May, 16:55 UTC):_ I've tried the following, suggested by @phunehehe:               $ dpkg-query -L gEDA     /.     /usr     /usr/share     /usr/share/doc     /usr/share/doc/geda      but it doesn't seem like the installation folder for gEDA, only the documentation.


Facebook games will not work on xubuntu 11.10 how do I fix?

I just had xubuntu 11.10 put on my computer and know nothing about the system. Adobe flash player is installed and up to date, I have only had this running for a few days. My YouTube works just fine but when I try to play a game on Facebook it tells me that my flash player needs to be upgraded. Being used to Windows, I went into my Firefox plugin menu, and there is not even an adobe flash plugin listed. (I thought maybe it wasn't active) I was wondering if/how this can be fixed? Can someone can explain it to me, even though I know absolutely nothing about the operating system?


stat on an encrypted volume in osx takes a long time

My workstation is a MacBook Pro with an SSD. For security reasons, my main volume is encrypted. I ran this command on a folder:               time find . -exec stat {} + >/dev/null          real    0m5.205s     user    0m0.367s     sys     0m4.556s      The folder contains 1961 items. Running the same command on a linux (debian) machine without ssd takes .09s real (similar folder, except it contains 1150 items). Also, running `find . -ls | wc -l` on my workstation only takes .05s real (it also lists modification dates). Is there anything that I can do to speed things up? For the record, I did this timing because my boost.build project takes 6s to check the dependencies on my workstation, while it takes less than a second on the linux machine. Edit: I copied the folder in question to another laptop with a 7200rpm non- encrypted hard disk, the find stat command takes 2.445s system time. Edit 2: I decrypted my hard disk, and now it takes ~3.6s on the same ssd on osx.


Which shell should I learn for FreeBSD and Debian?

I have read many articles that say the official shell in FreeBSD is `tcsh`, and in Debian, its `dash`. However, when I either `echo $shell` (FreeBSD) or `env` in Debian, it says that the shell is `csh` in the first case, or `bash` in Debian. This is in fresh installations. I tested under the root account and a normal user account. Also, when I create a new account in FreeBSD, I have the choice of 3 shells; `sh`, `csh` or `tcsh`. If I make no choice, `csh` is the default for the account. What is the official, standard shell under those systems? Is it `tcsh` or `csh` in FreeBSD? Is it `dash` or `bash` in Debian? Is it me that does something wrong? Or are the articles and sites misinformed? I want to learn two shells: one for Debian and one for FreeBSD, but I can't find which one I should learn, since its not clear which one is the official shell. Also, while searching for which shell I should learn, I found this: http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/ Is it someone that just doesn't like `csh`, or should we really avoid `csh`? I'm using the latest Debian and FreeBSD versions. I start to get lost with all these shell options, they all look the same to me (except for the syntax; I mean they all look to offer the same possibilities). It's why i want to learn the official one.


Myth or reality: SELinux can confine the root user?

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.


Run xterm with login shell or not?

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.” >


ls taking long time in small directory

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?


Granting all users access to mounted CIFS shares

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?


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

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


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

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.


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

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.


Transfer a Fedora system to another computer

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


Firefox not rendering some pages well

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.


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

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.. ?


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

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?


Grub change loopback amount?

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?


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

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!


How can I list subdirectories recursively?

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?


How to prevent users from deleting a directory?

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


How to disable playlist song hover info in Amarok?

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.


What are some excellent Emacs utter beginner resources?

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.


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

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?


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

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


BCM43228 does not work since kernel 3.15.xx

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)


Passing binary data to curl without using a @file

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?


How to turn off smooth scrolling in KDE4

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.


Regenerating Initrd.img on a different platform

**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?


Can TCP provide more than 65535 ports?

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.


What does "Reserve Distribution" means?

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"?


Nginx returning 502 Bad Gateway

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?


find command with -execdir not reading flags?

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?


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

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`


Perl - /etc/shadow - Permission Denied

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.


Kill all processes related to an application

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


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

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.


sed - how to replace a single quote?

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.


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

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.


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

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.


Trouble with dbus and systemd/user

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.


Update different dropbox instances

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)?


Yum Check Available Package Updates

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`?


Windows 7 not working correctly after partition resize

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


UART0 Access in AM1808 using Embedded Linux

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?


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

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 ?


Archlinux VGA video problem

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.


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

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?


Themed Tabs in Gnome Terminal

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.


Running a bash script within a bash script

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.


"Permission denied" trying to get a file using TFTP

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?


Fix "Route hash chain too long" without restart

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


Debian jessie cannot suspend anymore

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?


how to track down an internal port redirection?

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...


Temporary redirect ports

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


How to run executable program with filter

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.


Using git to manage /etc?

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?


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

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)


How to get MTPFS working on Scientific Linux 6.4?

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?


Build an Affordable Linux Tablet

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.


Troubles with Wifi and ethernet Aspire One AO725

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?


bash: syntax error near unexpected token `('

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"


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

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


Program that passes STDIN to STDOUT with color codes stripped?

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


How do you highlight ops' messages in Irssi?

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?


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

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


iptables couldn't load target allow

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


Install SSL Certificate in Iceweasel

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)


System cannot boot, continiously scanning btrfs filesystem

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...).


scp from one remote server to another remote server

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**.


Linux distro with PREEMPT_RT patch

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.


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

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.


Minimal Linux, stuck at building GRUB

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 ?


Debian 6 and the old Pentium II

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?


6.0.7 Debian timeout if more connections at once

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.


NSD Zone file wrong resolution

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.


How can I add Chinese character support to Emerald?

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


How to configure Squid for Microsoft Outlook?

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?


Debian/Grub2: Moving root partition to new drive?

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


Why change the owner of a symbolic link in linux?

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 ?


limiting a user's TCP transfer quota

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.


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

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.


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

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.


Is there any Project Management FLOSS that has Resource leveling?

An explanation of what Resource leveling is.


Screen blinks when unauthorized action is attempted

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.


List of available fonts with samples

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?


mdadm raid0 with disks of different size?

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?


How do I run IRSSI as non-root user?

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.


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

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/?