title: Samba set share browsable only for a group

text: How I can configure samba to set browsable a share for a group only. I wanna hide the share for all other users, if a set browsable to `yes` all the users can see the share when explore. I don't want this behavior. Example a simple share               [myshare]         force group = mygroup         write list = mygroup         read list = mygroup         browsable = yes


title: Mplayer video output drivers

text: Is there a document somewhere describing each of mplayer's video output drivers and why'd you'd want to pick that one for a given circumstance (or why it exists) Would someone be willing to write that out here?


title: How to disable styling on man pages?

text: Is there an easy way to turn off all styling on man pages? Colors, bold, italics, everything... If not, what is an uneasy way?


title: relaying ports to remote pc via vpn

text: I've got a situation where a remote pcs is vpn'ed to my Ubuntu box, and I'm wondering how I set the Ubuntu box up to redirect calls to specific ports over to the PC. Any Ideas?


title: How to build svnwcrev

text: I'm having a bad time building svnwcrew, and as the readme file says: "There is no sophisticated installation procedure for this small utility."... I modified the config.mk file setting the APR_INCLUDE as the readme says, and when I run **make** : > http://pastebin.com/NE1nevek any suggestion to build this tool? Thanks!


title: Wireless doesn't connect automatically in Ubuntu when connection is established with wifi Router Again

text: I am facing a problem here with Ubuntu version 10.4 I am working with. I am having a wifi router and when I start my system, Ubuntu connects to wifi automatically. But if due to some reasons the connection is lost and established again then Ubuntu wireless system doesn't connect automatically and it pops up with a window to enter the key again to connect. There are many times I keep my system ON with something to download and went away for some time, only to come back and see that the Ubuntu is waiting for my inputs to connect again as router had lost its connection. Is there any file settings needs to be done so that it connects to wifi without and user input required ? Or is there any shell script or command which can help in doing that.


title: Emacs mode for man pages

text: I'm translating man pages, and have run in to a few problems with Emacs.   1. How do you specify language? (With man, it looks like this `man -Lsv shutdown` for the Swedish "sv" subdirectory, if available.)   2. In the Emacs man mode, you can use **N** or **P** to jump forward or backward according to headers (in roff, they look like this: `.SH`). But, this doesn't work if the header includes one (or more) of the three special Swedish characters: Å, Ä, and Ö. It doesn't matter if I escape them (like this `\(:A`). (But they are correctly displayed.)   3. To view a work in project, I use for example `M-x man RET ./ls.1` (that is, the absolute path). This is great, because it is the same man mode as for viewing "real" manpages (those in /usr/share/man). Only, when I do some changes in the document, how do I refresh the manpage? `revert-buffer` says the buffer is not associated with a file (not true, but OK, I get it); `M-x load-file RET` seems to have lost track of the file; ... Ideas? By the way, translating is a lot of fun! **EDIT:** (see the first comment) ![Table](http://user.it.uu.se/~embe8573/emacs_woman_man.png)


I usually use kubuntu, but I had to install a custom kernel on my laptop and it's a lot easier with arch. The problem is that kde looks terrible in arch, especially the GTK applications. I know there are all sorts of tutorials of installing gnome icons, and various peicewise fixes, but is there a way to find out exactly how kubuntu sets up KDE so I can just duplicate that?


title: How do you output a list of all man pages in a particular section?

text: A man page for `fork`, for example, is in the System Calls section that has number 2: `man 2 fork` How do you see what else is section 2 without resorting to Google?


title: Parse syslog messages into separate MySQL tables with rsyslog

text: Out of the box rsyslog will dump everything into the `SystemEvents` table within the `Syslog database (if you use the default schema provided). I would like to use a regular expression to filter inbound messages into separate database tables. I've played with this, but I'm having a hard time figuring out the best way to accomplish this (or even a way that functions). In my rsyslog.conf:               $template wireless, \      "insert into RogueAPs \      (ReceivedAt, DeviceReportedTime, Facility, Priority, FromHost, Message) \      VALUES('%timegenerated%', '%timereported%', '%syslogfacility%', '%syslogpriority%', '%fromhost-ip%', '%msg%');", \       stdsql          if $msg contains 'subtype=wireless' then :ommysql:127.0.0.1,Syslog,dbusername,dbpassword;wireless          *.* :ommysql:127.0.0.1,Syslog,dbusername,dbpassword      This was my latest attempt, but I'm stuck. (the RogueAPs table is just a clone of the default SystemEvents table that ships with rsyslog) * * * Version Info:               shell# /usr/local/sbin/rsyslogd -v     rsyslogd 5.5.5, compiled with:             FEATURE_REGEXP:                         Yes             FEATURE_LARGEFILE:                      No             FEATURE_NETZIP (message compression):   Yes             GSSAPI Kerberos 5 support:              No             FEATURE_DEBUG (debug build, slow code): No             Atomic operations supported:            Yes             Runtime Instrumentation (slow code):    No          See http://www.rsyslog.com for more information.


title: mutt sidebar: expand/collapse folders

text: Is there a way to expand/collapse a single folder or all folders in the `mutt- patched` sidebar? I couldn't find anything about this in the sidebar documentation.


title: How to get a program running with root privileges without using su or sudo

text: I have a `bash` script that needs to run with **root privileges** , but must be invoked by the normal user. Difficult part is that the script should not ask for a password, and I don't want to use the _sudoers_ file. I'd like to avoid using **sudo** or **su**. Is this possible?


title: Tweak gimp for performance

text: I just realized that I can start gimp (version 2.8) via `gimp -d` to reduce startup time on an old system. Are there other tweaks to speed up the startup time of gimp and reduce memory usage?


title: mutt: return to index after deleting or saving message in pager view

text: After deleting or saving a message in pager view in the MUA mutt, the program remains in pager view and jumps to the next message in the current folder. Can this default behavior be changed so that after deleting or filing an email, the pager mode is exited and the folder index is displayed?


title: Sun blade 2000 - no prompt

text: I just bought a Sun Blade 2000 and a type 7 USB keyboard from EBAY. The blade has Solaris 8 installed and while I can login, I'd rather switch to something like UBUNTU. If I type STOP - A during the boot process, I get a white screen but no prompt that I can see. The video card is PCI and seems to work fine with Solaris. I'm not sure if the prompt is being directed elsewhere? Any ideas?


title: TUI interfaces not displaying correctly

text: I have an Ubuntu 11.04 server on Amazon EC2 which cannot display TUI interfaces correctly, like on `Midnight Commander` or `tree`. ![corruption](http://i.stack.imgur.com/iTD3P.png) I'm quite sure that this problem was not there when I set it up, and I suspect that it may have occurred since I did a `apt-get dist-upgrade`. How can I fix this?


title: How can I launch applications from 2 ttys on launch?

text: I've currently got 2 ttys logging in automatically, but I need to launch a node script from one and a C program from another as soon as the device loads. The device is a Raspberry Pi running Raspbian. It's set up to function like an appliance, these two programs will run for a few hours at a time before the device is turned off. I've successfully launched my programs via `/etc/rc.local` but it seems that this isn't the same as actually launching from tty, they are closed before the prompt loads.


title: Service script calls another script with variables

text: I have a simple service script `tomcat7` in /etc/init.d/ to start and stop my app server (tomcat) under the tomcat user. On RHEL6.               #!/bin/bash     # description: Tomcat Start Stop     # processname: tomcat     # chkconfig: 234 20 80          CATALINA_HOME=/usr/local/www/tomcat-7.0.54          case $1 in     start)     /bin/su tomcat $CATALINA_HOME/bin/startup.sh     ;;     stop)     /bin/su tomcat $CATALINA_HOME/bin/shutdown.sh 30     ;;     esac     exit 0      Which works fine. Both `startup.sh` and `shutdown.sh` call a script called `catalina.sh`. These are pre-made scripts that come with the app server. I can use `catalina.sh` directly like: `./catalina.sh stop 30 -force` Which lets me specify a wait time of 30 seconds and then does a kill -9 if the process hasn't ended. But I can't get the variables to work in the `tomcat7` service script. If I change it to:               stop)     /bin/su tomcat $CATALINA_HOME/bin/catalina.sh stop 30 -force      I get an error:               [root@543917-web1 bin]# service tomcat7 stop     /bin/su: invalid option -- 'o'      Can I pass the three arguments without altering the catalina.sh script? TIA


When giving presentations, I use the html/css/js-based `showoff`. It has a presenter mode which shows the notes and the progress in a good way for me. It seems like the idea is that somehow a second browser gets the changes I do in this mode, but that does not work. Therefore I thought of putting just the part of the presenter mode which displays the current slide (this is a 1024x768 area) on another device, namely the beamer display. As `X` has such a vast tooling box, I figured this could be possible. The presentation has been given with mirrored displays, which went good enough. What remains is the curiosity if it would have been possible:               Can I display part of a window on the second device?      I use `xmonad` as window manager normally. If this is supported by another window manager, I could switch just for presentations. **UPDATE** I am more interested in the way this could be achieved by `X11` means (or related tools) than just having the presenation run fine. That's just the incident that created my interest in such a solution. **SECOND UPDATE** I am still looking for a pure X11-solution, but the problem at hand is of course solved.


title: iptables hangs at applying rules

text: I have a set of rules that are supposed to give me the most protection before things like fail2ban and other things are added to the mix. The issue is that although everything checks out in the test, when I `service iptables restart` it will shut down just right, but when it goes to apply the rule it hangs. Here is the set               # Allow all traffic.     #---------------------------------------------------------     *filter     :INPUT ACCEPT [81:5076]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [44:3868]          #---------------------------------------------------------     # protection based on http://thelowedown.wordpress.com/2008/07/03/iptables-how-to-use-the-limits-module/     # and https://gist.github.com/virtualstaticvoid/1024546     # and http://www.cyberciti.biz/tips/howto-limit-linux-syn-attacks.html     #---------------------------------------------------------          #---------------------------------------------------------     # General rules     #---------------------------------------------------------     # it is gerenally view as best practice to drop all and add     # just what is needed.  Drop and reject to prevent abuse      # of the system and sour the milk     #---------------------------------------------------------     -P INPUT DROP     -P FORWARD DROP     -P OUTPUT DROP               # Allow incoming HTTP     #---------------------------------------------------------     -A INPUT -i eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT     -A OUTPUT -o eth0 -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT          # Allow incoming HTTPS     #---------------------------------------------------------     -A INPUT -i eth0 -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT     -A OUTPUT -o eth0 -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT                    # Allow loopback access     #---------------------------------------------------------     -A INPUT -i lo -j ACCEPT     -A OUTPUT -o lo -j ACCEPT          # Allow packets from internal network to reach external network.     # if eth1 is connected to external network (internet)     # if eth0 is connected to internal network (192.168.1.x)     #---------------------------------------------------------     -A FORWARD -i eth0 -o eth1 -j ACCEPT          # Allow outbound DNS     #---------------------------------------------------------     -A OUTPUT -p udp -o eth0 --dport 53 -j ACCEPT     -A INPUT -p udp -i eth0 --sport 53 -j ACCEPT          #---------------------------------------------------------     # DATABASE Connections     #---------------------------------------------------------     # Allow MySQL connection only from a specific network     #---------------------------------------------------------     -A INPUT -i eth0 -p tcp -s 192.168.200.0/24 --dport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT     -A OUTPUT -o eth0 -p tcp --sport 3306 -m state --state ESTABLISHED -j ACCEPT                    #---------------------------------------------------------     # SSH     #---------------------------------------------------------     # Allow ALL incoming SSH     #---------------------------------------------------------     -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT     -A OUTPUT -o eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT          # Allow outgoing SSH     #---------------------------------------------------------     -A OUTPUT -o eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT     -A INPUT -i eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT          # limit ssh to 10 connections in 10mins         # note 198.255.255.255 is fake for this post     #---------------------------------------------------------     -I INPUT -p tcp -s 0/0 -d 198.255.255.255 --sport 513:65535 --dport 22 -m state --state NEW,ESTABLISHED -m recent --set -j ACCEPT     -I INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 600 --hitcount 11 -j DROP     -A OUTPUT -p tcp -s 198.255.255.255 -d 0/0 --sport 22 --dport 513:65535 -m state --state ESTABLISHED -j ACCEPT               #---------------------------------------------------------     # DoS     #---------------------------------------------------------     # Prevent general DoS attack     #---------------------------------------------------------     -A INPUT -p tcp --dport 22 -m limit --limit 5/minute --limit-burst 10 -j ACCEPT     -A INPUT -p tcp --dport 80 -m limit --limit 5/minute --limit-burst 100 -j ACCEPT     -A INPUT -p tcp --dport 443 -m limit --limit 5/minute --limit-burst 100 -j ACCEPT          # Syn-flood protection     #---------------------------------------------------------     -A FORWARD -p tcp --syn -m limit --limit 1/s -j ACCEPT          # Interface 0 incoming syn-flood protection     #---------------------------------------------------------     -N syn_flood     -A INPUT -p tcp --syn -j syn_flood     -A syn_flood -m limit --limit 1/s --limit-burst 3 -j RETURN     -A syn_flood -j DROP          # Furtive port scanner     #---------------------------------------------------------     #-A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST \     #-A port-scan -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s -j RETURN     #-A port-scan -j DROP               # Ping of death     #---------------------------------------------------------     #-A FORWARD -p icmp --icmp-type echo-request -m limit \ --limit 1/s -j ACCEPT          # Limiting the incoming icmp ping request     #---------------------------------------------------------     -A INPUT -p icmp -m limit --limit  1/s --limit-burst 1 -j ACCEPT     -A INPUT -p icmp -m limit --limit 1/s --limit-burst 1 -j LOG --log-prefix PING-DROP:     -A INPUT -p icmp -j DROP     -A OUTPUT -p icmp -j ACCEPT               #---------------------------------------------------------     # Logging     #---------------------------------------------------------     # Log dropped packets     #---------------------------------------------------------     -N LOGGING     -A INPUT -j LOGGING     -A LOGGING -m limit --limit 2/min -j LOG --log-prefix "IPTables Packet Dropped: " --log-level 7     -A LOGGING -j DROP                    COMMIT     # End      I had to remove the `port-scan` and the ping of death rules as it was cause it not to pas the test. I want to correct that too. Any ideas why it would pass the test but hang for ever on applying the rules? **UPDATE** So far commenting everything except               # Allow all traffic.     #---------------------------------------------------------     *filter     :INPUT ACCEPT [81:5076]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [44:3868]      I still was getting odd results like `iptables` hanging while starting back up, to not being able to `yum install *`. At this point it's like I just need to start over on fixing the rules lol.


title: Installing Aqua interface on Darwin

text: Is is possible to install the Aqua GUI on top of Darwin? I was researching this about a year and a half ago and I don't remember much about what I found out. I also was not the main person in charge of research, so that didn't help. Anyhow, I can download Darwin from the Apple site, and I get a CLI (kinda like single-user mode for OS X), and I now want to install an interface on top of that.   1. Can I install the Aqua GUI?   2. Or do I have to install another GUI?   3. Would it be possible to write a GUI for it?   4. How would I do this?


title: How to stop the executing process in Linux

text: I have a script file pingIP.sh which just pings the given IP address,               ping -c 70 74.125.228.71      The problem is when I try to stop the executed script in the middle its not stopping it properly. Using linux cmd `ps -ef|grep pingIP |grep -v 'grep pingIP'` I'm able to get the process id, and killing it using cmd `kill -9 processid`. For example, executing script file               PING 74.125.228.71 (74.125.228.71) 56(84) bytes of data.     64 bytes from 74.125.228.71: icmp_seq=1 ttl=122 time=256 ms     64 bytes from 74.125.228.71: icmp_seq=2 ttl=122 time=244 ms     64 bytes from 74.125.228.71: icmp_seq=3 ttl=122 time=250 ms     64 bytes from 74.125.228.71: icmp_seq=4 ttl=122 time=254 ms     64 bytes from 74.125.228.71: icmp_seq=5 ttl=122 time=243 ms      Executing the `kill` command now just stops the script execution but ping response is continuing until specified ping count is reached. Any suggestions to avoid the ping execution even after stopping the execution of script file?


title: Symbolic Link local .jpg file to .jpg file on the internet

text: Is there any way to have a symbolic link that links a local .jpg file to a .jpg file on the internet in a l/unix environment?


title: SSH tunnel to router periodically hangs. TCP problem?

text: Something weird I've noticed since upgrading my office router to the Buffalo WZR-HP-G300NH. When I remote in using an SSH tunnel, the tunnel will "freeze" pretty often. The freeze lasts 1-2 minutes each, after which all the traffic that was stuck catches up. It's very annoying to be using VNC and have the session pause every few minutes. I am using the following command from my local machine:               ssh -D 9000 root@my.router.hostname       I know the whole router isn't freezing because I can open another SSH session and it's fine -- until it freezes, too. The freezing sessions are independent of each other. Both will periodically freeze, but not at the same time. I can start a ping going in both sessions and neither loses a single packet or even shows any lag, even though the both freeze a couple times. If I forward the VNC port straight through to the remote machine, the problem gets somewhat better leading me to believe this is more likely a TCP issue rather than SSH. But I'm not ruling anything out. This behavior has persisted despite upgrading firmwares to the latest dd-wrt, including the build that was pulled a few weeks ago. Is it a problem with dropbear? Or with MTU? QoS?


title: Cannot start xterm over ssh after several successes

text: I am running some MATLAB scripts on the command-line of a remote computer using `ssh`. These scripts launch 5 `xterms` that are forwarded to me via ssh (using the `-X` option). At the moment I am debugging my code so I am restarting my scripts every now and then. Everything works fine for a couple of runs, but after the N'th time (where N is a random number) I get theses error messages:               xterm Xt error: Can't open display: localhost:10.0     xterm Xt error: Can't open display: localhost:10.0     xterm Xt error: Can't open display: localhost:10.0     xterm Xt error: Can't open display: localhost:10.0     xterm Xt error: Can't open display: localhost:10.0      After this I can continue to use ssh except for starting anything GUI-related, meaning that I can no longer start `xterms` remotely. My only workaround is to restart the ssh connection. Can I fix this somehow to never be bothered again by this? **System**   * local system: privately owned laptop, running Chakra Linux, KDE   * remote system: university computer, running openSuSe, KDE


title: How to update ubuntu repositories?

text: I've just downloaded Bodhi Linux which is built on ubuntu 10.04 LTS. ubuntu 10.04 packages seems outdated and i cannot install newer versions of my packages. for example i need to install g++4.6 (to use some c++0x features) but i'm just able to install g++4.4. I added all backport repositories but they had no actual effect on version of packages. what should i do, can i add ubuntu natty's repositories to my software cources?


title: Configuring what commands xfce4-session-logout runs

text: The suspend command run when selecting ‘suspend’ from xfce4-session-logout does not work on my machine. I need it to run `s2ram -f -a 1`. Where do I change what is being run to suspend the system?


title: Detection of USB Modem is unstable - how can I correct this?

text: I am using Huawei 3G USB Modem in Ubuntu 12.04 LTS on DELL Inspiron NS5520. I tried every possible solution but had no luck. Whenever my USB Modem disconnects, I can not re-connect it and then I have to restart laptop. On restart, sometimes it detects the USB Modem and sometimes not. In Ubuntu 11.x It was working fine, but now I am using 12.04. This is the lsusb ouput:               Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub     Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 003 Device 003: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem     Bus 001 Device 003: ID 0bda:0129 Realtek Semiconductor Corp.      Bus 001 Device 004: ID 0c45:648d Microdia      Bus 002 Device 003: ID 8087:07da Intel Corp      Any help will be greatly appreciated.


title: Is there a FUSE which permits transparently accessing incremental backups?

text: While _creating_ incremental backups is relatively simple (and can be automated, e.g. via `rdiff-backup`), in order to access a specific state of a file one first has to manually restore the backup, which is both not-simple and tedious if you need to browse through multiple states. So is there a FUSE which allows to transparently access previous states e.g. via some `filename@2013-01-23` (the backup made at that date, if existing) or `filename@{-2}` (two backups ago) syntax while the current and backup files reside on arbitrary filesystems (including remote ones, e.g. nfs backups while the current state is on a local ext3)?


title: Is there a Linux deep diff tool that also compares file attributes?

text: Is there a Linux tool like diff that will recursively compare files and directories, but with the addition of also comparing: extended attributes, acl's, se contexts?


title: Mac Firebreath plugin port to Linux (dependencies)

text: I have Firebreath plugin for Mac that I need to port to Linux. I am trying to find the replacement dependencies for the Linux version. Here is the dependencies I have in my `cmake` for Mac:               find_library(COCOA_F Cocoa)      find_library(FOUNDATION_F Foundation)      find_library(APPKIT_F AppKit)      find_library(COREDATA_F CoreData)      find_library(AGL_F AGL)      find_library(CARBON_F Carbon)      find_library(AUDIOTOOLBOX_F AudioToolbox)      find_library(COREAUDIO_F CoreAudio)      find_library(AUDIOUNIT_F AudioUnit)      find_library(QUARTZCORE_F QuartzCore)      find_library(QUICKTIME_F QuickTime)      find_library(OPENGL_F OpenGL)      find_library(QTKIT_F QTKit)      So far I've found:               OpenGL       => freeglut3 ?     Cocoa        => GLFW ?      Any suggestions for the other dependencies?


title: I cant save files in /var/www/html

text: I'm running Centos 6.5 and I'm having problems saving my files to `/var/www/html`. The folder currently belongs to `root` and I have gone through everything from SELinux to configuration procedures, but I hardly understand those procedures. I believe the permission restriction is also preventing me from viewing my local web pages in the web browser. I want to be able to move files to and from the `/var/www/html` folder without restrictions.


title: Dunst notifier on CentOS

text: I need a notifier such that:   1. It is possible to send messages from one machine to another without any password (like in case of notify-send). Correct me if I'm wrong.   2. It is such that only when a user clicks on cross button that it closes. I found Dunst while searching. it needs basic packages.               dbus     libxinerama     libxft     libxss     libxdg-basedir      out of which, I'm not able to get `libxdg-basedir` installed on my system. I tried searching for it, but there aren't any packages available for CentOS. Question: is it possible to compile and install Dunst (or a notifier) on CentOS? If so how?


title: Ping command results in packet loss

text: Whenever I `ping` on my personal computer, nothing gets displayed other than a single statement. Upon stopping execution, I see that several packets were transmitted in the statistics. On top of all this, I'm getting a rather absurd packet loss. What can I do to make `ping` react in a sane manner? I am running **Centos 6.5 64bit**. Below is an example output when I try `ping google.com`:               [root@Virus os]# ping google.com     PING google.com (74.125.230.160) 56(84) bytes of data.     ^C     --- google.com ping statistics ---     5 packets transmitted, 0 received, 100% packet loss, time 4274ms      `ifconfig -a`:               [root@Virus os]# ifconfig -a     eth0      Link encap:Ethernet  HWaddr B4:B5:2F:29:FE:D7                 UP BROADCAST MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)          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:108 errors:0 dropped:0 overruns:0 frame:0               TX packets:108 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:9081 (8.8 KiB)  TX bytes:9081 (8.8 KiB)          wlan0     Link encap:Ethernet  HWaddr 84:4B:F5:14:9B:58                 inet addr:172.20.40.55  Bcast:172.20.255.255  Mask:255.255.0.0               inet6 addr: fe80::864b:f5ff:fe14:9b58/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:56944 errors:0 dropped:0 overruns:0 frame:0               TX packets:40200 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:55308863 (52.7 MiB)  TX bytes:6291284 (5.9 MiB)      `iptables -L`:               [root@Virus www]# iptables -L     Chain INPUT (policy ACCEPT)     target     prot opt source               destination              ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED      ACCEPT     icmp --  anywhere             anywhere                 ACCEPT     all  --  anywhere             anywhere                 ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh      REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited           Chain FORWARD (policy ACCEPT)     target     prot opt source               destination              REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited           Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination       `netstat -nr`:               [root@Virus www]# netstat -nr     Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     172.20.0.0      0.0.0.0         255.255.0.0     U         0 0          0 wlan0     0.0.0.0         172.20.4.254    0.0.0.0         UG        0 0          0 wlan0


title: Running minix3 in virtual box

text: My host OS is Ubuntu 12.04 32-bit.I want to run Minix 3 in the virtual box from live CD. I followed their instructions to install it, and faced the following error: > Warning:1 module failed to load. What should I do? ![image of minix3 installation problem](http://i.stack.imgur.com/bz4Rp.png)


title: Expand variable in function definition in zsh

text: I want to generate a set of functions in my shell in a `for` loop, but I can't see how to access a variable inside the function body of the function I'm creating. In essence, I would like the following               for f in foo ; do $f() { echo $f } ; done      to generate a function `foo() { echo foo }`, but instead I get `foo() { echo $f }`. I've read the section on parameter expansion flags in the zsh manual, but whatever I write after `$f()` seems to be put verbatim into the generated function's body, so I had no luck. Maybe this is the wrong way to do this? If not I want to know how I can expand `$f` inside the function when it's generated.


title: Permissions for installing programs on Linux

text: I'm running Linux Mint 16. When trying to install programs in the `usr/local` directory, instead of doing `sudo ./install` for the program, I've been creating the directory, the program wishes to install into, manually in the `usr/local` directory and changing the permissions of this directory, then after it has installed, I change the permissions back to default. I've been doing this so as not to give root access to the program I'm installing for security reasons. Is this really silly and/or damaging or does it matter?


title: Disable headphone jack detection in pulseaudio

text: I have a dodgy headphone port on my laptop that does not reliably detect when headphones/external speakers are plugged in. This means that the output is constantly being muted/unmuted which is rather annoying How can I configure pulseaudio to disable the jack detection (or alternatively just force output through this jack)? I assume it'll involve editing analog-output-headphones.conf however I can't figure out how to do so (analog-output.conf.common is of no help).


title: I can't use the command ftp

text: When I try to install ftp               [root@localhost bin]# yum install ftp     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile     Setting up Install Process     No package ftp available.     Error: Nothing to do      When I try to connect to my ftp               [root@localhost bin]# ftp 10.2.4.202     -bash: ftp: command not found      with yum               [root@localhost bin]# yum ftp 10.2.4.202     Loaded plugins: fastestmirror     No such command: ftp. Please use /usr/bin/yum --help      yum search ftp               yum search ftp     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile     ====================================================================== N/S Matched: ftp ======================================================================     curl.x86_64 : A utility for getting files from remote servers (FTP, HTTP, and others)     wget.x86_64 : A utility for retrieving files using the HTTP or FTP protocols            Name and summary matches only, use "search all" for everything.      yum install lftp, list *ftp*, install ncftp (same results)                yum install lftp     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile     Setting up Install Process     No package lftp available.     Error: Nothing to do      lftp               # lftp 10.2.4.202     -bash: lftp: command not found      yum repolist               yum repolist     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile     repo id                                                           repo name                                                                            status     CactiEZ                                                           CactiUsers Cactiez Repo                                                               30     pgdg93                                                            PostgreSQL 9.3 6 - x86_64                                                            195     repolist: 225


title: Fedora 19: can't disable the firewall

text: I've installed a server (WSO2 ESB) in my laptop. When I run it, going to the browser and typing the console address `https://10.13.6.75:9443/carbon`, it works normally, but if I try it on another machine on the network, it gives timeout. Some observations:   * ping works   * telnet respond on ssh port (22) but not in 23, 8080, 9443, etc   * I've already executed `service firewalld stop`, `service iptables stop`, and disabled the `selinux`, but no results. There's another process involved blocking the requests?


title: Specifying height for vertical splits in vim

text: Usually I am editing two files, A and B, split horizontally. I set it up, so that one buffer would only occupy the first 2 lines at the top of the screen, and the rest is for the other buffer. Sometimes I need to edit a third file, C, which is to have half the screen realestate of the big buffer, split vertically. The following roughly shows what I would like to end up with.               ------------------------------------------------------------------------------     | First  line of file A                                                      |     | Second line of file A                                                      |     ------------------------------------------------------------------------------     | First  line of file C               | First  line of file B                |     | Second line of file C               | Second line of file B                |     |        ...                          |       ...                            |     | Last   line of file C               | Last   line of file B                |     ------------------------------------------------------------------------------      The problem is, that when I do `:vsplit C` to split half of the big buffer off for the new file, vim also resizes the buffer showing file A to eat up half the screen and files B and C each get a quater screen. How do I tell vim to not care about horizontal resizing when doing vertical splits? **EDIT** To be more explicit: I am looking to specify the resulting height of a buffer, when doing a vertical split. The `vsplit` command accepts only width as a parameter, not height. I can resize windows after opening the new file, but that is rather tedious. The problem becomes more difficult with more open files. I could just stick to editing one file at a time, but I think vim is more powerful than that.


title: iproute command: ip -6 rule show nothing even with kernel option IPV6_MULTIPLE_TABLES=y

text: I want to enable my linux 3.2.4 to have ipv6 multi-routing table functionality. I enable IPV6_MULTIPLE_TABLES when make menuconfig and rebuild kernel.(Also with ip advanced routing and ip multi table) I use `ip -6 rule`, it still didn't show local and main tables, that is ipv6 multi table didn't work. Did Anyone have encounter the same problems?


title: Kill any service running at a specific port

text: I am trying to write a script that kills service running at a specific port. This is my script:               a=$(ps ax | grep 4990 | grep java | awk '{print $1}')     kill -9 $a      It's a java program. This script works sometimes, but mysteriously fails most of the time. Is there any other way to kill a service running on a port? My port is `4990`.


title: Fluxbox: how to map a key for taking screenshot of selected area?

text: I want to map the `Ctrl+Alt+4` to take a screenshot of a selected area. Right now I can do that from a terminal using `gnome-screenshot -a`. I have tried putting:               Control Mod1 4 :ExecCommand gnome-screenshot -a`       in my `~/.fluxbox/keys` but that does not work -- probably because of the space before `-a`. Is there a way to map those key combination to take a screenshot of a selected area?


title: Where to place source code for applications compiled from source?

text: In the past when I have compiled applications from source I have extracted the source code to `~/src` and compiled from there. I realize now that there may be no need for me to create the `~/src` directory, as Linux probably already has an established location for source code for applications such as this. Is this the case? What is the directory in Linux that is established as the place for source code from third party applications that I want to compile?


title: Installation of QEMU, GCC for ARM in RHEL

text: We are setting up a lab which has the QEMU system to emulate an ARM processor and run assembly programs. The lab is currently setup with the host operating system as Ubuntu. We are migrating the lab to RHEL environment. We are going to use RHEL 5.6 version OS. These are the set of software that needs to be installed to make the lab up and running.   * QEMU Emulator - It was fairly straight-forward. I used the command **yum install qemu** and **yum install qemu-kvm** for the virtualization.    * GCC for ARM - I am actually stuck in this process. I downloaded the gcc arm from this link. I used the command, **tar xjvf gcc-arm-none-eabi-4_7-2013q1-20130313-linux.tar.bz2** to extract the file and install it. However, after installation if I run the command, **arm-none-eabi-gcc --version** it is not giving me the version but an error saying command not found.    * GDB communicating with the QEMU/ARM program being executed.  What am doing wrong in the installation process? EDIT: The contents of the tar ball after extraction are as below. There are 5 folders named,   * arm-none-eabi   * bin   * gcc- arm-none-eabi-4_7-2013q2   * lib   * share


title: Reasonable literature on network printing (protocols)

text: I need some recommendations on reasonable and up-to-date literature about network printing, the corresponding protocols (ipp, lpdp, ...), printjob authentication and accounting in heterogenous networks.


title: Pidgin replace my symlinks

text: If I move the settins.xml (or any other file) from the `.purple` folder into another place and create a symlink to this file instead, it gets replaced by regular files after a restart of pidgin. I want to put some configuration files into a git repository and put symlinks to it. That worked on all other programs but pidgin seems to delete the symlinks.               cd .purple     mv settins.xml ../     ln -s ../settings.xml          ls -l settings.xml     settings.xml -> ../settings.xml      restart pidgin               ls -l settings.xml     settings.xml      Why is that happening and what can I do to prevent this behaviour?


title: In bash, how can I echo the variable name, not the variable value?

text: Suppose that I have a variable `var` in bash. I can assign a value to it. For example, I will make it a string:               var="Test"      I want to `echo` the name of `var`, not the value held by `var`. (I can do the latter with `echo $var`, but I actually want to do the former.) The answer to this question from SO says to use `echo ${!var}`, but when I do that I echo just returns a blank line. For example, this bash script               #!/bin/bash          echo "Hi"     var="Test"     echo ${!var}     echo "Bye"      returns this output:               Hi          Bye      with just a blank line between **Hi** and **Bye** , instead of **var**. What am I doing wrong? I'm running **bash 4.1.5(1)** on **Ubuntu 10.04.4**.


title: Wildcards inside quotes

text: This will be an easy one, but in my memories, when shell scripting, using double quotes would allow expanding globbing and variables. But in the following code:               #!/bin/sh          echo *.sh     echo "*.sh"     echo '*.sh'          echo $LANG     echo "$LANG"     echo '$LANG'      I get this result:               bob.sh redeployJboss.sh     *.sh     *.sh     en_US.utf8     en_US.utf8     $LANG      So single quoting prevent glob AND variable expansion but double quoting allows only variable expansion and no globbing? Can I glob in any quoting pattern?


title: Grep log and get text between log delimiters

text: Is there a way to `grep` a log and find text between the log entry delimeters? Our log file separates the line entry with characters "`-------`" So when I search the text word I want all the lines before and after the delimeters in the log. Sample log               ------------------------------------------------------------------------              r132279 | USERID | 2014-04-30 12:59:09 -0700 (Wed, 30 Apr 2014) | 3 lines         Removed unused "Calculated Fields" column entry.         Jira ID: JIRA-977          ------------------------------------------------------------------------      In the above i would Grep the word Fields but want all the lines between the "`----`" lines


title: Missing Messages and Secure logs files on CentOS

text: I'm having troubles with CentOS release 6.4 (Final). I'm looking for log files in `/var/log/` and I'm obviously missing two files:   * `/var/logs/messages`   * `/var/log/secure` I was checking if rsyslog is running (`service rsyslog status`) and it's _OK_. My rsyslog config file is called `/etc/rsyslog.conf`, folder `/etc/rsysconf.d/` is empty. Can anyone shed some light on what's going on?


title: How to return from root log-in to my user log-in?

text: I'm using SuSE Linux Enterprise and I know that there is a command               su root      for changing to root log-in. But what about the other way around? If I prefer to return to my user account, how to do it?


title: How can I delete a file with no name

text: I somehow managed to create a file that doesn't seem to have a filename. I found some information regarding how to get more details of the file in the following thread. However, I tried some of the suggestions listed and can't seem to delete the file. I'm not sure what I did to create it, but it happened while trying to copy an xml file. Any ideas are appreciated. Some info on the file is as follows;               > ls -lb     total 296     -rw-r--r--   1 voyager  endeavor  137627 Jan 12 12:49 \177          > file *     :               XML document          > ls -i      417777         I tried to find using the inum switch and then pipe that to rm as that seemed like the most foolproof way of getting rid of it. However, the example given at the bottom of the thread linked below failed for me. Example was;               > find -inum 41777 -exec ls -al {} \;     find: illegal option -- i     find: [-H | -L] path-list predicate-list      so I tried using the path list first like the following, but that didn't work either;               > find . -inum 41777 -exec ls -al {} \;      Any help on how to remove this file is appreciated. I'm not sure what the non- printable character \177 is or how I can pass that to an rm command, but I really want to make sure I don't mess up any other files/directories in my attempt to delete this file. Thanks.


title: How to recursively synchronize file timestamps across servers?

text: Suppose I run an rsync command to mirror a server, but forget to supply the -t option. The mirror will now have different timestamps to the original. What is the easiest way to fix this, without transferring all the files all over again?


title: How to set parameter i486 on glibc compiling process of x86_64 system?

text: My host:                 lfs@sam:/mnt/lfs/sources/glibc-build$ uname -m       x86_64       lfs@sam:/mnt/lfs/sources/glibc-build$       In lfs(LFS-BOOK-6.8-HTML/chapter05/glibc.html) It says                 case `uname -m` in         i?86) echo "CFLAGS += -march=i486 -mtune=native" > configparms ;;       esac      What I should change on 'i?86'? And should I change 'i486'? Thank you~


title: Resolve filename from a remote URL without downloading a file

text: I am creating a script, which should download latest version of an application from repository and deploy the app. The main issue: there are several repositories and I need to check, which of them has most recent version. E.g.               http://repo1/xyz/LATEST -> (redirects to) -> http://repo1/xyz/app-1.0.0.0.zip     http://repo2/xyz/LATEST -> (redirects to) -> http://repo1/xyz/app-1.1.0.0.zip      So I need to iterate over available repositories and get only a filename - no need to download obsolette versions of software.


title: How to find out that someone is using a Keylogger on the machine I am using?

text: HW/SW/whatever keyloggers are there. How to find out? E.x.: Regularly check the cable of the keyboard, because there could be HW keyloggers: http://i.imgur.com/TeMwo.jpg But what about other HW keyloggers, or Software keyloggers? [Using a Linux, e.x.: Fedora or Ubuntu for OS!] - How to track keylogger softwares/solutions? What are the "best-practises?


title: Uppercase input turns on periodically

text: I have some problem. Every 3-5 second everything, that I input from keyboard became **UPPERCASE** only. I also have two keyboard layouts: **us** and **ua**. And when uppercase happens - I can't switch my keyboard layout (I use mod4 for switching). This is my xmodmap output:               $ xmodmap     xmodmap:  up to 3 keys per modifier, (keycodes in parentheses):          shift       Shift_L (0x32),  Shift_R (0x3e)     lock        Caps_Lock (0x42)     control     Control_L (0x25),  Control_R (0x69)     mod1        Alt_L (0x40),  Meta_L (0xcd)     mod2        Num_Lock (0x4d)     mod3           mod4        Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)     mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)      I tried `xmodmap -e "clear lock"`, but uppercase input still periodically turns on. I tried to disable Caps Lock key in "hardware way", putting insulator between keyboard contacts. But I doesn't help. _== Update ==_ For **A#1**   Look, there is sticky Caps_Lock:               KeyPress event, serial 40, synthetic NO, window 0x2a00001,         root 0xaa, subw 0x0, time 30893676, (-254,229), root:(384,359),         state 0x2, keycode 39 (keysym 0x53, S), same_screen YES,         XLookupString gives 1 bytes: (53) "S"         XmbLookupString gives 1 bytes: (53) "S"         XFilterEvent returns: False      What I'm doing? **First** , I run `florence` (Virtual Keyoards) and turn off Caps_Lock key. **Second** , I type: `xmodmap -e "clear lock"`. But it is very dirty hack :), you know. It works for few minutes or few hours.


title: Current pending sector count error

text: Recently my hard disk show some error message in _SMART_ utility, I have taken a screenshot from error messages. That's something like : _Current pending sector count error_ && _Relocated sector count_ . Can someone explain me how to fix such Bad Sector and Errors ? ![enter image description here](http://i.stack.imgur.com/nYiwC.png) ![enter image description here](http://i.stack.imgur.com/uLGYl.png) notice : Sometimes system hangout and syslog show " _Kernel:Journal commit I/O error_ "


title: Mutt multi content type

text: Good afternoon I want to send multiple content_type with mutt. Can I do that? Here is my code :               mutt -e "set content_type=text/html" -e "set content_type=text/plain" someone@mail.com -s "Multi content_type" < body.html body.txt      I mean, I have 2 version of email body, body.html and body.txt What I want is, send both of them in same time but when someone read it, it only read one of each version. If his/her email client doesn't support html, he/she read text version instead of html version.


title: How to pass the output of a script to a command like ls without the output being split?

text: Suppose I have a script like this:               #!/bin/bash     printf '%q\n' "b c"      Executing the script prints:               b\ c      on the commandline. Now, being in a directory which contains a file named `b c` I want to pass the output of my script to a command like `ls`:               $ ls $(./myscript)      The problem here is that `b c` is split to `b\` and `c`, i.e. two arguments, and `ls` of course cannot find them. Is there some way to circumvent this? I thought escaping the space in the output would be enough.


title: How can I load the right hand pane of vim with a new file in linux?

text: I want to compare two files(say `A` and `B`) side by side(vertically) in in Vim. I open one of those two files(say A) and as per this answer in this site issue a `Ctrl+w v` . Now both the panels are showing contents of file `A`. How can I see the contents of A in the left had side and B in the right hand side ? I am using Red Hat Linux if that matters .


title: How to write in directory out of home?

text: I have my Apache server running in the `/srv/http/` directory. I changed the group of it to `httpadmin` and then added my user to that group. Then, I changed the permissions of that directory to `rwxrwxr-x`, which means everyone in the group `httpadmin` should be able to write in that directory, right? Yet, I can't create files in it. What am I missing?


title: Data extraction of entire DB on SCO Openserver 6

text: Firstly apologies if this question seems like a wall of text, I can't think of a way to format it. I have a machine with valuable data on (circa 1995), the machine is running UNIX (SCO OpenServer 6) with an unknown database stored on it. The data is normally accessed via a software package of which the license has expired and the developers are no longer trading. The software package connects to the machine via telnet to retrieve data and modify data (the telnet connection no longer functions due to the license being changed). I can access the machine via an ODBC driver (SeaODBC.dll) over a network, this was how I was planning to extract the data but so far I have retrieved 300,000 rows in just over 24 hours, in total I estimate there will be around 50,000,000 rows total so at current speed it will take 6 months! I've played around with the UNIX interface and the only large files I can find are in a massive matrix of single character folder (eg A>G>data, A>H>data ect). I need either a quicker way to extract the data from the machine via ODBC or a way to extract the entire DB locally on the machine to an external drive/network drive or other external source. Does anyone know how to find out the installed DB systems on the machine? Hopefully it is a standard and I'll be able to find a way to export everything into a nicely formatted file!


title: Debian - enable broadcom wireless controller

text: Ok, this is driving me crazy. I'm setting up an old Dell Precision M60 notebook, and I can't manage to enable support for its wireless device on debian squeeze. What I tried:               lspci | grep -i wireless         02:03.0 Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 02)      nice. I found this page on debianwiki: bcm43xx. First of all, let's check if the device is really supported.               lspci -vnn -d 14e4:         02:03.0 Network controller [0280]: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller [14e4:4320] (rev 02)             Subsystem: Dell TrueMobile 1300 WLAN Mini-PCI Card [1028:0001]             Flags: bus master, fast devsel, latency 32, IRQ 5             Memory at fafec000 (32-bit, non-prefetchable) [size=8K]             Capabilities: <access denied>             Kernel driver in use: b43-pci-bridge      so it's [14e4:4320] (rev 02). And yes, it's supported. Back to the debianwiki page " For 802.11b-only devices (BCM4301) or **802.11b/g devices with the BCM4306 revision 2 chipset, install firmware-b43legacy-installer** " let's try:               sudo aptitude install firmware-b43legacy-installer       ..                firmware-b43legacy-installer     E: Sub-process /usr/bin/dpkg returned an error code (1)     A package failed to install.  Trying to recover:     Setting up firmware-b43legacy-installer (4.178.10.4-4) ...     Not supported card here (PCI id 14e4:165     14e4:4320)!     Use b43 firmware. This is just for the b43legacy driver.     Aborting.     dpkg: error processing firmware-b43legacy-installer (--configure):      subprocess installed post-installation script returned error exit status 1     Errors were encountered while processing:      firmware-b43legacy-installer     Setting up firmware-b43legacy-installer (4.178.10.4-4) ...     Not supported card here (PCI id 14e4:165     14e4:4320)!     Use b43 firmware. This is just for the b43legacy driver.     Aborting.     dpkg: error processing firmware-b43legacy-installer (--configure):      subprocess installed post-installation script returned error exit status 1     configured to not write apport reports                                           Errors were encountered while processing:      firmware-b43legacy-installer     E: Sub-process /usr/bin/dpkg returned an error code (1)     A package failed to install.  Trying to recover:     Setting up firmware-b43legacy-installer (4.178.10.4-4) ...     Not supported card here (PCI id 14e4:165     14e4:4320)!     Use b43 firmware. This is just for the b43legacy driver.     Aborting.     dpkg: error processing firmware-b43legacy-installer (--configure):      subprocess installed post-installation script returned error exit status 1     Errors were encountered while processing:      firmware-b43legacy-installer      What? Let's try with the firmware-b43-installer               aptitude install firmware-b43-installer      It works. But:               sudo iwconfig              wlan0 IEEE 802.11bg  ESSID:off/any                 Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm                  Retry  long limit:7   RTS thr:off   Fragment thr:off               Encryption key:off               Power Management:off          sudo ifconfig wlan0 up         SIOCSIFFLAGS: No such file or directory      Again? I googled the error and it is related to the firmware, but i Installed it! I already checked in `lib/firmware`, there's a b43 folder with the .fw files Any idea?


title: Reinstall versions of software not found in repositories

text: I recently installed the utouch-daily PPA, and it's given me some problems. How can I revert to the packages available in the default repository? I've removed the repository from `/etc/apt/sources.list.d`, now how can I revert to the ones now available from the other normal repositories available on my system?


title: Connecting to localhost via system IP address

text: I am using Linux Mint 15, and I am running a Ruby web server(Thin) on port 3000. I can connect from my machine via `localhost:3000`, but the moment I type in the system IP address (eg. `http://192.168.43.250:3000`) (that I get from `ifconfig`), then I get a 'Webpage not available' message. I would like to connect to my web server via a tablet over a wi-fi connection for testing purposes so I need to be able to connect via the system IP address. What am I missing here?


title: Will I have to wipe my disk if I install linux?

text: It might be dumb question, but I want to experience Linux standalone and want to replace my windows 7 with it. My question is: Will I have to wipe my whole data If I install Linux on my notebook replacing windows?


title: Note taking app that can sync both android and Linux

text: I've been looking high and low for an Evernote alternative for Linux. I know I can use Everpad or Evernote in WINE but they don't work natively. Any note-taking app would be fine as long as it can sync my android and my linux.


title: debian X Xconf resolution xrandr badmatch

text: Recently I minimal installed debian squeeze(amd64), when I configs my resolution, unexpected errors came out, I did a lot of searching, but couldn't find a way to figure it out.   1. to install the desktop environment: `apt-get update`, `apt-get install xorg-core xserver-xorg-core gnome-core gdm3`   2. to install graphic grivers `apt-get install build-essential nvidia-kernel-common linux-headers-$(uname -r)`, `./NVIDIA-Linux-x86_64-304.64.run` steps above seems all things is in the correctly way.   1. to set resolution : `cvt 1440 900`, `xrandr --newmode xxx`, `xrandr --addmode VGA-0 xxx` then I got that error: > X Error of failed request: BadMatch (invalid parameter attributes) Major > opcode of failed request: 153 (RANDR). Minor opcode of failed request: 18 > (RRAddOutputMode). Serial number of failed request: 29. Current serial > number in output stream: 30. I don't know what information U need, and just list some graphic card: nvidia gt630. monitor: phlips 190cw(1440x900, works well on windows) `xrandr` out put               Screen 0: minimum 8 x 8, current 1280 x 1024, maximum 16384 x 16384     DVI-I-0 disconnected (normal left inverted right x axis y axis)     VGA-0 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 338mm x 270mm        1280x1024      60.0*+   75.0          1024x768       75.0     70.1     60.0          800x600        75.0     72.2     60.3     56.2          640x480        75.0     72.8     59.9       DVI-I-1 disconnected (normal left inverted right x axis y axis)     HDMI-0 disconnected (normal left inverted right x axis y axis)       1440x900_60.00 (0x29f)  106.5MHz             h: width  1440 start 1528 end 1672 total 1904 skew    0 clock   55.9KHz             v: height  900 start  903 end  909 total  934           clock   59.9Hz      `lshw -c video` out put               *-display                       description: VGA compatible controller        product: nVidia Corporation        vendor: nVidia Corporation        physical id: 0        bus info: pci@0000:05:00.0        version: a1        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress vga_controller bus_master cap_list rom        configuration: driver=nvidia latency=0        resources: irq:16 memory:f6000000-f6ffffff memory:e0000000-efffffff(prefetchable) memory:f0000000-f1ffffff(prefetchable) ioport:d000(size=128) memory:f7000000-f707ffff(prefetchable)      xorg.conf               Section "ServerLayout"         Identifier     "Layout0"         Screen      0  "Screen0"         InputDevice    "Keyboard0" "CoreKeyboard"         InputDevice    "Mouse0" "CorePointer"     EndSection          Section "Files"     EndSection          Section "InputDevice"         # generated from default         Identifier     "Mouse0"         Driver         "mouse"         Option         "Protocol" "auto"         Option         "Device" "/dev/psaux"         Option         "Emulate3Buttons" "no"         Option         "ZAxisMapping" "4 5"     EndSection          Section "InputDevice"         # generated from default         Identifier     "Keyboard0"         Driver         "kbd"     EndSection          Section "Monitor"         Identifier     "Monitor0"         VendorName     "Unknown"         ModelName      "Unknown"         HorizSync       30.0 - 83.0         VertRefresh     55.0 - 75.0         Option         "DPMS"     EndSection          Section "Device"         Identifier     "Device0"         Driver         "nvidia"         VendorName     "NVIDIA Corporation"     EndSection          Section "Screen"         Identifier     "Screen0"         Device         "Device0"         Monitor        "Monitor0"         DefaultDepth    24         SubSection     "Display"             Depth       24         EndSubSection     EndSection      * * * **update** : I trid to get edid: `apt-get install read-edid`, `sudo get-edid | parse-edid` but got this error:               get-edid: get-edid version 2.0.0              Performing real mode VBE call         Interrupt 0x10 ax=0x4f00 bx=0x0 cx=0x0         Function supported         Call successful              VBE version 300         VBE string at 0x11100 "NVIDIA"          VBE/DDC service about to be called         Report DDC capabilities              Performing real mode VBE call         Interrupt 0x10 ax=0x4f15 bx=0x0 cx=0x0         Function supported         Call successful              Monitor and video card combination does not support DDC1 transfers         Monitor and video card combination does not support DDC2 transfers         0 seconds per 128 byte EDID block transfer         Screen is not blanked during DDC transfer          Reading next EDID block          VBE/DDC service about to be called         Read EDID              Performing real mode VBE call         Interrupt 0x10 ax=0x4f15 bx=0x1 cx=0x0         Function supported         Call failed          The EDID data should not be trusted as the VBE call failed     Error: output block unchanged      * * * **update** I tried to force the resolution to 1440x900 by using `nvidia-settings`, after reboot, resolution changed to 1440X1024(nvidia-settings added a line to xorg.conf `Option "metamodes" "1440x1024 +0+0"`). screen become horizon- scrollable like that: ![enter image description here](http://i.stack.imgur.com/AWe06.png) I also tried to extract `edid.bin`(by using nvidia-settings) and add `Option "CustomEDID" "DFP-1:/etc/X11/edid.bin"` at `Section "Device"` to xorg.conf. thanks to the awesome post `Fixing Ugly DVI/HDMI Displays due to EDID bugs on nVidia drivers`, but unfortunately it doesn't work either. Any help is greatly appreciated. Thank you


title: fail2ban log parsing too slow on Raspberry Pi - options?

text: I'm running fail2ban on a Raspberry Pi at 950MHz which I cannot overclock further. The Pi is occasionally subject to SYN floods on particular ports. I've set up iptables to throttle the rate of SYNs on the port of interest; when the throttle limits are exceeded, hosts which send SYNs are dropped into the REJECT chain and the particular SYN packet which exceeded the limit is logged. fail2ban then watches for these logged SYNs and, after seeing a few, temporarily bans the host for a short time (this is a transient issue in the app I'm working with). The problem is that the SYN floods can occasionally reach rates which are too fast for fail2ban to keep up with; I'll see 20-40 log messages per second, and eventually fail2ban falls behind and becomes ineffective. To add insult to injury, it continues consuming a LOT of CPU as it tries to catch up. I have verified that DROP chained packets from hosts already banned by fail2ban are _not_ logged, and thus do not add to its load. What are my options here? I have a few ideas, but no clear path forward.   1. Could I make the log-parse regex "easier" so it takes fewer cycles? Would using iptables --log-prefix to put a token near the start of the log message, and/or otherwise simplifying/altering the fail2ban regex help? Here is the current fail2ban config line containing a regex:   `failregex = kernel:.*?SRC=(?:::f{4,6}:)?(?P<host>[\w\-.^_]+) DST.*?SYN`   2. Is there a faster way for fail2ban to watch for the packets exceeding the limits than parsing kern.log?   3. Could fail2ban be run under PyPy instead of CPython with minimal nonstandard wizardry (the OS is Raspbian 7, so, mostly Debian 7)?   4. Is there something better than fail2ban that I could use to watch for the packets which exceed the SYN limits, and after N exceeds in X seconds, temporarily put the offending IP into the iptables DROP bucket, and take it out when the ban timer expires? Again, I'd vastly prefer a solution that uses as much software available in Debian as possible, though I can build Debian packages in a pinch.


title: Setting group permission on directory

text: I'm looking for the best way to give a group permission to view any files in /var/log, but only using cat or tail. My best guess right now is that I need to use ACL's:                setfacl -mR default:g:group:4 /var/log      Not sure how to limit them only to using cat or tail. Thanks for any suggestions.


title: Why VNC not showing actual Remote Desktop

text: Ok i installed vnc server on RHEL 5.9 and also installed Tightvnc viewer on windows 7 and from RHEL i started vncserver and assigned the password using vncpasswd. Then from tightvnc viewer i gave the IP and listening port xxx.xxx.xxx.xxx:1. It successfully connected with VNC server installed and running on RHEL. And then I gave the password and then BOOOM it gave me this hideous interface ![enter image description here](http://i.stack.imgur.com/TgSeX.png) When Actual Desktop is like this ![enter image description here](http://i.stack.imgur.com/b6Z1v.png) Ok people tell me what Im missing


title: Why setuid does not work on executable?

text: I know that enabling setuid on scripts has security issues and so is inactive by default, but expect that it works for executables. I created and executable which shows uid as an output following instructions described in this post: Allow setuid on shell scripts But it returns same uid (1000) both before and after running`sudo chmod +s ./setuid-test`. I think this means that setuid does not have any effects on my executable, why and how to solve? The source code:               #include <stdio.h>     #include <unistd.h>     int main(int argc, char** argv) {         printf("%d", geteuid());         return 0;     }      Built and run with               $ gcc -o setuid-test setuid-test.c     $ ./setuid-test     1000     $ sudo chown nobody ./setuid-test; sudo chmod +s ./setuid-test     $ ./setuid-test     1000      When running `ls -la`, this is what I get:               me@me:~$ ls -la setuid-test     -rwsrwsr-x 1 nobody me 8572 Aug 19 16:39 setuid-test


title: Rebuilding sendmail on FreeBSD application server after adding new activedirectory domain controller to network

text: In the process of adding a new ActiveDirectory domain controller to our network, we decided to rename the domain from "domain.local" to "domain.priv." I scoured all parts of our application server for instances of "domain.local," replacing them with "domain.priv." I did change hostname and change the content of files in `/etc/mail` which had "domain.local" in them. I also navigated to `/etc/mail` and rebuilt sendmail using `make`. New files with our new domain were generated, which was promising. I then restarted sendmail and sent test emails, but none are being successfully sent. Pertinent entry from `/var/log/maillog`: `Authentication-Warning: server_name.domain.priv: deploy set sender to user@company.com using -f` Which other places on the server could contain the old domain name? What should I configure/reconfigure to ready this application server for the domain name change? At this point I'm not sure if it's sendmail, a DNS issue or simply the contents of some file on the application server Thanks and cheers!


title: What is needed for a minimal systemd boot to launch getty on a virtual console?

text: For SysV `init`, I need `/etc/inittab` respawning getty entries, the `/sbin/init` binary, the binaries and shared libraries for the shell, `login`, the `getty`, the PAM/security/shadow stuff, and a few device files. For `upstart` I need pretty much the same requirements, but instead of `/etc/inittab`, I have a few `*.conf` files under `/etc/init`: one *.conf that `start on startup` that sets a runlevel with `telinit`, and one *.conf for each tty that start/respawn `getty` on that tty on the appropriate runlevels. What configuration and binaries do I need for `systemd` `init`? The documentation I find all seems to be focused on how to use an already- installed system to start and stop services. A minimal list of files to copy (except the kernel/initrd) from a running _Arch_ or _fedora_ installation would do fine, but I cannot seem to find that kind of information about `systemd`. * * * What I would like to know is, for `systemd`, what files are required, and what must they contain, to start a login shell after an initramfs does it's `switch_root` call to the `systemd` `/sbin/init`. * * * Example for `upstart`, the binaries and two `*.conf` files: File `/etc/init/whatever.conf`:               start on startup     emits runlevel     task     script       telinit 2     end script      File `/etc/init/tty1.conf`:               start on runlevel [12345]     respawn     exec /sbin/agetty -8 --noclear 38400 tty1 linux      * * * Example for `sysvinit`, the binaries and 1 conf file named `/etc/inittab`:               id:2:initdefault:     c1:12345:respawn:/sbin/agetty 38400 tty1 linux      * * * Now I'm after the `systemd` equivalent. I assume at least 1 `*.service` file is needed somewhere, with a `[Service]` entry containing `ExecStart=-/sbin/agetty --noclear %I linux` and `Restart=always`, but what else is needed?


title: Install new most recent python package in ubuntu?

text: I could really do with installing matplotlib 1.1.0 on my ubunutu 11.10 system. The current ubuntu package is at 1.0.1, how do I use the new one?


title: In Debian based systems, how do we purge configuration files of packages that have already been uninstalled?

text: To be more specific, I would like to do the equivalent of adding the `--purge` flag to the following command               sudo apt-get autoremove --purge [package name]      to packages that are no longer on the system. Preferably, I would like to know how to do it to specific packages and to every uninstalled package in the system.


title: bash_completion rule for resolving ip into hostnames

text: I am trying to create a `bash_completion` rule for my script `rmpxe`. This script takes `<hostname>` as its only argument. It then resolves this hostname into `<ip_address>` and removes the corresponding symlink `/srv/tftp/pxelinux.cfg/<ip_address>`. The ip address `<ip_address>` in the symlink `/srv/tftp/pxelinux.cfg/<ip_address>` is in hex format, but I have written a simple program in C (`getnameinfo`) which resolves this hex ip address into hostname. Thus, I can use my program `getnameinfo` to get hostname from hex ip:               $ getnameinfo 0A6F010B     server1.mydomain.com      So for example, following command would delete the symlink `/srv/tftp/pxelinux.cfg/0A6F010B`                $ rmpxe server1.mydomain.com      Now to my `bash_completion` problem: I have created following code which works fine, except that instead of completing hostnames (as my script expects) it completes hex IP addresses (i.e. the symlink files in my directory `/srv/tftp/pxelinux.cfg/`). I need to somehow integrate into this code, that before the argument is autocompleted, it will be first resolved into hostname.               _rmpxe()     {         local word         COMPREPLY=()              if [ 1 -eq "$COMP_CWORD" ]; then           pushd /srv/tftp/pxelinux.cfg &>/dev/null || return 1           word="${COMP_WORDS[COMP_CWORD]}"           COMPREPLY=($(compgen -f "$word"))           popd &>/dev/null         fi          }     complete -F _rmpxe rmpxe      In other words, at the moment my bash completion works like this:               $ ls /srv/tftp/pxelinux.cfg     0A6F010B 0A6F010C 0A6F010D 0A6F010E          $ rmpxe <tab>     0A6F010B 0A6F010C 0A6F010D 0A6F010E      whereas, I need it to work like this:               $ rmpxe <tab>     server1.mydomain.com server2.mydomain.com server3.mydomain.com


title: How to find responsible script with ausearch results?

text: So I wanted to know which process is creating a directory ']' in my root. I was assuming this is some typo in some script. So I set up an audit for that directory, very similarly as shown on This question. The next day I checked my logs and found out that the directory has been created again, and it has been logged by audit. But all I can tell from this output, is that _root_ created it. output:               type=SYSCALL msg=audit(26.04.2013 06:25:20.275:85) : arch=i386 syscall=mkdir success=yes exit=0 a0=bfd02ea5 a1=1ed a2=bfd02ea5 a3=bfd025b8 items=2 ppid=24114 pid=24115 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=4294967295 comm=mkdir exe=/bin/mkdir key=weird       Broken to lines :               type=SYSCALL      msg=audit(26.04.2013 06:25:20.275:85) :      arch=i386      syscall=mkdir      success=yes      exit=0 a0=bfd02ea5      a1=1ed a2=bfd02ea5 a3=bfd025b8      items=2 ppid=24114 pid=24115      auid=unset      uid=root      gid=root      euid=root      suid=root      fsuid=root      egid=root      sgid=root      fsgid=root      tty=(none)      ses=4294967295      comm=mkdir      exe=/bin/mkdir      key=weird       I would like to know which script issues this command as root. Is that possible? The process using that PPID is no longer running.


title: Is it possible to prevent files created being world-readable?

text: Assume a user uid=1000 and guids=1000,33,277 is allowed to create a file in the folder `/files/`. Is there any way I can prevent that the this user allows others to read the file (which are not at least in the groups 1000, 33 or 277)? Let the file created be `/files/user1000.file` then the question can be specific: Is there a way to prevent this outcome of `ls /files/user1000.file -al`               -rw-rw-r-- 1 1000 1000 6 May 15 17:21 user1000.file      and have this instead:               -rw-rw---- 1 1000 1000 6 May 15 17:21 user1000.file      Maybe using `umask`? I know that there are things like setgid `drw-rws---`, so I'm optimistic there might be a way. Yet I would imagine it is up to the user to decide to do a `chmod o+rw user1000.file`?


title: Linux Mint 12 two finger scrolling

text: i can't get two finger scrolling to work for anything on Linux mint 12 64bit.... hp dv7 laptop. the hardware definitely supports it as it works just fine on my windows partition. following the instructions here: http://robert.orzanna.de/2011/06/06/enable- two-finger-scroll-in-linux-mint-11-and-ubuntu-11-04/ i created a /usr/share/X11/xorg.conf.d/50-twofingerscroll.conf file and add the following information:               Section "InputClass"     Identifier "touchpad catchall"     MatchProduct "SynPS/2 Synaptics TouchPad"     MatchDevicePath "/dev/input/event*"     Option "VertTwoFingerScroll" "on"     Option "HorizTwoFingerScroll" "on"     Option "EmulateTwoFingerMinW" "8"     Option "EmulateTwoFingerMinZ" "40"     EndSection      based on this link: http://jaisejames.wordpress.com/2011/11/29/to-enable-touchpad-tap-on-click- two-finger-scroll-in-linux-for-laptop-users/ i also tried a slightly different conf file               Section "InputClass"           Identifier "touchpad catchall"           Driver "synaptics"           MatchIsTouchpad "on"           MatchDevicePath "/dev/input/event*"           Option "HorizScrollDelta" "0"           Option "TapButton1" "1"           Option "TapButton2" "2"           Option "RBCornerButton" "3"           Option "VertTwoFingerScroll" "1"     EndSection      i've also been to Settings > Mouse >Touchpad and enabled two-finger scrolling. this does nothing but kills all scrolling since edge-scrolling is no longer enabled. i've also installed gpointing device settings and tried enabling it that way per the instructions here: http://craiglayne.com/linux-mint-enable-two-finger- scrolling-multitouch/ and i still can't get two finger scrolling to work. this is driving me crazy, not to mention i still have about 2-3 other problems with mint while trying to make the switch away from windows. any further ideas? am i missing something obvious? let me know if you need any more information from me. **edit** : the following terminal commands DO finally enable two-finger scrolling. however, they are lost every time i reboot.               synclient VertTwoFingerScroll=1     synclient HorizTwoFingerScroll=1     synclient EmulateTwoFingerMinW=5     synclient EmulateTwoFingerMinZ=48      I found this xorg configuration that definitely works on my Samsung Series 7 for enabling the clickpad! https://gist.github.com/2382480


title: Linux Mint - Gnome Shell with dual monitor switch main screen

text: I have a Lenovo Thinkpad T420 with Linux Mint 12 and gnome-shell on it. Its a Intel HD 3000 Graphics card in there. When I'm at home, I have another Screen plugged in (19" 4:3) and everything works fine (Extended Desktop), except that I would like to have the Gnome 3 Bars + Shell on the right screen. Can't figure out how to do it. Thanks in advance


title: Losing smtp/pop3/imap access

text: I have a server running OS X. This server connects to another server, this other one CentOS 6.3, from times to times to collect mail messages over POP3/IMAP and also to send mails using SMTP (exim, on that server). After half a day working well, suddenly this OS X loses the ability to connect using IMAP/POP3/SMTP to the other server over the web but it can access the other server using HTTP/HTTPS/FTP and all other protocols. This OSX server is behind a router installed by the ISP, without a known brand (probably OEM from another company). When the problem happens, I reboot that router and the OSX machine can access the server again. What can be wrong? Is OSX saturating the router for some reason? Is the router broken? How can I trace the origin of this nasty problem?


title: To env or not to env

text: What is the difference between the command               $ env FOO=bar baz      and               $ FOO=bar baz      What effect does `env` have?


title: Grep: search and replace full line

text: The command                grep "foo" myfile.txt      prints all matching lines in my file. Now I want to replace the **full line** with another string. How can I do that?


title: How are Flash Videos played?

text: I was tweaking around with a script for playing Youtube playlists in mplayer. My question is: How does linux play flash videos? My current research yields (By reading scripts written by others): When a video starts buffering, a new folder is created in `/proc/MY_ID/fd` A file is present in that folder with `ls -la` yielding: `lrwx------ 1 username username 64 2012-02-23 21:52 17 -> /tmp/FlashXX6MuuBn (deleted)` Typing `vlc 17` starts playing the video in VLC. I can't understand what is happening. Any suggestions? EDIT: After installing and experimenting, I found the following:   * For my **Chromium** , the MY_ID is one of the PID of `chromium-browse` (there are many)   * For my **Opera** the MY_ID is the PID of `operapluginwrap`   * For my **Firefox** the MY_ID is of `plugin-containe` but this works intermittently. If someone is using Chromium,


title: What is the python equivalent of grep -v?

text: I like `grep -v`. I use it all the time. But I am also doing some text processing in python, and there is one crucial thing that I lack. Usually, I use `grep -v` to take extraneous stuff out of text. For instance,               $grep -v [a-z]     (confirms that I don't want those lines)     $grep [a-z] > linesiwanted      But how do I match the complement of a regex in Python? For instance, the complement of `\w`?


title: How to "close" open ports?

text: A few days ago I started to care a lot about my data security, I end up `nmap`ing myself with: `nmap 127.0.0.1` Surprise, surprise, I have lots of active services listen to localhost:               $ nmap 127.0.0.1     Starting Nmap 5.21 ( http://nmap.org ) at 2013-05-05 00:19 WEST     Nmap scan report for localhost (127.0.0.1)     Host is up (0.00025s latency).     Not shown: 993 closed ports     PORT    STATE SERVICE     22/tcp  open  ssh     25/tcp  open  smtp     53/tcp  open  domain     111/tcp open  rpcbind     139/tcp open  netbios-ssn     445/tcp open  microsoft-ds     631/tcp open  ipp          Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds      The only one that I _might_ use is `ssh` (although it is probably not well configured, I will keep this matter to another question). As far as I know `ipp` protocol is used by CUPS to share my printers, I don't need to share them, just access printers from a server. This is the output of `netstat -lntup` by the root user, removing the localhost addresses:               Active Internet connections (only servers)     Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name     tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      497/sshd             tcp        0      0 0.0.0.0:17500           0.0.0.0:*               LISTEN      2217/dropbox         tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      892/smbd             tcp        0      0 0.0.0.0:50022           0.0.0.0:*               LISTEN      1021/rpc.statd       tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      892/smbd             tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      906/rpcbind          tcp6       0      0 :::22                   :::*                    LISTEN      497/sshd             tcp6       0      0 :::42712                :::*                    LISTEN      1021/rpc.statd       tcp6       0      0 :::445                  :::*                    LISTEN      892/smbd             tcp6       0      0 :::139                  :::*                    LISTEN      892/smbd             tcp6       0      0 :::111                  :::*                    LISTEN      906/rpcbind          udp        0      0 0.0.0.0:51566           0.0.0.0:*                           615/avahi-daemon: r     udp        0      0 0.0.0.0:68              0.0.0.0:*                           7362/dhclient        udp        0      0 0.0.0.0:111             0.0.0.0:*                           906/rpcbind          udp        0      0 192.168.1.255:137       0.0.0.0:*                           1782/nmbd            udp        0      0 192.168.1.67:137        0.0.0.0:*                           1782/nmbd            udp        0      0 0.0.0.0:137             0.0.0.0:*                           1782/nmbd            udp        0      0 192.168.1.255:138       0.0.0.0:*                           1782/nmbd            udp        0      0 192.168.1.67:138        0.0.0.0:*                           1782/nmbd            udp        0      0 0.0.0.0:138             0.0.0.0:*                           1782/nmbd            udp        0      0 0.0.0.0:655             0.0.0.0:*                           906/rpcbind          udp        0      0 0.0.0.0:17500           0.0.0.0:*                           2217/dropbox         udp        0      0 0.0.0.0:5353            0.0.0.0:*                           615/avahi-daemon: r     udp        0      0 0.0.0.0:34805           0.0.0.0:*                           1021/rpc.statd       udp6       0      0 :::40192                :::*                                1021/rpc.statd       udp6       0      0 :::111                  :::*                                906/rpcbind          udp6       0      0 :::655                  :::*                                906/rpcbind          udp6       0      0 :::5353                 :::*                                615/avahi-daemon: r     udp6       0      0 :::42629                :::*                                615/avahi-daemon: r      How do I configure those services so they only listen to the outside world when I'm actually using them?


title: What are the effects, if any, of scheduler priorities and policies for threads in an uncontended cpuset?

text: I have a Linux system where we have used cgroups to create two cpu_exclusive cpusets, A and B, and where we have migrated all user threads and all unbound kernel threads to a cgroup attached to cpuset A. Things running in cpuset A have varying scheduler policies and varying priorities, and there are many more threads running in cpuset A than there are cores in cpuset A. There is also some small number of very active processes attached to cpuset B, where the total number of user threads across these processes is never greater than the number of cores exclusively available in cpuset B. The goal is to shield these important tasks running in cpuset B from other activity on the machine and to minimize processing latency. In such a setup, does the scheduling policy/priority of the user threads running in cpuset B have any observable effect? Stated differently: would changing the scheduling policy of the B cpuset threads from the default SCHED_OTHER to SCHED_FIFO or SCHED_RR have any consequences, good or bad? It seems like the answer should be 'no', since the scheduler should be able to assign each thread running in cpuset B its own dedicated core, so there would be nothing to prioritize or schedule, and so the policy and relative priority of the B cpuset threads wouldn't matter. On the other hand, there are the bound kernel threads and the 'scheduler domain' aspects to worry about, and probably other things I have not considered. Do the scheduling policies and priorities of threads running in an overprovisioned exclusive cpuset matter in any practical sense?


title: Integer Expression expected error in Line 27

text: #! /usr/bin/bash                    homeDir=/home/evivpat/Scripts/AlarmPendencyReportOPS/LogMGW          nodeDir=/home/evivpat/Nodelist          rpDir=/home/evivpat/Reports/AlarmPendencyReport                    NodeName=`cat $nodeDir/MGW | awk '{print $1}'`          for i in $NodeName          do          NodeUN=`grep -c "Unable to connect" $homeDir/Logfile.$i.log | awk -F":" '{print $1}'`          if [ "$NodeUN" -eq "0" ];          then          TotalAlarmCount=`grep "Nr of active alarms are" $homeDir/Logfile.$i.log | cut -f6 -d' '`          if [ "$TotalAlarmCount" -gt "0" ];          then          UnAckAlarmCount=`grep "UNACKNOWLEDGED ALARMS" $homeDir/Logfile.$i.log | cut -f3 -d' '`          if [ "$TotalAlarmCount" -eq "$UnAckAlarmCount" ];          then          pline=`grep -n "UNACKNOWLEDGED ALARMS" $homeDir/Logfile.$i.log | awk -F":" '{print $1}'`          qline=`expr $pline + 4`          for (( z = 1; z <= $TotalAlarmCount; z++ ))          do          AlmDt=`cat $homeDir/Logfile.$i.log | sed -n -e"$qline"p | awk '{print $1}'`          AlmTm=`cat $homeDir/Logfile.$i.log | sed -n -e"$qline"p | awk '{print $2}'`          AlmP=`cat $homeDir/Logfile.$i.log | sed -n -e"$qline"p | awk '{print $3}'`          AlmCk=`cat $homeDir/Logfile.$i.log | sed -n -e"$qline"p | cut -c23-58`          ZLDCnt=`grep -c "$AlmCk" $nodeDir/ZLD_MGW`          if [ "$ZLDCnt" -ge "1" ];          then          ZLDCk=`cat $nodeDir/ZLD_MGW | grep "$AlmCk" | awk -F"|" '{print $2}'`          xline=`expr $ZLDCk + 22`          AlmDesc=`cat $homeDir/Logfile.$i.log | sed -n -e"$qline"p | cut -c23-$xline`          yline=`expr $xline + 1`          AlmDet=`cat $homeDir/Logfile.$i.log | sed -n -e"$qline"p | cut -c$yline-`          echo "$i|$AlmP|$AlmDt|$AlmTm|$AlmDesc|$AlmDet|DL">>$rpDir/MGW_Alarm_Processed_DL.txt          else          AlmDesc=`cat $homeDir/Logfile.$i.log | sed -n -e"$qline"p | cut -c23-58`          AlmDet=`cat $homeDir/Logfile.$i.log | sed -n -e"$qline"p | cut -c59-`          echo "$i|$AlmP|$AlmDt|$AlmTm|$AlmDesc|$AlmDet|DL">>$rpDir/MGW_Alarm_Processed_DL.txt          fi          qline=`expr $qline + 1`          done          fi           else          echo "$i node has zero alarm!!!|DL">>$rpDir/MGW_Zero_Alarm_DL.txt          fi          else          echo "Unable to connect $i node!!!|DL">>$rpDir/MGW_Alarm_Failed_Node_DL.txt          fi          done


title: Is it possible in bash, to start reading a file from an arbitary byte count offset?

text: I want to locate a date which is somewhere in an 8 GB log (text). Can I somewhat bypass a full sequential read, and first do binary splits of the file (size), or somehow navigating the filesystem `inodes` (which I know _very_ little about), to start reading from each split point, until I find a suitable offset from where to start my text search for a line cotaining the date? `tail`'s read of the last line doesn't use a normal sequential read, so I wonder if this facility is somehow available in bash, or would I need to use Python or C/C++... but I am specifically interested in a `bash` option..


title: Only two 2GB memory available on 64-bit Linux kernel

text: I've just upgraded my Debian Linux (Wheezy) to a 64 bit kernel, as well as user mode binaries, in an attempt to make use of the 4GB of memory in the system without PAE. Exchanging the kernel and packages seems to have gone fine, but I'm not getting the expected result:               mymachine:~# dmesg | grep Memory     [    0.000000] Memory: 2007644k/2062784k available (3494k kernel code, 452k absent,                            54688k reserved, 3042k data, 476k init)          mymachine:~# uname -m     x86_64      What could be causing this? I would like to expand the memory further, but if I can't even make use of the current 4GB, that is a bit useless :) `lshw` output says shows the memory is properly installed:                *-memory           description: System Memory           physical id: 29           slot: System board or motherboard           size: 4GiB         *-bank:0              description: DIMM DDR Synchronous 1333 MHz (0.8 ns)              product: PartNum0              vendor: Manufacturer0              physical id: 0              serial: SerNum0              slot: DIMM A1              size: 2GiB              width: 64 bits              clock: 1333MHz (0.8ns)         *-bank:1              description: DIMM DDR Synchronous 1333 MHz (0.8 ns)              product: PartNum1              vendor: Manufacturer1              physical id: 1              serial: SerNum1              slot: DIMM B1              size: 2GiB              width: 64 bits              clock: 1333MHz (0.8ns)      The Memory Remap Feature is enabled in my BIOS.