IPSec VPN Debian Squeeze Server for Mac OS X

I'm trying to get an IPSec VPN set up on my Debian home server, so that I can access my home network and browse without having my internet filtered by my college network, and so that I can perform maintenance on my home network from college as needed. I set up my server by following this link, and when I try to connect to it via Mac OS X 10.7.4, it will say "The L2TP-VPN server did not respond. Try reconnecting. If the problem continues, verify your settings and contact your Administrator." It prints the following to the console:               8/11/12 7:11:11.532 PM configd: SCNC: start, triggered by SystemUIServer, type L2TP, status 0     8/11/12 7:11:11.669 PM pppd: pppd 2.4.2 (Apple version 560.13) started by Jon, uid 501     8/11/12 7:11:11.687 PM pppd: L2TP connecting to server '10.0.1.100' (10.0.1.100)...     8/11/12 7:11:11.688 PM pppd: IPSec connection started     8/11/12 7:11:11.708 PM racoon: Connecting.     8/11/12 7:11:11.709 PM racoon: IPSec Phase1 started (Initiated by me).     8/11/12 7:11:11.709 PM racoon: IKE Packet: transmit success. (Initiator, Main-Mode message 1).     8/11/12 7:11:14.712 PM racoon: IKE Packet: transmit success. (Phase1 Retransmit).     8/11/12 7:11:17.716 PM racoon: IKE Packet: transmit success. (Phase1 Retransmit).     8/11/12 7:11:20.719 PM racoon: IKE Packet: transmit success. (Phase1 Retransmit).     8/11/12 7:11:21.710 PM pppd: IPSec connection failed      I turned debugging on level 3, and when I tried it again and pulled the logs from the server, and nothing prints to the logs. I'm thinking that the server for some reason isn't getting or recognizing the vpn connection attempt, as it prints the same thing to the logs when I try connecting to a server that doesn't exist. The server has the IP 10.0.1.100, which is the IP that I am trying to connect to, just in case there is something wrong with the port forwarding on the router. Here is my three configuration files, configured in accordance to the how-to guide listed above. (I replaced the secrets with asterisks) ## /etc/freeradius/clients.conf               # -*- text -*-     ##     ## clients.conf -- client configuration directives     ##     ##  $Id$          #######################################################################     #     #  Define RADIUS clients (usually a NAS, Access Point, etc.).          #     #  Defines a RADIUS client.     #     #  '127.0.0.1' is another name for 'localhost'.  It is enabled by default,     #  to allow testing of the server after an initial installation.  If you     #  are not going to be permitting RADIUS queries from localhost, we suggest     #  that you delete, or comment out, this entry.     #     #          #     #  Each client has a "short name" that is used to distinguish it from     #  other clients.     #     #  In version 1.x, the string after the word "client" was the IP     #  address of the client.  In 2.0, the IP address is configured via     #  the "ipaddr" or "ipv6addr" fields.  For compatibility, the 1.x     #  format is still accepted.     #     client localhost {         #  Allowed values are:         #   dotted quad (1.2.3.4)         #       hostname    (radius.example.com)         ipaddr = 127.0.0.1              #  OR, you can use an IPv6 address, but not both         #  at the same time.     #   ipv6addr = ::   # any.  ::1 == localhost              #         #  A note on DNS:  We STRONGLY recommend using IP addresses         #  rather than host names.  Using host names means that the         #  server will do DNS lookups when it starts, making it         #  dependent on DNS.  i.e. If anything goes wrong with DNS,         #  the server won't start!         #         #  The server also looks up the IP address from DNS once, and         #  only once, when it starts.  If the DNS record is later         #  updated, the server WILL NOT see that update.         #              #  One client definition can be applied to an entire network.         #  e.g. 127/8 should be defined with "ipaddr = 127.0.0.0" and         #  "netmask = 8"         #         #  If not specified, the default netmask is 32 (i.e. /32)         #         #  We do NOT recommend using anything other than 32.  There         #  are usually other, better ways to achieve the same goal.         #  Using netmasks of other than 32 can cause security issues.         #         #  You can specify overlapping networks (127/8 and 127.0/16)         #  In that case, the smallest possible network will be used         #  as the "best match" for the client.         #         #  Clients can also be defined dynamically at run time, based         #  on any criteria.  e.g. SQL lookups, keying off of NAS-Identifier,         #  etc.         #  See raddb/sites-available/dynamic-clients for details.         #          #   netmask = 32              #         #  The shared secret use to "encrypt" and "sign" packets between         #  the NAS and FreeRADIUS.  You MUST change this secret from the         #  default, otherwise it's not a secret any more!         #         #  The secret can be any string, up to 8k characters in length.         #         #  Control codes can be entered vi octal encoding,         #   e.g. "\101\102" == "AB"         #  Quotation marks can be entered by escaping them,         #   e.g. "foo\"bar"         #         #  A note on security:  The security of the RADIUS protocol         #  depends COMPLETELY on this secret!  We recommend using a         #  shared secret that is composed of:         #         #   upper case letters         #   lower case letters         #   numbers         #         #  And is at LEAST 8 characters long, preferably 16 characters in         #  length.  The secret MUST be random, and should not be words,         #  phrase, or anything else that is recognizable.         #         #  The default secret below is only for testing, and should         #  not be used in any real environment.         #         secret      = ********              #         #  Old-style clients do not send a Message-Authenticator         #  in an Access-Request.  RFC 5080 suggests that all clients         #  SHOULD include it in an Access-Request.  The configuration         #  item below allows the server to require it.  If a client         #  is required to include a Message-Authenticator and it does         #  not, then the packet will be silently discarded.         #         #  allowed values: yes, no         require_message_authenticator = no              #         #  The short name is used as an alias for the fully qualified         #  domain name, or the IP address.         #         #  It is accepted for compatibility with 1.x, but it is no         #  longer necessary in 2.0         #     #   shortname   = localhost              #         # the following three fields are optional, but may be used by         # checkrad.pl for simultaneous use checks         #              #         # The nastype tells 'checkrad.pl' which NAS-specific method to         #  use to query the NAS for simultaneous use.         #         #  Permitted NAS types are:         #         #   cisco         #   computone         #   livingston         #   max40xx         #   multitech         #   netserver         #   pathras         #   patton         #   portslave         #   tc         #   usrhiper         #   other       # for all other types              #         nastype     = other # localhost isn't usually a NAS...              #         #  The following two configurations are for future use.         #  The 'naspasswd' file is currently used to store the NAS         #  login name and password, which is used by checkrad.pl         #  when querying the NAS for simultaneous use.         #     #   login       = !root     #   password    = someadminpas              #         #  As of 2.0, clients can also be tied to a virtual server.         #  This is done by setting the "virtual_server" configuration         #  item, as in the example below.         #     #   virtual_server = home1              #         #  A pointer to the "home_server_pool" OR a "home_server"         #  section that contains the CoA configuration for this         #  client.  For an example of a coa home server or pool,         #  see raddb/sites-available/originate-coa     #   coa_server = coa     }          # IPv6 Client     #client ::1 {     #   secret      = testing123     #   shortname   = localhost     #}     #     # All IPv6 Site-local clients     #client fe80::/16 {     #   secret      = testing123     #   shortname   = localhost     #}          #client some.host.org {     #   secret      = testing123     #   shortname   = localhost     #}          #     #  You can now specify one secret for a network of clients.     #  When a client request comes in, the BEST match is chosen.     #  i.e. The entry from the smallest possible network.     #     #client 192.168.0.0/24 {     #   secret      = testing123-1     #   shortname   = private-network-1     #}     #     #client 192.168.0.0/16 {     #   secret      = testing123-2     #   shortname   = private-network-2     #}               #client 10.10.10.10 {     #   # secret and password are mapped through the "secrets" file.     #   secret      = testing123     #   shortname   = liv1     #       # the following three fields are optional, but may be used by     #       # checkrad.pl for simultaneous usage checks     #   nastype     = livingston     #   login       = !root     #   password    = someadminpas     #}          #######################################################################     #     #  Per-socket client lists.  The configuration entries are exactly     #  the same as above, but they are nested inside of a section.     #     #  You can have as many per-socket client lists as you have "listen"     #  sections, or you can re-use a list among multiple "listen" sections.     #     #  Un-comment this section, and edit a "listen" section to add:     #  "clients = per_socket_clients".  That IP address/port combination     #  will then accept ONLY the clients listed in this section.     #     #clients per_socket_clients {     #   client 192.168.3.4 {     #       secret = testing123     #        }     #}      ## /etc/l2tpns/startup-config               # Debugging level     set debug 2          # Log file: comment out to use stderr, use "syslog:facility" for syslog     set log_file "/var/log/l2tpns"          # Write pid to this file     set pid_file "/var/run/l2tpns.pid"          # Shared secret with LAC     set l2tp_secret ""          # MTU of interface for L2TP traffic     #set l2tp_mtu 1500          # PPP counter and timer values     #set ppp_restart_time 3     #set ppp_max_configure 10     #set ppp_max_failure 5          # Only 2 DNS server entries are allowed     set primary_dns 10.0.1.1     set secondary_dns 8.8.8.8          # Can have multiple radius server entries, but ony one radius secret     set primary_radius 127.0.0.1     #set primary_radius_port 1645     #set secondary_radius 0.0.0.0     #set secondary_radius_port 1645     set radius_secret "********"          # Acceptable authentication types (pap, chap) in order of preference     #set radius_authtypes "pap"          # Turn on or off Radius Accounting     #set radius_accounting no          # Port for DAE RADIUS requests     #set radius_dae_port 3799          # Allow multiple logins for the same username     #set allow_duplicate_users no          # Write usage accounting files into specified directory     set accounting_dir "/var/run/l2tpns/acct"          # Listen address for L2TP     set bind_address 10.0.1.100          # Send a gratiuitous ARP for bind address     set send_garp yes          # Gateway address given to clients     set peer_address 10.0.1.1          # Default throttle rate in kb/s     #set throttle_speed 0          # Number of buckets to allocate for throttling     #set throttle_buckets 3000          # If set to anything other than 0, setuid when initialised.     #set setuid 0          # If set to true, dump current speed to stderr every second     #set dump_speed no          # Number of packets to read from tun/udp/cluster fd when select     # returns readable     #set multi_read_count 10          # Set scheduling priority of process to SCHED_FIFO     #set scheduler_fifo no          # Lock pages into memory     #set lock_pages no          # Maximum number of host unreachable packets to send per second     #set icmp_rate 0          # Maximum number of downstream packets per 0.1s to handle for each     # session (0 = ulimited)     #set packet_limit 0          # Cluster multicast address, interface     #set cluster_address 239.192.13.13     set cluster_interface eth1          # Cluster multicast TTL     #set cluster_mcast_ttl 1          # Cluster timers (1/10th second)     set cluster_hb_interval 100     set cluster_hb_timeout 20          # Minimum number of slaves before master withdraws routes     #set cluster_master_min_adv 1          # Drop/kill sessions     #load plugin "sessionctl"          # Throttle/snoop based on RADIUS     #load plugin "autothrottle"     #load plugin "autosnoop"          # Control throttle/snoop with nsctl     #load plugin "throttlectl"     #load plugin "snoopctl"          # Punt RX speed if not supplied     #load plugin "setrxspeed"          # Remove domain from username     #load plugin "stripdomain"          # Walled garden     #load plugin "garden"      ## /etc/ipsec.conf               # /etc/ipsec.conf - Openswan IPsec configuration file          # This file:  /usr/share/doc/openswan/ipsec.conf-sample     #     # Manual:     ipsec.conf.5               version 2.0     # conforms to second version of ipsec.conf specification          # basic configuration     config setup             # NAT-TRAVERSAL support, see README.NAT-Traversal             nat_traversal=yes             # exclude networks used on server side by adding %v4:!a.b.c.0/24             virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12:!10.0.1.0/24             # OE is now off by default. Uncomment and change to on, to enable.             oe=off             # which IPsec stack to use. auto will try netkey, then klips then mast             protostack=netkey             #             #interfaces="ipsec0=br0"             uniqueids=no          conn road_warrior             rekey=no             authby=secret             pfs=no             keyingtries=3             dpddelay=30             dpdtimeout=120             dpdaction=clear             compress=yes             #             left=10.0.0.100             leftprotoport=17/1701             leftnexthop=10.0.1.1             #             right=%any             rightprotoport=17/%any             rightsubnet=vhost:%no,%priv             #             auto=add      ## /etc/ipsec.secrets               # /etc/ipsec.secrets     # The IPSec Secrets File          10.0.1.100: PSK "********"      Does anyone see a problem in these config files? I'm stumped...


How do DE's call ACPI functions?

Okay, first off, this is not a problem I am facing, but I would like to understand this better. If I wish to shutdown / reboot my machine from the command line I need to call:               $ sudo poweroff     $ sudo reboot      That is, I need root privileges to make these ACPI calls. However, I start my DE, (I use XFCE) without granting it root privileges: $ startxfce4 --with-ck-launch Now, I know that the `\--with-ck-launch` parameter helps allows XFCE to shutdown / reboot my system, but I do not understand how. What allows ConsoleKit to shutdown without root privileges? How can it change the runlevel without super-user privileges? And since it is possible, how can I shutdown my machine from the console without root privileges?


How to keep the content of the BuildRoot?

The good old rpm while building package in steps simply kept the content of the BuildRoot -- it was very useful for me, because if some piece of software was difficult to create, I could check BuildRoot if everything is OK. Now, with all "improved" rpm -- the content of BuildRoot is deleted automatically, so I cannot really dive into it (installing step is not that long). One hack I know of would be adding some kind of sleep at the end of install stage to rpm spec. But this is ugly. So -- **QUESTION** -- how to keep the content of BuildRoot in nice way -- in other words, how to disable auto delete once and for good?


Shell console clearing

Is there a way to clear up what is displayed on the shell console (in ubuntu linux) in just a single key or two? When I get flood of lines from `grep` and that exceeds the height of the window, I want to quickly scroll back to the position where I typed the command after the prompt. I can do so if I had opened a fresh terminal before I type the command, and just go to the initial position. But if keep using the same terminal window, I have to manually find the position. `Ctrl`+`l` is not an answer because it just scrolls, and the contents of the terminal remains. I cannot use `less` because the colored output of grep does not show up in color.


GPG check regarding packages on various distributions

It's ok that the various linux distributions use gpg to verify e.g. new packages downloaded with http. But what happens if the server that holds the packages gets hacked? OK, they need a new gpg key, but how do they guarantee that the new gpg keys are the valid gpg keys? There is no valid gpg key until the new one gets downloaded to the client, so there is a window when the packages [containing the new gpg keys] are not "validated" with gpg keys. Is there any method to give the new gpg keys to the clients in an "authoritative"/secure way?


Sleep key stops working after some time

I've got a "Sleep" key on my keyboard that I use to suspend the system when I'm away from the computer for a longer time. This works fine, at least for a while after I've turned the computer on. However, after some time, the Sleep key just stops working, and I've got to reboot the computer to make it work again. Problem is, I don't know what to check. What kinds of things can change in a system to disrupt the operation of this key? And sometimes it takes longer than other times before it stops working; sometimes I can use the key for days on end; other times it won't even work once.   I can still always use `pm-suspend` manually to suspend the system, so it's not the system itself that has become corrupted, only the keyboard. Anyone got any ideas on what to check, where to begin? I'm running Debian, by the way.


adding additional tracks using sox and the command line

I'm trying to add additional tracks using `sox` using the command line Example: I have several different stereo tracks a drum track, vocal track, effects track, etc. Can I add additional stereo tracks with `sox`? I don't want to append to the end of the tracks or mix them all together. I want to add additional stereo tracks to the audio file.               Example:     Stereo Track1-Vocals     Stereo Track2-Effects     Stereo Track3-Drums      Ps: the stereo tracks can't be split into individual mono files since I have specific sounds going into to the left and right channels and splitting them into all mono files negates that I have a total of 12 stereo tracks I would like to add is this possible? If not is there another application that will do this using the command line? I'm using Ubuntu 13.04 Linux 64bit.


Same ftp upload issue on any live distribution I tried

I have just installed Linux Mint Petra 16 after trying more live distributions. The problem I am facing right now, is that I can't upload anything on any ftp server. The upload speed doesn't exceed 0.20kb, which is practically 0, it starts at about 20KB/s and than quickly drops to 0.3-0.5KB/s. When downloading from any ftp server, everything is fine. I had this problem with any Linux distribution I tried (live instances). I tested my speed, and got about 30 Mbps for both uploading and downloading. I also have Windows 7 installed on my pc and I have no problems whatsoever there. I tried different ftp clients and the result is always the same.


cdrdao is installed, but Brasero doesn't think so

When I try to copy CD to image, Brasero tells me that cdrdao isn't installed. However I reinstalled cdrdao and Brasero, but the error is still there. [ **system** ] Ubuntu Lucid (10.04)


How to 'burn' a subtitle track onto an mp4 video file

I would like to make a subtitle file to be a part of an mp4 video file, so that I don't have to deal with two separate files. I imagine two ways:   * Make the subtitle an intrinsic part of the video. This will require video re-encoding.   * Make the subtitle a separate stream, but still embedded in the same video file. This is far more preferable, especially because I can disable it (unlike the other approach), or even play with the font type/size. How do I do things the 2nd way? It would also be kool to know how the 1st approach works.


Bash flush standard input before a read

Is there an easy way in bash to flush out the standard input? I have a script that is commonly run, and at one point in the script read is used to get input from the user. The problem is that most users run this script by copying and pasting the command line from web-based documentation. They frequently include some trailing whitespace, or worse, some of the text following the sample command. I want to adjust the script to simply get rid of the extra junk before displaying the prompt.


Change Korn prompt to show shorter path for working directory

I have changed my `.kshrc` to show my prompt as follows: `511 /export/home/students/cninja $` where `511` is the command number and `../students/cninja` is the current working directory. Is it possible to show a shortened version of the working directory, the prompt then showing something like: `511 ~/cninja $` or `511 ../students/cninja $` or what have you? This is what my line looks like in `.kshrc`:      `PS1=' ! $PWD $'; export PS1` * * * **Update:** I haven't been able to determine whether I have a ksh88 or ksh93 shell. Most of the `echo *what have you*` commands return a blank stare and a prompt from the shell, and `echo ${.sh.version}` returns `/bin/ksh: ${.sh.version}: bad substitution`.


What software can I use to do live screen-casting in linux?

I'm looking for a software to do live screen-cast of our local user group meeting. What software can I use to do that? Ideally I'd like to capture the computer screen and speaker's audio and stream it live? Edit: I'm not looking to just record my desktop and upload the video. I'm trying to live stream the desktop as it is happening.


Whats the sense of dbus objects?

Despite reading through tons of Dbus - tutorials, I still struggle to understand the whole concept. In my opinion this was one of the best explanations so far: http://telepathy.freedesktop.org/doc/book/sect.basics.dbus.html The reason to use the DBus is because I want to exchange Data between different programs. In my opinion it would suffice to provide a server or, like named in Figure 2-2 a service. This service provides several methods over an interface, which I share with the client. The client then invokes a method and gets an answer. So what am I missing? Why is there a need of additional objects? _edit:_ I guess its just to stick to the Java conventions of objects respectively classes. Each object represents an instance. Would really like someone to confirm that. _edit2:_ Basically, what is the benefit of the first system over the second?: ![Diagram](http://img5.fotos-hochladen.net/uploads/dbus34r07npwzq.jpg)


What is the function/point of "config.sub"

I'm trying to install some software from the command line. There is a file called "config.sub". Am I supposed to use this for something? I haven't been able yet to find out by searching online what this file is supposed to do. I think part of the deal is I don't know how to ask the question correctly.


Installing Arch on VM - DNS Issues

I have been following the Install Wiki and I have arrived at the part where I need to install X Server. My issue is that I cant install X because my DNS doesnt work. I can ping 8.8.8.8 just fine, google.com does not respond. Running Arch as a VM through Hyper-V               # nano /etc/resolv.conf     nameserver 8.8.8.8     nameserver 8.8.4.4          # systemctl stop dhcpcd.service     #ip link     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noquene state UNKNOWN mode DEFAULT group default link/loopback 00:00:00:00:00:00     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT mode DEFAULT group default qlen 1000 link/ether 00:15:5d:00:0f:03 brd ff:ff:ff:ff:ff:ff          # ip link set eth0 up          # ip addr add 10.100.0.25/24 dev eth0          # ip route add default via 10.100.0.25      Where should I start in troubleshooting this? I dont mind working out the problem I just dont know what to do.


How to scan for heartbleed vulnerability with nmap from Ubuntu 12.04?

[root@notebook ~] lsb_release -a     No LSB modules are available.     Distributor ID: Ubuntu     Description:    Ubuntu 12.04.4 LTS     Release:    12.04     Codename:   precise     [root@notebook ~] dpkg -l nmap | grep ^ii     ii  nmap                                          5.21-1.1ubuntu1                            The Network Mapper     [root@notebook ~] wget -q https://svn.nmap.org/nmap/scripts/ssl-heartbleed.nse -O /usr/share/nmap/nselib/ssl-heartbleed.nse     [root@notebook ~] wget -q https://svn.nmap.org/nmap/nselib/tls.lua -O /usr/share/nmap/nselib/tls.lua     [root@notebook ~] wget -q https://svn.nmap.org/nmap/nselib/sslcert.lua -O /usr/share/nmap/nselib/sslcert.lua     [root@notebook ~] wget -q https://svn.nmap.org/nmap/nselib/asn1.lua -O /usr/share/nmap/nselib/asn1.lua     [root@notebook ~] wget -q https://svn.nmap.org/nmap/nselib/stdnse.lua -O /usr/share/nmap/nselib/stdnse.lua     [root@notebook ~] nmap -p 443 --script ssl-heartbleed www.ssllabs.com          Starting Nmap 5.21 ( http://nmap.org ) at 2014-06-25 07:49 CEST     NSE: failed to initialize the script engine:     /usr/share/nmap/nselib/stdnse.lua:59: attempt to index field 'socket' (a nil value)     stack traceback:         /usr/share/nmap/nselib/stdnse.lua:59: in main chunk         [C]: in function 'require'         /usr/share/nmap/nse_main.lua:95: in main chunk         [C]: ?          QUITTING!     [root@notebook ~] cat /usr/share/nmap/nselib/stdnse.lua     ...       50 --- Sleeps for a given amount of time.       51 --       52 -- This causes the program to yield control and not regain it until the time       53 -- period has elapsed. The time may have a fractional part. Internally, the       54 -- timer provides millisecond resolution.       55 -- @name sleep       56 -- @class function       57 -- @param t Time to sleep, in seconds.       58 -- @usage stdnse.sleep(1.5)       59 _ENV.sleep = nmap.socket.sleep;     ...      **My question** : What is the problem? The many "wget's" before the nmap is because nmap said before it's missing modules.


Set file creation date to its modification date on OSX

I need to batch edit file creation date (some stupid audio recorder set the file creation date to UNIX epoch and the correct recording date in the modification date) to set it to the files modification date. I am aware of the `touch` command which can set a file creation like this `touch -t 201406251546.10 filename.wav` but I don't know how to retrieve each file modification date to give it as an argument to the `touch` command. I also know that the `ls -lT` command prints the modification time before each file but on my system (OS X 10.9) the output is localized which is not really handy for batch processing Any idea on how to do this?


How do I use colors in the MOTD?

I edited the default `/etc/update-motd.d/00-header`, adding some color to make it easier to read:               printf "Welcome to \e[1;34m%s\e[0m \e[2m(%s %s %s)\e[0m\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"      I can run that line of code just fine in a terminal, but when I edit `00-header` with this information, I get the escape codes printed out in plaintext:               Welcome to \e[1;36mUbuntu 13.10\e[0m \e[2m(GNU/Linux 3.11.0-23-generic i686)\e[0m      How can I add a splash of color to the message of the day?


How to get text at start up of terminal

![Just as the name shown in this image](http://i.stack.imgur.com/0G7G9.jpg) How to get text at start up of terminal as shown in this image.It should show whenever i open terminal.


starting LXDE automatically (without Display Manager)

I am disappointed with existing Display Managers, and so I was wondering wheteher I could live without one. I have very basic needs on my laptop. I have one user `martin` who wants to be logged into `LXDE` automatically after boot. I have made following change in `/etc/inittab`               #1:2345:respawn:/sbin/getty 38400 tty1     1:2345:once:/bin/login -f martin tty1 </dev/tty1 >/dev/tty1 2>&1      and added following line to my `/home/martin/.profile`               xinit 2>/dev/null      Now, when I boot my laptop, `LXDE` starts automatically. Thats great. When I log out of `LXDE`, I am back in `tty1`, logged in as `martin`. The problem is, when `LXDE` is running and I have screen-lock active to protect my `LXDE` session, somebody could press `CTRL+c` in `tty1`, thereby killing LXDE and he would be logged in as `martin`. Is there a way to make `LXDE` start without leaving martin logged in on `tty1`? i.e., after `LXDE` has started, I don't need `tty1` anymore and I would like to log out of it. but I cannot because `LXDE` is started from that console. Is there any way to make `LXDE` to "detach" itself from `tty1`, so that is shows the standard `login` prompt as normally? In case it is relevant, I am using Debian Wheezy


Replacing Evernote with Emacs and markdown - .org file list

I have grown tired of using evernote with wine or with any of the linux clients. I decided to change to Emacs and write all my notes in markdown so I can easily publish them in HTML and sync them with Dropbox. For organizing my notes I thought of putting them in separate folders and having a script make a .org file with a list of all my .md files. The structure I imagined was something like this:               * ~/Dropbox/Notebook1/          ** [[~/Dropbox/Notebook1/notefile1.md][notefile1]]     ** [[~/Dropbox/Notebook1/notefile2.md][notefile2]]               * ~/Dropbox/Notebook2/          ** [[~/Dropbox/Notebook2/notefile3.md][notefile3]]     ** [[~/Dropbox/Notebook2/notefile4.md][notefile4]]               * ~/Dropbox/Notebook3/          ** ~/Dropbox/Notebook3.1/     *** [[~/Dropbox/Notebook3.1/Notefile5.md][notefile5]]     *** [[~/Dropbox/Notebook3.1/Notefile6.md][notefile6]]          ** ~/Dropbox/Notebook3.2/     *** [[~/Dropbox/Notebook3.2/Notefile7.md][notefile7]]      The problem is that my scripting/programming skills are somewhere between very basic to none. I figured that I should begin with something like "find ~/Dropbox/ -name '*md' > list", but then I got lost. How can I take the output and manipulate it into the structure above?


Double port forwarding - SSH

**NOTE:** _I'm not explaining why I want to do this. But here is the requirement._ **There are 4 hosts. Host A, Host B, Host C, Host D**   1. Host A is running some application which can be accessed at port 8001   2. I forwarded port 8001 of Host A to 8002 of Host B.   3. Host B is accessible only using Host C. So, again, I forwarded port 8002 of Host B to 8003 of Host C. Now, from Host D...when I say: `https://HostC:8003` -- it should take me to the application running on Host A. But I'm not able to do that. But what I could do was, I forwarded port 22 of Host A to port 7777 of Host B. Then, from Host C, I ran:               $ ssh Host B -p 7777 -L 6666:localhost:8001      Doing this, `ssh Host B -p 7777`, took me to a command line on Host A. Hence port 8001 of Host A was directly forwarded to 6666 of Host C. Now, from Host D, `https://Host C:8001` worked! But, I want to do it using the former way.   * How can I do that?   * What am I missing here?


How can I find out if the ~/.XCompose file has loaded?

I've added a simple sequence, but it won't work. How can I find out if the OS (Ubuntu 12.10 with Unity) is actually loading the file?


Permissions to deny SSH users from accessing other user's folders

I am currently running Fedora on a network computer, acting as a host to other users who will SSH into my terminal to do their work. However I realised that they are also able to access my `/home` folder. How do I go about setting the permissions such that they are not able to access it?


Running user script with root permissions

I have a script that I've made that needs to have root permissions to enable and disable bluetooth features. I am binding this to a button so it is not feasible to log in as root to run the script. How do I properly set the file permissions for the script? I know that it's good practice to make it so that only root can edit and read the file, but how do I give it full execution permissions?               BT_RFKILL=$(rfkill list | grep tpacpi_bluetooth_sw | sed 's/\([0-9]\+\):.*/\1/')     BT_STATE=$(rfkill list $BT_RFKILL | grep "Soft blocked: yes")          if [ "x" == "x$BT_STATE" ]; then         sixad --stop         sleep 2s         rfkill block $BT_RFKILL     else         rfkill unblock $BT_RFKILL         sleep 2s         sixad --start     fi     exit 0      The script runs perfectly if I sudo it, but that's not ideal since I'd love run it through a simple key binding.


Send email from a shell script

I have written a script which runs a simple program in the background, logs the output and emails me when the job is done. It works fine except for the fact I am not recieving the email. I have tried a yahoo mail, a gmail but I never get the email. I have been told that: 1) I can try the `tee` command, but i have never used this 2) Some email services wont accept email when the sender is not specified I am using Fedora. This is the code I have for logging the results of the background program and then sending the email:               (nice -n 10 nohup ./$user_cmd >$log_stdout 2>$log_stderr </dev/null ; echo $body `date` | mutt -s "$subj" $recipient) & Can someone please help me get this working properly? Why am I not recieving the email? If this is not clear let me know and i will post the entire script. Basically the objective is to get the email sent using the `nice` and `nohup` commands.


How do I point certain directory to /dev/null?

I am running CentOS with cPanel, which creates a custom log directory and writes the logs there. The result is that the IO for the hard disk goes sky high. If I do `lsof` I got:               hostsite.com          httpd      2383    nobody 3779w   REG  253,0         0  422463 /usr/local/apache/domlogs/mygamecardotcobnao.super                  hostsite.com-bytes_log     httpd      2383    nobody 3780w   REG  253,0      5265  420994 /usr/local/apache/domlogs/myfreefreedatixuua.super                  hostsite.com     httpd      2383    nobody 3781w   REG  253,0        36  422464 /usr/local/apache/domlogs/myfreefreedatixuua.super                  hostsite.com-bytes_log     httpd      2383    nobody 3782w   REG  253,0      3101  415849 /usr/local/apache/domlogs/myfreedatingfrekeuo.supe                  rhostsite.com     httpd      2383    nobody 3783w   REG  253,0        72  422465 /usr/local/apache/domlogs/myfreedatingfrekeuo.supe                  rhostsite.com-bytes_log     httpd      2383    nobody 3784w   REG  253,0       672  419338 /usr/local/apache/domlogs/myfreedatingblogsxgo.sup                  erhostsite.com     httpd      2383    nobody 3785w   REG  253,0         0  422466 /usr/local/apache/domlogs/myfreedatingblogsxgo.sup         Disabling this domlog is impossible because there are tons of those lines automatically generated. I just want to point `/usr/local/apache/domlogs/` to `/dev/null`. Can that be done?


Tool to create text files from a template

I have to regularly create 100+ text files from templates.   I currently use an overly complicated shell script. I think there is a smarter way to handle this, but I don't know how. I have a "database" :               # outputfile      template            data1   data2    data3     first.txt         $template_main      $text1  abcd     1234     second.txt        $template_main      $text2  efgh     5678     third.txt         $template_other     $text1  ij       90      And a configuration file :               template_main=main.txt     template_other=other.txt     text1=whatever     text2=blah      The templates are text files with placeholders like %%data2%% (the placeholder form can be changed). Does someone know a tool to automate this better than with a complicated shell script ?


How to build a tool with specific libraries without breaking Fedora?

This is probably a noob question, but so far never needed to deviate from the standard Fedora 16 core development components. I am needing to build clutter- mx project, but this library requires glib-2.0.32. Along with this, glib-2 needs libffi-3.0.11. I can download the source and build these libraries, however, I am concerned that installing them will break the rest of the system. The clutter-mx project uses autotools and looks for the glib-2 version. The questions are:   1. If I build and install the new components, and something goes wrong, can you get back using yum, or something similar?   2. Is there a way of getting autotools to look in another directory for the installed headers? Thanks.


How to find a Fedora package providing a dependency I need?

I sometimes install software which isn't present in the repositories, and then I run into the problem of not satisfied dependencies. The error usually tells me which library or command is missing. Then I run a `yum search`. If there is a package name coinciding with the library/command name needed, it is easy. The problem comes when I can't find anything in yum. I start searching around on the Web, and often I find links to the library. But I don't know whether to trust these sites, where to copy the library if I download it, what it is supposed to do at all, and so on. Often it is supposed to be for another distribution, or another Fedora version, and then I don't know whether they will work with mine. I suspect that these libraries are probably present in some package already in the repository, and I would much rather have them from there than from random Googled sites. How can I find out which package a library belongs to, if I have its name? For example, now I need the library libpng12.so.0, how do I get it? And if it is not a library, but a command, how do I find the package which provides it?


GUI log viewer for logs produced by Apache log4j

I'm looking for a good graphical tool for view and analyze log files (local and remote) that works on Fedora 15.


Bash script to ftp only files of type gz in current directory

I have a bash script that cd to the right directory then uses the mput command to ftp all the files in the directory to a remote server, as below:               for from_dir in $DATE_LIST      do         cd ${FILE_LANDING_DIR}/deltas/${from_dir}         ftp_files     done          ftp_files () {         ftp -inv $HOST <<-EOF > $LOG_DIR/tempftplog         user $USER $PASS          cd ${ID_LANDING_DIR}         mput *         bye          EOF     }       I tried altering the ftp_files function to ftp only the `.gz` files in that directory by changing the line from `mput *` to `mput *.gz` but that did not work. Can someone tell me how I can do this once in the ftp command?


Reinstall GRUB from LiveCD

I have both windows and linux run on same machine. In Windows, when I set parition C to main boot, I cannot use GRUB anymore. So, I decide to reinstall GRUB. But, when I use Fedora live CD to boot. I don't see previous Linux parition. I juse see Windows partition. So, I don't know how to mount linux partition to install GRUB. Here is the output of command:               su -c "/sbin/fdisk -l /dev/sd?"          Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *          63   188747684    94373811    7  HPFS/NTFS/exFAT     /dev/sda2       188747685   976768064   394010190    f  W95 Ext'd (LBA)     /dev/sda5       251674353   566259119   157292383+   7  HPFS/NTFS/exFAT     /dev/sda6       566259183   976768064   205254441    7  HPFS/NTFS/exFAT      As you see, maybe sda2 is the linux partition. So, I use this command:               mount -t ext4 /dev/sda2 /mnt      > mount: wrong fs type, bad option, bad superblock on /dev/sda2, missing > codepage or helper program, or other error In some cases useful info is > found in syslog - try dmesg | tail or so I don't know does sda2 is real linux partition or not. (it doesn't appear partition size, so I cannot know). but if this true, I'm pretty sure the partition is format in ext4. Please help me. Thanks :)


Get Network activity

I have an embedded board running Linux with http, ftp and some other servers. I need a way to detect when there is no network activity both http, ftp etc. I will make a linux program, that will run some stuff when there is no network activity for xx minutes.


Using huawei e303 on a modified linux machine

I am trying to configure a new modem to work on my Linux machine.The machine is based on `debian` (6) without most of the graphical interface.I'm also using a modified kernel based on 2.6.37.Until recently I had `huawei e173` modem on my machine and it worked just fine (The only thing I had to configure was the usb port that was assigned by the OS which is usually `ttyUSB1`). Now since I can't buy the old modem I am trying a new one but it doesn't work.When I use `lsusb` it is recognized but when I'm trying to use `cat /dev/ttyUSB` it doesn't work for any port I tried. When I used to use the `cat /dev/ttyUSB1` command on the old modem I had access to the data that is transferred from the modem (usually `AT` commands etc). I thought that it might be a driver issue but since I'm using a modified system it's a bit harder for me to install new drivers. I would appreciate any suggestions and any help that you can offer in order to get this modem to work.


Extract part of string using grep

I have 3 files in a directory               MYO144064T     MYO144064TA     MYO144064TX      Where the digits and 11th character will change. In my csh script, I want to extract the letters 'A' and 'X' probably using grep The variable $study equals MYO144064 What I have managed so far is very cumbersome               ls | grep $study | cut -c 11 | sed 's/\///'      Which gives me               A     X      How can I do this with minimal processes and without the additional blank line?


How to keep LiveCD settings?

As I am now only able to run my machine from liveCD (Fedora XFCE 16 or Xubuntu 11.10), I would like to know if there is a way to keep the current session's settings (keyboard, wifi etc.) for a later session. Can the settings be stored on a USB drive for instance?


Case-insensitive file system for production server?

The initial situation looks like this:   * The corporate software is PHP-based.   * It is delivered by Apache 2 on a Windows 2003 Server.   * It is **big**.   * It is a legacy of rather unprofessional developers who did not mind about case sensitivity or directory separators. The desired situation looks like that:   * Everything migrated to Apache 2 under a Linux distribution of yet undecided flavor. Problem:   * Endless tons of code without any caring about the case-sensitivity or directory separator character. I did some research already, but unfortunately did not find anything which would be suitable also for a production environment. `CIOPFS` looks nice but is explicitly meant not to be used on production systems. Would you think `mod_spelling` for Apache would be an option? The yet unresolved question for me is, if PHP accesses files with help of that module or directly (which would make it useless). Should we swallow the bitter pill and go through all the code? We would like to avoid that, as we will replace the current software environment piece by piece with new build stuff (in long term).


Converting bash script to fish

I'm trying to add the following bash scripts to fish, yet am having trouble getting the syntax in fish right. Here is the original script:               export MINION_INSTALL=$HOME/minion     export NOTES_HOME=$HOME/Notes     export INBOX=$NOTES_HOME/inbox          if [ -d "$MINION_INSTALL" ] ; then         export PATH="$MINION_INSTALL:$PATH"     fi          source $MINION_INSTALL/aliases_for_minion      And this is the `aliases_for_minion` file:               alias mn="minion"     alias icannotfind="minion --open --archive --full $@"     alias newnote="minion --new-note $@"     alias open="minion --open $@"     alias remind="minion --new-note --quick $@"     alias summary="minion --count inbox; minion --list --show-tags=False today; \         minion --count next; minion --count soon; minion --count someday"       The minion command works fine if I run fish after starting bash. Any help would be greatly appreciated!


Mod, Meta, Super ... keys?

In Window Managers circle there are some technical terms; couple of them are `Mod keys` and `Meta keys`. The questions here I am asking are   * What exactly are those and are they universal across different keyboards.   * What `ALT`, `SHIFT` and `CTRL` (both right and left), `Win` and `right click` keys are called? I ask this because I am working on both tilling window managers and stack ones. and there are lots of references to this issue.


Log new files in a directory

Is there a tool, which lets me know about the last newly created files? The still common way of using a hierarchically file system makes it hard to save files in different places, so sometimes I sort things into general topic folders and sometimes at the place of directly related things, f.e. publications related to a certain tool in the directory of the binaries. Best would be a tool, which I can ask:   * Period of creation / saving   * File type / name / extension   * Black-/Whitelist of directories to exclude/include


awk to split the input file into 2 files(one for duplicated values and one for unique values)

I have an input file like below.               file.txt     14 2.692022 author1 0     14 2.57826 author2 1     229 2 author3 2     323 2 author4 3     514 2.0625 author5 4      I am trying to split the file with the duplicated values as one file and the rest of values as another file. So, for the above input, I am trying to generate files like,               file1.txt     14 2.692022 author1 0     14 2.57826 author2 1          file2.txt     229 2 author3 2     323 2 author4 3     514 2.0625 author5 4      I am not able to figure out how to use awk for this purpose.               awk '{print $1}' file.txt | uniq -d > file1.txt      The above command gives me only the duplicated values in a file. Also, it gives me only the field1 but not all the 3 fields.


Logging into multiple SSH servers as root and create an user with same power as root does

I need a script from which I can log into multiple servers as root (but not all root passwords are same;there are 3-4 different root passwords) and make a superuser (user with same access as root) but some of the server already have one (same user:same passwd). And if the server we logged into, got one already, the script just need to skip it and move on to the next server. Please help


mutt -- multiaccount support

Can anybody help me with mutt configuration? I need to configure mutt to support mutiple accounts the same time. At this moment my config file for personal email looks like this:               ~ $ cat ~/.mutt/personal          set imap_user = «%personal_email%@gmail.com»     set imap_pass = «%personal_email_pass%»     set smtp_url = «smtps://%personal_email%@smtp.gmail.com:465/»     set smtp_pass = «%personal_email_pass%»     set from = «%personal_email%»     set realname = «%username%»     set hostname = gmail.com     set folder = «imaps://%personal_email%@imap.gmail.com:993»     set spoolfile = «imaps://%personal_email%@imap.gmail.com/INBOX»     set postponed = «imaps://%personal_email%@imap.gmail.com/[Gmail]/Drafts»     set record = «imaps://%personal_email%@imap.gmail.com/[Gmail]/Sent Mail»      "~/.mutt/work" looks the same way, except the values of "%personal_email%" and "%personal_email_pass%", of course. "~/.muttrc" looks like this:               ~ $ cat ~/.muttrc          source «~/.mutt/personal»          macro index <f2> '<sync-mailbox><enter-command>source ~/.mutt/personal<enter><change-folder>!<enter>'     macro index <f3> '<sync-mailbox><enter-command>source ~/.mutt/work<enter><change-folder>!<enter>'      When I press F2 or F3 mutt really changes an account, but when I'm trying to change mailbox (via 'c' -> '?') it opens a mailbox of the first account (in my case "personal") even when the current account is "work". Why? What am I doing wrong? How can I fix it?


Google App Engine alternative for CentOS, Fedora, Ubuntu?

I have written WebRTC Apps which is Python and Google App Engine. Google App Engine is not freely available to use for production release, so I am looking alternative of it for CentOS, Fedora. Can anyone please advise me for working/stable/production use like alternative Google App Engine for CentOS, Fedora.


Why is the 'if [ $1="1" ]' branch always selected even if $1 is not 1?

I have a shell script named 'teleport.sh' like this:               if [ $1="1" ];         then         shift             mv "$@" ~/lab/Sun     elif [ $1="2" ];         then         shift             mv "$@" ~/lab/Moon     elif [ $1="3" ];         then         shift             mv "$@" ~/lab/Earth     fi      When I execute:               sh teleport.sh 2 testfile      This `testfile` is moved to the `~/lab/Sun` directory, which confuses me a lot as I didn't pass 1 or '1' to that script. What's wrong here?


How to make a library linkable with g++ -l argument

How can I make a shared library which is in `/usr/lib/some-path` linkable with the g++ `-l` argument when compiling? As far as I know, to do what I want, I need to `chmod 0755` the library `.so` file, create some kind of a link file and I need to update the library cache. I tried using `ldconfig` command and it worked, but not for the subdirectories of `/usr/lib`. I also tried `ln -s /usr/lib/some-path/libmy.so /link/file/output/dir` which created a link file, but g++ still couldn't find the library with the `-lmy`. I tied running `ldconfig` after `ln` but that did not help.


How do I split the $0 variable to find directory and relative paths in bash?

The $0 variable contains the path info of the script.   * How can I change the path info to absolute path? I mean how to process ~, ., .. or similar?   * How can I split the path info into directory and file name? I could use python/perl for this, but I want to use bash if possible.


Fedora vs. Ubuntu installation

I am using Fedora 13, and it was my friend who did the installation for me. I have used Ubuntu also and I found it more easy to install than fedora. Ubuntu uses a WUBI installer (if I am correct) and its more easy for the users to install and remove Ubuntu. For a person who knows how to install and remove an application in Windows, can they install/remove Ubuntu also. Why is it that its not the same with Fedora. Are there any steps being taken for making it more user-friendly.


Why can't the OOM-Killer just kill the process that asks for too much?

It is explained here that the OOM-Killer can be configured via `overcommit_memory` and that:   * 1 = no overcommit. Allocations fail if asking too much.   * 0, 2 = overcommit. Kill _some_ process(es) based on some heuristics when too much memory is actually accessed. Now, I may completely misunderstand that, but why isn't there an option (or why isn't it the default) to kill the very process that actually tries to access too much memory it allocated?


Is there a way to check which process terminates first during reboot

Assuming I have 2 processes running. Is there any way for me to check which process terminates first during reboot/shutdown? From this link, it tells about appending boot to a file. Yet, I still don't know which process is terminated first between my 2 processes. Is there any way for me to do find out? Maybe a bash script or a .conf file. I'm applying this to CentOS, Redhat, Ubuntu, Solaris, HPUX.


GNU/Linux distribution for network virus || malware identification

I'm looking for a GNU/Linux distro that I can install in transparent setup to look for infected hosts on a LAN. I don't need to stop viruses and malwares but only identify them and the host where they come from. I don't necessarily need fancy graphics but I would like something pre- configured and possibly free. Any suggestions?


Where to find source code of Linux NTFS driver?

Brief description : Linux driver gives us a chance to interface with an NTFS filesystem. Thanks to this driver, we can use built-in Linux commands on an NTFS filesystem. Ex : ls, chown, chmod, cd, locate, rm, ln etc. Question : Where can I find this source code ? Why : Try to be familiar with NTFS


Make error - installing wifi driver offline

I need to install Kali Linux updates without Internet access on my laptop. I think I need to do this because I'm trying to install the wifi driver but I get an error when I try to `make`: > make ARCH=x86_64 CROSS COMPILTE= -C /lib/modules/3.7-trunk-amd64/build > M=/root/Desktop/rtl8723A_WiFi_linux_v4.1.3_6044.20121224 modules make: *** > /lib/modules/3.7-trunk-amd64/build: No such file or directory. Stop. make: > *** [modules] Error 2 Can anyone help? Again, no wired or wireless connection available for laptop (Yoga 13). The OS is a fresh install.


Immutable bit on AIX?

Under Linux I can:               chattr +i SOMEFILE      so that even root can't modify the SOMEFILE. Are there any similar solutions for AIX?


Poor random read SSD performance on Linux

I recently got an Intel 320-series SSD, and I am having difficulty achieving the advertised 38K IOPS for random 4K reads. Both with `fio` and my own hacked-together program, I am seeing around 6K IOPS. It's almost like the IO depth size does not matter, and the kernel is trying to fetch one block at a time. Example:               $ cat job     [randread]     filename=/dev/sdb2     rw=randread     size=128m     blocksize=4k     ioengine=libaio     iodepth=64     direct=1          $ sudo fio job     randread: (g=0): rw=randread, bs=4K-4K/4K-4K, ioengine=libaio, iodepth=64     Starting 1 process     Jobs: 1 (f=1): [r] [100.0% done] [25423K/0K /s] [6207/0 iops] [eta 00m:00s]     randread: (groupid=0, jobs=1): err= 0: pid=4678       read : io=131072KB, bw=24852KB/s, iops=6213, runt=  5274msec         slat (usec): min=1, max=94, avg= 5.00, stdev= 2.88         clat (usec): min=312, max=13070, avg=10290.25, stdev=1399.78         bw (KB/s) : min=23192, max=24464, per=97.08%, avg=24125.60, stdev=383.70       cpu          : usr=15.74%, sys=22.57%, ctx=31642, majf=0, minf=88       IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=99.8%          submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%          complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0%          issued r/w: total=32768/0, short=0/0          lat (usec): 500=0.01%, 750=0.01%, 1000=0.03%          lat (msec): 2=0.05%, 4=0.10%, 10=20.10%, 20=79.70%          Run status group 0 (all jobs):        READ: io=131072KB, aggrb=24852KB/s, minb=25448KB/s, maxb=25448KB/s, mint=5274msec, maxt=5274msec          Disk stats (read/write):       sdb: ios=30453/0, merge=850/0, ticks=319060/0, in_queue=319060, util=98.09%      The system is `Linux 2.6.35-31-generic #63-Ubuntu SMP Mon Nov 28 19:29:10 UTC 2011 x86_64 GNU/Linux`. `/dev/sdb2` above is a ~10GB partition on an 80GB SSD. `fio` is version 1.38. Would really appreciate thoughts on what might be wrong. PS: The partition in the above test (/dev/sdb2) is aligned on a 4K boundary. Reading from a larger span (size=10g) does not help.


Why does btrfs allow to create a raid1 with mismatched drives?

I'm creating a btrfs using               sudo mkfs.btrfs -m raid1 -d raid1 <small-disk> <large-disk> or     sudo mkfs.btrfs -m raid1 -d raid1 <large-disk> <small-disk>      it creates the fs with the size of the sum of the two disks/partitions, but                btrfs fi df <mountpoint>      gives me RAID1 for data, system and metadata How can this be correct? Is there some way like mdadm's               cat /proc/mdstat      to see what btrfs is doing and to assure myself my raid1 is secure? It's not terribly important data, hence it's ok to use btrfs, but i don't want to lose it either.


Total in `ls -l`

When I run `ls -l`, the following is displayed:               >: ls -l     total 320     -rw-r--r--   1 foo  staff    633  5 Apr 13:23 A.class     -rw-r--r--   1 foo  staff    296  5 Apr 13:24 A.java     ...      What does the `total` signify? Size? If so, what size?


How do I create new partitions and format my hard drive in parted?

I'm somewhat new to working with commandline tools when dealing with partitioning, so you'll have to excuse my newness. I'm basically trying to create a new logical partition on `/dev/sdb` and would like to install `ext3` on it. How would I do this, step by step, in `parted`? It's a brand-new hard drive with absolutely nothing on it.


Groups ssh user is apart of don't apply on SSHFS

I am connecting to a remote server over SSH but am running into a permissions issue. My remote account is `thelq` and primarily part of the group `thelq`. I'm also part of the generic group `users`. Another remote account called `game` is primarily part of the group `users`. On the remote server I can freely view and edit all of `game`'s files. However on the local server I'm apparently not part of the `users` group. Strangely explicitly specifying the `users` group for the gid option still doesn't allow me access to the `users` group Example of what I tried in command line:               [thelq@quackwall ~]$ sshfs -o idmap=user -o uid=1000 -o gid=1000 -o allow_other -o default_permissions quackgame:/home game-home            thelq@quackgame's password:     [thelq@quackwall ~]$ echo something >> game-home/game/INIT-SETUP     bash: game-game/game/INIT-SETUP: Permission denied      I'm confused on what else to do as Linux permissions are not my strong point. I was thinking that longing in as me on the remote machine would allow me access to everything the groups says I can but apparently not. Any suggestions? * * * As per @penguin359's request               [thelq@quackwall ~]$ ls -ld game-home     drwxr-xr-x 2 thelq allusers 4096 Apr  5 19:06 game-home     [thelq@quackwall ~]$ sshfs quackgame:/home game-home     thelq@quackgame's password:     [thelq@quackwall ~]$ ls -ld game-home     drwxr-xr-x 1 root root 4096 Jan  5 18:20 game-home     [thelq@quackwall ~]$ ssh quackgame id     thelq@quackgame's password:     uid=1000(thelq) gid=1000(thelq) groups=1000(thelq),4(adm),20(dialout),24(cdrom),46(plugdev),100(users),107(sambashare),109(lpadmin),110(admin)     [thelq@quackwall ~]$ ssh quackgame ls -ld /home/game     thelq@quackgame's password:     drwxr-xr-x 11 game users 4096 2011-04-11 21:59 /home/game


Is there a way to demux a h264 video stream from an flv (h264, aac)?

Using `ffmpeg` to demux an h264 stream from a .flv video always gives me a stream which I cannot remux into a .mp4 container (using either `MP4Box from package *gpac),` or `ffmpeg`). Here is the demuxing command which produces the "invalid" stream.. ( _Unknown format_ )               ffmpeg -i "(h264-aac).flv"  # get stream info       # Stream #0.0: Video: h264, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 259 kb/s, 29.97 tbr, 1k tbn, 59.94 tbc          ffmpeg -y -map "0.0" -vcodec copy -an -i "(h264-aac).flv" \                                              "(h264-aac).flv.h264"       I've also tried it with: -f h264, but get the same error. The above command works when run against a video in a `.mp4` container, so maybe this is something specific to `flv`(?). The closest I've come to isolating the h264 video stream is with the following command; but it wraps the stream in an `flv` container which has lost its aspect ratio....               ffmpeg -y -map "0.0" -vcodec copy -an -i "(h264-aac).flv" \                                              "(h264-aac).flv.NEW.flv"       Is there some way to grab this video stream? PS. I've treid with several different input .flv vids, ...same error.


What is the unit measurement used in edquota?

I have the following quota setting for ec2-user:               Disk quotas for user ec2-user (uid 500):           Filesystem  blocks   quota   limit   grace   files   quota   limit   grace           /dev/xvdf      32*      1       1   6days       8       0       0      However, when I donwload files with 3.1 MB it still works, then I try a new file with 1.5Gb and it still works, no warning or error messages show up. What is the unit measurement for the quota soft and hard limit in this case? E.g: bytes or mb or gb?


Distro with pip and npm as package managers?

Is there an attempt of distro around that for Python and Node code ( and Ruby , Lua ) would use Pip, NPM and rubygems and luarocks respectively ? It could simply work as a passthrough from native package manager. Say, for example, if i did "aptitude install" on a python package, apitude would be smart enough to go and fetch it using pip from pypi.python.org or a distro specific mirror with "stable" versions ( with an option to use the latest )


How to match stream against white-list and black-list?

How can I duplicate a pipe stream (output from another program) so that for every line, I can check whether it matches independent regular expressions (ideally, reuse a `grep` command with options like `-i` etc.) but process results of each expression separately? I want to define exit code from my `check` function as follows:   * no line in stream matches `blacklist`; AND   * at least one line in stream matches `whitelist` I want to process lines in memory without storing them to file, report exit code and pass original stream to another program using pipes (logging `whitelist` matches to `stderr` or elsewhere would be useful too). Usage would look like:               fetch-big-stream | check whitelist blacklist | cat     exitcode=$?      where `fork` duplicates lines, `whitelist` and `blacklist` are functions and `check` passess copy of stream to each separately and terminates once exitcode can be determined before `EOF`. There is also a problem with `|` implementation that does not propagate non-zero code.


Mac 10.9.1 // Gerris installation //

I am trying to install Gerris . The website is : http://gfs.sourceforge.net/wiki/index.php/Mac_OSX_Installation I followed the instructions. But I could not install Gerris Dependencies. I installed Xcode, Command line tools, Xquartz as the page suggests, but about brew not quite sure because of what terminal says for the steps below.As page says I make a directory.               % cd     % mkdir soft      As page says :Paths               For installed software to be properly localized, various environment variables have to be set accordingly in ~/.bashrc     % export PATH=$PATH:$HOME/soft/bin     % export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/X11/lib:$HOME/soft/lib     % export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/X11/lib/pkgconfig/:$HOME/soft/lib/pkgconfig     Note: make sure that the file ~/.profile contains the line     source ~/.bashrc     for these changes to be taken into account.      I created `nano ~/.bashrc` and included the lines:                   % export PATH=$PATH:$HOME/soft/bin         % export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/X11/lib:$HOME/soft/lib         % export       and pressed ctrl+X and then I created `nano ~/.profile` and include `source ~/.bashrc` on the last line and pressed ctrl+X. But at this stage below I stuck. Gerris dependencies Now that brew is installed, almost every dependency needed by gerris can be installed in just a single command line:               % brew install gtkglext     % brew install gnuplot     % brew install gawk     % brew install gsl     % brew install gfortran     % brew install open-mpi     % brew install proj     % brew install netcdf     % brew install ode     % brew install fftw     % brew install ffmpeg --with-theora     % brew install coreutils     % brew install autoconf     % brew install libtool     % brew install automake      When I type brew install gtkglext the terminal says               samires-mbp:~ samirebalta$ brew install gtkglext     -bash: brew: command not found      I did `~/.bashrc` and `~/.profile` what is wrong I do not know?


sed or tr one-liner to delete all numeric digits

So, I have this textfile, and it consists of mostly alphanumeric characters. It's a standard document. But since I copied it and pasted it from a PDF, there are page numbers in there. I don't much care for the occasional number that's not a page, so I figure I'll wipe them all out with `sed` or `tr`. Just marginally faster than find and replacing first zero, then one, then two, etc. in the GUI, after all. So how do I do that?


How can I get wireless and ethernet to work with ubuntu?

I have an acer aspire 7551 laptop running windows 7 and I've successfully used wubi to also install ubuntu (the latest release version). Wireless works fine on windows 7, but neither wireless nor ethernet works on ubuntu. In particular, the wireless icon shows up at the top-right (but no available connections show up when I click the icon). When I connect my ethernet cable (which works fine when I plug it into my PC) to my laptop when it's running ubuntu and click the wireless icon, auto-etho shows up as an option but when I click it, it works for a few seconds and then disconnects. (Note - ethernet also doesn't work in windows 7 even though all the latest drivers are installed) How can I get wireless and ethernet to work under ubuntu? **Additional Info** Ubuntu version: "Ubuntu 10.0 - the Maverick Meerkat" lspci output:               00:00.0 Host bridge: Advanced Micro Devices [AMD] RS780 Host Bridge Alternate     00:01.0 PCI bridge: Acer Incorporated [ALI] Device 9602     00:04.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 0)     00:05.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 1)     00:11.0 SATA controller: ATI Technologies Inc SB700/SB800 SATA Controller [AHCI mode]     00:12.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller     00:12.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller     00:13.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller     00:13.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller     00:14.0 SMBus: ATI Technologies Inc SBx00 SMBus Controller (rev 41)     00:14.1 IDE interface: ATI Technologies Inc SB700/SB800 IDE Controller (rev 40)     00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia (Intel HDA) (rev 40)     00:14.3 ISA bridge: ATI Technologies Inc SB700/SB800 LPC host controller (rev 40)     00:14.4 PCI bridge: ATI Technologies Inc SBx00 PCI to PCI Bridge (rev 40)     00:18.0 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor HyperTransport Configuration     00:18.1 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Address Map     00:18.2 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor DRAM Controller     00:18.3 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Miscellaneous Control     00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Link Control     01:05.0 VGA compatible controller: ATI Technologies Inc M880G [Mobility Radeon HD 4200]     01:05.1 Audio device: ATI Technologies Inc RS880 Audio Device [Radeon HD 4200]     03:00.0 Ethernet controller: Broadcom Corporation NetLink BCM57780 Gigabit Ethernet PCIe (rev 01)     06:00.0 Network controller: Broadcom Corporation BCM43225 802.11b/g/n (rev 01)      ifconfig -a output:               eth0      Link encap:Ethernet  HWaddr 20:6a:8a:1c:70:0e                 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)               Interrupt:16           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:76 errors:0 dropped:0 overruns:0 frame:0               TX packets:76 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:5840 (5.8 KB)  TX bytes:5840 (5.8 KB)


How does one find out how many bits a file has in one command?

I know I can use `ls -lat` to find out how many bytes has a file and then multiply by 8 to find out how many bits. But is this possible in only one command line?


Error loading shared library libSDL-1.2

I've compile ToME 3 game but I can run it, I've got:               tome3: error while loading shared libraries: libSDL-1.2.so.0: cannot open shared     object file: No such file or directory      I have installed libstd1.2 both devel and runtime packages. I have that library               $ ls /usr/lib/x86_64-linux-gnu/libSDL*     /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0     /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4     /usr/lib/x86_64-linux-gnu/libSDL.a     /usr/lib/x86_64-linux-gnu/libSDL_image-1.2.so.0     /usr/lib/x86_64-linux-gnu/libSDL_image-1.2.so.0.8.4     /usr/lib/x86_64-linux-gnu/libSDLmain.a     /usr/lib/x86_64-linux-gnu/libSDL.so      I've try to put `/usr/lib/x86_64-linux-gnu/` into PATH and also copy libSDL-1.2.so.0 to the directory where I have the game, but it not work. Someone ask the same question on AskUbuntu the solution was to reinstall the lib but it don't work.


Calling a script on machine shutdown

I want to call a script on machine shutdown and restart. I have written code like               #! /bin/bash     #chkconfig: 0 6 1 1     #description: Description of the script     # processname: killfoo     # this script starts and stops foo          # Some things that run always     LOG_FILE="/tmp/killfoo.log"          log() { while IFS='' read -r line; do echo "$(date) $line" >> "$LOG_FILE"; done; };     exec > >(tee >(log))     # Carry out specific functions when asked to by the system     case "$1" in       start)         echo "Nothing to done"         ;;            stop)         echo "Stopping script killfoo"         pkill   -9 foo >> $LOG_FILE 2>&1              ;;       *)         echo "Usage: /etc/init.d/killfoo {stop}"         exit 1         ;;     esac          exit 0      I created file /etc/init.d/killfoo having executable permission. I have enable this script for run level 0,6.               chkconfig --add killfoo     chkconfig --level 6 killfoo on      But script is not getting executed on machine restart. What could be the problem ?


How do I temporarily make Weechat's message area "full width" like irssi?

Coming from `irssi`, I'm used to being able to copy and paste messages from the message view of my terminal (PuTTY) running `irssi` with relative ease without having hard wraps on the text. This works when `irssi` is run directly, or when `irssi` is run in a screen session with the current window set to the size of the terminal (i.e. `Ctrl`-`a`, `:fit`). How do I achieve something similar for `weechat`? With the default layout, on the right, `weechat` draws a border and lists the nicks in the channel. On the left, there's a border for the date/time and the message source (the nick, or the event type). Is it possible to temporarily hide all the chrome of the window and present something like what's kept in the logs?


Ext4 - How to enable extra sanity, checksums, validations, tests of any kind?

I'm running Ext4 on a harddrive, and to be perfectly honest, I don't really trust the drive because it's old and has a few badblocks. I have nonessential data on the drive, so if it died tomorrow, then no big deal. However, I would like to know if/when it starts to die, and remount read only. Are there any options that will enable extra file checks on an Ext4 fs? (I don't care if it makes the filesystem slower.)


Trimming Filenames from the end

I have a folder with following mp4 file which are needed to be renamed               for filename in /media/usama/CRUNCH/RO_Plant/RO_Videos/*; do         File1=$filename         echo $File1     done     /media/usama/CRUNCH/RO_Plant/RO_Videos/Desal RO 16' Desalination Plants-JdN_Yx_5HzI.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/How Desalination Works-_H8EDLFNDtI.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/how membrane filter works with water-M3mpJysa6zQ.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Hydranautics - Spiral Wound Reverse Osmosis Elements-YlMGZWmh_Mw.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 1 of 3-6xD9FhbAIvY.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 2 of 3-Dt23yzCXaVA.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 3 of 3-VXyK20P6HD4.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/MED Desalination Process-5nDcxhkq8Js.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis Membrane Replacement Procedure-zNXYkH3uj-I.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis or RO System-BeXHKpuHVZg.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis Pressure Vessel-BeXHKpuHVZg.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/RO Process Equipments by R S Engineering, Mumbai-ijJ6QyaQ-Bk.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/The BioSand Water Filter-SlqAitfBbdQ.mp4      Now I want to trim the random words starting from **-** till **.mp4** such that this filename is converted from `The BioSand Water Filter- SlqAitfBbdQ.mp4` to `The BioSand Water Filter.mp4` for this I got partial success as is shown below               for filename in /media/usama/CRUNCH/RO_Plant/RO_Videos/*; do         File1=$filename         Out=${File1:0:${#File1}-16}".mp4"         echo $Out     done     /media/usama/CRUNCH/RO_Plant/RO_Videos/Desal RO 16' Desalination Plants.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/How Desalination Works.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/how membrane filter works with water.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Hydranautics - Spiral Wound Reverse Osmosis Elements.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 1 of 3.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 2 of 3.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 3 of 3.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/MED Desalination Process.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis Membrane Replacement Procedure.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis or RO System.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis Pressure Vessel.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/RO Process Equipments by R S Engineering, Mumbai.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/The BioSand Water Filter.mp4      Now when I add the last piece, it boils down to nothing?               for filename in /media/usama/CRUNCH/RO_Plant/RO_Videos/*; do         File1=$filename         Out=${File1:0:${#File1}-16}".mp4"         echo $Out         mv $filename $Out     done     /media/usama/CRUNCH/RO_Plant/RO_Videos/Desal RO 16' Desalination Plants.mp4     mv: target ‘Plants.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/How Desalination Works.mp4     mv: target ‘Works.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/how membrane filter works with water.mp4     mv: target ‘water.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/Hydranautics - Spiral Wound Reverse Osmosis Elements.mp4     mv: target ‘Elements.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 1 of 3.mp4     mv: target ‘3.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 2 of 3.mp4     mv: target ‘3.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 3 of 3.mp4     mv: target ‘3.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/MED Desalination Process.mp4     mv: target ‘Process.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis Membrane Replacement Procedure.mp4     mv: target ‘Procedure.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis or RO System.mp4     mv: target ‘System.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis Pressure Vessel.mp4     mv: target ‘Vessel.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/RO Process Equipments by R S Engineering, Mumbai.mp4     mv: target ‘Mumbai.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/The BioSand Water Filter.mp4     mv: target ‘Filter.mp4’ is not a directory


Problems installing Oracle 11g XE in Fedora 20 - No apex access, not network access

I need to setup a temporary Oracle XE database on a virtual machine to work as a server, so I choose Feroda as Oracle mainly support RedHat. So, this is what I did: a) Downloaded newest version of Fedora and installed it. Now I have Fedora 20 installed. b) Once in Fedora, I had downloaded `oracle-xe-11.2.0-1.0.x86_64.rpm.zip` and unzipped it. c) I had added my node to `/etc/hosts` (as `127.0.0.1` `oracleserver`) d) Run `# rpm -ivh downloads/oracle-xe-11.2.0-1.0.x86_64.rpm` e) Executed `/etc/init.d/oracle-xe configure` f) Choose all default (`8080` as HTTP port, `1521` for listener, my password and start on boot) g) Run `. ./u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh` h) Then sqlplus system and them `EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);` Sqlplus is running fine, but I have 2 problems: 1) When I go in Firefox and run "`localhost:8080`", it asks for the login for XDE and APEX. After I enter the login credentials (SYSTEM + password) the browser keeps loading indefenetely the page showing a blank page. So no access do APEX at all. 2) I cannot access Oracle from other nodes on network, either by the browser (like `192.168.0.174:8080` or `192.168.0.174:8080/apex` doesn´t work), or by SQLPLUS `(sqlplus SYS/pass@192.168.0.174)` I have triple checked the listener and it´s up and running. Also the database. I had tried several stuff, and had to reinstall it all 3 times, but until now no solution at all. I´m fighting that for 2 days now. So, how can I make ORACLE live to my network/browsers ? **[SOLVED]** Problem ALL related to firewall settings. No Oracle issue at all. I was using the wrong firewall profile. Opened 8080 and 1521 ports and all fine now.


Patching linux kernel fails?

From what I understand, I can easily upgrade my kernel by applying patches to it, opposed to recompiling the kernel every time. I'm trying to go from kernel 3.2.51 to 3.2.54 by applying all the patches in between. I'm trying to patch my 3.2.51 kernel (I downloaded it from `www.kernel.org` and compiled it myself) to 3.2.52. When I run this command (in the source directory `/usr/src/linux-3.2.51`):               $ gzip -dc /root/patch-3.2.52.gz | patch -p1      I get this error:               patching file Documentation/HOWTO     Reversed (or previously applied) patch detected!  Assume -R? [n]           Apply anyway? [n]      And it rejects all the changes. Can someone explain what I'm doing wrong?


Open window maximised on X startup

I have a .xsession script. I am opening a gnome-terminal in background. I would like to open it maximised. I use Cinnamon as window manager. I do understand usually window manager is responsible for resizing client X applications when maximise button is clicked. I want to know whether there is any way to achieve this.               ~$ cat .xsession     google-chrome > /dev/null 2>&1 &     gnome-terminal &     gnome-session --session cinnamon


Difference between two types of shell arithmetic

What is the difference between the following two shell arithmetic commands:               echo $[ $var1 - 1 ]     echo $(( $var1 - 1 ))      Assuming var1 = 5 for example.


tshark dump only when string is matched

I'm working on a web capture script where I only want to dump the traffic if the HTML body or URL contains a string defined in a .txt file. Here is my tshark command which dumps `src ip dest url` (HTTP host) which works like a charm.               tshark -i eth1 'port 80' -R 'http.request' -T fields \        -e frame.number -e frame.time -e ip.src  -e http.host \        -e http.request.uri -E header=y -E separator=, \        -E quote=d -E occurrence=f       Now here is where im stuck. How do I go about only triggering this dump when a user browses to lets say hidemyass or the HTML body contains key words like porn?


How do I set my monitor to widescreen mode in Mint when it doesn't recognize widescreen capability?

My computer is a former laptop from which I removed the screen. The graphics card is an ATI Radeon of some kind. I have it plugged into a small TV via VGA cable, but Mint still thinks I have the original laptop screen too. The external monitor displays in 1024x768 resolution, but when I use game consoles, and the two times I tested Mageia Linux, it displays in 1280x800 **[EDIT: I forgot, it was only the first time with Mageia 1, Mageia 2 didn't suport it]**. This resolution is also available for the laptop screen. I want to get the widescreen display to work for the computer, but Mint isn't allowing it. I've been looking at this page: https://wiki.ubuntu.com/X/Config/Resolution xrandr -q outputs this (not including the part below about the laptop monitor):               $ xrandr -q     Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192     VGA-0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm        1024x768       60.0*         800x600        60.3     56.2          848x480        60.0          640x480        59.9        I ran `cvt`               $ cvt 1280 800 60     # 1280x800 59.81 Hz (CVT 1.02MA) hsync: 49.70 kHz; pclk: 83.50 MHz     Modeline "1280x800_60.00"   83.50  1280 1352 1480 1680  800 803 809 831 -hsync +vsync      Then I copied that to xrandr, but xrandr didn't like it. When I sudo tried again it gave me this:               X Error of failed request:  BadName (named color or font does not exist)       Major opcode of failed request:  140 (RANDR)       Minor opcode of failed request:  16 (RRCreateMode)       Serial number of failed request:  25       Current serial number in output stream:  25      Does anybody know how to fix this?


When does the order of arguments matter?

In bash, I am not sure if my observation is correct. For most commands, option-like arguments, i.e. arguments that begin with `\--abc` or `-a`, can be anywhere in the list of arguments to the command, while other arguments have some fixed position in the list of arguments. I was wondering if there are some written/unwritten rules about this? Thanks!


Have to run Repair-Boot after booting windows

I have grub installed as my boot loader for dual booting windows 8 and Ubuntu. It works fine as long as I'm only booting Ubuntu but as soon as I boot windows, something stops working. The next time I reboot my machine, there is no grub menu, nothing. My BIOS seems to think there is no operating systems installed. I am working around this using the bootable USB I used to install Ubuntu to run repair-boot. After running it, I have the grub menu back and I'm back at the start. I know very very little about anything Linux so please keep it simple.


Installing different distro without losing /home

I have a 2 year old laptop with Linux Mint 13 on it. Recently I've been having some problems with it (computer freezing, my settings suddenly disappearing and more) so I've been thinking about installing a new distro. I was recommended Xubuntu and I want to try it. Is is possible to install it instead of my Mint, but keeping (it becoming my new /home) /home directory? I have lots of files in there, including various IDEs for various programming languages (my /home takes about 100 GB) and I'm 100% sure that if I decided to back up everything I would sooner or later realize that I forgot to backup something.


How to install drivers for intel GMA 3600 intergrated graphics system?

I am currently using crunchbang 11 32bit, on a laptop with Atom D2500/GMA3600. Does anyone know how to install a more modern driver - rather than the gma500? Is this even possible?


Debian/kfreebsd VirtualBox guest additions

I'm trying and failing to install the virtualbox guest additions for a unstable Debian/kfreebsd virtual machine running in VirtualBox. Without the guest additions, the idle process pegs one of my CPU cores. I've tried to install the `virtualbox-guest-additions-dkms` package, but that depends on `virtualbox-guest-utils` which apparently isn't packaged for Debian/kfreebsd. I've grabbed the `virtualbox-guest-additions-iso` package and tried to compile that but no luck there either, even with the kernel-headers installed. I've also tried install `kfreebsd-9.2-source` and compile the iso package and the source package that way but I only get "no targets found". VirtualBox does not come with FreeBSD guest additions, but there are guest additions for FreeBSD in the `emulators/virtualbox-ose-additions` port on FreeBSD. I'm looking for the equivalent of this port on Debian. Anyone have any thoughts?


Ubuntu use compiled package instead of apt-get

I have a compiled binary specifically sun Oracle java that I am using instead of Ubuntu`s apt-get version of java ( what ever it may be ). I am installing an apt-get package ( maven ) and would like apt-get to use the version of java I have manually installed I can not install any more packages or tools on the system. I have what ever Ubuntu LTS 12.04 comes with.


Setting programming font in RHEL 5 + gvim

I am working on RedHat RHEL5. I want to change the font in GVIM. The only font format that my GVIM accepts is               *-courier-medium-r-normal-*-*-140-*-*-m-*-*      It refuses to use `Courier\ New` or `Courier_New` names. The default font is ugly and I wanted to change it to something prettier, like `monospace` font that I use in my terminal, but `xfontsel` does not show his font. `set guifont=*` neither works. My questions are:   1. How to "convince" GVIM to accept other system fonts   2. Or, how to install additional fonts so they can be delivered to GVIM in `-*-*-*-` Morse code format **Edit** `:set guifont=*` gives error:               Font "*" is not fixed-width     Invalid font(s): guifont=*      To make the font selectable with `xfontsel`, additionally I had to use this trick:               xset fp+ ~/.fonts/  # maybe unnecessary     xset fp rehash     fc-cache


Path independent shebangs

I have a script that I want to be able to run in two machines. These two machines get copies of the script from the same git repository. The script needs to run with the right interpreter (e.g. `zsh`). Unfortunately, **both** `env` and `zsh` live in different locations in the local and remote machines: ### Remote machine               $ which env     /bin/env          $ which zsh     /some/long/path/to/the/right/zsh      ### Local machine               $ which env     /usr/bin/env          $which zsh     /usr/local/bin/zsh      How can I set up the shebang so that running the script as `/path/to/script.sh` always uses the `Zsh` available in `PATH`?


Booting Fedora in rescue mode

I have created a new Fedora live USB with the intention of booting into rescue mode and fixing the bootloader, so that I can dualboot win7 and Fedora 20. However, I do not understand how I am to boot into rescue mode, seeing as the installation boot prompt is not shown as described by the guide, I am taken directly to the installation process. Pressing tab when given the option to run Fedora Live allows me write stuff in a terminalish thingy, but writing               linux rescue      simply starts the Fedora Live as usual. Some sources claim that I need the DVD, not the LiveUSB. I will try this shortly.


Extract specific folder from a tar.gz

I know this question was previously asked on this site before like here 1 and here 2 but no success for me. I want to extract the `Measures` folder from my S012011_csv.tar.gz zipped file. If I do `tar -ztvf file.tar.gz` to see the content, you can see the folder directory structure: `global//scratch//chamar//data//S012011_csv/Measures/file1.csv` `global//scratch//chamar//data//S012011_csv/Measures/file2.csv` and so on (yes there are `//` and may be the real issue here). I only want to extract the subfolder `Measures` under folder `S012011_csv` in the current directory of the `.tar.gz` folder. I have tried all these options but no success:               tar -xvzf S012011-v41_csv.tar.gz --strip=6 ./global//scratch//chamar//book//S012011-v41_csv/Mearsures/*          tar -xvzf S012011-v41_csv.tar.gz --strip=6 global//scratch//chamar//book//S012011-v41_csv/Mearsures/*          tar -xvzf S012011-v41_csv.tar.gz --strip=6 global/scratch/chamar/book/S012011-v41_csv/Mearsures/*          tar -xvzf S012011-v41_csv.tar.gz global/scratch/chamar/book/S012011-v41_csv/Mearsures/*      What am I doing wrong? (I've asked this question on SuperUser.com but I think this site is more appropriate)


Dropbox on both Windows and Ubuntu 12.04.3 LTS

I have Dropbox installed on both Windows 7 and Ubuntu 12.04.3 LTS and there are two separate folders that are being synchronized so there is some waste of disk space.   I would like to have only one Dropbox folder to be synchronized and would like to see a link to this particular folder both on Windows and Ubuntu desktops. The problem is that my original Dropbox folder (the larger and complete one) is on a separate partition that is not mounted by Ubuntu at startup. How can I have this partition automatically mounted without me interfering ? Furthermore, if the Dropbox folder on Ubuntu is deleted will it be reflected to my Dropbox account and the online synchronized files? How could this be prevented? I would like to get help on this matter.


Strange message at Debian login. What does it mean?

In an attempt to learn more on the command-line I added Debian-7.4-Standard to my Acer-Aspire-One laptop. I am not sure as to what I did exactly, but after I managed to install the non-free firmware and manually installed network- manager to get a wired connection that worked well enough to use `apt-get update` and `apt-get dist-upgrade`, I started to see a strange message on my login prompt after I had booted into my Debian OS. I wrote out a copy of it and it looks like this on my login prompt:               Debian GNU/Linux 7 debian tty1          debian login: [   17.63024] ieee80211 phy0: brcm_ops_config: change monitor mode: false (implement)     [   17.630399] ieee80211 phy0: brcms_ops_config: change power-save mode: false (implement)     [   17.631562] ieee80211 phy0: brcms_ops_bss_info_changed: qos enabled: false (implement)      What does this mean? Is this a problem I need to worry about? If I hit enter the login prompt returns to just the usual `debian login:` prompt and I can login normally. * * * **Update:** I just noticed that when there is no WiFi signal my login prompt acts in the normal way. I am only seeing these messages when a WiFi signal is available.


Is installing Kali on LiveDVD advisable?

I want to install the Kali penetration testing software on a DVD or a CD as a LiveDVD / LiveCD. Google turned up results on installation for a Usb and hard drive / disk installation, but nothing for LiveCD/DVD. One site said that LiveDVD installation isn't suggested for Kali, because of installation problems. Will installing Kali on a DVD or CD give me anything serious to worry about? What about installing the image on a DVD / CD and booting from that (not sure of that's similar or different from LiveCD/DVD)? And if I do install it, what problems will it give me?


Tricks for avoiding bash history logging?

What are some tricks for avoiding bash history being logged in a fascist logging environment that does not involve modifying `.bash_rc` or deleting content from within the history file?


Temporarily suspend bash_history on a given shell?

Is there a way to temporarily suspend history tracking in bash, so as to enter a sort of "incognito" mode? I'm entering stuff into my terminal that I don't want recorded, sensitive financial info.


How to Lookup the values of an index values from a big data file?

I have a data file (data_array.txt in the example) and index file, index.txt, at which I want to extract the data from the data file that have the same ID in the index file and store in to a new file, Out.txt. I also want to put NA ,in the Out.txt, for those ID's that have no value in the data file. I know how to do it for one column. But my data has more than 1000 columns (from 1 to 1344). I want you help me with a script that can do it faster. My data file, index id and proposed out put as follows. data_array.txt               Id  1   2   3   .   .   1344     1   10  20  30  .   .   -1     2   20  30  40  .   .   -2     3   30  40  50  .   .   -3     4   40  50  60  .   .   -4     6   60  60  70  .   .   -5     8   80  70  80  .   .   -6     10  100 80  90  .   .   -7      index.txt               Id     1     2     8     9     10      Required Output is Out.txt               Id  1   2   3   .   .   1344     1   10  20  30  .   .   -1     2   20  30  40  .   .   -2     8   80  70  80  .   .   -6     9   NA  NA  NA          NA     10  100 80  90  .   .   -7


What is this .gtkrc file?

I was going through Tim Pope's dotfiles and I happened to notice that he had a `.gtkrc` file. What does this configuration file do? And how can I make one of those?