How can Linux detect automatically if kernel must boot on dev hdc or hda

I have an industrial PC mounting Linux. These PC is delivered in two version, each with slightly different internal board and depending on the board type the disk inside the PC is see as hda or hdc. Until now, to select between the two type of disk boot I simply put two entry inside the grub menu.lst like show below, so at the first start of the PC the maintenance people will select the correct device which will be memorize for future reboot.               default = 0     timeout = 9          title Linux 2.4.34 ( hda )             root (hd0,0)             kernel /boot/vmlinuz-2.4.34 ro root=/dev/hda1 console=ttyS0,9600 console=tty0 apm=off          title Linux 2.4.34 ( hdc )             root (hd0,0)             kernel /boot/vmlinuz-2.4.34 ro root=/dev/hdc1 console=ttyS0,9600 console=tty0 apm=off      But in most cases this type of PC are delivered without screen and keyboard and the maintenance people are not able to select the boot option so I'm looking for a way that allow the PC to check for the correct boot device before loading the kernel. In pratical term I need that the boot procedure check if the disk is see as /dev/hdc or as /dev/hda in order to call the boot option with the right value for root device ( ie root=/dev/hda1 or root=/dev/hdc1 ) The problem is that I have no idea if that is possible and how to do that. Someone have some suggestion about this topic ?


Why doesn't the output get redirected into the file?

have the following command line that outputs vmstat every second with a time stamp on each line via the perl script:               vmstat 15 | /home/Beer/addtimestamp.pl > File_1       the contents of the addtimestamp.pl:               !/usr/bin/perl while (<>) { print localtime() . ": $_"; }      So why doesn't the output get redirected to the "File_1" file? It works perfectly when I don't, it prints out the output perfectly every second with no issues at all.


linux mint - loud system beep on laptop

I installed the newest Linux mint on My BTO W271EU laptop. All Works well, for a couple of minutes. Then the system beeps start. Really loud and continuously. Other symptoms are a flashing caps Lock and num Lock light. After a few minutes the PC shuts down. Without warning. This occurs after 5 minutes. Sometimes after An hour An sometimes I can use My laptop for Days without It happening. I already disabled the pcspkr. And added It To the blacklist (as found on mighty Google). But that doesn't work. ## edit: I also noticed that when the Laptop starte beeping and shut it self down. The beeping also occurs on startup. Once the kernel is loaded it starts beeping continiously. Again untill it shuts itself down. I have the problem with power cord plugged in and plugged out. Any ideas?


Copying a directory to multiple users home dir and changing user/group ownership

On my Ubuntu server there are about 150 shell accounts. All usernames begin with the prefix u12.. I have root access and I am trying to copy a directory named "somefiles" to all the home directories. After copying the directory the user and group ownership of the directory should be changed to user's. Username, group and home-dir name are same. How can this be done?


Fedora 15 won't remember wireless password

I just installed Fedora 15 beta with Gnome 3. I've done all the updates. The networking applet asks for the wireless password every time it connects. I found this bug, which says that the issue is fixed in gnome- keyring-2.91.92-1.fc15. I have version 3.0.1-1.fc15, so this shouldn't be an issue. Is there any other reason why the keyring wouldn't store the password?


How do I remove a Read-only file system from a usb drive

During an ill-fated attempt to get tinycore linux to boot from a USB drive I managed to create a bunch of files that I now cannot remove.               fortino@rebel:/media/working/boot/isolinux$ rm *.*     rm: cannot remove `boot.cat': Read-only file system     rm: cannot remove `boot.msg': Read-only file system     rm: cannot remove `isolinux.bin': Read-only file system     rm: cannot remove `isolinux.cfg': Read-only file system      I tried giving myself w and x permission for the files but that didn't appear to work. What is the best way to clean these files off of this USB drive? Thank you


Indirection on a Bash array

Is there a possibility to write the following script without the loop?               IPv4_first=1.1.1.1     IPv4_second=2.2.2.2     IPv4_third=3.3.3.3          IPv4_all=()           for var in ${!IPv4_@}     do        IPv4_all+=(${!var})     done          printf "'%s'\n" "${IPv4_all[@]}"      Something like:               IPv4_all=${!${!IPv4_@}}


Is there some kind of "patterns" when coding bash scripts?

In Java, we have Javadoc and some different styles when programming. In Python, there's pep8. I'm creating some bash scripts for my own use, and would like to know from you, experienced bash users, if there's some kind of "pattern" like indentation, documentation for functions, etc. A book or a website with some references.


What is the alsamixer of Pulse Audio?

I just installed Pulse Audio over my ALSA installation. Is there a Pulse Audio equivalent of alsamixer that I can use for tasks such as changing the microphone gain?


Isn't $HOME supposed to be the location of the user's home directory?

I'm having trouble with a web application I'm writing: The web application, which runs as user `nobody`, needs to launch an `inkscape` process to manipulate some SVG files. Because this runs as user `nobody`, there is no home directory. What I am doing is creating a temporary directory under `/tmp` and trying to set that as the home directory via `export HOME=/tmp/someUniqueId`. I then set a few things in that "temporary" home directory, like a symlink `.fonts` to the folder for the font files to use. I know this works for finding the `~/.fonts` directory. But when I launch Inkscape, all I get is a message that Inkscape could not create the `.inkscape` directory: ![Cannot create directory /.inkscape](http://i.stack.imgur.com/wENAF.png) Doesn't `$HOME` set the location of my home directory? Why is Inkscape still trying to access `/` as my home directory?


How to check if libfftw3_threads.so.3.2.4 shared library was compiled for pthreads or for OpenMP?

There is FFTW library installed by an administrator system-wide, in `/usr/lib64`, and it includes `/usr/lib64/libfftw3_threads.so.3.2.4`. When I compiled this library myself, before it was installed by sysadmin, I have noticed that you have to choose between **OpenMP** and **pthreads** version: >   * `\--enable-openmp`: Like `\--enable-threads`, but using OpenMP compiler > directives in order to induce parallelism rather than spawning its own > threads directly. Useful especially for programs already employing such > directives, in order to minimize conflicts between different parallelization > mechanisms. Use either `\--enable-openmp` or `\--enable-threads`, not both; > in either case the multi-threaded FFTW interface/library (see Multi-threaded > FFTW) is compiled (with different back ends). > The distribution is Gentoo, so theoretically either is possible. How to check if said library was compiled with OpenMP support (which would be best), or with pthreads?


Forcing compton to free directory

I often have trouble unnounting filesystems because `compton` is keeping a subdirectory open. Here is one line from `lsof` I have right now:               compton   30043            valmi  cwd       DIR              254,0    32768       7485 /media/truecrypt1/videos      I cannot for the life of me figure what it is doing with this directory (it is not used by any other process nor was it ever opened in any application besides bash). So far, I always just ended up restarting X when this happened, but I would love for someone to tell me how to make `compton` understand that it should let go my directory, or as a consolation tell me what it is doing with it. If this is relevant, this is compton-git 20121102-2 from Debian stable, with 3.5.0-7 and everything up-to-date.


install php5 with readline support on debian wheezy

php5-cli does not come with readline support on debian wheezy. this means that the interactive php shell (run as `$ php -a`) does not have a prompt (`php >`), instead it just says `Interactive mode enabled` and then leaves the cursor on a blank line. i can execute php but it is awkward, eg `<? echo 'hi'; ?>` `enter``ctrl``d` and it will excute a php command, but this is no way near as nice as having the prompt with readline support. I found some instructions to install php5-cli with readline support via the dotdeb repository however i get half way and it gives an error: ### download GPG key               $ cd /tmp     $ wget http://www.dotdeb.org/dotdeb.gpg     --2013-10-13 00:12:27--  http://www.dotdeb.org/dotdeb.gpg     Resolving www.dotdeb.org (www.dotdeb.org)... 88.190.17.153     Connecting to www.dotdeb.org (www.dotdeb.org)|88.190.17.153|:80... connected.     HTTP request sent, awaiting response... 200 OK     Length: 5299 (5.2K) [application/octet-stream]     Saving to: `dotdeb.gpg'          100%[=====================================================================================>] 5,299       --.-K/s   in 0.005s            2013-10-13 00:12:28 (946 KB/s) - `dotdeb.gpg' saved [5299/5299]      ### Install GPG key               $ cat dotdeb.gpg | sudo apt-key add -     OK     $ sudo apt-get update     Ign cdrom://[Debian GNU/Linux 7.0.0 _Wheezy_ - Official Snapshot amd64 LIVE/INSTALL Binary 20130505-10:47] wheezy Release.gpg     Ign cdrom://[Debian GNU/Linux 7.0.0 _Wheezy_ - Official Snapshot amd64 LIVE/INSTALL Binary 20130505-10:47] wheezy Release     Ign cdrom://[Debian GNU/Linux 7.0.0 _Wheezy_ - Official Snapshot amd64 LIVE/INSTALL Binary 20130505-10:47] wheezy/main amd64 Packages/DiffIndex     Ign cdrom://[Debian GNU/Linux 7.0.0 _Wheezy_ - Official Snapshot amd64 LIVE/INSTALL Binary 20130505-10:47] wheezy/main Translation-en_AU     Ign cdrom://[Debian GNU/Linux 7.0.0 _Wheezy_ - Official Snapshot amd64 LIVE/INSTALL Binary 20130505-10:47] wheezy/main Translation-en     Hit http://ftp.au.debian.org wheezy Release.gpg                                                                   Hit http://ftp.au.debian.org wheezy-updates Release.gpg                                                           Hit http://ftp.au.debian.org wheezy Release                                                                       Hit http://ftp.au.debian.org wheezy-updates Release                                                                                Hit http://ftp.au.debian.org wheezy/main Sources                                                                                Hit http://ftp.au.debian.org wheezy/main amd64 Packages                                                                            Hit http://ftp.au.debian.org wheezy/main Translation-en                                                           Hit http://ftp.au.debian.org wheezy-updates/main Sources                            Hit http://ftp.au.debian.org wheezy-updates/main amd64 Packages/DiffIndex     Hit http://ftp.au.debian.org wheezy-updates/main Translation-en/DiffIndex     Hit http://packages.dotdeb.org wheezy Release.gpg     Hit http://security.debian.org wheezy/updates Release.gpg     Hit http://packages.dotdeb.org wheezy Release     Hit http://security.debian.org wheezy/updates Release     Hit http://packages.dotdeb.org wheezy/all Sources     Hit http://packages.dotdeb.org wheezy/all amd64 Packages     Hit http://security.debian.org wheezy/updates/main Sources     Hit http://security.debian.org wheezy/updates/main amd64 Packages     Hit http://security.debian.org wheezy/updates/main Translation-en     Ign http://packages.dotdeb.org wheezy/all Translation-en_AU     Ign http://packages.dotdeb.org wheezy/all Translation-en     Reading package lists... Done      ### dist-upgrade               $ sudo apt-get dist-upgrade     Reading package lists... Done     Building dependency tree            Reading state information... Done     Calculating upgrade... Done     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.      ### Test PHP in interactive mode               $ php -a     Interactive mode enabled          <?php echo 'hi'; ?>     hi$ # this is not what i want!      ### Try compiling readline support               $ sudo aptitude install php5-dev libedit-dev     No packages will be installed, upgraded, or removed.     0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     Need to get 0 B of archives. After unpacking 0 B will be used.          $ cd ~/     $ sudo apt-get source php5-cli     Reading package lists... Done     Building dependency tree            Reading state information... Done     Picking 'php5' as source package instead of 'php5-cli'     NOTICE: 'php5' packaging is maintained in the 'Git' version control system at:     git://git.debian.org/pkg-php/php.git     Need to get 11.8 MB of source archives.     Get:1 http://packages.dotdeb.org/ wheezy/all php5 5.4.20-1~dotdeb.1 (dsc) [3,425 B]     Get:2 http://packages.dotdeb.org/ wheezy/all php5 5.4.20-1~dotdeb.1 (tar) [11.7 MB]     Get:3 http://packages.dotdeb.org/ wheezy/all php5 5.4.20-1~dotdeb.1 (diff) [121 kB]                                                Fetched 11.8 MB in 31s (374 kB/s)                                                                                dpkg-source: warning: extracting unsigned source package (php5_5.4.20-1~dotdeb.1.dsc)     dpkg-source: info: extracting php5 in php5-5.4.20     dpkg-source: info: unpacking php5_5.4.20.orig.tar.bz2     dpkg-source: info: unpacking php5_5.4.20-1~dotdeb.1.debian.tar.gz     dpkg-source: info: applying 001-libtool_fixes.patch     dpkg-source: info: applying 006-debian_quirks.patch     dpkg-source: info: applying libtool2.2.patch     dpkg-source: info: applying 019-z_off_t_as_long.patch     dpkg-source: info: applying 033-we_WANT_libtool.patch     dpkg-source: info: applying 052-phpinfo_no_configure.patch     dpkg-source: info: applying 053-extension_api.patch     dpkg-source: info: applying 054-phpinfo_dotdeb.patch     dpkg-source: info: applying 057-no_apache_installed.patch     dpkg-source: info: applying 100-recode_is_shared.patch     dpkg-source: info: applying 113-php.ini_securitynotes.patch     dpkg-source: info: applying sybase-alias.patch     dpkg-source: info: applying qdbm-is-usr_include_qdbm.patch     dpkg-source: info: applying session_save_path.patch     dpkg-source: info: applying php-fpm-man-section-and-cleanup.patch     dpkg-source: info: applying fpm-config.patch     dpkg-source: info: applying php-fpm-sysconfdir.patch     dpkg-source: info: applying temporary-path-fixes-for-multiarch.patch     dpkg-source: info: applying php-5.3.9-mysqlnd.patch     dpkg-source: info: applying php-fpm-listen-on-unix-socket.patch          $ cd php5-5.4.20/ext/readline     $ pwd     /home/peter/php5-5.4.20/ext/readline     $ ls     config.m4  CREDITS  php_readline.h  readline.c  readline_cli.c  readline_cli.h  README.libedit  tests      ### Run phpize               $ sudo phpize     Configuring for:     PHP Api Version:         20100412     Zend Module Api No:      20100525     Zend Extension Api No:   220100525          $ pwd     /home/peter/php5-5.4.20/ext/readline          $ ls     acinclude.m4    build         config.m4   configure.in  ltmain.sh        mkinstalldirs   readline_cli.c  run-tests.php     aclocal.m4      config.guess  config.sub  CREDITS       Makefile.global  php_readline.h  readline_cli.h  tests     autom4te.cache  config.h.in   configure   install-sh    missing          readline.c      README.libedit      ### Configure               $ sudo ./configure      checking for grep that handles long lines and -e... /bin/grep     checking for egrep... /bin/grep -E     checking for a sed that does not truncate output... /bin/sed     checking for cc... cc     checking whether the C compiler works... yes     checking for C compiler default output file name... a.out     checking for suffix of executables...      checking whether we are cross compiling... no     checking for suffix of object files... o     checking whether we are using the GNU C compiler... yes     checking whether cc accepts -g... yes     checking for cc option to accept ISO C89... none needed     checking how to run the C preprocessor... cc -E     checking for icc... no     checking for suncc... no     checking whether cc understands -c and -o together... yes     checking for system library directory... lib     checking if compiler supports -R... no     checking if compiler supports -Wl,-rpath,... yes     checking build system type... x86_64-unknown-linux-gnu     checking host system type... x86_64-unknown-linux-gnu     checking target system type... x86_64-unknown-linux-gnu     checking for PHP prefix... /usr     checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib     checking for PHP extension directory... /usr/lib/php5/20100525     checking for PHP installed headers prefix... /usr/include/php5     checking if debug is enabled... no     checking if zts is enabled... no     checking for re2c... re2c     checking for re2c version... 0.13.5 (ok)     checking for gawk... no     checking for nawk... nawk     checking if nawk is broken... no     checking for libedit readline replacement... yes, shared     checking for tgetent in -lncurses... no     checking for tgetent in -ltermcap... yes     checking for readline in -ledit... yes     checking for rl_callback_read_char in -ledit... yes     checking for rl_on_new_line in -ledit... no     checking for rl_completion_matches... no     checking how to print strings... printf     checking for a sed that does not truncate output... (cached) /bin/sed     checking for fgrep... /bin/grep -F     checking for ld used by cc... /usr/bin/ld     checking if the linker (/usr/bin/ld) is GNU ld... yes     checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B     checking the name lister (/usr/bin/nm -B) interface... BSD nm     checking whether ln -s works... yes     checking the maximum length of command line arguments... 1572864     checking whether the shell understands some XSI constructs... yes     checking whether the shell understands "+="... yes     checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop     checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop     checking for /usr/bin/ld option to reload object files... -r     checking for objdump... objdump     checking how to recognize dependent libraries... pass_all     checking for dlltool... no     checking how to associate runtime and link libraries... printf %s\n     checking for ar... ar     checking for archiver @FILE support... @     checking for strip... strip     checking for ranlib... ranlib     checking for gawk... (cached) nawk     checking command to parse /usr/bin/nm -B output from cc object... ok     checking for sysroot... no     checking for mt... mt     checking if mt is a manifest tool... no     checking for ANSI C header files... yes     checking for sys/types.h... yes     checking for sys/stat.h... yes     checking for stdlib.h... yes     checking for string.h... yes     checking for memory.h... yes     checking for strings.h... yes     checking for inttypes.h... yes     checking for stdint.h... yes     checking for unistd.h... yes     checking for dlfcn.h... yes     checking for objdir... .libs     checking if cc supports -fno-rtti -fno-exceptions... no     checking for cc option to produce PIC... -fPIC -DPIC     checking if cc PIC flag -fPIC -DPIC works... yes     checking if cc static flag -static works... yes     checking if cc supports -c -o file.o... yes     checking if cc supports -c -o file.o... (cached) yes     checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes     checking whether -lc should be explicitly linked in... no     checking dynamic linker characteristics... GNU/Linux ld.so     checking how to hardcode library paths into programs... immediate     checking whether stripping libraries is possible... yes     checking if libtool supports shared libraries... yes     checking whether to build shared libraries... yes     checking whether to build static libraries... no     configure: creating ./config.status     config.status: creating config.h     config.status: executing libtool commands      ### Make               $ sudo make     /bin/bash /home/peter/php5-5.4.20/ext/readline/libtool --mode=compile cc  -I. -I/home/peter/php5-5.4.20/ext/readline -DPHP_ATOM_INC -I/home/peter/php5-5.4.20/ext/readline/include -I/home/peter/php5-5.4.20/ext/readline/main -I/home/peter/php5-5.4.20/ext/readline -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /home/peter/php5-5.4.20/ext/readline/readline.c -o readline.lo      libtool: compile:  cc -I. -I/home/peter/php5-5.4.20/ext/readline -DPHP_ATOM_INC -I/home/peter/php5-5.4.20/ext/readline/include -I/home/peter/php5-5.4.20/ext/readline/main -I/home/peter/php5-5.4.20/ext/readline -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/peter/php5-5.4.20/ext/readline/readline.c  -fPIC -DPIC -o .libs/readline.o     /bin/bash /home/peter/php5-5.4.20/ext/readline/libtool --mode=compile cc  -I. -I/home/peter/php5-5.4.20/ext/readline -DPHP_ATOM_INC -I/home/peter/php5-5.4.20/ext/readline/include -I/home/peter/php5-5.4.20/ext/readline/main -I/home/peter/php5-5.4.20/ext/readline -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /home/peter/php5-5.4.20/ext/readline/readline_cli.c -o readline_cli.lo      libtool: compile:  cc -I. -I/home/peter/php5-5.4.20/ext/readline -DPHP_ATOM_INC -I/home/peter/php5-5.4.20/ext/readline/include -I/home/peter/php5-5.4.20/ext/readline/main -I/home/peter/php5-5.4.20/ext/readline -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/peter/php5-5.4.20/ext/readline/readline_cli.c  -fPIC -DPIC -o .libs/readline_cli.o     /home/peter/php5-5.4.20/ext/readline/readline_cli.c:54:31: fatal error: readline/readline.h: No such file or directory     compilation terminated.     make: *** [readline_cli.lo] Error 1      As you can see it terminates with a fatal error complaining that it can't find `readline.h`. any idea what i am doing wrong? could it just be that it will not work on debian wheezy (7)? the dotdeb page instructions only talk about debian squeeze (6)...


Error installing Fedora 19

I'm trying to install Fedora 19. After my computer booted from installation DVD for about 20 minutes, it displays white screen with 'Oh no! Something has gone wrong.' message. I've tried 3 times and it still persists.


Convert any Date format in unix

How can I convert any user inputted date into `yyyy/mm/dd`? For example user can input date in one of the following formats `20120121` , `2012-01-21`, `01/21/2012`, `01/21/2012` etc. But I need to convert any of the date entered by user into `yyyy/mm/dd` (2012/01/2012). How? This is the script I was using , but it is not working.               echo "Please enter the date: "     read X     a=$X+"%y/%m/%d"     echo $a


No wireless interface detected in Linux

I'm using Backtrack5R3 via bootable CD and getting `no wireless interface found` output. These are the o/p of commands by which you can get details of my problem. My laptop model is Lenovo b490(20205).               root@bt:~# iwconfig         lo        no wireless extensions.              eth0      no wireless extensions.          root@bt:~# ifconfig     eth0      Link encap:Ethernet  HWaddr 3c:97:0e:8d:ef:29                 UP BROADCAST MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)               Interrupt:42 Base address:0x6000           lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:69 errors:0 dropped:0 overruns:0 frame:0               TX packets:69 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:15785 (15.7 KB)  TX bytes:15785 (15.7 KB)          root@bt:~# airmon-ng               Interface   Chipset     Driver                   root@bt:~# lspci     00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)     00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)     00:14.0 USB Controller: Intel Corporation Panther Point USB xHCI Host Controller (rev 04)     00:16.0 Communication controller: Intel Corporation Panther Point MEI Controller #1 (rev 04)     00:1a.0 USB Controller: Intel Corporation Panther Point USB Enhanced Host Controller #2 (rev 04)     00:1b.0 Audio device: Intel Corporation Panther Point High Definition Audio Controller (rev 04)     00:1c.0 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 1 (rev c4)     00:1c.1 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 2 (rev c4)     00:1c.3 PCI bridge: Intel Corporation Panther Point PCI Express Root Port 4 (rev c4)     00:1d.0 USB Controller: Intel Corporation Panther Point USB Enhanced Host Controller #1 (rev 04)     00:1f.0 ISA bridge: Intel Corporation Panther Point LPC Controller (rev 04)     00:1f.2 SATA controller: Intel Corporation Panther Point 6 port SATA AHCI Controller (rev 04)     00:1f.3 SMBus: Intel Corporation Panther Point SMBus Controller (rev 04)     02:00.0 Network controller: Broadcom Corporation Device 4365 (rev 01)     03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 07)          root@bt:~# lshw -c network       *-network UNCLAIMED                 description: Network controller            product: Broadcom Corporation            vendor: Broadcom Corporation            physical id: 0            bus info: pci@0000:02:00.0            version: 01            width: 64 bits            clock: 33MHz            capabilities: pm msi pciexpress bus_master cap_list            configuration: latency=0            resources: memory:f0500000-f0507fff       *-network            description: Ethernet interface            product: RTL8111/8168B PCI Express Gigabit Ethernet controller            vendor: Realtek Semiconductor Co., Ltd.            physical id: 0            bus info: pci@0000:03:00.0            logical name: eth0            version: 07            serial: 3c:97:0e:8d:ef:29            size: 10MB/s            capacity: 1GB/s            width: 64 bits            clock: 33MHz            capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation            configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl_nic/rtl8168e-3.fw latency=0 link=no multicast=yes port=MII speed=10MB/s            resources: irq:42 ioport:2000(size=256) memory:f0404000-f0404fff memory:f0400000-f0403fff      Let me know if you require more details.


Add users from dat file

I have a dat file with names. These are the names of users I must add, without groups or passwords. Ofcourse i have to remove all spaces. I have to add them with a bash script. Can anyone help me write the script? File:               Marianne        Earman     Justina Dragaj     Mandy   Mcdonnell     Conrad  Lanfear     Cyril   Behen     Shelley Groden     Rosalind        Krenzke     Davis   Brevard     Winnie  Reich     Trudy   Worlds     Deshawn Inafuku     Claudio Loose     Sal     Pindell     Cristina        Sharper     Tricia  Kruss      My script:               #!/bin/bash     #users.dat | sed "s/\t\t*/ /g"     while read p; do       #var=$(echo $p | sed "s/\t\t*/ /g")       var= echo $p | sed '/^$/d;s/[[:blank:]]//g'       #sudo useradd $var       sudo useradd $var      done < users.dat


How can I print out the current keybindings in Linux/Debian?

How can I print out the current keybindings in Linux/Debian ? I tried               xmodmap -pp      and got the response:               xmodmap:  unable to open display ''


Script in C shell skipping over last else statement?

This is a C shell script that checks the number of arguments and if the file/directory exists. When the arguments are valid, it should go to the last else statement and print "hi", but when I run this script with the correct arguments it doesn't print anything. (but the exit status is 0)   Everything else works fine when I have invalid arguments.               if ($#argv != 2) then             echo "Two arguments required"     else             if (! -f $argv[1]) then                     echo "File does not exist"                     exit 1             else                     if (! -d $argv[2]) then                             echo "Not a valid directory"                             exit 2                     endif             endif     else                 echo "hi"     endif      Maybe it's my syntax that is wrong? Any ideas?


How to put syslinux on an sd card

I would like to know how to put syslinux on my sd card and I have tried using extlinux. However, I keep getting the message `Missing Operating System`. Please help me.


Multiple ACLs in Squid Proxy

Here is my Squid configuration file. I would like to give specific users access to specific web content, But through this configuration file, if I give permission for a specific user to access the tutorial, social networking is blocked but movie is accessible. Even if I grouped allow and deny separately and checked, the same problem continues; I can't grant access to the tutorial but still block access to movies               acl localnet src 10.1.1.0/24     acl special src "/etc/squid/special.txt" # All Access IPs     acl unlimited src "/etc/squid/unlimited.txt"        # Full Download access     acl allow_proxy src "/etc/squid/allow_proxy.txt"    # Allow Proxy sites     acl allow_social src "/etc/squid/allow_social.txt"  # Allow Social networking          acl allow_tutorial src "/etc/squid/allow_tutorial.txt"  # Allow Tutorial     acl allow_movie src "/etc/squid/allow_movie.txt"    # Allow Jobs     acl allow_jobs src "/etc/squid/allow_jobs.txt"      # Allow Movie          #Allow / Block     acl goodkey url_regex "/etc/squid/goodkey.txt"     acl proxy url_regex "/etc/squid/proxy.txt"     acl social url_regex "/etc/squid/social.txt"     acl tutorial url_regex "/etc/squid/tutorial.txt"     acl movie url_regex "/etc/squid/movie.txt"     acl jobs url_regex "/etc/squid/jobs.txt"          #Download Limit     reply_body_max_size 3000 KB localnet !unlimited     request_body_max_size 3000 KB localnet !unlimited          #Allow     http_access allow special     http_access allow goodkey          #Proxy     http_access allow allow_proxy     http_access deny proxy          #Social     http_access allow allow_social     http_access deny social          #Tutorial     http_access allow allow_tutorial     http_access deny tutorial          #Movie     http_access allow allow_movie     http_access deny movie          #Jobs      http_access allow allow_jobs     http_access deny jobs          #ACL Allow     http_access allow localnet          #And finally deny all other access to this proxy     http_access allow localhost     http_access deny all


Is it possible to run a webdav fuse client with no root access?

I have seen examples showing how to use `davfs2` under linux, but each has involved one of these things:   1. Running `mount` as root   2. Adding an entry to `/etc/fstab`   3. Running `mount.davfs` setuid, which, alas, still requires an entry in `/etc/fstab` Can this be avoided? If not, what aspect of webdav prevents it, more than for, e.g. sshfs?


SSH and certificates - how to connect?

My geeky friend has dropped me this message: _Debian instance has been created for you with IP address of`10.5.0.95`. Remember: To connect to it, you need the certificate: `ssh -i xxx.xxx admin@10.5.0.95`. The certificate is in the root home of `10.5.0.20` -> I showed you this instance and you can connect to it any time._ Unfortunately I have no idea about how to connect to this Debian instance using the given information. Those certificates and `ssh` - I can't really understand that.


Having some trouble authenticating via proxy in order to use apt-get successfully on a corporate network

Our server is on a corporate network, which requires corporate proxy authentication (e.g. enter corporate username and password). This is not an issue on the Windows machines on that network - when a web browser is opened the user is prompted to authenticate. However, when using a browser on Linux, the user is not prompted to authenticate, the browser simply shows a message saying authentication is required. Internet Access would be useful At the moment I have to walk to my desk on another floor, if I need to look something up, because I cannot get Internet access from this machine, since I cannot (or do not know how to) authenticate. It would be useful to have the ability to authenticate, so I can use a web browser. Packages cannot be updated When I attempt to perform updates using `sudo apt-get update` or `sudo apt-get install [package]`, there are errors, which I believe are caused due to lack of authentication. After performing `sudo apt-get update`, I get errors like `W: Failed to fetch [link] 401 Authorization Required`. (For some reason some http://us.archive.ubuntu.com trusty/ sources work correctly, and some throw the same error). This is a major problem, as I need to be able to update packages on the server.   * I have installed `cntlm` via `sudo apt-get install cntlm` (it works from one of the few Ubuntu repositories that randomly work).    * I edited the configuration at `/etc/cntlm.conf` and added my username, the domain and the proxy.    * I started the service (`sudo /etc/init.d/cntlm start`).   * I tested the service (`sudo cntlm -I -M http://www.google.com/`) and the response was `Config Profile 1/4... Auth not required (HTTP code: 307) Your proxy is open, you don't need another proxy`.   * I tried performing `sudo apt-get update` again and still receive the same error message. (`401 Authorization Required`)    * _(Whoops! My mistake! I see I need to configure`apt` proxy settings manually...)_   * I added the line `Acquire::http::Proxy "http://localhost:3128";` to `/etc/apt/apt.conf`.   * I restarted `cntlm`. (`sudo /etc/init.d/cntlm stop`, `sudo /etc/init.d/cntlm start`)   * I performed `sudo apt-get update` ... and it hit `0% [Waiting for headers] [Waiting for headers] [Waiting for headers] [Waiting f` - and just stopped there. **Steps Taken (after asking)**   * I performed `sudo apt-get clean`, before performing `sudo apt-get update` - this started working and then stopped at `19% [Waiting for headers]`   * I performed `sudo apt-get clean` again, before performing `sudo apt-get update` - this started working and then stopped at `0% [Waiting for headers]`   * I tried this a third time (`sudo apt-get clean`, `sudo apt-get update`) and it stopped at `20% [Waiting for headers]`   * I researched this subsequent problem and found an answer on AskUbuntu, suggesting this may be an issue with IPv6 causing ICS to halt for a while, when it receives concurrent connections.   * I checked the `/etc/sysctl.conf` file and discovered the IPv6 already appears to be disabled... (The lines `net.ipv6.conf.all.disable_ipv6 = 1`, `net.ipv6.conf.default.disable_ipv6 = 1`, and `net.ipv6.conf.lo.disable_ipv6 = 1` are already in the config file.)    * _(I'm now drawing a bit of a blank! The symptoms match the hypothesized IPv6 issue, however, if it is already disabled that doesn't seem to be able to be the cause)_   * I performed `sudo apt-get clean` and `sudo apt-get update` a fourth time _(What the hell - why not?)_ and it hung on `24% [Waiting for Headers]` this time, but first it hit a bunch of repositories. A repository which used to trigger errors did not do so now (`http://cran.rstudio.com trusty /`) but one which used to trigger errors now triggered a different error, `Received HTTP code 501 from proxy after CONNECT`.


merge that works at word granularity instead of line

The old `diff`, `patch`, and `merge` programs, and their modern descendents in the form of version control systems work great for managing source code that can be edited concurrently by multiple people. They are, however, strictly line oriented, and thus tend to fall down flat on text that is more free form. In my particular case, I'm working with `latex` files edited by multiple people, and text is constantly reflowed -- adding or subtracting a word to a paragraph alters the line boundaries for the rest of the paragraph. There are `diff` tools that highlight changes within a line (many modern GUI ones), or even handle reflowed text (`wdiff`, `git diff --word-diff`). However, I've found nothing that handles three-way-merges or patching. Does anyone know of a good tool that will do this automatically? (Yes, I could chop the text up so as to put each word (and run of white space) onto a separate line. Something like the format for `git diff --word-diff=porcelain` might not be a bad choice. But making this reversible and robust to an automated merge (including merge conflict markers) is not quite trivial). Bonus points for a `git` merge driver.


iostat usage and output

When I run the `iostat` command like this:               iostat -d      I get a result something like this:               Linux 2.6.18-238.el5 (mon01)       09/03/2011          Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn     sda               9.83        11.88       264.67   38378414  854835288     sda1              9.83        11.88       264.67   38375658  854834320     sda2              0.00         0.00         0.00       2346        968     sdb              58.40         7.96      1552.02   25716671 5012803778     sdb1             58.40         7.96      1552.02   25715861 5012803778      If I run it again several times waiting two to three few minutes between execution I get exactly the same set of values for `tps`, `Blk_read/s` and `Blk_wrtn/s`. The `man` page for `iostat` says: > The first report generated by the iostat command provides statistics > concerning the time since the system was booted. Each subsequent report > covers the time since the previous report. If this is the case why are my `tps`, `Blk_read/s` and `Blk_wrtn/s` values not varying in the slightest? Does _"Each subsequent report"_ mean between the individual reports if running:               iostat -d 1 5      ...rather than the last time I ran `iostat -d`? I am slightly confused here.


Extracting queries from log file that do not include banned lines

I have a log file that looks something like the following:               query1 startQuery     query1 do something     query1 do something else     query2 startQuery     query1 do something banned     query2 do something     query3 startQuery     query2 endQuery 1000     query3 something else to do     query1 endQuery 2003     query3 do something     query4 startQuery     query4 endQuery 100     query3 endQuery 1434      I am finding the longest running queries:               > grep "endQuery" logfile | awk '{print $3 " " $1}' | sort -nr | head -n 3     2003 query1     1434 query3     1000 query2      However, there are certain operations known to be long, and I want to find the longest running queries that _do not_ include these operations. For example, I want to find the longest running queries that do not, in any of their log lines, include the word "banned". In this example it would output:               1434 query3     1000 query2     100 query4      In reality these log files are large and contain a lot of queries.


convert images to pdf: How to make PDF Pages same size

I did something like               convert -page A4 -compress A4 *.png CH00.pdf      But the 1st page is much larger than the subsequent pages. This happens even though the image dimensions are similar. These images are scanned & cropped thus may have slight differences in dimensions I thought `-page A4` should fix the size of the pages?


newgrp asks for password

I don't understand why `newgrp` prompts me for password when I want to change my group. I don't even know what password it is asking for but certainly not mine (user clime).               $ id     uid=500(clime) gid=501(www) groups=501(www),500(clime) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023     $ newgrp clime     Password: <--- huh?!      My system is centos 6.3.


Adding two numbers using expr

I'm learning Shell scripting for a diploma in IT I'm currently doing. I'm trying to write a small script that adds two numbers as shown as in one of the tutorials we were given.               echo "Enter two numbers"     read num1 num2     sum = 'expr $num1 + $num2'     echo "The sum is = $sum"      However when I give it the execution permission and run the script, it gives me this error.               sum: =. No such file or directory.     sum: expr $num1 + $num2: No such file or directory      ![enter image description here](http://i.stack.imgur.com/AOK8W.png) I tried running this on both Ubuntu and Fedora but same error occurs. Can anyone please tell me what I'm missing here?


Reading and searching long man pages

I finally got fed up when wanting to read about _bash_ 's `read` and it's `-s` option with `man bash`. I found the right spot eventually (around line 4500), but it was a frustrating as usual, since both `/read` and even `/\s-s\s` searches have way too many matches. So, the question is: How can I read long man pages efficiently, or get same information in other ways, _locally_? As a specific example, how to reach the relevant documentation after seeing `read -s pwd` in a shell script? A good answer could be a shell script snippet, or hint about some tool and how it is used, or something else entirely, as long as it helps in finding the right spot to read. Note: I'm not tagging with bash because I want the question to be about man page reading in general, even though that quite possibly is the most commonly encountered humongous man page.


How to highlight some text on a man page?

I find the manuals very difficult to read using the terminal. Is there a way to highlight specific text on the terminal? I tried piping to `gedit` using `man man | gedit`, but it opens a blank file instead. Perhaps there's some way to find text within a man page and have it highlighted?


Can I get individual man pages for the bash builtin commands?

Is there anywhere you can download a manpage for every builtin commands? I know you can just use `help` or `man bash` and search to find info about it, but I want them separated, so I can just do `man read` and get the read manpage.


Allocation of Swap in 64 bit UBUNTU 13.04

I have 256GB ssd drive, 32GB DDR RAM, and 1TB HDD. What is the maximum limit of Swap memory that can be set in SSD?


How can I limit ssh *remote* port forwarding?

I need to limit which ports can be remotely '`ssh -R`' forwarded by an user. I know about `permitopen` option on authorized_keys, but as it says on man page it only limits local '`ssh -L`' port forwarding As discussed here an user would get the same with netcat or similar, but in this case user has no shell access I also found this thread that talks about using selinux or LD_PRELOAD, but I never configured selinux before and can't find info on how to do that with LD_PRELOAD. maybe someone have made a patch for openssh to implement that? EDIT: I've found this bug report so I guess it's not yet implemented


sshfs mount, sudo gets permission denied

I am using `sshfs` to mount a folder with some python projects over ssh to my `~/` directory.               $ mkdir -p ~/mount/myprojects     $ sshfs user@myserver:/home/user/myprojects ~/mount/myprojects      I can perform most commands as could be expected:               $ ls ~/mount/myprojects     somepythonproject      But I if I try to do anything with `sudo`, it fails with permission denied:               $ sudo ls ~/mount/myprojects     ls: cannot access /home/user/mount/myprojects: Permission denied      What I'm actually trying to accomplish is to test a python package installation script on my local machine:               $ cd ~/mount/myprojects/somepythonproject     $ sudo python setup.py install


CPU monitoring tool for Centos

I'm looking for a CPU monitoring tool that could monitor the different processors in my machine, and also has a GUI (similar to the Ubuntu monitoring tool). Is there anything like that in Centos?


show hostname in top

I'm using `top` with `tmux` to monitor the most-CPU-consuming processes on different computers. How can I get the hostname to be displayed in each pane? Can I tell `top` to display the hostname somehow? ![screenshot top+tmux](http://i.stack.imgur.com/QEYTO.png)


converting unix time to string time with date command

I have read the man pages for date command, but there is no option for converting unix time to string time. I found some websites telling this:               date -d @1343715322      there is no option like `@` in the man and info pages. Can someone explain it?


How to maximise a window horizontal or vertically?

In awesome, what key binding can you use to maximise a window (in floating mode, of course) so that it maximise in just the horizontal or just the vertical direction? I know that `mod4 + m` will maximise it fully in both directions so I kind of assume it will be possible to do a mapping to just one direction.


What happens to files in mountpoint after running fs-cifs to mount NAS?

I'm running QNX Neutrino. I've got some files in `/mountpoint`:               # ls /mountpoint     /mountpoint/a     /mountpoint/b      And after mounting my NAS using fs-cifs like so,               # fs-cifs //hostname:hostipaddress:/sharename /mountpoint login password &      I see the remote files (c, d) as well as my local files (a, b)               # ls /mountpoint     /mountpoint/a     /mountpoint/b     /mountpoint/c     /mountpoint/d      * * *   * Is this the expected behaviour? I thought `mount` usually hid the local files (as per Where do the files go if you mount a drive to a folder that already contains files?)   * Is there an easy way of determining whether the files listed are stored locally or on the NAS?   * Is there an easier method of moving local files in `/mountpoint` to the NAS than unmount, move local files to tmp, remount, move files from tmp to `/mountpoint`?


Vim NERDTree re-size vsplit

I am using the NERDTree plugin for Vim. When using the `s: open vsplit command`, is it possible to resize the windows so that the file takes up a larger portion of the screen than the directory tree?


How to get user-level access to modifier keypresses in console app?

I need to get access to modifier-key state for a console app I'm writing (a personalized editor). Are there any packages/libs/whatever that provide this access? I cobbled the following from somewhere, but it only works if you're root, and I don't really want to mess about at root-level.               #include <iostream>     #include <string>     #include <stdio.h>     #include <string.h>     #include <stdlib.h>     #include <termios.h>     #include <fcntl.h>     #include <linux/input.h>     #include <unistd.h>     #include <errno.h>          int kbhit(void)     {         struct termios oldt, newt;         int ch;         int oldf;              tcgetattr(STDIN_FILENO, &oldt);              newt = oldt;         newt.c_lflag &= ~0000172 ; //~(ICANON | ECHO);              tcsetattr(STDIN_FILENO, TCSANOW, &newt);         oldf = fcntl(STDIN_FILENO, F_GETFL, 0);         fcntl(STDIN_FILENO, F_SETFL, oldf | O_NONBLOCK);              ch = getchar();              tcsetattr(STDIN_FILENO, TCSANOW, &oldt);         fcntl(STDIN_FILENO, F_SETFL, oldf);              return ch;     }          enum MODKEYS     {         SHIFT_L = 1,         SHIFT_R = 2,         CTRL_L = 4,         CTRL_R = 8,         ALT_L = 16,         ALT_R = 32,     };          int chkmodifiers()     {         int mods=0,keyb,mask;         char key_map[KEY_MAX/8 + 1];    //  Create a byte array the size of the number of keys              //event1 - got by inspecting /dev/input/...          FILE *kbd = fopen("/dev/input/event1", "r");         if (kbd == NULL)         {             printf("(chkmodifiers) ERROR: %s\n", strerror(errno)); //permission - got to be root!             return 0;         }              memset(key_map, 0, sizeof(key_map));         ioctl(fileno(kbd), EVIOCGKEY(sizeof(key_map)), key_map);    //  Fill the keymap with the current keyboard state              keyb = key_map[KEY_LEFTSHIFT/8];         mask = 1 << (KEY_LEFTSHIFT % 8);         if (keyb & mask) mods += SHIFT_L;              keyb = key_map[KEY_RIGHTSHIFT/8];         mask = 1 << (KEY_RIGHTSHIFT % 8);         if (keyb & mask) mods += SHIFT_R;              keyb = key_map[KEY_LEFTCTRL/8];         mask = 1 << (KEY_LEFTCTRL % 8);         if (keyb & mask) mods += CTRL_L;              keyb = key_map[KEY_RIGHTCTRL/8];         mask = 1 << (KEY_RIGHTCTRL % 8);         if (keyb & mask) mods += CTRL_R;              keyb = key_map[KEY_LEFTALT/8];         mask = 1 << (KEY_LEFTALT % 8);         if (keyb & mask) mods += ALT_L;              keyb = key_map[KEY_RIGHTALT/8];         mask = 1 << (KEY_RIGHTALT % 8);         if (keyb & mask) mods += ALT_R;              return mods;          }               int main()     {         puts("Press a key!");              char ch=0;         int n=0,m;              while (ch != 'q')         {             n = kbhit();             if (n != -1)             {                 m = chkmodifiers();                 ch =  (char)n;                 printf("You pressed '%c' [%d]\n", ch, n);                 if ((m & SHIFT_L) == SHIFT_L) printf(" .. and ls\n");                 if ((m & SHIFT_R) == SHIFT_R) printf(" .. and rs\n");                 if ((m & CTRL_L) == CTRL_L) printf(" .. and lc\n");                 if ((m & CTRL_R) == CTRL_R) printf(" .. and rc\n");                 if ((m & ALT_L) == ALT_L) printf(" .. and la\n");                 if ((m & ALT_R) == ALT_R) printf(" .. and ra\n");                  }         }         return 0;     }


How can I find out how many lines a text file contains without viewing it?

How can I find how many lines a text file contains without opening the file in an editor or a viewer application? Is there a handy Unix console command to see the number?


Bash string replace multiple chars with one

I'm replacing, from a feed title, all chars except letters and digits with a dash to use the result as a safe filename for any filesystem:               $ t="Episodie 06: No hope of riding home (NEW) - Advanced grammar"     $ echo ${t//[^A-Za-z0-9]/-}     Episodie-06--No-hope-of-riding-home--NEW----Advanced-grammar      However I'd like to condense all repeating dashes with a single one like `Episodie-06-No-hope-of-riding-home-NEW-Advanced-grammar` I found I can achieve it using a two pass substitution:               $ t="Episodie 06: No hope of riding home (NEW) - Advanced grammar"     $ tmp=${t//[^A-Za-z0-9]/-}     $ echo ${tmp//--/-}     Episodie-06-No-hope-of-riding-home-NEW--Advanced-grammar      I thought I could do it in a single pass like:               $ echo ${t//[^A-Za-z0-9]+/-}      but it doesn't work. Any clue? Note: I don't want to go with `sed` or other tools


Monit won't execute commands

Running Monit 5.2.5 on Fedora 15 All standard alerts are working, however just cannot get **exec** to run anything. I have tried more than ten different configurations based on examples from the Monit Wiki. None of the **exec** commands do anything. Below is just one simple examples in an attempt to get 'something' working:               check process tomcat6 with pidfile /var/run/tomcat6.pid         start program = "/etc/init.d/tomcat6 start"         stop program = "/etc/init.d/tomcat6 stop"         if failed host localhost port 8080 then             exec "/bin/bash -c '/bin/touch /tmp/monittest'"      If I shutdown Tomcat an alert is sent and the service restarts. However whatever I try in **exec** is always ignored. I understand that Monit is very restrictive in terms of its environment and is limited to directories such as /bin and/sbin/. Therefore all the example I have tried have been restricted to these directories. But still nothing. Anyone any ideas? p.s. I have turned on verbose logging and no clues in the log file.


how to guess and rename file from deleted rar has invalid encoding

i have many files and folders that extracted from many rar from jdownloader, and deleted after extract, some of it names are:               �������[�ς݂��ς݂� - �Ȃ��ꂭ������ (invalid encoding)     �R�e���} (invalid encoding)     ??? - ? ??? ?      ���΂ɂ����� (invalid encoding)      i know that those name should be korean, chinese/taiwanese or japanese. and i know that we could convert those files using `convmv -f enc_from -t enc_to` but how to guess the current encoding of those files?


Installing and uninstalling gnome on debian

I am using debian sid with xfce. I would like to test last version of gnome (I didn't give gnome 3.x a chance). Therfore, I would like to install gnome _but_ , also, to know how to go back to my xfce desktop. My worries are to have hard time to uninstall all packages installed for gnome. I plan to install gnome with :               apt-get install gnome      Which produces:               The following extra packages will be installed:       accountsservice aglfn aisleriot alacarte apg argyll bluez bogofilter bogofilter-bdb       bogofilter-common browser-plugin-gnash caribou caribou-antler cheese cheese-common cli-common       cracklib-runtime dconf-cli dconf-editor dconf-tools empathy empathy-common eog espeak-data       evince evolution evolution-common evolution-data-server evolution-data-server-common       evolution-plugins file-roller finger five-or-more folks-common four-in-a-row gdebi gdm3 gedit       gedit-common gedit-plugins geoclue geoclue-hostip geoclue-localnet geoclue-manual       geoclue-nominatim gir1.2-accountsservice-1.0 gir1.2-atspi-2.0 gir1.2-caribou-1.0       gir1.2-clutter-gst-2.0 gir1.2-evince-3.0 gir1.2-gck-1 gir1.2-gconf-2.0 gir1.2-gcr-3       gir1.2-gdata-0.0 gir1.2-gdesktopenums-3.0 gir1.2-gdm3 gir1.2-gkbd-3.0 gir1.2-gmenu-3.0       gir1.2-gnomebluetooth-1.0 gir1.2-gnomedesktop-3.0 gir1.2-goa-1.0 gir1.2-gtkclutter-1.0       gir1.2-gtop-2.0 gir1.2-gucharmap-2.90 gir1.2-ibus-1.0 gir1.2-javascriptcoregtk-3.0       gir1.2-mutter-3.0 gir1.2-networkmanager-1.0 gir1.2-nmgtk-1.0 gir1.2-panelapplet-4.0       gir1.2-polkit-1.0 gir1.2-rb-3.0 gir1.2-rest-0.7 gir1.2-soup-2.4 gir1.2-telepathyglib-0.12       gir1.2-telepathylogger-0.2 gir1.2-totem-1.0 gir1.2-totem-plparser-1.0 gir1.2-tracker-0.16       gir1.2-upowerglib-1.0 gir1.2-vte-2.90 gir1.2-webkit-3.0 gir1.2-wnck-3.0 gir1.2-xkl-1.0       gir1.2-zpj-0.0 gjs gkbd-capplet gksu gnash gnash-common gnome-applets gnome-applets-data       gnome-backgrounds gnome-bluetooth gnome-calculator gnome-chess gnome-color-manager       gnome-contacts gnome-control-center gnome-control-center-data gnome-core gnome-desktop3-data       gnome-dictionary gnome-disk-utility gnome-documents gnome-font-viewer gnome-games       gnome-icon-theme-extras gnome-klotski gnome-mag gnome-mahjongg gnome-media gnome-menus       gnome-mines gnome-nettool gnome-nibbles gnome-online-accounts gnome-orca gnome-packagekit       gnome-packagekit-data gnome-packagekit-session gnome-panel gnome-panel-data gnome-power-manager       gnome-robots gnome-screensaver gnome-screenshot gnome-session gnome-session-bin       gnome-session-common gnome-session-flashback gnome-settings-daemon gnome-shell       gnome-shell-common gnome-shell-extensions gnome-sudoku gnome-sushi gnome-system-log       gnome-system-monitor gnome-terminal gnome-terminal-data gnome-tetravex gnome-tweak-tool       gnome-user-guide gnome-user-share gnome-video-effects gnuchess gnuchess-book gnuplot gnuplot-nox       gnustep-base-common gnustep-base-runtime gnustep-common grilo-plugins-0.2 groff       gstreamer0.10-nice gstreamer1.0-clutter gstreamer1.0-libav gstreamer1.0-nice       gstreamer1.0-plugins-bad gtk2-engines gucharmap guile-2.0-libs hamster-applet hwdata iagno       iputils-tracepath libaccountsservice0 libapache2-mod-dnssd libatk-adaptor libatspi1.0-0       libavahi-gobject0 libavahi-ui-gtk3-0 libavresample1 libboost-chrono1.54.0       libboost-program-options1.54.0 libboost-thread1.54.0 libbrlapi0.6 libcamel-1.2-43       libcanberra-gtk-module libcanberra-gtk0 libcanberra-pulse libcaribou-common       libcaribou-gtk-module libcaribou-gtk3-module libcaribou0 libchamplain-0.12-0       libchamplain-gtk-0.12-0 libcheese-gtk23 libcheese7 libclutter-gst-2.0-0 libclutter-gtk-1.0-0       libcolorblind0 libcolord-gtk1 libcpufreq0 libcrack2 libdbus-glib2.0-cil libdbus2.0-cil       libdee-1.0-4 libdmapsharing-3.0-2 libdotconf1.0 libebackend-1.2-6 libebook-1.2-14       libebook-contacts-1.2-0 libecal-1.2-15 libedata-book-1.2-17 libedata-cal-1.2-20       libedataserver-1.2-17 libespeak1 libevolution libexempi3 libfarstream-0.1-0 libfarstream-0.2-2       libfolks-eds25 libfolks-telepathy25 libfolks25 libgail-common libgconf2.0-cil libgdata-common       libgdata13 libgdict-1.0-6 libgdict-common libgdiplus libgdm1 libgeocode-glib0 libgksu2-0       libgles2-mesa libglib2.0-cil libgnome-desktop-3-7 libgnome-mag2 libgnome-media-profiles-3.0-0       libgnome-menu-3-0 libgnomekbd-common libgnomekbd8 libgnustep-base1.22 libgrilo-0.2-1       libgsf-1-114 libgsf-1-common libgssdp-1.0-3 libgstreamer-plugins-bad1.0-0 libgtk-vnc-2.0-0       libgtk2.0-cil libgtkglext1 libgtkhtml-4.0-0 libgtkhtml-4.0-common libgtkhtml-editor-4.0-0       libgtkmm-3.0-1 libgtop2-7 libgtop2-common libgucharmap-2-90-7 libgupnp-1.0-4 libgupnp-av-1.0-2       libgupnp-dlna-2.0-3 libgupnp-igd-1.0-4 libgvnc-1.0-0 libgweather-3-3 libgweather-common       libibus-1.0-5 libicc2 libidl0 libimdi0 libiptcdata0 libjemalloc1 liblinear-tools liblinear1       liblouis-data liblouis2 libmeanwhile1 libmetacity-private0a libmission-control-plugins0       libmono-addins-gui0.2-cil libmono-addins0.2-cil libmono-cairo4.0-cil libmono-corlib4.0-cil       libmono-corlib4.5-cil libmono-i18n-west4.0-cil libmono-i18n4.0-cil libmono-posix4.0-cil       libmono-security4.0-cil libmono-sharpzip4.84-cil libmono-system-configuration4.0-cil       libmono-system-core4.0-cil libmono-system-drawing4.0-cil libmono-system-security4.0-cil       libmono-system-xml4.0-cil libmono-system4.0-cil libmpg123-0 libmusicbrainz5-0 libmutter0b       libnatpmp1 libnice10 liboauth0 libobjc4 libopencv-calib3d2.4 libopencv-contrib2.4       libopencv-core2.4 libopencv-features2d2.4 libopencv-flann2.4 libopencv-highgui2.4       libopencv-imgproc2.4 libopencv-legacy2.4 libopencv-ml2.4 libopencv-objdetect2.4       libopencv-video2.4 libopenobex1 liborbit2 libpam-systemd libpanel-applet-4-0 libpst4       libpulse-mainloop-glib0 libpulsedsp libpurple-bin libpurple0 libpwquality-common libpwquality1       libreoffice-gnome librest-extras-0.7-0 librhythmbox-core8 librygel-core-2.0-1       librygel-renderer-2.0-1 librygel-renderer-gst-2.0-1 librygel-server-2.0-1 libsbc1       libsocialweb-client2 libsocialweb-common libsocialweb-service libsocialweb0       libsofia-sip-ua-glib3 libsofia-sip-ua0 libsonic0 libsrtp0 libsvm-tools libsystemd-daemon0       libtbb2 libtelepathy-farstream3 libtelepathy-glib0 libtelepathy-logger3 libtotem0       libtracker-extract-0.16-0 libtracker-miner-0.16-0 libwacom-common libwacom2       libwebrtc-audio-processing-0 libwnck-3-0 libwnck-3-common libytnef0 libzapojit-0.0-0       libzeitgeist-1.0-1 libzeitgeist-2.0-0 libzephyr4 lightsoff media-player-info metacity       metacity-common mono-4.0-gac mono-gac mono-runtime mousetweaks mutter-common nautilus       nautilus-data nautilus-sendto nautilus-sendto-empathy nmap obex-data-server obexd-client       pidgin-data pulseaudio pulseaudio-module-x11 pulseaudio-utils python-brlapi python-gconf       python-gnome2 python-louis python-mako python-markupsafe python-pyatspi python-pyatspi2       python-pyorbit python-speechd python-wnck python-zeitgeist quadrapassel rdesktop rhythmbox       rhythmbox-data rhythmbox-plugin-cdrecorder rhythmbox-plugins rtkit rygel rygel-playbin       rygel-preferences simple-scan sound-juicer sound-theme-freedesktop speech-dispatcher sudo       swell-foop systemd tali telepathy-gabble telepathy-haze telepathy-idle telepathy-logger       telepathy-mission-control-5 telepathy-rakia telepathy-salut tomboy totem totem-common       totem-plugins tracker tracker-extract tracker-gui tracker-miner-fs tracker-utils       transmission-common transmission-gtk unar unoconv vinagre vino xbrlapi xdg-user-dirs-gtk       xserver-xephyr xul-ext-adblock-plus zeitgeist zeitgeist-core zeitgeist-datahub zenity       zenity-common     Suggested packages:       gnome-cards-data gir1.2-colordgtk-1.0 doc-base browser-plugin-lightspark       gnome-video-effects-frei0r evolution-ews evolution-plugins-experimental       evolution-data-server-dbg arj lha lzip lzop ncompress rpm2cpio rzip sharutils unace unalz zoo       dia-gnome gnome-boxes gnucash libreoffice-evolution planner iceweasel-l10n-all       xul-ext-gnome-keyring libcanberra-gtk3-module gnome-hearts gnome-system-tools       gnome-packagekit-tools xboard eboard scid feedgnuplot gnuplot-doc libgnuplot-iostream-dev       python-gnuplot gnustep-base-doc frei0r-plugins python-evolution monodoc-gtk2.0-manual       liblinear-dev libmono-i18n4.0-all libgamin0 natpmp-utils sofia-sip-doc srtp-utils pidgin gajim       pavumeter pavucontrol paman paprefs python-gnome2-doc python-beaker python-mako-doc pcscd       gnome-codec-install rygel-tracker rygel-mediathek gstreamer0.10-plugins-ugly gstreamer0.10-lame       gstreamer0.10-plugins-really-bad speech-dispatcher-festival speech-dispatcher-doc-cs       libttspico-utils systemd-ui tasque totem-mozilla gromit     The following packages will be REMOVED:       evince-gtk     The following NEW packages will be installed:       accountsservice aglfn aisleriot alacarte apg argyll bluez bogofilter bogofilter-bdb       bogofilter-common browser-plugin-gnash caribou caribou-antler cheese cheese-common cli-common       cracklib-runtime dconf-cli dconf-editor dconf-tools empathy empathy-common eog espeak-data       evince evolution evolution-common evolution-data-server evolution-data-server-common       evolution-plugins file-roller finger five-or-more folks-common four-in-a-row gdebi gdm3 gedit       gedit-common gedit-plugins geoclue geoclue-hostip geoclue-localnet geoclue-manual       geoclue-nominatim gir1.2-accountsservice-1.0 gir1.2-atspi-2.0 gir1.2-caribou-1.0       gir1.2-clutter-gst-2.0 gir1.2-evince-3.0 gir1.2-gck-1 gir1.2-gconf-2.0 gir1.2-gcr-3       gir1.2-gdata-0.0 gir1.2-gdesktopenums-3.0 gir1.2-gdm3 gir1.2-gkbd-3.0 gir1.2-gmenu-3.0       gir1.2-gnomebluetooth-1.0 gir1.2-gnomedesktop-3.0 gir1.2-goa-1.0 gir1.2-gtkclutter-1.0       gir1.2-gtop-2.0 gir1.2-gucharmap-2.90 gir1.2-ibus-1.0 gir1.2-javascriptcoregtk-3.0       gir1.2-mutter-3.0 gir1.2-networkmanager-1.0 gir1.2-nmgtk-1.0 gir1.2-panelapplet-4.0       gir1.2-polkit-1.0 gir1.2-rb-3.0 gir1.2-rest-0.7 gir1.2-soup-2.4 gir1.2-telepathyglib-0.12       gir1.2-telepathylogger-0.2 gir1.2-totem-1.0 gir1.2-totem-plparser-1.0 gir1.2-tracker-0.16       gir1.2-upowerglib-1.0 gir1.2-vte-2.90 gir1.2-webkit-3.0 gir1.2-wnck-3.0 gir1.2-xkl-1.0       gir1.2-zpj-0.0 gjs gkbd-capplet gksu gnash gnash-common gnome gnome-applets gnome-applets-data       gnome-backgrounds gnome-bluetooth gnome-calculator gnome-chess gnome-color-manager       gnome-contacts gnome-control-center gnome-control-center-data gnome-core gnome-desktop3-data       gnome-dictionary gnome-disk-utility gnome-documents gnome-font-viewer gnome-games       gnome-icon-theme-extras gnome-klotski gnome-mag gnome-mahjongg gnome-media gnome-menus       gnome-mines gnome-nettool gnome-nibbles gnome-online-accounts gnome-orca gnome-packagekit       gnome-packagekit-data gnome-packagekit-session gnome-panel gnome-panel-data gnome-power-manager       gnome-robots gnome-screensaver gnome-screenshot gnome-session gnome-session-bin       gnome-session-common gnome-session-flashback gnome-settings-daemon gnome-shell       gnome-shell-common gnome-shell-extensions gnome-sudoku gnome-sushi gnome-system-log       gnome-system-monitor gnome-terminal gnome-terminal-data gnome-tetravex gnome-tweak-tool       gnome-user-guide gnome-user-share gnome-video-effects gnuchess gnuchess-book gnuplot gnuplot-nox       gnustep-base-common gnustep-base-runtime gnustep-common grilo-plugins-0.2 groff       gstreamer0.10-nice gstreamer1.0-clutter gstreamer1.0-libav gstreamer1.0-nice       gstreamer1.0-plugins-bad gtk2-engines gucharmap guile-2.0-libs hamster-applet hwdata iagno       iputils-tracepath libaccountsservice0 libapache2-mod-dnssd libatk-adaptor libatspi1.0-0       libavahi-gobject0 libavahi-ui-gtk3-0 libavresample1 libboost-chrono1.54.0       libboost-program-options1.54.0 libboost-thread1.54.0 libbrlapi0.6 libcamel-1.2-43       libcanberra-gtk-module libcanberra-gtk0 libcanberra-pulse libcaribou-common       libcaribou-gtk-module libcaribou-gtk3-module libcaribou0 libchamplain-0.12-0       libchamplain-gtk-0.12-0 libcheese-gtk23 libcheese7 libclutter-gst-2.0-0 libclutter-gtk-1.0-0       libcolorblind0 libcolord-gtk1 libcpufreq0 libcrack2 libdbus-glib2.0-cil libdbus2.0-cil       libdee-1.0-4 libdmapsharing-3.0-2 libdotconf1.0 libebackend-1.2-6 libebook-1.2-14       libebook-contacts-1.2-0 libecal-1.2-15 libedata-book-1.2-17 libedata-cal-1.2-20       libedataserver-1.2-17 libespeak1 libevolution libexempi3 libfarstream-0.1-0 libfarstream-0.2-2       libfolks-eds25 libfolks-telepathy25 libfolks25 libgail-common libgconf2.0-cil libgdata-common       libgdata13 libgdict-1.0-6 libgdict-common libgdiplus libgdm1 libgeocode-glib0 libgksu2-0       libgles2-mesa libglib2.0-cil libgnome-desktop-3-7 libgnome-mag2 libgnome-media-profiles-3.0-0       libgnome-menu-3-0 libgnomekbd-common libgnomekbd8 libgnustep-base1.22 libgrilo-0.2-1       libgsf-1-114 libgsf-1-common libgssdp-1.0-3 libgstreamer-plugins-bad1.0-0 libgtk-vnc-2.0-0       libgtk2.0-cil libgtkglext1 libgtkhtml-4.0-0 libgtkhtml-4.0-common libgtkhtml-editor-4.0-0       libgtkmm-3.0-1 libgtop2-7 libgtop2-common libgucharmap-2-90-7 libgupnp-1.0-4 libgupnp-av-1.0-2       libgupnp-dlna-2.0-3 libgupnp-igd-1.0-4 libgvnc-1.0-0 libgweather-3-3 libgweather-common       libibus-1.0-5 libicc2 libidl0 libimdi0 libiptcdata0 libjemalloc1 liblinear-tools liblinear1       liblouis-data liblouis2 libmeanwhile1 libmetacity-private0a libmission-control-plugins0       libmono-addins-gui0.2-cil libmono-addins0.2-cil libmono-cairo4.0-cil libmono-corlib4.0-cil       libmono-corlib4.5-cil libmono-i18n-west4.0-cil libmono-i18n4.0-cil libmono-posix4.0-cil       libmono-security4.0-cil libmono-sharpzip4.84-cil libmono-system-configuration4.0-cil       libmono-system-core4.0-cil libmono-system-drawing4.0-cil libmono-system-security4.0-cil       libmono-system-xml4.0-cil libmono-system4.0-cil libmpg123-0 libmusicbrainz5-0 libmutter0b       libnatpmp1 libnice10 liboauth0 libobjc4 libopencv-calib3d2.4 libopencv-contrib2.4       libopencv-core2.4 libopencv-features2d2.4 libopencv-flann2.4 libopencv-highgui2.4       libopencv-imgproc2.4 libopencv-legacy2.4 libopencv-ml2.4 libopencv-objdetect2.4       libopencv-video2.4 libopenobex1 liborbit2 libpam-systemd libpanel-applet-4-0 libpst4       libpulse-mainloop-glib0 libpulsedsp libpurple-bin libpurple0 libpwquality-common libpwquality1       libreoffice-gnome librest-extras-0.7-0 librhythmbox-core8 librygel-core-2.0-1       librygel-renderer-2.0-1 librygel-renderer-gst-2.0-1 librygel-server-2.0-1 libsbc1       libsocialweb-client2 libsocialweb-common libsocialweb-service libsocialweb0       libsofia-sip-ua-glib3 libsofia-sip-ua0 libsonic0 libsrtp0 libsvm-tools libsystemd-daemon0       libtbb2 libtelepathy-farstream3 libtelepathy-glib0 libtelepathy-logger3 libtotem0       libtracker-extract-0.16-0 libtracker-miner-0.16-0 libwacom-common libwacom2       libwebrtc-audio-processing-0 libwnck-3-0 libwnck-3-common libytnef0 libzapojit-0.0-0       libzeitgeist-1.0-1 libzeitgeist-2.0-0 libzephyr4 lightsoff media-player-info metacity       metacity-common mono-4.0-gac mono-gac mono-runtime mousetweaks mutter-common nautilus       nautilus-data nautilus-sendto nautilus-sendto-empathy nmap obex-data-server obexd-client       pidgin-data pulseaudio pulseaudio-module-x11 pulseaudio-utils python-brlapi python-gconf       python-gnome2 python-louis python-mako python-markupsafe python-pyatspi python-pyatspi2       python-pyorbit python-speechd python-wnck python-zeitgeist quadrapassel rdesktop rhythmbox       rhythmbox-data rhythmbox-plugin-cdrecorder rhythmbox-plugins rtkit rygel rygel-playbin       rygel-preferences simple-scan sound-juicer sound-theme-freedesktop speech-dispatcher sudo       swell-foop systemd tali telepathy-gabble telepathy-haze telepathy-idle telepathy-logger       telepathy-mission-control-5 telepathy-rakia telepathy-salut tomboy totem totem-common       totem-plugins tracker tracker-extract tracker-gui tracker-miner-fs tracker-utils       transmission-common transmission-gtk unar unoconv vinagre vino xbrlapi xdg-user-dirs-gtk       xserver-xephyr xul-ext-adblock-plus zeitgeist zeitgeist-core zeitgeist-datahub zenity       zenity-common     0 upgraded, 432 newly installed, 1 to remove and 0 not upgraded.     Need to get 0 B/259 MB of archives.     After this operation, 891 MB of additional disk space will be used.     Do you want to continue? [Y/n] n     Abort.      So there are lots of packages... I would like to be sure to be able to uninstall all these packages after trying gnome for some time. I'm afraid `apt-get remove --purge gnome` will not remove all previously installed packages (because gnome is a meta-package). So, what should I do, after installing gnome, to go back on my minimal xfce system (i.e. delete all installed gnome related packages)? Update : `apt-get autoremove` does not remove any of the package installed automatically by gnome. I deleted the gnome meta-package:                # apt-get remove gnome     Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages will be REMOVED:       gnome     0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.     After this operation, 53.2 kB disk space will be freed.     Do you want to continue? [Y/n] y      And then tried to remove all gnome packages with `autoremove`               # apt-get autoremove     Reading package lists... Done     Building dependency tree            Reading state information... Done     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


How to open a GNOME 3 window from console?

in my GNOME 2 ubuntu i used to issue this command to open a new window to browse the files in some folder:               nautilus ./      For example, i could go to a difficult location through the console, and when i found it I opened the window:               cd /home/santiago/Music/Blues/BB-King/Live/Live at...     nautilus ./      And that folder was displayed in the window, and i could browse it regulary. But now I have GNOME 3 on Fedora 15 and that doesn't work any more. I think it's becouse the process doesn't return control to the console, so if i want to do that different times, the subsequents calls to `nautilus ./` open the first location. Thank you!


rpm --upgrade not upgrading?

Can someone please help me understand the rpm command. From the rpm man pages:               rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...          This upgrades or installs the package currently installed to a newer version.     This is the same as install, except all other version(s) of the package are     removed after the new package is installed.      My understanding is that if I indicate a `PACKAGE_FILE` that is an upgrade of something I already have installed, it will replace the files... upgrading the package. Specifically I am trying to upgrade _VirtualBox_ on a _Fedora 14_ OS. I am running the following command:               rpm -Uvh VirtualBox-4.1-4.1.4_74291_fedora14-1.x86_64.rpm      and am getting (many) errors saying there is an older version of the file               ... <similar output omitted>          file /bla/virtualbox/bla/powernotification-r0drv.c from install of        VirtualBox-4.1-4.1.4_74291_fedora14-1.x86_64 conflicts with file from         package VirtualBox-4.0-4.0.12_72916_fedora14-1.x86_64          ... </similar output omitted>      I am obviously not understanding something here. Can anyone shed some light on this?


Rename current file in vim

Searching over net shows `:f filename` would rename the current file in `vim`. But executing this and later exiting `vim`, shows the new file with all the contents and also the old file is present with the saved content untill executing the above command. So, how can we rename the current file we are editing in `vim` ? **EDIT** - Any solution that does not involve a plugin, as I guess that would require administrative privileges which I don't have. Any tweaks with config or mapping ?


Mount a Rackspace drive in Linux

Is there any software that will allow me to mount a Rackspace drive in linux? I want to copy SQL files from my database onto my Rackspace. I have web min running a backup nightly and copying those backups offsite would be ideal for obvious reasons. On my Windows desktop I've been using Cyberduck to upload/download and manage files on the server. I purchased a subscription to "Jungle Disk" but this problem was unstable on all the systems I had available in my office — Ubuntu and Windows 7. The application itself seems alright but any click took on average 10 seconds to respond. Can anyone point me in the right direction to the most simple way to copy this stuff to Rackspace? I have a Cloud Files account and am using Ubuntu.


How do I stop gnome's disk-utility from spamming me with disk error messages until my X session freezes?

I have a headless computer running ubuntu 11.04 with metacity. I vnc into it every now and again. It has a failing disk attached which I am trying to get some data off. Every now and again a friendly message comes up titled "Disk Utility" saying "Hard disk problems detected" and giving me the option to "Examine", "Ok" or "Cancel" (cool, did not know I could just cancel my hard disk problems). This is useful the first time but it comes up a lot. So often in fact that the next morning my X session has usually been rendered unusable because so many of these dialog windows have popped up. I don't really consider this a usability win. How can I disable it?


Nexenta bash script uses /usr/sun/bin/sed instead of /usr/bin/sed

I'm using a script for Linux and for Solaris (Nexenta). This line works on Linux, but not on solaris (but when run from shell it works):               cat "pg_hba.conf" | sed "0,/^local/{s/md5/trust/}"      The error message is:               sed: command garbled: 0,/^local/{s/md5/trust/}      After some research, I found out that the `sed` that bash uses in the script is different. from shell: `/usr/bin/sed` from script: `/usr/sun/bin/sed` I want to make the script use `/usr/bin/sed`. What I tried to do:   1. call `sed` with full path. Same results. It seems that it is still uses the other `sed`...   2. tried to call it via `bash -l`. Same results.   3. tried to declare a different command: `S=/usr/lib/sed` and use `$S` instead. Same results.   4. checked PATH - both cmd and script have `/usr/bin` in it.   5. Tried replacing the double quotes to single. Same results.   6. tried running the sed with -r flag. Output is : `# /usr/xpg4/bin/sed -r /usr/xpg4/bin/sed: illegal option -- r Usage: sed [-n] script [file...] sed [-n] [-e script]...[-f script_file]...[file...]` HELP?? What I need to do is to replace the first match of "md5" with "trust" on the first line that starts with "local"). I know I can do it otherwise but I the `sed` issue is itching me too much! # EDIT: I hope this makes a little order...   1. PATH from login shell = `/usr/local/ctera/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/ctera/apache-ant-1.8.2/bin`   2. PATH from script =   `/usr/sbin:/usr/bin:/usr/local/ctera/apache- ant-1.8.2/bin:/usr/local/ctera/apache-ant-1.8.2/bin`   3. PATH from script when `PATH=$(command -p getconf PATH):$PATH` is called = `/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin:/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin:/usr/sbin:/usr/bin:/usr/local/ctera/apache-ant-1.8.2/bin:/usr/local/ctera/apache-ant-1.8.2/bin`   4. `truss -f sed` from login shell calls `/usr/bin/sed`   5. `truss -f sed` from script calls `/usr/sun/bin/sed`   6. `truss -f /usr/bin/sed` from script calls `/usr/sun/bin/sed` !!!   7. After setting `PATH=$(command -p getconf PATH):$PATH`:   7.1 `truss -f sed` from script calls `/usr/xpg4/bin/sed`   7.2 `truss -f /usr/bin/sed` from script calls `/usr/sun/bin/sed` !!! # MORE INFO: Commands output: (run both from shell prompt and from within the script)   1. `truss -ft execve /usr/bin/sed q`   as shell command:   `8604: execve("/usr/bin/sed", 0x08047D20, 0x08047D2C) argc = 2`   from script:   `8545: execve("/usr/sun/bin/sed", 0x08047768, 0x08047774) argc = 2`   2. `file /usr/bin/sed`   as shell command:   `/usr/bin/sed: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped`   from script:   `file: /usr/bin/sed zero size or zero entry ELF section - ELF capabilities ignored file: /usr/bin/sed: can't read ELF header /usr/bin/sed: data`   3. `ls -l /usr/bin/sed`   as shell command:   `-rwxr-xr-x 1 root root 96440 May 31 2008 /usr/bin/sed`   from script:   `-rwxr-xr-x 1 root root 96440 May 31 2008 /usr/bin/sed`   4. `ls -ld $(type -pa sed)`   as shell command:   `-rwxr-xr-x 1 root root 96440 May 31 2008 /bin/sed -rwxr-xr-x 1 root root 96440 May 31 2008 /usr/bin/sed`   from script:   `-rwxr-xr-x 1 root root 96440 May 31 2008 /usr/bin/sed`   5. `md5sum $(type -pa sed)`   as shell command:   `385361c5111226c8eac8e25b53fed29c /bin/sed 385361c5111226c8eac8e25b53fed29c /usr/bin/sed`   from script:   `385361c5111226c8eac8e25b53fed29c /usr/bin/sed`     * The script is invoced by JAVA code.     * `uname -a`   `SunOS cteraportal 5.11 NexentaOS_134f i86pc i386 i86pc Solaris`     * This might add info about the `sed` version on my machine                          ~# ll `find / -name sed`           -rwxr-xr-x 1 root root 96440 May 31  2008 /usr/bin/sed           -r-xr-xr-x 1 root bin  35656 Sep  7  2010 /usr/sun/bin/sed           -r-xr-xr-x 1 root bin  32104 Sep  7  2010 /usr/ucb/sed           -r-xr-xr-x 1 root bin  35636 Sep  7  2010 /usr/xpg4/bin/sed                    /usr/share/doc/sed:           total 113           -rw-r--r-- 1 root root   168 Jun 21  2005 AUTHORS.gz           -rw-r--r-- 1 root root  2507 Jun 21  2005 BUGS.gz           -rw-r--r-- 1 root root  6584 Feb  3  2006 NEWS.gz           -rw-r--r-- 1 root root   285 Jun 21  2005 README.gz           -rw-r--r-- 1 root root  1071 Jan 12  2006 THANKS.gz           -rw-r--r-- 1 root root  4806 May 31  2008 changelog.Debian.gz           -rw-r--r-- 1 root root 32312 Feb  3  2006 changelog.gz           -rw-r--r-- 1 root root   796 May 31  2008 copyright           drwxr-xr-x 2 root root     3 May 30  2011 examples           drwxr-xr-x 2 root root     3 May 30  2011 sed-4.1.5           -rw-r--r-- 1 root root 56538 May 31  2008 sedfaq.txt.gz


Transfering whole linux system to a new disk

Few weeks back I installed linux as a virtual machine on my windows 7 system but I didn't gave much thought to(or miscalculated) the size of various partitions and even worse I'm not using 'lvm'. Today I tried to installed Qt 5.0 SDK which required around 500MB of space in /tmp which I didn't had but other partitions had quite a bit of space. The partition scheme is: > primary partitions: > > /boot 60M ext4 > > extended partitions: > > / 6.5G ext4 > > swap 512M ext4 > > /tmp 512M ext4 > > /var 1G ext4 > > /home 5G ext4 I booted from ubuntu live cd and used gparted to get resize the /tmp partition, problem solved! But here I can see the benefit of using 'lvm'. I want to create a new system which uses lvm. But instead of making a fresh install I think we can transfer my current system to a new hard disk. So,I added another 100GB virtual hard disk to this virtual machine, created a 256 MB /boot primary partition and the rest of the space for an lvm partition. Now I have the various partitions(except /boot) on logical volumes(using this guide). Now comes the hard part, how do I move the system to this new disk properly? Current configuration: Linux Mint 13 32 bit on Windows 7 32 bit using virtualbox 4.2. thanks


How to unset set -o vi?

I wanted to try vi mode in bash but now I would like to change it back to normal. How can I unset `-o vi` ?


How to permit any user (mysql, apache, etc) to use any TCP or UDP port?

How can I ensure that all ports are open to any user? Currently ports 1 to 1024 are reserved for "root" only. Although I am not sure why "apache" is capable of using port "80" if this port too is reserved for "root". I would like to simply free all ports so they can be used by any user.


Why does $TERM var equal linux with virtual terminals

Is there a terminal linux? I was experimenting with the machine to see how the virtual terminals work and when I echo $TERM it printed linux? Is this the default linux terminal? I tried searching for man pages on linux but only results about the operating system return.


Is there anyway to download an entire RHEL repo from windows?

I have a number of offline machines RedHat machines that I need to update, and I have an active RedHat subscription for all of them. I am unable to get an internet connection to these machines so I would like to be able to mirror the updates repo and bring it with me on a harddrive. For other distros I have done this with wget on a windows machine, but I dont know how to do this for RedHat. Any ideas for how to do this on a windows machine, or should I just make a RedHat machine to use to mirror the repo?


Any way to restart a Linux machine via SSH if the root filesystem is not working?

Just as a curiosity; something went wrong with a Linux machine, making the root file system show up as "64Z". A few commands work, like `top`, `df`, and `kill`, but others like `reboot` come up with "command not found" (since it can't read the root filesystem), and `chmod` comes up with a segmentation fault. Is there any way to restart the system anyway, i.e. without the `reboot` program? I tried `kill -PWR 1` (sending SIGPWR to init), but this didn't seem to do anything. It's mostly an academic curiosity. The labmate who was doing whatever large- database work that caused the failure will be physically restarting the machine soon.


How to specify file path with find when searching for files with -regex

I want to search a directory for some files using `find` and a regular expression. If I do               cd dir     find -E . -type f -regex '^\..*[^~]'      I get a list of files in the directory that match the the regular expression. However, if I do               find -E ~/dir -type f -regex '^\..*[^~]'      i.e.               find -E /home/adam/dir -type f -regex '^\..*[^~]'      I get no output. How do I specify the directory to be searched by `find` when using a regular expression? This is BSD `find`, as I am on a Mac.


how to focus different `regions`(Ctrl-a S) via mouse-click in `screen`?

When I start `vim` in a `screen` session, and activate the mouse:               :set mouse=a      the mouse remains disabled. I cannot switch tabs via mouse click. How can I configure `screen` so that mouse support in `vim` works? * * * **Edit:**   I guess the version of my `screen` is too old. When I upgrade it, mouse works fine in vim. I still want to know how to focus different `regions`(`Ctrl-a S`) via mouse click.


NFS server causes high load even when idle

I have an Ubuntu (12.04) NFS server that has a high load (larger than 10) even when nothing is running. In detail, the storage is provided by an iSCSI device, on which I have 5 logical volumes (LVM) and some ext4 partitions. Even with all services stopped, and no exports (that is no client traffic), the load is at 10. Running iostat shows that one particular mapped device (/dev/dm-1) is always being written to (if I interpret the output correctly):               Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn     sda               0.00         0.00         0.00          0          0     sdb             342.00         0.00         9.21          0          9     dm-0              0.00         0.00         0.00          0          0     dm-1            615.00         0.00        11.71          0         11      (sdb is where the iSCSI device appears, dm-n the various logical volumes). I have literally stopped (almost) all other services running, and I can with good confidence say that the moment I start the NFS server the load goes up, and when I stop it the load goes down. What is going on? How can I see what is writing to the disk? (I tried lsof but that shows no process). **Additions** Adding information as asked. **uptime** says:               18:27:15 up 1 day,  9:59,  2 users,  load average: 14.22, 12.42, 11.55      **vmstat** says:               procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----      r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa      1  1    960 865924  51604 23204424    0    0    43     4    7   20  0  2 86 12      **mpstat** says:               Linux 3.2.0-26-generic-pae (leitrim)    12/25/2012  _i686_  (8 CPU)          06:33:53 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle     06:33:53 PM  all    0.08    0.04    0.96   11.62    0.00    0.88    0.00    0.00   86.43      **dstat -cdD sdb -ng 60 3**               ----total-cpu-usage---- --dsk/sdb-- -net/total- ---paging--     usr sys idl wai hiq siq| read  writ| recv  send|  in   out        0   1  86  12   0   1| 324k 8729k|   0     0 |   1B    8B       0   1  87  12   0   1|  17k 8953k|8064k 9652k|   0     0        0   1  86  12   0   1|1229B 9081k|8010k 9796k|   0    68B       0   1  89  10   0   1|3209B 8364k|7703k 9014k|   0     0       **rpcinfo**                 program version netid     address                service    owner         100000    4    tcp6      ::.0.111               portmapper superuser         100000    3    tcp6      ::.0.111               portmapper superuser         100000    4    udp6      ::.0.111               portmapper superuser         100000    3    udp6      ::.0.111               portmapper superuser         100000    4    tcp       0.0.0.0.0.111          portmapper superuser         100000    3    tcp       0.0.0.0.0.111          portmapper superuser         100000    2    tcp       0.0.0.0.0.111          portmapper superuser         100000    4    udp       0.0.0.0.0.111          portmapper superuser         100000    3    udp       0.0.0.0.0.111          portmapper superuser         100000    2    udp       0.0.0.0.0.111          portmapper superuser         100000    4    local     /run/rpcbind.sock      portmapper superuser         100000    3    local     /run/rpcbind.sock      portmapper superuser         100024    1    udp       0.0.0.0.172.13         status     116         100024    1    tcp       0.0.0.0.229.210        status     116         100024    1    udp6      ::.137.98              status     116         100024    1    tcp6      ::.175.197             status     116         100021    1    udp       0.0.0.0.171.56         nlockmgr   superuser         100021    3    udp       0.0.0.0.171.56         nlockmgr   superuser         100021    4    udp       0.0.0.0.171.56         nlockmgr   superuser         100021    1    tcp       0.0.0.0.153.54         nlockmgr   superuser         100021    3    tcp       0.0.0.0.153.54         nlockmgr   superuser         100021    4    tcp       0.0.0.0.153.54         nlockmgr   superuser         100021    1    udp6      ::.206.206             nlockmgr   superuser         100021    3    udp6      ::.206.206             nlockmgr   superuser         100021    4    udp6      ::.206.206             nlockmgr   superuser         100021    1    tcp6      ::.132.23              nlockmgr   superuser         100021    3    tcp6      ::.132.23              nlockmgr   superuser         100021    4    tcp6      ::.132.23              nlockmgr   superuser         100003    2    tcp       0.0.0.0.8.1            nfs        superuser         100003    3    tcp       0.0.0.0.8.1            nfs        superuser         100227    2    tcp       0.0.0.0.8.1            -          superuser         100227    3    tcp       0.0.0.0.8.1            -          superuser         100003    2    udp       0.0.0.0.8.1            nfs        superuser         100003    3    udp       0.0.0.0.8.1            nfs        superuser         100227    2    udp       0.0.0.0.8.1            -          superuser         100227    3    udp       0.0.0.0.8.1            -          superuser         100003    2    tcp6      ::.8.1                 nfs        superuser         100003    3    tcp6      ::.8.1                 nfs        superuser         100227    2    tcp6      ::.8.1                 -          superuser         100227    3    tcp6      ::.8.1                 -          superuser         100003    2    udp6      ::.8.1                 nfs        superuser         100003    3    udp6      ::.8.1                 nfs        superuser         100227    2    udp6      ::.8.1                 -          superuser         100227    3    udp6      ::.8.1                 -          superuser         100005    1    udp       0.0.0.0.154.132        mountd     superuser         100005    1    tcp       0.0.0.0.217.173        mountd     superuser         100005    1    udp6      ::.165.76              mountd     superuser         100005    1    tcp6      ::.141.19              mountd     superuser         100005    2    udp       0.0.0.0.183.55         mountd     superuser         100005    2    tcp       0.0.0.0.214.84         mountd     superuser         100005    2    udp6      ::.233.222             mountd     superuser         100005    2    tcp6      ::.211.16              mountd     superuser         100005    3    udp       0.0.0.0.188.56         mountd     superuser         100005    3    tcp       0.0.0.0.158.62         mountd     superuser         100005    3    udp6      ::.152.158             mountd     superuser         100005    3    tcp6      ::.201.200             mountd     superuser


New keyboard messing up mouse

Fedora 20, xfce. I just plugged in a new keyboard, and everything appears to work. There's a backlight-toggling button in the corner. I press it. Now my mouse clicks don't want to register, or my mouse unclicks don't want to register, or both, or something stranger. I can't figure it out. As soon as I unplug the keyboard and plug it back in, things are back to normal. So I fire up xev: 'd' behaves normally:               KeyPress event, serial 37, synthetic NO, window 0x1000001,         root 0x290, subw 0x0, time 505354779, (-804,-173), root:(67,302),         state 0x10, keycode 40 (keysym 0x64, d), same_screen YES,         XLookupString gives 1 bytes: (64) "d"         XmbLookupString gives 1 bytes: (64) "d"         XFilterEvent returns: False          KeyRelease event, serial 37, synthetic NO, window 0x1000001,         root 0x290, subw 0x0, time 505354867, (-804,-173), root:(67,302),         state 0x10, keycode 40 (keysym 0x64, d), same_screen YES,         XLookupString gives 1 bytes: (64) "d"         XFilterEvent returns: False      This is what happens when I press the light-toggling button:               FocusOut event, serial 37, synthetic NO, window 0x1000001,         mode NotifyNormal, detail NotifyNonlinear          VisibilityNotify event, serial 37, synthetic NO, window 0x1000001,         state VisibilityFullyObscured      And then it's like the system doesn't know where my mouse is, even though it is displaying it correctly. And I can't seem to click on anything, though if after going crazy with the mouse I do apparently click on something, it doesn't seem to want me to unclick. As an example, I was getting a lot of these:               MotionNotify event, serial 37, synthetic NO, window 0x1000001,         root 0x290, subw 0x0, time 505483157, (565,160), root:(1436,635),         state 0x210, is_hint 0, same_screen YES      Even when my mouse wasn't anywhere near the input detector window. Any tips? I'm a little lost here, and Google isn't finding my anything.


Test tar file integrity in bash

I have a bash script that creates a '.tar' file. Once the file is created, I would like to test its integrity and send an email to the root user if the integrity is bad. I know I would need to use the command `tar -tf /root/archive.tar` to check the integrity of the file, but how would I implement this in a bash if statement and check for errors?


Fedora 19 zfsonlinux - how to configure cifs share?

Fedora 19 with current version of zfsonlinux / smb version 4.0.9. When I try to               zfs set sharesmb=on      I receive               smb add share failed      Any ideas? Is this supposed to work yet or still in development?


sed - remove unmatched "}", ")" or ']" (only for the line in question)

I have a file with a lot of lines Some of the lines end in unmatched braces, i.e. "`}`" This is only true for lines that contain `".to"` How can I remove the unmatched braces with sed for ALL lines that contain a string ("`.to`") but don't have another string ("`{`") anywhere in the line (before or after the `.to`) but do end in "`}`"? Something like `sed -i '/\\.to/s/[[:space:]]*\\}//' file` but that would be for ALL lines that contain a string ("`.to`") and end in a "`}`" i want it for lines that DONT have a brace/bracket, e.g. `{` before the `}` I do not need to worry about multi-line braces for this. Limiting to lines that match a search ('.to' in this case) helps prevent that. e.g.                 expect(:size).to eq 2 }       expect(:first).to be_persisted }       expect("first.number_field").to eq 10 }       expect(:last).to be_persisted }       expect("last.number_field").to eq 10 }       this remains unchanged }       this {remains} unchanged }       this {          is ok }          =>            expect(:size).to eq 2       expect(:first).to be_persisted       expect("first.number_field").to eq 10       expect(:last).to be_persisted       expect("last.number_field").to eq 10       this remains unchanged }       this {remains} unchanged }       this {          is ok }


Array Cartesian product in bash

Is there a way to generate cartesian product of arrays without using loops in bash? One can use curly brackets to do a similar thing:               echo {a,b,c}+{1,2,3}     a+1 a+2 a+3 b+1 b+2 b+3 c+1 c+2 c+3      but I need to use arrays as inputs, and most obvious tricks fail me.


Screenshot tool Linux Mint

In Linux Mint (15) you have a screenshot tool, 'described' here You read > More difficult way > > But sometimes - mostly in games - this shortcut doesn't work. What to do > then? >You can use Take Screenshot application to make a screenshot after a > delay. > > To start Take Screenshot application: Mint Menu -> All applications -> > >Accessories -> Take Screenshot. > > Next select Grab the current window, disable Include pointer option, disable > >Include window border, and choose Effect: None. > > Now it's time to choose the delay. I usually choose 10-15 seconds. Why? > Because >it's the time period in which you have to launch the application > (mostly game) and start playing. > > After you've chosen the delay click the Take Screenshot button, and then > >quickly launch the game, start playing, and wait until Save Screenshot > window appears. What is the name of this program, (and not Screenshot but a name so I can actually google it)? I want to know it because I'm searching for an alternate on windows, not really necessarily but if anyone knows one, that answers my question too (which at least has the `Select area to grab` function).


iptable rule to redirect only https handshake?

I was reading this interesting article today: http://www.moserware.com/2009/06/first-few-milliseconds-of-https.html A crazy thought came to mind...Is it possible to write an iptable rule that only redirects https handshake requests?