How to remove GNOME 3 and restore GNOME 2

I am on Debian Squeeze. In over-enthusiasm I added an experimental repo and installed GNOME 3 (here is the evil discussion on installing GNOME 3 http://forums.debian.net/viewtopic.php?f=6&t=60481) and now I am awe and shock to see only GNOME 3 as available desktop session apart from failsafe :( I know I did a total stupid thing but now, is it possible to remove Gnome3? And is it possible to have both GNOME 3 and GNOME 2 both on my box? FYI, I tried `aptitude remove` but it didn't help.


How to make Wi-Fi work on Dell Inspiron 14R laptop running Ubuntu 12.10?

I have seen that on most Dell laptops running Ubuntu 12.04 or 12.10, the Wi-Fi doesn't work. It appears the reason for this is the fact that Dell laptops have Broadcom wireless cards. How to make it work?


Change the time format for the touch command in BSD

I am wondering how to change the time format when I am modifying a time with the touch command in the c shell. For example I need to use               touch -a -t 051512002015 file.txt      This will change the access time to May 15th 2015, 12:00. What I want to do though is (notice year is first now)               touch -a -t 201505151200 file.txt      This is how touch works in Linux. I use UnxUtils on Windows, which I am almost sure uses c-shell touch. I want the commands to be consistent. Is it possible to change the c-shell touch command?


Is there an excellent tutorial on how to resize a rootfs partition (and shrink another) on a drive that is 100% allocated?

I'm experiencing the all-too-common "root partition full" situation. 100% of my hard drive is allocated. My home (ext4) partition has plenty of space to give up for my full root partition (rootfs). Is there an amazing step by step tutorial out there for this type of a scenario where the root partition (rootfs) needs to be expanded after shrinking an ext4 partition (my home partition)?


Find biggest files or directories

Which command will print the sizes of all files and directories in the tmp directory (including hidden ones) and sort them by sizes from largest to smallest in human readable format (e.g. 2 GB)? The output could be as follows:               file.mpg 2GB     file.avi 1.8GB     .backtup 1.7 GB (this is directory)      I tried to use the `ls` and `du` commands but was not able to find the right switches.


service to start on boot doesn't work with update-rc.d comand

I have installed redis server on my ubuntu based server, so I can start/stop/restart redis server, the redis_server.sh is already in the /etc/init.d. Now I want to make redis start on boot, I learned from website that by working the update_rc.d command, I can add / remove the service on boot. I tried the update-rc.d to add startup on boot, which does't work               root@ip-172-31-4-108:/etc/init.d# update-rc.d redis-server defaults     //System start/stop links for /etc/init.d/redis-server already exist.      In addition, there are some services I don't want to startup on boot, so I tried               root@ip-172-31-4-108:/etc/init.d# update-rc.d reids_6379 remove      Removing any system startup links for /etc/init.d/reids_6379 ...      But when rebooting next time, I still see that service running on boot.


problem with rsync. forgot the ending dot and can't find beackupfiles now

I am new with linux and tried to backu my files doing this:               rsync -arvu /home /etc /opt /var      I was in the desired directory (on an external hard-disk drive) and logged in as su. but no files where in my directory after that. And Ubuntu told me that my hard-dsik is full ... absolutely full... 0 Bytes left. then I did (with the dot in the end) this:               rsync -arvu /home /etc /opt /var .      and all worked fine... **BUT** my hard space (not the external one) is absolutely full now. **WHERE did rsync put the files of the first try? how can I remove them? ... HEELP! :-)**


Make `most` pager properly handle colours from standard‑input

How do I make the `most` pager properly display colours in text received from standard‑input? Note: I'm not sure whether or not it's a bug in `most`. I am not encountering the same issue with `less` and `more`, only with `most`, which otherwise works nicely as a pager used by `man`. I'm not posting an image, and invite people to try this (only if you have `most` installed):               $ command apropos zip | command grep --color=always zip | command less     $ command apropos zip | command grep --color=always zip | command more     $ command apropos zip | command grep --color=always zip | command most      `less` and `more` properly display colours, while `most` displays colours with additional “garbage” `^[[K` wrapping all coloured text areas. Surprisingly, this is OK:               $ (export PAGER=most; command man zip)      Am I missing something (the manual page for `most` did not help), misusing the command or is this something which I should report as a bug? ## A note on `less` (update): As Sparhawk mentioned in a comment, `less` does not work either if it's not given the option `-R` (or `\--RAW-CONTROL-CHARS`) or `-r` (or `\--raw-control- chars`), which may also be set in the `LESS` environment variable. And indeed, I first searched for a similar option for `most` (but failed to find one). ## Update All have issues with coloured UTF‑8 encoded text, not just `most`. In my case, the terminal is fine with it, so that's not the terminal. The same uncoloured UTF‑8 text is fine with all three pagers, so that's not the characters encoding.


How to access shared locations on a windows machine from a linux machine via terminal?

I’ve setup a Virtual CentOS machine and set up a bridged network and static IP so that it can communicate with other Windows machines in the network. Currently, to access any shared directory, I navigate using the GUI. These are the steps I follow:   1. Click on Places > and click on Network Servers. This opens the Nautilus Manager to show network servers. (screenshot below)   2. Then I double click on windows network. This shows me all the available domains in the network.   3. I double click the required domain which chows me all the machines under that domain.   4. I double click the machine which prompts for authentication. (screenshot below screenshot =))   5. After filling up the required details, clicking connect shows me all the shared folders in that machine. Now I’d like to access this shared location from terminal; so that I can use ‘cd’ command or something like that (maybe 'ls') to navigate through the folders or see the files in the windows share directory. How do I do this? ![Network Servers in Nautilus](http://i.stack.imgur.com/aFPUz.png) ![Authentication Information](http://i.stack.imgur.com/Jc06z.png)


Protect folder from sudoers

Is there an ability to not allow sudoers view your folder (only you and root can access folder)?


Please explain the -f option in pgrep

man `pgrep` says the following about `-f` option:                  -f     The  pattern  is normally only matched against the process name.                   When -f is set, the full command line is used.      What does it mean to say the full command line is used?


Is it viable to have a file with 700 permissions?

I have been wondering about the following thing: Consider Pc A. Pc A has n users. There is a folder with one file per user. There is some sensitive information for each usere there, so you don't want anyone except the owner of the file to be able to read/write from it. (not even the sudo of the other users) What is the correct approach to achieve that ? What I have thought of is to set `chmod to 700`


Why is there no "Euro English" locale?

I used to use the somewhat whimsical `en_DK.UTF-8` locale when installing a new system because that would produce (roughly) the locale results I wanted, even though I am not in Denmark.   * Measurements metric   * Sensible date and time formats, but day and month names in English      * 24-hour time format     * Work week starts on Monday     * Numeric date in (something at least resembling) ISO format, yyyy-mm-dd     * Informal date is dd/mm, not the other way around   * A4 paper size   * Euro currency   * System messages in English Alas, Ubuntu and Debian no longer seem to support the `en_DK` locale. I have been thinking there should be something like `en_EU` for "Euro English". Every place I have worked has had this sort of requirement -- the official language of the organization is English, but we want continental European defaults for everything else. I am imagining I am not the first person to think that a "location agnostic" English locale would benefit both me personally and the organizations I work for. So why does it not exist, and where do I look for further discussions and rationale? ... Or should I go ahead and propose it? To whom?


Update only one package with pacman

Is there a way to update only selected programs in pacman? I'm running ArchLinux on my netbook, and the complete upgrade of my system takes up more temporary space than I have on my system, so I'd like to just update one program at a time


Mass update of /etc/ldap.secret

I have a group of servers authenticating against an LDAP server. I would like to be able to periodically update the /etc/ldap.secret file with an updated secret. I've written a small script that reads a list of hosts in from a file and uses SSH to update all the servers but I keep getting a nagging feeling that there must be a better tool or method.


Batch copy and rename with regexp

I am wondering whether there is a way how to copy and rename a bunch of files without scripting. I have files with names like `prefix_12345678901_12345678901_suffix.ext` and I need to copy all of them into a given directory such that the copies are named like `1234567890_1234567890.ext` I also do not want to overwrite existing files in the target directory. I know I could do something like:               cp -n source/*.ext target      followed by               rename 's/.*([0-9]{11}_[0-9]{11}).*\.(.*$)/$1.$2/' *.ext      but this would make copies first and only then figured out whether the files already exist or not. I need sort of a reversed process... EDIT: Well, I guess this is scripting, but I finally suceeded with something like:               for i in /source/*.ext; do if [[ "$i" =~ [0-9]{11}_[0-9]{11} ]]; then cp $i /target/${BASH_REMATCH[0]}.ext; fi done;


Are there any MathType clones for Open/Libre - Office?

Are there any OpenOffice.org/LibreOffice equation editor/makers, similar to MathType?


firefox multiple profiles

I have two instances of firefox running under separate profiles:               $ firefox -P default &     ...     $ firefox -no-remote -P second &      Now I can open a new tab from the command line with:               $ firefox -new-tab http://unix.stackexchange.com      But how do I open a new tab in the second profile? This:               $ firefox -P second -new-tab http://unix.stackexchange.com      opens a tab in the default profile, while:               $ firefox -no-remote -P second -new-tab http://unix.stackexchange.com      complains that there is already an instance running under that profile.


LDAP : one suffix : search multiple separate Active Directory

I have configured an OpenLDAP 2.4.23 as a proxy to multiple separate Active Directory, it works fine when each AD as a different suffix/search base. I have an use case to fullfil : one application server is only able to check ONE LDAP server and it allows only to check ONE search base, and the users are in several seperate Active Directory. So I would like to configure OpenLDAP (or any other free directory) to work as a proxy and it should try each Active Directory to find is the user exists there, if not check the next Active Directory. I have an unique key for each user (so no problem with duplicate). I have already tried :   * to set multiple databases with the same suffix but openldap is not happy with that config   * to use meta (but the search base cannot be the same for two entries) If you have any idea how to proceed I would be grateful.


Mount home partition on user login

I got a VPS with a user dedicated to store my files. As i am aware of the current situation with the NSA and many other governments, and my VPS is hosted on a doubtful country i would like to ensure my privacy (not that i have any top-secret file, or anything similar). I am thinking of making the home folder of my user a truecrypt file, which would be mounted after a successful user login. Is it possible? And can the SSH login also prompt for the password to mount the file after login and before shell access? Something like: "insert user@host password:" and then "insert home folder password:" before shell access. If wrong it would start the working directory somewhere else, like on fs root. Can it be done?


How to restore /sysroot on Fedora 20

I can't boot my Fedora 20 system as usual. Upon boot I get the message               Entering emergency mode. Exit the shell to continue.      journalctl reveals the following:               systemd[1]: Starting Switch Root...     systemd[1]: Not switching root: /sysroot does not seem to be an OS tree. /etc/os-release is missing.     systemctl[391]: Failed to issue method call: Invalid argument     systemd[1]: initrd-switch-root.service: main process exited, code=exited, status=1/FAILURE     systemd[1]: Failed to start Switch Root.     systemd[1]: Startup finished in ...      I ran fsck on /dev/mapper/fedora-root, which appeared to direct a lot of stuff to /lost+found. It's now clean, apparently. ls / (from emergency mode) gives:               bin dev dracut-state.sh etc init lib lib64 proc root run sbin shutdown sys sysroot tmp usr var      I can ls each of these directories, but they appear much smaller than usual and lack stuff I know was there. Is this a consequence of emergency mode or a corrupted file system? My direct question is: how do I restore /sysroot and /etc/os-release? However, I'm worried that this isn't the only damage, and that when this is fixed more problems will be revealed, so my secondary question is: how do I detect and fix any further problems that might have been caused? I do not have a backup of these (I've just discovered that I'm stupidly only backing up /home, when I thought I was backing up everything). Background to the problem: I dual boot Windows and Fedora 20 on separate hard disks. /dev/sda and /dev/sdb both contain NTFS partitions for Windows. /dev/sdc is and SSD for /boot and everything except /home; /home is on /dev/md127. Everything was working fine, I booted into Windows for the first time in quite a while to use some Windows software, then booted back into Linux and had this problem. I've done this many times before in the past, so not sure whether or not this is the cause of the issue. /dev/sdc2 (where the OS resides) is an LVM partition. Please tell me if I can be any more specific, if I can provide any more information that is relevant, or if there are any additional diagnostics I can run. Thank you!


Debian access point is detected, but provides no Internet access

I am use Debian sid. I want to share my network (ppp0) via AP (Access Point) to my mobile device. This is my configuration. `/etc/hostapd/hostapd.conf` :               # WiFi Hotspot     interface=wlan0     driver=nl80211     #Access Point     ssid=PERSIB_nu_AING     hw_mode=g     # WiFi Channel:     channel=1     macaddr_acl=0     auth_algs=1     ignore_broadcast_ssid=0     wpa=3     wpa_passphrase=anggabaedeuh     wpa_key_mgmt=WPA-PSK     wpa_pairwise=TKIP     rsn_pairwise=CCMP      `/etc/dhcp/dhcpd.conf` :               option domain-name-servers 208.67.222.222, 208.67.220.220;     default-lease-time 600;     max-lease-time 7200;     ddns-update-style none; ddns-updates off;     subnet 192.168.0.0 netmask 255.255.255.0 {             range 192.168.0.200 192.168.0.229;             option subnet-mask 255.255.255.0;             option broadcast-address 192.168.0.255;             option routers 192.168.0.1;     }      and here my other config for calling AP :                iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE     echo "1" > /proc/sys/net/ipv4/ip_forward     ifconfig wlan0 192.168.0.1     hostapd -dd /etc/hostapd/hostapd.conf      In my mobile device, the SSID is detected. but when I try to access the Internet, I can't connect. What's wrong with my configuration? On my PC, I also installed Slackware-current and Ubuntu 12.04, and configured them in the same way, and it worked.               #uname -a     Linux angga.id 3.11-2-686-pae #1 SMP Debian 3.11.10-1 (2013-12-04) i686 GNU/Linux


How to redirect/forward between a tun/tap device and a socket using linux tools?

I have a socks5 proxy that is bind to eth0. It opens two ports, Port1 is used to connect to remote (for example a http server), Port2 is to listen for clients to connect. Then I created a tun device. And set routing table to make all data go through the tun device. Now is my question, how to link the tun device and Port2? So all data will actually go through the socks5 proxy? I have found tun2socks that could do this. But still, I am wondering if there is other ways like using iptables to archive that.


Compare an old file and new file, but ignore lines which only exist in new file?

I have two files:   1. `oldlist` - This contains a list of files and a md5 hash for each file. This was generated one year ago.   2. `newlist` - This also contains a list of files and a md5 hash for each file. However, some files have been changed (e.g. their md5 hash is different) and some new files have been added. I would like to see all differences between `oldlist` and `newlist`, but I want to ignore any files which don't exist in `oldlist`. That is, I don't care about new files. I only want to compare the md5 hashes for each old file, so that I can see if any files have changed within the last year. I have tried diff and comm, but have not found a solution yet.


How can I log all activity in a terminal window?

Ubuntu 10.04/GNOME "classic". How can I log all my "gnome-terminal-related" things? I mean ex.: I open up 2 gnome-terminal window and ssh to two different servers with them, work a couple of hours, then I close the gnome-terminal's window, then I need these two log files ex.:               logfile-2011-09-08-10-00-02.txt     logfile-2011-09-08-10-00-04.txt      So I need each of my GNOME-terminals to be fully logged. So e.g.: when did I gived out a command on a server, etc. Are there any good methods to fully log a terminal session? Are there any solutions to log menus, eg.: "smitty" from client side?


How can I test if a program is running from within a script

Let's assume that another user started a bunzip process, and I have a script that I'd like to start running after that bunzip finishes. What's the best way to check from inside my script that the bunzip process has finished? A call to `ps` with the pid specified? A pgrep bunzip? Assume that I will throw my script into a crontab that checks every 5 minutes to see if it can run. Also assume that I don't want to stop the bunzip, as it's been running for over an hour and will likely take another hour to complete. My first reaction would be to use something like               if `ps -p 12938`         # bunzip is done, execute the code     fi          # exit      But, I'm wondering if there is a better way. Also, I'm not sure how cross-unix ps -pid is.


Is MSN chat encrypted or not? If not how can I make it encrypted?

How can I force pidgin to use only encrypted connections when using MSN chat? I'm on Ubuntu 10.04


How many XUSER's

I'm working on a script an I need to show how many people are logged into XServer. It was suggested that I look at the last part of the who command (N:N):                user1  tty7         2013-10-10 12:14 (:0)      I'm trying to find information on this an having trouble finding it. Any info would be appreciated. Thanks.


Advice for managing SSH keys

_What is the best practice you have found for managing lots of SSH keypairs?_ I use SSH to connect to several systems, both at home and at work. I currently have a fairly small, manageable collection of keypairs for both work and home systems. I have a script that generates a named keypair so I can avoid confusion. My home network is comprised of my laptop (ubuntu), two desktops (ubuntu/fedora dual boot, fedora/windows dual boot), and a media system (ubuntu). At work I have my personal laptop (which I use for working from home), my desktop (fedora), a production system (RHEL), and an a laptop with windows (sigh) and a VM (fedora). All good so far. _(I have no interest in either putting my home keypair on my work system, or my work keypair on my home systems. And we have virtual user accounts to mechanize file transfers with other systems, where the private key must reside on the production machine, to transfer files between other systems.)_ But now comes Hadoop, a large cluster of 100+ systems, and with that more complexity, more users, and more keypairs. Now I need to manage keys. _(I need to clarify. I am a software developer consulting to a client who is deploying a Hadoop cluster. They need to manage keys. There will be many folks accessing the cluster, needing to place their public keys onto the system. As the resident Linux savant, they asked me for help. I advised hiring a system admin, but until they do, I am helping)_ When I need to publish the public key to a remote system, all of the 'how-to' web pages suggest either overwrite (>) (destroying existing keys), or append (>>) (which is good, preserves existing keys). But I would think preserving each public key on the destination machine separately, and combining them would be better. I am looking for advice. What is the best practice you have found for managing lots of keys? Thank you! * * * _Edit: One aspect is needing to place keys on lots of systems, and the concomitant CRUD (create, read, update, delete/disable) for specific users, which means needing to be able to identify which keys belong to which users._


Using prelink on manually loaded libraries? (like Java native libraries)

As far as I can tell, prelink can only works with dynamic libraries which an executable declares it needs at compile time (the libraries that can be found with ldd). It doesn't seem to include dynamic libraries which are manually loaded by the executable, like plugins or (in my particular case) Java native libraries. Is there any way to force prelink to cover these sort of libraries?


Solaris/OpenIndiana: Good documentation for permission-mechanism - roles, profiles and auths?

Are there any good documentation, HOWTOs or books (preferably free and online) describing the permission-mechanism for Solaris/OpenIndiana? How `auths`, `profiles`, `roles`, `projects`, `groups` and `users` relate to each other... how to use the mechanism optimally... and what exactly the various named `auths`, `profiles` and `roles` actually are allowed to do, and what users should be assigned them and why?


How to find process bind to network interface

I have two Hadoop processes (with web UI interface) running on a CentOS 5.3 machine inside a VirtualBox. I cannot access both interfaces from my host machine via port forwarding. Either first or second is not working and I cannot make both of them work concurrently. Both processes are configured via guest hostname - master. One web UI I can access via master:8088 or guest machine IP - 10.0.2.15:8088 but the second one I can access only via loacalhost:50070 I can make it work by modifying machine's `/etc/hosts` file:               127.0.0.1  localhost master      But obviously the second one stops working. I have several questions:   1. Is there a way how to make both working?   2. Is it possible to find a network interface the process is bind to?   3. What is the relation between hostname and network interface?   4. Is it automatic that when I access on a guest machine master:8088 it gets translated to 12.0.2.15:8088? To me it seems that I have to have a host entry which maps those two together. Am I right? (I do not consider DHCP). I tried to use `ifconfig` & `netstat` commands but that doesn't answer my questions so it would be great to clarify those.


what is it that clobbers my letters together in gedit?

sometimes after I've been editing a textfile in gedit the letters clobber together like this: ![enter image description here](http://i.stack.imgur.com/DVXW4.png) what is it that does that and how can i stop it from happening?


Xubuntu: Restoring the notifcation area in xfce4

While playing with xfce4 (on Xubuntu) I accidentally removed the notification area which is placed by default in the right of the top panel. Is there a way to restore it back to it's original state without diving into the process of adding, placing and adjusting icons? **EDIT** Actually, I'm looking for restoring the notification area to it's **default original state** by restoring its state "meta data" stored in the my /home directory, how can I accomplish that with the command line? Where should I go and what should I restore? Thanks


How to automatically launch a lxc container on ssh connection?

I'm attempting to setup a system that automatically creates a new sandbox on a ssh login to use as a temporary jump box into my server. So to do this I was wonder how to setup lxc to spin up a new shell in the container once there is a ssh connection then destroy that container after the session is closed. What would be the best way to go about this? EDIT: Thanks to everyone that has placed their input. I have been able to devise the method to do this same setup as follows: /etc/ssh/sshd_config: `match group ssh forceCommand sudo docker run --rm -t -i busybox /bin/sh` What this does is forces the user session to instantly go into a busybox container then delete the changes on exit. One could change or create their own image and specify this in place of busybox. Though this is included here since the only thing the default busybox container offers is wget and telnet which is good enough for most OOB testing/jump-boxes and this was the use case goal with this design.


Vim: word wrap for documents

Whats the best way to do word wrapping for a document in `vim`?   I'd like have each line wrap at 80 characters, not just visually wrap but enter a newline. I got this kind of working by using               :set wrap     :set linebreak      But if I go back and insert text on a previous line, it doesn't adjust the rest of the paragraph. It takes the overflow text and puts it on a newline, but the line that comes after doesn't get moved up to fill in the gap. So if I edit a previous line, my paragraph can look like this               A line that is 80 characters long     short line     A line that is 80 characters lone      I want it to be like this:               A line that is 80 characters long     short line A line that is 80     characters long


CentOS command issue

This is what I am trying to run in VMware using CentOS 5               /pwnat: invalid option -- p     usage: ./pwnat <-s | -c> <args>       -c    client mode (default)             <args>: [local ip] <local port> <proxy host> [proxy port (def:2222)] <remote host> <remote port>       -s    server mode             <args>: [local ip] [proxy port (def:2222)] [[allowed host]:[allowed port] ...]       -6    use IPv6       -v    show debug output (up to 2)       -h    show this help and exit     ./pwnat -c 3.3.3.3 -p 4444 --proxyhost IP 3.3.3.4 -proxyport 2222 --remotehost IP 8.8.8.8 --remoteport 4444     resulting in this reply      invalid option -- p


Shell Script for going through a dir recursively and chmodding based on conditions of file type

Can anyone point me to either code or a tutorial for writing a shell script that can recursively go through an entire directory structure (starting at the current working directory, or given an required argument of where to start at) and can:   1. Determine whether an item is a directory, and if it is, `chmod 755` it, or...   2. Determine whether an item is a file (not a dir), and `chmod 644` it. I'm looking for compatibility with Ubuntu, Debian, RHEL-Based, etc., so I'm not tagging this with any particular language. I'd like this in Bash, but if you have a ZSH script, that will work also.


How does pre-boot authentication with disk encryption work technically?

I'm looking for a solution to fully encrypt my dual-boot SSD drive (it's still new and empty, and I want to set up encryption before I put anything on it). While there's a lot of chaos on the web regarding that question, it appears that TrueCrypt might be able to do this, although I might need its boot loader on an extra boot disk. From what I'm reading, some Linux tools (including some modified GRUB2) might also be able to do that. However, I have my doubts, and no article I read really went in deep enough to answer a basic question: if the whole disk is encrypted, and some pre-boot tool asks the user for a key to decrypt it, doesn't that mean this tool has to run beneath the OS that's going to boot? In other words, are there tools that leave the OS unaware of the fact that the disks it sees are actually encrypted? If there's no such tool, doesn't that mean the decryption tool somehow has to pass decryption information to the OS on boot? I can imagine that this would be hard to do cross-platform.


How to delete a directory from terminal?

I'm trying to delete a directory after a series of events take place. That being said, I need to be able to place this in a file to execute once said events take place.


Chown permission denied on owned dir

I have following directory (`/usr/local`)               rwxr-xr-x. 43 root root  4096 Jul 25 14:19 .     rwxr-xr-x. 14 root root  4096 Feb 21 10:27 ..     rwxr-xr-x.  2 root root  4096 Jun 28  2011 bin     [...]     rwxr-xr-x   1 root root  8192 Jul 25 13:41 bad_dir     rwxr-xr-x.  4 root root  4096 Mar 28 11:56 good_dir      I am logged as root. When I run `chown root:root good_dir` everything is ok, but when I run `chown root:root bad_dir` I got `chown: changing ownership of '/usr/local/bad_dir': Permission denied` What is wrong with bad_dir? What should I change to make `chown` working correctly? I see a dot in the end of permissions, but I don't know what does it mean. **Update** Running               echo 0 > /selinux/enforce     chmod 755 bad_dir      gives also `chmod: changing permissions of 'bad_dir': Permission denied` **Update 2** Output of `ls -la /usr` is               total 128     drwxr-xr-x.  14 root root  4096 Feb 21 10:27 .     dr-xr-xr-x.  24 root root  4096 May 28 08:22 ..     dr-xr-xr-x.   2 root root 28672 Jun 27 10:29 bin     drwxr-xr-x.   2 root root  4096 Jun 28  2011 etc     drwxr-xr-x.   2 root root  4096 Jun 28  2011 games     drwxr-xr-x.  36 root root  4096 Jul 23 14:04 include     dr-xr-xr-x.  12 root root  4096 Apr 11 17:10 lib     dr-xr-xr-x.  45 root root 36864 Jul 23 14:04 lib64     drwxr-xr-x.  14 root root  4096 Mar 28 11:58 libexec     drwxr-xr-x.  43 root root  4096 Jul 25 14:34 local     drwxr-xr-x.   3 root root  4096 Feb 21 10:27 man     dr-xr-xr-x.   2 root root 12288 Jul 23 14:04 sbin     drwxr-xr-x. 106 root root  4096 Mar 28 12:00 share     drwxr-xr-x.   4 root root  4096 Nov 20  2013 src     lrwxrwxrwx.   1 root root    10 Nov 20  2013 tmp -> ../var/tmp


Overwrote Windows with Linux, how can I recover data?

While installing Ubuntu 11.10 (ext4) I accidentally chose a wrong partition and it overwrote my Windows 2003 installation (ntfs). How can I recover files? So far I tried photoRec and it recovered some. Testdisk refuses to recover the entire partition, perhaps because it would have to recover a partition it is running from. Should I try making a liveCD "rescue disk" and run `testdisk` from there? Is there any software that could help me? Or should I install Windows again on another partition and try recovery with some Windows software?


Dealing with script interruption

I need to iterate over between 120k and 500k files. `find` handles this well.               find $PWD -type f -path "fragments/*.pdbqt"      For some reason I want to list the same set of files again, in the same order. I don't mind if the list is sorted alpha-numerically or by `fstat` calls or whatever. Using `sort` is not an option because it needs to know the full `find` output before proceeding, slowing down the script execution. Do you know some way to accomplish this? **Update.** I described my problem poorly. While my script is processing this large number of files, a light outage might occur, and the UPS could go down. My script should continue from where it left off. How can I process the remaining files?


What are the user interface subsystems, their components and responsibilities?

I am trying to understand the different subsystems that are in charge of the user interface, the terminology to refer to them, and how they are structured; so far I know there are: At the top level: _desktops_? (kde, gnome, etc) Then we have:   * a display manager (also called desktop manager or desktop environment)   * window manager   * anything else? I'm making this a community wiki, I'd like this to be a central place for *all there is to know (from the user perspective) regarding user interface subsystems in Linux; what I would like to know is what are the components of each, and what are the responsibilities of each, i.e. I would like to know things like:   * what exactly is in charge of the global shortcut keys, when I open up the "run application" dialog, who is doing that, when I press a key to show the desktop, run a terminal, maximize a window, etc, who is capturing that and sending it over to the right window;   * who is in charge of drawing the desktop, the workspaces, etc.   * what are the environment variables that can give me information regarding these components   * Is the "main menu" a subsystem, or a component of a subsystem? It would also be nice to compile a list of the most popular desktops/subsystems, which ones run under each, can you mix and match desktops/desktop environments/window managers, etc? Finally, how do I tell which desktop/subsystems are actually running (active?) on the system, can different users have a different subsystem each?


How to find information about the system/machine in Unix?

I have always found it difficult to find information about the system itself in Unix, whether it be   * Which OS I am using (version number and all, to compare it with the latest available builds)?   * Which Desktop Environment am I using? If I am using KDE, most of the programs begin with a K and I can say I am using KDE, but there should be some way to query this, say from a script.   * Which kernel version am I using? (For example, I am using Fedora, and I want to know what Linux kernel version I am using) Basically, what I miss is a single point/utility that can get all this information for me. Most of the times the solutions to the above would themselves be OS specific. Then, you are stuck.


destination IP mangle table

I have machine with 2 interfaces:               eth1 connected to internet (ip xx.xx.xx.xx)     eth0 connected to my laptop (ip yy.yy.yy.yy)      I add those lines to the firewall file in order to manage the bandwidth               iptables -t mangle -N TRAFFICSHAPING 2> /dev/null     iptables -t mangle -A PREROUTING -i eth0 -d ! yy.yy.yy.yy -j TRAFFICSHAPING     iptables -t mangle -A PREROUTING -i eth0 -p tcp -d yy.yy.yy.yy --dport 3128 -j TRAFFICSHAPING     iptables -t mangle -A OUTPUT -o eth0 -p tcp -s yy.yy.yy.yy --sport 3128 -j TRAFFICSHAPING     iptables -t mangle -A FORWARD -j TRAFFICSHAPING.      in this way I control the bandwidth for all the website. What do I do need to do if I want to control a specific website? For example: if the user try to download from 4shared.com he will get 400Kb/s , and get full speed for the rest.


What does the errors=continue mount option mean?

On the output of the mount command on my system there are some lines like the following:               /dev/sda2 on /var/log type ext3 (rw,relatime,errors=continue,barrier=1,data=ordered)      And inside the parenthesis as you can see it says `errors=continue`. What does this mean? Is there any error on the sda2 partition? Shall i consider this or can I just ignore it?


Next day of the user entered date - date +1 day

I am new to scripting I needed a script in the AIX environment to get the next days date based on the date entered by the user of the script. After hard time browsing for this I got a piece of code which does the reverse of the goal which i had to achieve. It gets me one day before(Yesterday's) the date entered by the user. The code is as below               #!/bin/ksh     echo "Enter the date (YYYY/MM/DD):"     read date     YEAR=`echo $date | cut -d"/" -f1`     MONTH=`echo $date | cut -d"/" -f2`     DAY=`echo $date | cut -d"/" -f3`     DAY=`expr "$DAY" - 1`     case "$DAY" in     0)     MONTH=`expr "$MONTH" - 1`     case "$MONTH" in     0)     MONTH=12     YEAR=`expr "$YEAR" - 1`     ;;     esac     DAY=`cal $MONTH $YEAR | grep . | fmt -1 | tail -1`     esac     echo "Yesterday's Date is $YEAR/$MONTH/$DAY"      Can some one please help to me acheive this. That is to get the next day of the user entered date. Desired Output:               Enter the date (YYYY/MM/DD): 2013/09/30          Tomorrow's Date is 2013/10/1


Compiling Wine 1.7.1 from git in Gentoo

Trying to compile Wine 1.7.1 with the great new D3D and Opengl patches. I proceed like this : 1-Download the GIT source code from here : https://github.com/tpruzina/wine-1.7.1-d3dstream_patches-gentoo_compat_patches 2-Run the script the author made to build both 32 bit and 64 bit libs, wich is basically create 2 directories one for each arch and configure / make 3- The configure goes kind of well for what I see but then the make crashes badly here :               make[1]: Leaving directory `/home/cf/Downloads/wine-1.7.1-d3dstream_patches-gentoo_compat_patches-master/wine64/dlls/dxguid'     make: *** No rule to make target `dlls/ntoskrnl.exe/ntoskrnl.exe.spec', needed by `dlls/ntoskrnl.exe/libntoskrnl.exe.def'.  Stop.      Full configure and make logs here : http://pastebin.com/vRZpUVH1 Thank you !


FTP error 553could not create file in RHEL

We need to transfer a file from local machine to remote machine. Remote machines settings is as below:               [540607@hsldevoradb ~]$ su - Saphr002     Password:     [Saphr002@hsldevoradb ~]$ pwd     /odi/CSV/in     [Saphr002@hsldevoradb ~]$ ls -ld /odi/CSV/in     drwxrwxr-x. 2 oraedw oedw 4096 Oct 28 18:33 /odi/CSV/in     [Saphr002@hsldevoradb ~]$ groups     Saphr002 oedw     [Saphr002@hsldevoradb ~]$ touch a     [Saphr002@hsldevoradb ~]$ ls     a      Here `/odi/CSV/in` is the home directory for the user Saphr002. There is full permission for the directory `/odi/CSV/in` to the user Saphr002 and we are able to create a file inside that directory remotely. But Whenever we try to transfer file from `ftp`, it will throw "553 could not create file" error.               C:\Users\osprbs01>ftp 192.168.5.52     Connected to 192.168.5.52.     220 (vsFTPd 2.2.2)     User (192.168.5.52:(none)): Saphr002     331 Please specify the password.     Password:     230 Login successful.          ftp> put test.csv.odt     200 PORT command successful. Consider using PASV.     553 Could not create file.     ftp>      Kindly help to transfer the file through `ftp`.


How to install much newer mpt2sas driver version in debian squeeze?

Linux debian squeeze 6.0.6 (2.6.32-5-amd64) is supplied with quite an old 02.100.03.00 version of the mpt2sas driver. I do wish to install a much **newer mpt2sas driver version**. In know there are backported kernel versions available, like bpo.3 and bpo.4. Those backports both contain version 10 of the mpt2sas driver. The mpt2sas.ko module is already blacklisted from being loaded during boot, with:               $ echo 'blacklist mpt2sas' >> /etc/modprobe.d/mpt2sas.conf; depmod; update-initramfs -u -k $(uname -r)      For this mpt2sas driver are precompiled binaries available in rpm format for RHEL5 and SLES10, and there is source code available. How can a newer much mpt2sas driver be installed in debian?


Create and control start up scripts in BusyBox

I have compiled a custom linux kernel in BusyBox. BusyBox `init` does not support runlevels. When the kernel boots up in BusyBox, it first executes `init` which looks for the specified runlevel in `/etc/inittab`. BusyBox `init` works just fine without `/etc/inittab`. When no `inittab` is found it has the following behavior:               ::sysinit:/etc/init.d/rcS      This part is very clear to me, but I would like to know how to manage daemons that start up networking, create serial ports, or start `java` processes. I have looked in the scripts that reside in `/etc/init.d/` but I don't understand how to manage them. I am looking for a good tutorial or solution to control these services myself without an automated tool like `buildroot`. I want to understand how these scripts work and how to create devices in `/dev/` (right now I only have `console` and `ttyAM0`).


Stop browser window from switching workspace and getting focus when opening a link?

(I just switched from Gnome 2 to Xfce 4, so I have still to find my way around how Xfce works.) Iceweasel is opened on Workspace 1, Icedove is opened on Workspace 2. I click at a link in Icedove, which opens a tab in Iceweasel. Great, **but** : _Iceweasel_ moves to Workspace 2 and gets focus. Can I configure it so that windows always stay on their workspace, no matter if other application interact with them? And that the focus doesn’t get changed? On Gnome 2, Iceweasel stayed on Workspace 1, but it was highlighted/blinking in the taskbar of Workspace 2 (instead of being focused). I’d like to have that (or a similar) behaviour in Xfce, too.


How to update font path?

I am using OpenBSD 5.5 and have just installed a package named xpdf The installation completed with the following message:               You may wish to update your font path for /usr/local/share/ghostscript/fonts      What exactly do I need to do?


How to change partition UUID (2 same UUID)?

I have a fedora guest OS in VMware. I want to expand `/boot` partition, so I add another virtual disk to this VM, and try to clone the disk. After `dd if=/dev/sda1 of=/dev/sdb1`, `blkid` report that **/dev/sda1** and **/dev/sdb1** have same UUID/GUID. It's weird that there're 2 same UUIDs in the universe, how to change one of them to another UUID value?


Forcing sudo to prompt for a password

If I do the following:               sudo su -     //enter password     exit     exit     //login again straight away     sudo su -      The second invocation of sudo does not request a password because even though I have logged out again, I am still within some time limit meaning that I do not need to be prompted for my password again. Because I am trying out some new privs to make sure they work, this is really slowing me down while I wait for the timeout to happen. Is there a command I can run to reset the timeout? I don't want to change the timeout or affect other users, by the way!


Using KDE in Debian Squeeze

I just installed Debian Squeeze and it defaulted to the gnome desktop environment. I have installed KDE via the package manager but do not know how to set it as the default environment. Any help would be appreciated.


How do I change the GRUB default boot?

I'm trying to configure grub on my computer. I use the dual boot with Windows and Ubuntu. The grub always suggest with a countdown from 10 seconds to boot the Ubuntu. However, I do not want to be that way because other people in my home also use the computer and do not have much affinity with Linux. I wonder if there is a way to set Windows as the main option. I found these commands but I could not move much:               ~$ grub-     grub-bios-setup       grub-mkconfig         grub-mkstandalone     grub-editenv          grub-mkdevicemap      grub-mount     grub-file             grub-mkfont           grub-ntldr-img     grub-fstest           grub-mkimage          grub-probe     grub-glue-efi         grub-mklayout         grub-reboot     grub-install          grub-mknetdir         grub-render-label     grub-kbdcomp          grub-mkpasswd-pbkdf2  grub-script-check     grub-macbless         grub-mkrelpath        grub-set-default     grub-menulst2cfg      grub-mkrescue         grub-syslinux2cfg      Could you help me?


How to get the network status (online/offline) and attribute it to a variable in shell script?


How do I prevent expansion when I use a pattern as argument to a script?

I need a very simple script which does this:               mogrify -resize $1x$2^ -gravity center -crop $1x$2+0+0 $3      so that I can call it in this way:               cropresize.sh 110 110 *.png      the problem is that the shell expands the `*.png` pattern instead of passing it as it is to the script. How can I achieve this (script, alias or any other equivalent solution is fine)?


TAR: better to skip directory or use split

I've got a file.tar.gz that I create and backup to Amazon S3. It's gotten bigger than Amazon's limits and thus has not been backing up. This is my current command:               tar -cpzf file.tar.gz directory/      Is it better, with TAR's --exclude functionality to skip a directory where the bulk of files live or TAR and Gzip the entire directory and then use something like 'split' to break it up into smaller chunks?


How to find files compared to the time of a specific file

How can I search for files that were modified or changed 5 minutes before and 5 minutes after, a certain file. I have tried               mint@mint ~/Desktop $ touch -t 201210101315 /tmp/timestamp     mint@mint ~/Desktop $ sudo find . ~ -cmin -5 | xargs ls -l      to create a temp file with that time stamp and search for files changed within 5 minutes but I'm only getting files changed 5 minutes within current time. What is the simplest way?


Which filesystem to use when a samba share should allow for NTFS encryption?

I'm using a NAS (Buffalo LinkStation Pro with SSH access, if that matters) which runs Linux (`2.6.31.8 #1 Fri Jun 8 11:07:30 JST 2012 armv5tel GNU/Linux`, with `smbd --version` = `Version 3.0.30-1.4.osstech`), while all clients run Windows 7. Currently, the shares are on a xfs partition. How can samba be modified such that the share behaves like an NTFS share to the clients, i.e. allowing for encryption? Or do I need to reformat the partition as an NTFS drive (or more likely, use a loop-mounted NTFS file)?


How to make ghostscript not wipe PDF metadata

Ghostscript wipes the PDF metadata like `author, title, subject` etc. How can I tell ghostscript not to touch the metadata? I invoke it as follows:               gs \       -dBATCH                    \       -dNOPAUSE                  \       -sOutputFile=<output_file> \       -sDEVICE=pdfwrite          \       -dPDFSETTINGS=/ebook       \       <input_file>


Difference between route cache and neighbor table

Can someone please explain differences between kernel route cache and neighbor table? They seem to serve similar purpose, work with the same mechanisms (garbage collected) and both manage routes...


Why does cat x >> x loop?

The following bash commands go into an infinte loop:               $ echo hi > x     $ cat x >> x      I can guess that `cat` continues to read from `x` after it has started writing to stdout. What is confusing, however, is that my own test implementation of cat exhibits different behavior:               // mycat.c     #include <stdio.h>          int main(int argc, char **argv) {       FILE *f = fopen(argv[1], "rb");       char buf[4096];       int num_read;       while ((num_read = fread(buf, 1, 4096, f))) {         fwrite(buf, 1, num_read, stdout);         fflush(stdout);       }            return 0;     }      If I run:               $ make mycat     $ echo hi > x     $ ./mycat x >> x      It does _not_ loop. Given the behavior of `cat` and the fact that I'm flushing to `stdout` before `fread` is called again, I would expect this C code to continue reading and writing in a cycle. How are these two behaviors consistent? What mechanism explains why `cat` loops while the above code does not?


sorting threads in mutt

I'd like to have mutt sort messages newest first, and have threads displayed with the newest message at the top of the thread. Right now I have the message list in the correct order, but the sub-sorting within threads is backwards (newest at bottom of thread). Here's my current configuration...               set sort = threads     set sort_aux = reverse-last-date-received      Is there any option to control sorting within threads?


Dual keyboard shortcuts in Gnome

I would like to set multiple keyboard shortcuts doing the same thing. My particular example is Volume Up/Down, I would like to retain the standard settings I have (Sound/VolumeUp - XF86AudioRaiseVolume, my laptop dedicated button) and I would like to add a second set (Tux+Up). How can I do that? Thanks a lot.


Is there an easy way to create a FreeBSD rc script?

I have a FreeBSD jail in which I run a server using the command:               /usr/sbin/daemon /path/to/script.py      At the moment I have to run this command every time I restart the machine and the jail starts. I'd like to have this command started from `/etc/rc`. Is there an easy way to create a FreeBSD rc script for a `daemon` command? * * * **UPDATE:** I read through this BSD documentation about rc scripts, and from that I created the following script in `/etc/rc.d/pytivo`:               #!/bin/sh          . /etc/rc.subr          name=pytivo     rcvar=pytivo_enable     procname="/usr/local/pytivo/pyTivo.py"          command="/usr/sbin/daemon -u jnet $procname"          load_rc_config $name     run_rc_command "$1"      This works to start the python script I am wanting as a daemon when the jail starts... (given `pytivo_enable="YES"` is in `/etc/rc.conf`) but the rc script doesn't know if the daemon is running (it thinks it isn't when it is) and it gives a warning when I try to start it:               [root@meryl /home/jnet]# /etc/rc.d/pytivo start     [: /usr/sbin/daemon: unexpected operator     Starting pytivo.     [root@meryl /home/jnet]#       So it's _close_ , and it _works_ , but I feel like I should be able to get better functionality than this.


wget duplicate files

I'm executing the command: > wget -b --no-clobber -nc -w 0 -Q 0 -r -E -e robots=off -U mozilla -t 0 --no- > dns-cache -4 -R gif,jpeg,tif,jpg,pdf,bmp,png,css,js > http://www.mywebsitearchive.com Problem: If I re-run the command (when necessary if wget abruptly stops) I get duplicates for [some] files, such as example.html and example.1.html. Oddly enough a .2.html .3.html is never created. Any idea how to prevent this?


How to install Nvidia drivers on Debian Jessie

I have installed the Nvidia drivers according to the wiki but with no success. The system hanged during boot. So, how can I install the drivers successfully on Debian Jessie? My PC's specs: GPU: GeForce 7600GS, kernel: 3.10-3-amd64


How to dual boot linux and windows 8.1?

I have a computer running Windows 8.1 and I would love to dual boot it with Linux. I am very new to Linux. I have run it in a virtual machine a few times before, but virtual machines are slow. I want to run it in real time with basically every resource in my computer used on Linux. I have tried installing Ubuntu but it gets confusing once I have to pick partitions for things and I do not want to erase anything from my Windows partition by accident. Does anyone have any suggestions for someone with my experience or lack there of. I understand it is a broad question, but please help a fellow computer wanna-be enthusiast out. T


How do I pause the output of minicom?

What is the key combination to pause/freeze the output of minicom? At times the output scrolls very quickly and it makes it difficult to analyse some event. I know I could instead capture to a file but I would really prefer to be able to just pause.


How can I find out which version of screen I am using?

Further to my previous question on `screen` not splitting my terminal , I got to the point where I can split my terminal horizontally but not vertically . This documentation says that vertical splitting requires `screen` >= 4.1. So how can I find out which version of `screen` I am using?


mutt SMTP TLS error sending mail

When I try to send a mail, I get the following error: gnutls_handshake: An unexpected TLS packet was received. This is my .muttrc (myname, myaddress and mymail are placeholders):               # Automatically log in to this mailbox at startup     set imap_user="myname"     set imap_pass=""     set spoolfile="imaps://imap.myaddress/Inbox"     set folder="imaps://imap.myaddress/Inbox"     set record="=Sent"     set postponed="=Drafts"          # define how to send mails     set smtp_url="smtps://$imap_user:$imap_pass@smtp.myaddress:587"          # activate TLS if available on the server     set ssl_starttls=yes          # always use SSL when connecting to a server     set ssl_force_tls=yes          # wait to enter mailbox manually     set imap_passive          # Automatically poll subscribed mailboxes for new mail (new in 1.5.11)     set imap_check_subscribed          # Reduce polling frequency to a sane level     set mail_check=60          # And poll the current mailbox more often (not needed with IDLE in post 1.5.11)     #set timeout=10          # keep a cache of headers for faster loading (1.5.9+?)     #set header_cache=~/.hcache          # Display download progress every 5K     set net_inc=5          # Cancel a message when subject is blank     set abort_nosubject=yes          # Set default editor     set editor="gvim -v"          # Asks to include message when replying     set include=ask-yes          # Asks to postpone a message when not sent     set postpone=ask-yes          # Ask before printing     set print=ask-yes          # set from to ensure mutt doesn't put user@localhost.localhost      set from="myemail"     set use_from=yes     set envelope_from="yes"


Generate nodes.pp using hiera in puppet

I have a environment that has several environments like production staging etc . Now what i want is that I can re-use the **nodes.pp** written for one environment for the other. Example - Suppose I have 2 environment production and staging. Each contains a web server. Now if I already have nodes.pp (or some other manifests ) written for a node in a environment, how to use hiera-puppet to generate this nodes.pp according to the environment.               +++     ++++Production      +--------------server1-production     +--------------server2-production     ++++Staging     +--------------Staging-web1  (Needs the same classes as server1-production)     +--------------Staging-web2  (Needs the same classes as server2-production)


Downgrade package from backports back to stable

I updated `tmux` on my VPS with:               apt-get install -t squeeze-backports tmux -V      And needed to get back to previous version to recover some running sessions, so I went to look which version of `tmux` is the right for Debian and then downgraded with:               apt-get install tmux=1.3-2+squeeze1      But it took me a lot of time to figure out this specific command and look for a proper version. Is there a shortcut that automatically gets the stable version? I tried different combinations for `-t` flag, but it didn't help. **UPDATE** (`apt-cache policy tmux` for debugging):               tmux:       Installed: 1.6-2~bpo60+1       Candidate: 1.6-2~bpo60+1       Version table:      *** 1.6-2~bpo60+1 0             200 http://www.backports.org/debian/ squeeze-backports/main amd64 Packages             100 /var/lib/dpkg/status          1.3-2+squeeze1 0             500 http://debian.newdream.net/ squeeze/main amd64 Packages             500 http://security.debian.org/ squeeze/updates/main amd64 Packages


How to overwrite stdout using echo?

We know to overwrite `bar.txt`, we can use this:               echo "foo" > bar.txt      but how can we overwrite to the standard output? I tried this command:               echo "foo" >      but it failed. I want this because I want to print something like this:               Hello            world          I'm           HERE       one word at a time and I want to delete the previous word (one word at a time on standard output).


Time requires to synch. UNIX server with NTP server; after manually chaging te UNIX server's time

I have a GPS server with NTP output. I want to synchronize the clock on the UNIX server using the NTP output of the GPS. After changing the UNIX server time manually, UNIX server takes a long time to synch with GPS time. for example if I change the UNIX server time to lag by 2 seconds, it takes approximately 20 minutes to synchronize with GPS time: similarly, if I change the UNIX server time to lag by 1 minutes; it is taking approximately 1 hour to synchronize with the GPS time. My question, why does UNIX server takes such a long time to synch with GPS after changing the time maually?


extracting and copying parts of tex files into new tex files

I have a bunch of tex files in different folders on my system. The goal is to create new tex files (using a template, that has the title page, packages, new commands,...) that combines all the definitions/theorems of the other tex files at a specific place in this template file. I'm pretty new to linux, so I was wondering which command/set of commands would be the best to use here. So far I used:               $ sed -n '/begin{definition}/,/end{definition}/p' <infile >outfile      which succeeds in extracting the definitions from one file into another. Someone any suggestions?


Can you have two paths listed in init.d file?

In `/etc/init.d/red5` can I list two home paths for different programs using it that are in different locations? I have red5 set up in /var/www/html but I also have it set up in /var/www/html/red5/webapps At the moment I am using `service red5 start` in the first and in second directory `sh red5.sh`. I know they do the same thing except with the first it shuts down on command `service red5 stop` but on the second it never wants to shut down, at least not right away with `./red5-shutdown.sh` The bash script seems more efficient and so I wondered if I could use it for both?


chroot into system

Update : Following the advies of slm, I could destroy the RST raid 0 and create a new raid0 using mdadm using the webpage he gave me. I could start the installation but at the step where grub is installed, I still get an error and installation stop. When I try to do the step of the webpages below, I get an error while using chroot, telling me that the file or directory doesn't exit despite it does. Do you have any idea how I can fix this ? Original : I need to install Mint on my laptop which has a fake raid0. I tried lots of time and always get an error while installing Grub. I checked on the internet and someone found a solution : after installing Mint as usual, I need to chroot into the system installed on raid. The author give the following link to help : https://help.ubuntu.com/community/Grub2/Installing#ChRoot The fact is that I just can't apply this solution to my computer. I'm stuck at the step 7 where I need to mount the correct partition. When using the partition GUI tools, I can see 4 volumes : the first one has 3 partitions (one efi, one ext4 and one swap). The 3 others volumes seem to be the 3 partitions of the first volume take one by one. Otherwise, it is asked on the link above to use fdisk, blkid. The fdisk -l command give me the followind information :               Disk /dev/sda: 128.0 GB, 128035676160 bytes          Device Boot       Start         End      Blocks   Id   System     /dev/sda1             1   500130303  250065151+   ee   GPT          Disk /dev/sdb: 128.0 GB, 128035676160 bytes          Disk /dev/sdb doesn't contain a valid partition table          WARNING: GPT (GUID Partition Table) detected on '/dev/mapper/isw_ecbefbijea_Volume1'! The util fdisk doesn't support GPT. Use GNU Parted.          Disk /dev/mapper/isw_ecbefbijea_Volume1: 256.1 GB, 256066715648 bytes          Device Boot                           Start        End      Blocks  Id   System     /dev/mapper/isw_ecbefbijea_Volume1p1      1  500130303  250065151+  ee   GPT          Disk /dev/mapper/isw_ecbefbijea_Volume1p1: 537 MB, 537657344 bytes          Disk /dev/mapper/isw_ecbefbijea_Volume1p2: 247.1 GB, 247061020672 bytes          Disk /dev/mapper/isw_ecbefbijea_Volume1p2 doesn't contain a valid partition table          WARNING: GPT (GUID Partition Table) detected on '/dev/mapper/isw_ecbefbijea_Volume1p3'! The util fdisk doesn't support GPT. Use GNU Parted.          Disk /dev/mapper/isw_ecbefbijea_Volume1p3: 8467 MB, 8467513344 bytes          Disk /dev/mapper/isw_ecbefbijea_Volume1p3 doesn't contain a valid partition table          Disk /dev/mapper/sdc: 8004 MB, 8004304896 bytes          Device     Boot  Start       End   Blocks  Id  System     /dev/sdc1     *     63  15631244  7815591   b  W95 FAT32      The blkid command give me this :               /dev/mapper/isw_ecbefbijea_Volume1p1: UUID="BF26-91E7" TYPE="vfat"     /dev/mapper/isw_ecbefbijea_Volume1p2: UUID="ac1c5978-7533-46b9-87ac-d28b7b8c5453" TYPE="ext4"     /dev/mapper/isw_ecbefbijea_Volume1p3: UUID="8c12d467-0b8d-48db-ad69-96f7a23b4ca3" TYPE="swap"     /dev/loop0: TYPE="squashfs"     /dev/sda: TYPE="isw_raid_member"     /dev/sdb: TYPE="isw_raid_member"     /dev/sdc1: LABEL="SANDISK" UUID="4208-38E8" TYPE="vfat"      Can someone help me to fix this problem ? EDIT : This is the parted -l command output :               Backtrace has 8 calls on stack :     8: /lib/x86_linux-linux-gnu/libparted.so.0(ped_assert+0x31) [0x7f3d015404b1]     7: /lib/x86_linux-linux-gnu/libparted.so.0(+0x3f5f6) [0x7f3d015705f6]     6: /lib/x86_linux-linux-gnu/libparted.so.0(ped_disk_new+0x49) [0x7f3d0145f99]     5: parted() [0x406dff]     4: parted() [0x407bda]     3: parted(main+0x154b) [0x4065cb]     2: /lib/x86_linux-linux-gnu/libparted.so.6(__libc_start_main+0xf5) [0x7f3d00d1dec5]     1: parted() [0x406617]          You found a bug in GNU Parted! Here's what you have to do:     ....


setting up script in a linux machine for scientific computation

I'd like to setup machine for test some computation in my old laptop, before replicate the tests on the server. The computation will be image-processing and machine learning, run some program, load images and videos and run a svm training for object detection. the trainig could be 1 week of computations, maybe more. The server will be CentOS, so I'm thinking about a Fedora machine. I'd like to make a setup bash script where I install all the needed (vpn, zsh, cmake, python, numpy, ffmpeg, libsvm, opencv, qt) and **send me a report** via mail when finished. I'd like to automate everything with a script and make the image of the filesystem because the main idea is to have some data, analyse them in the next days, then reset the system, use new parameters for the learning algorithm, and run again the training program. repeat it. The machine will have to run and I will wait it to finish so that I'm thinking about some watchdog with cronjob that tell me how is working, send me report in the end, send me a mail if something goes wrong, etc I'm not a Linux guru so.. any kind of advice are welcome!


I'm looking for a videochat/videoconferencing server software (Debian)

I'd like to host a videochat/videoconferencing server on my Debian VPS. It should be in first place SECURE and light. It should use `RTMPE` protocol because `RTMP` is not secured, `RTMPS` needs an SSL certificate from a Certificate Authority, that I don't want to buy. I have tried `Apache OpenMeetings` and it was pretty good (even though it had too many features for my needs). This software anyway is not suitable because it doesn't support `RTMPE` and the Linux and Mac flash clients do not support `RTMPS`. Which is the best free software to obtain simple and secure video-chatting or conferencing? Any alternative to RTMPE will be appreciated.


What environment and credential is used by startup, background and service processes

Startup scripts (on boot) Processes running in (or sent to) the background (when using SSH -fN for example) Services etc... What $path variable will they be using? What credentials? Anything else I should know? Tried googling it... found a lot of fragmented info in forums but nothing giving a clear/complete picture of whats going on. FYI I'm running Raspbian which is pretty much the same as Debian. Thanks for your help.


When gnu parallel exit，my program also fail

I use gnu parallel to run a bash function. The function just contains the bash script to restart my program. At first, the restart is ok, but when the gnu parallel script exits， my program also fails. Why?               #!/bin/bash          function_A () {             local module=$1             set -x             cd /dir/${module}/;sh stop_${module}.sh;sh start_${module}.sh;sleep 10     }     export -f function_A          parallel --tag --onall --env function_A -S my_host function_A ::: my_program      * * * ## ps command info: root 12967 0.0 0.0 65960 1152 pts/1 Ss+ 16:30 0:00 bash -c echo $SHELL | egrep "/t?csh" > /dev/null && echo CSH/TCSH DO NOT SUPPORT newlines IN VARIABLES/FUNCTIONS && exec false;? eval `echo $SHELL | grep "/t\\{0,1\\}csh" > /dev/null && echo setenv PARALLEL_SEQ 1\; setenv PARALLEL_PID 6431 || echo PARALLEL_SEQ=1\;export PARALLEL_SEQ\; PARALLEL_PID=6431\;export PARALLEL_PID` ; tty >/dev/null && stty isig -onlcr -echo;echo $SHELL | grep "/t{0,1}csh" > /dev/null && setenv function_A ()\ {\ \ local\ module=\$1\;"?"\ set\ -x\;"?"\ cd\ /dir/\${module}/\;"?"\ sh\ test.sh\;"?"\ sleep\ 10"?"} || export function_A=()\ {\ \ local\ module=\$1\;"?"\ set\ -x\;"?"\ cd\ /dir/\${module}/\;"?"\ sh\ test.sh\;"?"\ sleep\ 10"?"} && eval function_A"$function_A";function_A my_program


Graphical login without a keyboard

Is there an XDM variant (kdm, gdm etc.) that allows graphical login without a physical keyboard? I have a tablet computer (like iPad, but Intel i5) running KDE and would prefer that users have to login to use it. However, the virtual keyboard is not available in the xdm screens I have seen. I could plug in keyboard, but that is kludgy; I'd prefer to do something more like Android's gesture login. Do you know of any options?


mount: wrong fs type, bad option, bad superblock on /dev/sdb on CentOS 6.0

Somehow my partition on /dev/sdb has gotten all buggered up. This hard drive contains a lot of data that I need to recover and haven't been able to backup yet. When I attempt to mount it:               # mount -t ext4 /dev/sdb /world     mount: wrong fs type, bad option, bad superblock on /dev/sdb,            missing codepage or helper program, or other error            In some cases useful info is found in syslog - try            dmesg | tail  or so      Also when I run `fdisk` to try see what partitions are on the hard drive:               Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x25467742             Device Boot      Start         End      Blocks   Id  System     /dev/sdb3   *           1           1           0    0  Empty     Partition 3 does not end on cylinder boundary.      I have attempted to use TestDisk to try to recover my lost partition but both quick and deep scans find no partitions present. I am able to look at the used space and all of my data is still intact on the hard drive itself, it just seems my partition is complete gone. Is there any way I can recover this data? Any tools or details that I am missing?


Is there a folder accessible to all process and users at all times?

I have a script that gathers debugging info from the running environment and I need to figure out were I can save that info. It may be called anytime:   * at boot   * when the system is running   * at shutdown, etc...    * and by any user or process / service. I need a folder that is accessible at all time to EVERYTHING. Does that exist already? If not how can I make it happen?   Since this is for debugging purposes I don't care about security, it'll all be removed before hitting prod.


How to resize application windows in an arbitrary direction (not vertical and not horizontal)

One of the most annoying things for me in using Linux, is resizing an open window, such as a terminal window. I'd like to resize the terminal window (make it larger or smaller). But when I put the mouse at the lower right corner to grab the corner point, it is trial and error to get the mouse to become at an angle so I can resize the terminal in an arbitrary direction this way:                        \               \                \ |               ___|      It insists that I resize it either like this               ---->        or like this                 |       |       V      Sometimes it takes 5 seconds of trial error moving of the mouse around the corner of the window and error in order for the mouse to show at an angle instead of up or sideways so that the window can be resize in direction other than vertical or horizontal only. I am using standard terminal emulation that appears in the menu->system->terminal. I think this is has to do with the desktop type. I am using Linux mint 14, with xfce distribution. Is there a way to disable the horizontal and vertical resizing, and just keep the angle resizing? As I can use that for both and it is much more flexible. Now I have to first resize vertically, then resize horizontally to enlarge the window which is very silly. This actually affects all windows, not just the terminal. For example, when I open firefox, and want to resize it, same problem happens. That is why I think it is a window manager configuration issue, and not the gnome-terminal itself. In other words, I want it to work just like on windows, where I grab the corner of any window, and I can resize at an arbitrary direction always. Surely one can do this in Linux.


Move matched line above a different matched line using sed

I have something like               dsadjakldjska     safdsfdsfsf     fdsfsf**STGN**fdsfsd     fdsfkjldsf     fdsff     fdsfs**IRV**fdsfs      and I want to get               dsadjakldjska     safdsfdsfsf     fdsfkjldsf     fdsff     fdsfsf**STGN**fdsfsd     fdsfs**IRV**fdsfs      but only for an interval of lines (say line 40000 till end of file) (moving the line containing STGN right above the next IRV underneath it) Any idea how I can do this, or whether there's a better alternative for this than sed?


Samson Meteor Mic under Linux/ALSA

Has anybody gotten a Samson Meteor Mic working under Linux/ALSA? I tried to google it but I found no mention of Samson Meteor under Linux at all. Kernel/ALSA/Audacity see the device. Unfortunately I was unable to record anything. `arecord` refuses to work and Audacity freezes completely when I press the record button. `arecord -l` gives me:               **** List of CAPTURE Hardware Devices ****     ...     card 1: Mic [Samson Meteor Mic], device 0: USB Audio [USB Audio]       Subdevices: 1/1       Subdevice #0: subdevice #0      `arecord -L` gives me:               ...     default:CARD=Mic         Samson Meteor Mic, USB Audio         Default Audio Device     front:CARD=Mic,DEV=0         Samson Meteor Mic, USB Audio         Front speakers     surround40:CARD=Mic,DEV=0         Samson Meteor Mic, USB Audio         4.0 Surround output to Front and Rear speakers     surround41:CARD=Mic,DEV=0         Samson Meteor Mic, USB Audio         4.1 Surround output to Front, Rear and Subwoofer speakers     surround50:CARD=Mic,DEV=0         Samson Meteor Mic, USB Audio         5.0 Surround output to Front, Center and Rear speakers     surround51:CARD=Mic,DEV=0         Samson Meteor Mic, USB Audio         5.1 Surround output to Front, Center, Rear and Subwoofer speakers     surround71:CARD=Mic,DEV=0         Samson Meteor Mic, USB Audio         7.1 Surround output to Front, Center, Side, Rear and Woofer speakers     iec958:CARD=Mic,DEV=0         Samson Meteor Mic, USB Audio         IEC958 (S/PDIF) Digital Audio Output      But, e.g. `arecord -f cd -D default:CARD=Mic` returns only error messages:               ALSA lib pcm_direct.c:1052:(snd1_pcm_direct_initialize_slave) unable to start PCM stream     ALSA lib pcm_dsnoop.c:604:(snd_pcm_dsnoop_open) unable to initialize slave     arecord: main:654: audio open error: Broken pipe      and in `dmesg` I find this:               ...     [ 1750.460164] ehci_hcd 0000:00:1d.0: iso resched full ffff8801b3e02500 (now 128 max 8320)     [ 1750.460168] cannot submit datapipe for urb 0, error -28: not enough bandwidth      Additionally, full `dmesg` output when connecting the device:               [ 2030.857802] hub 2-1:1.0: state 7 ports 8 chg 0000 evt 0040     [ 2030.858084] hub 2-1:1.0: port 6, status 0101, change 0001, 12 Mb/s     [ 2030.961848] hub 2-1:1.0: debounce: port 6: total 100ms stable 100ms status 0x101     [ 2030.972865] hub 2-1:1.0: port 6 not reset yet, waiting 10ms     [ 2031.034704] usb 2-1.6: new full speed USB device using ehci_hcd and address 9     [ 2031.045748] hub 2-1:1.0: port 6 not reset yet, waiting 10ms     [ 2031.119403] usb 2-1.6: ep0 maxpacket = 16     [ 2031.120233] usb 2-1.6: skipped 10 descriptors after interface     [ 2031.120236] usb 2-1.6: skipped 2 descriptors after interface     [ 2031.120238] usb 2-1.6: skipped 1 descriptor after endpoint     [ 2031.120240] usb 2-1.6: skipped 2 descriptors after interface     [ 2031.120242] usb 2-1.6: skipped 1 descriptor after endpoint     [ 2031.120243] usb 2-1.6: skipped 1 descriptor after interface     [ 2031.120443] usb 2-1.6: default language 0x0409     [ 2031.122480] usb 2-1.6: udev 9, busnum 2, minor = 136     [ 2031.122482] usb 2-1.6: New USB device found, idVendor=17a0, idProduct=0310     [ 2031.122485] usb 2-1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=0     [ 2031.122486] usb 2-1.6: Product: Samson Meteor Mic     [ 2031.122488] usb 2-1.6: Manufacturer: Samson Technologies     [ 2031.122563] usb 2-1.6: usb_probe_device     [ 2031.122566] usb 2-1.6: configuration #1 chosen from 1 choice     [ 2031.122693] usb 2-1.6: adding 2-1.6:1.0 (config #1, interface 0)     [ 2031.122735] snd-usb-audio 2-1.6:1.0: usb_probe_interface     [ 2031.122739] snd-usb-audio 2-1.6:1.0: usb_probe_interface - got id     [ 2031.139846] usb 2-1.6: adding 2-1.6:1.1 (config #1, interface 1)     [ 2031.139870] usb 2-1.6: adding 2-1.6:1.2 (config #1, interface 2)     [ 2031.139890] usb 2-1.6: adding 2-1.6:1.3 (config #1, interface 3)     [ 2031.139916] usbhid 2-1.6:1.3: usb_probe_interface     [ 2031.139917] usbhid 2-1.6:1.3: usb_probe_interface - got id     [ 2031.140837] input: Samson Technologies Samson Meteor Mic as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.3/input/input12     [ 2031.140856] usb 2-1.6: link qh2-0601/ffff88016d9c4300 start 1 [1/2 us]     [ 2031.140890] usbhid 2-1.6:1.3: looking for a minor, starting at 96     [ 2031.140948] generic-usb 0003:17A0:0310.000A: input,hiddev0,hidraw2: USB HID v1.00 Device [Samson Technologies Samson Meteor Mic] on usb-0000:00:1d.0-1.6/input3     [ 2031.140961] drivers/usb/core/inode.c: creating file '009'      Thanks for any help.


What is rsh.rlogin and How to remove rsh.rlogin

I never heard of this word rsh and also received a check list from Security pro that we have to disable rsh. Can someone please tell me what is this rsh and how to disable it. Base OS : RHEL 5.5 and 5.6


How to get Wine to work with SELinux?

I want to run a `.msi` file on Fedora 17. After installing Wine Windows Program Loader on my Linux machine, it failed to run the file. A check on `/var/log/messages` shows the following line: > Jan 11 17:32:26 some kernel: [15554.188474] type=1400 > audit(1357983146.108:13): avc: denied { mmap_zero } for pid=4779 comm="wine- > preloader" scontext=unconfined_u:unconfined_r:wine_t:s0-s0:c0.c1023 > tcontext=unconfined_u:unconfined_r:wine_t:s0-s0:c0.c1023 tclass=memprotect An online forum has a suggestion to toggle a switch with:               setsebool -P mmap_low_allowed 1      I did that but it gave me an error: > libsepol.scope_copy_callback: entropyd: Duplicate declaration in module: > type/attribute entropyd_var_run_t (No such file or directory). > libsemanage.semanage_link_sandbox: Link packages failed (No such file or > directory). Could not change policy booleans Next, I try setting SELinux to permissive mode with:               setenforce 0      After checking that SELinux is on permissive mode, I tried to run the file again, but to no avail. What could be causing this problem? And how do I solve it?


Can I run several TKL appliances on one server box (eg, HP Microserver)?

I'm interested in by Ubuntu-based TurnKey Linux (TKL)'s many (apparently) ready-to-use, FOSS appliances. Is it possible to create one server box (without virtualization) that runs more than one TKL appliance?


Can you switch between windows within an application in Openbox?

Is it possible to set up a keybinding in Openbox for switching between open windows within an application? Just like you can in gnome 3 with alt + [key above Tab] .


How to create QtCurve theme KDE

I want to make my gtk2 theme for KDE.   Is there a good instructions/tutorials/tools for creating a QtCurve theme. Can Images be used as elements (buttons, badgrounds, handles, scrollbars...)


Update phpmyadmin manually when installed as an package

Is it possible to manually update phpMyAdmin when I installed it as a package?   The current version in Ubuntus package list is 3.4.5deb1 but I want to upgrade to 3.4.8


Write all tmux scrollback to a file

How can I write all the scrollback in a tmux session to a file? `capture-panel` can grab the current screen, but not the entire scrollback.


scheduling background tasks in succession

I've got three SAS programs to run in the background over a weekend. The three programs output information into files of the same names, so I'll need to remove these output files after the first program finishes and before the second program starts, as well as after the second program finishes and before the third program starts. Obviously the simplest way to get around this issue is to alter each of the programs in such a way that the output filenames are different, but that wouldn't help me learn how to use Unix. So this is what I've got so far:               # Begin by running the first SAS program in the background.     sas program1.sas & | at 5:00 PM JAN 11          # I'd like to wait until the first program finishes to remove     # the output files and run the second program.     wait ???     rm file1.sas7bdat file2.sas7bdat file3.sas7bdat file4.sas7bdat file5.sas7bdat     sas program2.sas & | at 5:00 PM JAN 12          # And now I repeat.     wait ???     rm file1.sas7bdat file2.sas7bdat file3.sas7bdat file4.sas7bdat file5.sas7bdat     sas program3.sas & | at 5:00 PM JAN 13      I set each program to run at the same time on consecutive days for two reasons: (1) I know the previous program will finish within 24 hours, and (2) I am assuming the load on the server will be similar at the same time on consecutive days. Ideally I could somehow grab the process ID for the first program and pass it to the first `wait` command, and similarly for the second program and `wait` command. Any ideas? **EDIT** I am more interested in a general solution for determining a process ID and passing it to the `wait` command than this specific situation.


Refreshing less on the fly

I'm writing a script in which I pass the output of a function to `less`, wait for some time, and then kill `less`. All of this done inside a loop. This makes it look like `less` is updated on the fly. This is my script:               #!/usr/bin/env bash          for i in {0..5}; do         echo $i | less -c &         pid=$!         sleep 2         kill $pid &>/dev/null     done      This works as expected, but the terminal kind of becomes unresponsive (keystrokes are not visible for instance) after this. What am I doing wrong? **EDIT:** Okay, I think the way I asked the question was confusing. I'm trying to write a script which scrapes lyrics off a website according to the current song in music player. The way I want to do this, I'll keep this script running in a screen session, and I want it to auto-update every 30s or so. The finall script would look something like:               function get_lyrics()     {         # function which gets the lyrics based on current song     }          while true; do         song=$(get_lyrics)         echo "$song" | less -c &         pid=$!         sleep 30         kill $pid &>/dev/null     done


How to install iftop?

I tried:               root@host [/home]# yum install iftop     Loaded plugins: fastestmirror, security     Loading mirror speeds from cached hostfile      * base: centos.mirrors.tds.net      * extras: yum.singlehop.com      * updates: mirror.wiredtree.com     Setting up Install Process     No package iftop available.     Error: Nothing to do      So how to do it? What should I do to be able to do so?


Replacing the values in one file with the values in another file in bash

I am having a csv file naming `List.csv` in following format:               Location,IP Address,Host Name,Domain,Domain Name, User Name,Manufacturer,Model,System Type, Serial Number, Operating System,RAM (GB),Processor Type,Processor Frequency     H1,xx.xx.xx.xx,PC1,domain.com,DOMAIN,User1,LENOVO,4089AZ8,X86-based PC,L90RA96,Microsoft Windows 7 Professional ,2,Pentium(R) Dual-Core CPU E5800,3.20GHz     H3,xx.xx.xx.xx,PC2,domain.com,DOMAIN,User2,LENOVO,4089AZ8,X86-based PC,L906W3P,Microsoft Windows 7 Professional ,2,Pentium(R) Dual-Core CPU E5800,3.20GHz     H2,xx.xx.xx.xx,PC3,domain.com,DOMAIN,User3,LENOVO,4089A76,X86-based PC,L929410,Microsoft Windows 7 Professional ,2,Pentium(R) Dual-Core CPU E5400,2.70GHz     H2,xx.xx.xx.xx,PC4,domain.com,DOMAIN,User4,Hewlett-Packard,Z800,x64-based PC,SGH007QT16,Microsoft Windows 7 Professional ,12,Intel(R) Xeon(R) CPU W5590,3.33GHz      If you look at the `MODEL` column, it is bearing some values which do not interpret the name of the model. I have created another file `model-list.csv` which bears the information of the said values and the corresponding model names. It looks something like :               Manufacturer,Value,Model Name     Lenovo, 4089AZ8, ThinkCentre     Lenovo, 4089A76, ThinkCentre     HP, Z800, HP Z800 Workstation      I want the values in the `List.csv` file to be replaced by the corresponding model name present in `model-list.csv`. As there are 2900+ items in the `List.csv` and about 150 items in `model.csv` file, I was planning to achieve this using a bash script, which is as follows:               #!/bin/bash          file1="List.csv"     file2="model-list.csv"     outfile="List_out.csv"     stagingfile="List-staging.csv"          rm -f "$outfile" "$stagingfile"          while read line     do             ModelNo=`echo "$line"|awk -F',' '{print $2}'`             ModelName=`echo "$line"|awk -F',' '{print $3}'`                       cat "$file1"|grep ",$ModelNo," > "$stagingfile"             if [ -s "$stagingfile" ]             then                          while read line1                     do                             NewLine=`echo "$line1"|sed "s/,${ModelNo},/,${ModelName},/g"`                             echo "$NewLine" >> "$outfile"                          done < "$stagingfile"                     rm -f "$stagingfile"             fi          done < "$file2"      When above script is executed, the `"$outfile"` contains almost 40-50 additional entries as compared to the `List.csv`. Anything wrong with the script?


Why does PyCrypto require a C compiler?

Is there a python crypto library that does not rely on anything besides python? Or pre-complied bundles of PyCrypto for Linux?


using sf probe to make u-boot faster

My uboot was running slow on a ARM cortex A9 processor based Xilinx zynq chip. Xilinx forum referred me to the following to solve this issue:                   +From 0a212cfc2dd4e4d1595de2ca2dde3f642e5707e7 Mon Sep 17 00:00:00 2001              +From: Mike Looijmans <mike.looijmans@topic.nl>              +Date: Fri, 18 Apr 2014 11:15:34 +0200              +Subject: [PATCH] configs/zynq-common: Don't add parameters to "sf probe"          + command          +          +When booting from QSPI flash, the system "hangs" for a few seconds           +between reading the devicetree and reading the kernel.           +         +This only happens for "run qspiboot", it did not happen when entering         +the read commands manually. I suspect it is triggered by reading the          +environment from flash somehow.              +              +"sf probe 0 0 0" triggers this, "sf probe" does not. So do not pass          +any parameters to sf probe.          +---          + include/configs/zynq-common.h |    2 +-       + 1 file changed, 1 insertion(+), 1 deletion(-)       +       +diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h        +index 2c7f257..f2c1ddb 100644              +--- a/include/configs/zynq-common.h         ++++ b/include/configs/zynq-common.h         +@@ -268,7 +268,7 @@         +         "fatload mmc 0 ${loadbit_addr} ${bitstream_image} && " \              +         "fpga load 0 ${loadbit_addr} ${filesize}\0" \              +     "qspiboot=echo Booting from QSPI flash... && " \         +-        "sf probe 0 0 0 && " \              ++        "sf probe && " \              +         "sf read 0x2A00000 " STR(CONFIG_SYS_SPI_DEVTREE_OFFS) " ${devicetree_size} && " \         +         "sf read ${kernel_addr} " STR(CONFIG_SYS_SPI_UIMAGE_OFFS) " ${kernel_size} && " \         +         "bootm ${kernel_addr} - 0x2A00000\0" \              +--               +1.7.9.5              +      The link is here: But I could not get what I have to do so , as suggested above I changed `sf probe 0 0 0` to `sf probe` in zynq_common.h But even now the u-boot execution speed is the same. Is there any other correct method for making the changes?


how to output text to both screen and file inside a shell script?

Currently I have a shell script which logs messages to a log file like this:               log_file="/some/dir/log_file.log"     echo "some text" >> $log_file     do_some_command     echo "more text" >> $log_file     do_other_command      When executing this script, there is no output to screen, and, since I'm connecting to the server via putty, I have to open another connection and do "tail -f log_file_path.log", because I can't terminate the running script and I want to see the output in real time. Obviously, what I want is that the text messages are printed on screen and into file, but I'd like to do it in one line, not two lines, one of which has no redirection to file. How to achieve this?


What is the relationship between command line code and higher level language code?

I'm learning to use the terminal on my Ubuntu 14.04 and I'm running command line code in my shell (which I'm told is what is inside the terminal) to install programs. But I can also start my node.js server in my shell and I can then run javascript code in the terminal; it keeps track of values I store in variables and I can create functions and then use them and so on. However it does seem to change mode because I'm no longer in a specific folder of my operating system so maybe I'm no longer in my shell? So I started looking into shell commands: What Are "Commands? According to http://linuxcommand.org/lc3_lts0060.php commands can be one of 4 different kinds:   1. **An executable program** like all those files in /usr/bin. Within this category, programs can be compiled binaries such as programs written in C and C++, or programs written in scripting languages such as the shell, Perl, Python, Ruby, etc.   2. **A command** built into the shell itself. bash provides a number of commands internally called shell builtins. The cd command, for example, is a shell builtin.   3. **A shell function**. These are miniature shell scripts incorporated into the environment.    4. **An alias**. Commands that you can define yourselves, built from other commands.  Does this mean that I'm always running the higher level code I have in my files (e.g. x.php, x.js x.css x.html files) with the help of my shell every time I start a program? Or does it only mean that I can use the command line to start a program which then run somewhere else (if somewhere else, then where?)? How can you grasp the interaction between these different types of code/languages? For example: can you view it all as code put into a command line; line after line with some languages making calls to other languages which then return the control to the caller and so on, or what kind of mental model is useful for understanding what is going on?


How to find the PID of nginx process

I am trying to fix a problem with nginx and think that there is an nginx process running on my machine. When I run this command I get this output.               $ ps aux -P | grep nginx     1000      3947  0.0  0.0  13596   932 pts/0    S+   14:05   0:00 grep --color=auto nginx      But if I try to kill processes 1000, 3947, 13596 or 932 I get errors like: `bash: kill: (1000) - No such process` What's going on? How do I find and kill the nginx process?


Combining parameter expansion with modifiers in zsh

Say I have the following               $f1=/some/path     $f2=/some/subpath     $f3=/some/other/subpath      If I try:               test1=${$f1/$f2/${f3:t}}      zsh complains with `bad substitution`. However:               test2=${f3:t}      works well. What am I doing wrong?


How to set default console keyboard layout in Arch Linux?

Whenever I reboot my computer I have to set the keyboard layout in a console again with `loadkeys`. Is there a way to change the default keyboard layout that is loaded everytime the computer boots?


Why I'm still able to use ssh reverse tunnel after closing reverse ssh connection?

I have created a reverse ssh tunnel to connect to a computer behind NAT using: `ssh -R 9050:localhost:22 user@middleserver` in the destination system. I closed the terminal that I entered this command in. But I'm still able to connect to the destination computer using `ssh destuser@middleserver -p 9050` from my system Is this normal?


How do I force yum to download from a specific mirror?

In a Fedora system, I can access only ftp and not http. When I try to install a package with _yum_ , it usually tries to download from http mirrors. How do I force it to download from a ftp mirror(listed here http://mirrors.fedoraproject.org/publiclist/Fedora/17/i386/) ?


Missing "version.h" when installing fglrx

I have downloaded the fglrx driver installer from the ATI drivers page. when I start the installation, everything goes smoothly until I hit an error message, telling me to check `/usr/share/ati/fglrx-install.log`. The contents of that file are as follows: > Check if system has the tools required for installation. fglrx installation > requires that the system have kernel headers. > /lib/modules/3.8.11-200.fc18.x86_64/build/include/linux/version.h cannot be > found on this system. One or more tools required for installation cannot be > found on the system. Install the required tools before installing the fglrx > driver. Optionally, run the installer with --force option to install without > the tools. Forcing install will disable AMD hardware acceleration and may > make your system unstable. Not recommended. Now, after a bit of searching around, I found that the symbolic link called `build` in `/lib/modules/3.8.11-200.fc18.x86_64` points to a nonexistent location. I installed the `kernel-devel` package, and now it had pointed to an existing directory. However, in the `/lib/modules/3.8.11-200.fc18.x86_64/build/include/linux/` directory, that is populated with various header files - I cannot find the one I need - `version.h`. How can I solve this problem? Should I install the driver in a different manner? Which other package can I install to get the `version.h` file? I'm running a clean install (default) of Fedora 18, which I had updated today.


Apply "upgrade" certain packages with apt

I need to update my version of OpenSSL and so I looked to implement an "upgrade", but I do not want my versions of php and apache is updated, that I can do to accomplish this?


Running a script as Grub boot option

I'm assembling some DR stuff for my Linux boxes. One item that would be really handy would be a GRUB option that would run a script to change my boxes from static IPs to dynamic. I know we could do a single user mode, run a script, reboot, etc but it would greatly simply things for the other admins (mostly with a Windows background) to select one item and have it complete the process automatically. I would swear that I've seen configuration settings provided to let Grub do this at one point or another but it's been a while. Not sure what to google for. EDIT: I'm aware of the rc.local method, however I don't want this to run on every boot. I want there to be an option listed (line item in grub.conf, probably) which allows for a specific script to be run only when that boot option is selected.


Finding all the hard-links of a file without traversing the file system

I have seen in this page that inodes have a **link counter** to know how many files (read: "directory entry") point to this inode. Is there a way to know which directories contain such entries without traversing the whole file system? Is this information stored somewhere?               struct inode {         kdev_t                       i_dev;         unsigned long                i_ino;         umode_t                      i_mode;         nlink_t                      i_nlink;         uid_t                        i_uid;         gid_t                        i_gid;         …     };


centos 6, hostname won't resolve, dns issue, loop detected

I've searched everywhere and tried all the suggestions that I've seen, but I just can't get this to work now (it was working before). This is the first time I've ever installed a test server that I want to be accessible from outside my local network, so bare with me. I have a test box in my home that is behind my router (192.168.1.1 gateway), server IP on network is 192.168.1.9 which I've set up statically in the router to receive the traffic. When I first set this up, I used a temporary hostname for the server that I was going to change, which after I have changed now is when I'm experiencing the issues. I have another colocated server, with it's own name servers, and in that server I quickly set up a CNAME entry under my main domain that pointed to my home IP address. Basically at that time this was working, and visiting the cname entry let me access the document root on my server at home. I decided to change my hostname using a separate domain, and this is when everything went to shit. Here is what I did. In godaddy under my domain I setup 2 new hosts entries, ns1. mydomain.net, and ns2.mydomain.net that point to my home IP. I changed the nameservers for my domain to reflect these. I changed the hostname throughout the server, I setup BIND and added 2 zones to reflect my domain and IP address, and now I cannot get my domain name to resolve to my server. Below are some responses that I get, if you need me to post any more output let me know as the DNS settings are what I'm not super familiar with. I can access the web server document root fine using my wan IP address, or the dhcp address, but the hostname won't resolve, everything locally seems to work fine. iptables               -A INPUT -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT     -A INPUT -p tcp -m state --state NEW -m tcp --dport 53 -j ACCEPT      /etc/resolv.conf               domain mydomain.net     search mydomain.net     nameserver 192.168.1.1      other names resolve               nslookup serverfault.com     Server: 192.168.1.1     Address: 192.168.1.1#53          Non-authoritative answer:     Name:    serverfault.com     Address: 198.252.206.16      but not mine               nslookup mydomain.net     ;; connection timed out; trying next origin     ;; connection timed out; no servers could be reached      EDIT: After doing some dns lookups, I'm getting a loop detected message. "Loop detected! We were referred back to 'My home IP'" Does this mean there is something wrong with my zone files?


bash command line editing (Emacs shortcuts)

When writing a command on the bash command line, I can use `CTRL+w` to delete a word backwards, or `ALT+d` to delete word forwards. The problem is, that these two shortcuts are not exactly complementary: `CTRL+w` deletes everything up to a space, whereas `ALT+d` deletes only up to any non-alphabetic character (i.e. stops at `/`) Is there a shortcut that acts as `ALT+d`, but backwards? So that when I am at the end of `/etc/hostname` and press shortcut, I end up with `/etc/`.


NFS partition mounted as read only

(Disclaimer: I've read "NFS sharing is read only" and I think it's not the same problem) I have just setup NFS on my raspberry (Raspbian) and I'm trying to access it from OSX. So far so good, I can mount the partition but unfortunately it's **read only**. Some more info: ## Client (OSX)               ➜  ~ mount     /dev/disk0s2 on / (hfs, local, journaled)     devfs on /dev (devfs, local, nobrowse)     map -hosts on /net (autofs, nosuid, automounted, nobrowse)     map auto_home on /home (autofs, automounted, nobrowse)     192.168.1.102:/export/data on /media (nfs)          ➜  ~  ls -ld /media         drwxr-xr-x  3 root  wheel  4096 Mar  8 15:57 /media      ## Server (Raspbian)               pi@raspberrypi ~ $ cat /etc/exports           /export       192.168.0.0/16(rw,fsid=0,insecure,no_subtree_check,async)     /export/data  192.168.0.0/16(rw,nohide,insecure,no_subtree_check,async)          pi@raspberrypi ~ $ cat /etc/idmapd.conf      [General]          Verbosity = 0     Pipefs-Directory = /var/lib/nfs/rpc_pipefs     # set your own domain here, if id differs from FQDN minus hostname     # Domain = localdomain          [Mapping]          Nobody-User = nobody     Nobody-Group = nogroup      As I said the problem comes when trying to create a file in the mounted directory:               ➜  /media  touch foo     touch: foo: Permission denied     ➜  /media  sudo touch foo     Password:     touch: foo: Permission denied      Note that **I can create a file from the server** , the problem must be in the nfs mount. (BTW I followed this guide to set the whole thing up) ## Additional info (edit): Here's how I'm mounting the partition on osx: `sudo mount -t nfs -o rw 192.168.1.102:/export/data /media`