Print some fields of /etc/passwd

I have a question concerning the usage of wild cards in Linux. Here I have some lines from a long list of lines in the /etc/passwd -file.               root:x:0:0:root:/root:/bin/bash     daemon:x:1:1:daemon:/usr/sbin:/bin/sh     bin:x:2:2:bin:/bin:/bin/sh     sys:x:3:3:sys:/dev:/bin/sh     sync:x:4:65534:sync:/bin:/bin/sync     games:x:5:60:games:/usr/games:/bin/sh     ...      What is and appropriate command/commands to print out only the username, UID number and GID number from this line (if possible show multiple ways so I can explore further)?


How can sed add text after existing indent?

I have a sed script that has:               sed -i '/ *it.*do/! {               /\.should/ {                 s/\.should/)\.to/                 s/\(\S\)/expect(\1/                  # ...others      The last `s` adds `expect(` to the start of the line. I don't understand how it works. It works though for: Original:                 it "uses the given count if set" do         call('5').should == 5       end            it "uses the processor count from Parallel" do         call(nil).should == 20       end      After:                 it "uses the given count if set" do         expect(call('5')).to eq 5       end            it "uses the processor count from Parallel" do         expect(call(nil)).to eq 20       end      But it doesn't add the `expect(` for: Original:                 it "does not wait if not run in parallel" do         ParallelTests.should_not_receive(:sleep)         ParallelTests.wait_for_other_processes_to_finish       end            it "stops if only itself is running" do         ENV["TEST_ENV_NUMBER"] = "2"         ParallelTests.should_not_receive(:sleep)         with_running_processes(1) do             ParallelTests.wait_for_other_processes_to_finish           end       end      After - no `expect(`...                 it "does not wait if not run in parallel" do         ParallelTests).to_not receive(:sleep)         ParallelTests.wait_for_other_processes_to_finish       end            it "stops if only itself is running" do         ENV["TEST_ENV_NUMBER"] = "2"         ParallelTests).to_not receive(:sleep)         with_running_processes(1) do             ParallelTests.wait_for_other_processes_to_finish           end       end      However it **DOES** work for:   After:                 it "should be true when there is a Gemfile" do         use_temporary_directory_for do           FileUtils.touch("Gemfile")           expect(ParallelTests.send(:bundler_enabled?)).to eq true         end       end


Web navigation with dark color schemes

I use KDE with a dark color scheme so the text main color is white. Unfortunately this causes many websites to be unusable because text inside combobox, checkbox, and similar inherits the white color and so is white, while the background does not inherits the black color from the color scheme so is again white. So you have white on white. I use firefox as my main browser but this happens also in chromium and rekonq. Is it possible to fix this?


Fedora 17 : hotkey for terminal

Each time, if I want to use terminal, I press super key, typing terminal in search box, and enter to select terminal icon. How can I have hotkey to open terminal. (I'm not say hotkey : control + alt + Fn because it will open a full-console, not what I want). I just want a terminal windows. I have searched in keyboard shortcut, but I don't see option to select hotkey for this purpose. I just see one option : "Hotkey to enter command", when use this hotkey, it will apppear a small popup, but I don't know what command exist. (and it doesn't look like terminal) Thanks :)


“No such file or directory” when executing a cross-compiled program on a Raspberry Pi

I recently bought a Raspberry Pi. I already have configured it, and I install a cross compiler for arm on my desktop (amd64). I compiled a simple "hello world" program and then I copy it from my desktop to my Pi with `scp ./hello david@192.168.1.33:~/hello`. After login in my Pi I run `ls -l hello` and I get a normal response:               -rwxr-xr-x 1 david david 6774 Nov 16 18:08 hello      But when I try to execute it, I get the following:               david@raspberry-pi:~$ ./hello     -bash: ./hello: No such file or directory          david@raspberry-pi:~$ file hello     hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0x6a926b4968b3e1a2118eeb6e656db3d21c73cf10, not stripped     david@raspberry-pi:~$ ldd hello          not a dynamic executable


I installed Debian 7 using a USB flash drive "burned" from the first DVD ISO of the Debian installation CD/DVD. I did a very minimal install without Debian desktop environment, Print server and Standard system utilities. After installation and a reboot, I was presented with a console with the words _Debian GNU/Linux 7 hostname tty1_. I supplied the login username and password. After I typed the command _sudo apt-get install xorg_ , an error message popped up stating:               Media changed: please insert the disk labeled 'Debian GNU/Linux 7.4.0 _Wheezy_ - Official amd64 DVD Binary-1 20140208-13:47' in the drive and press Enter      I inserted the same USB flash drive into the same port and after waiting for a few seconds, I pressed Enter. The same error message popped up. I have tried the following steps on the advice of some of my colleagues:   1. remove/delete all the entries in /etc/apt/sources.list and reboot the computer   2. dmesg and fstab show that the USB thumb drive is mounted on /dev/sdb1   3. sudo mount /dev/sdb1 /media/usb0   4. sudo apt-cdrom -m -d /media/usb0 add After doing the above, the following error message appears:               Using CD-ROM mount point /media/cdrom/     Identifying.......{a long string of alphanumeric characters}     Scanning disc for index files...............     Found 0 package indexes, 0 source indexes, 0 translation indexes and 0 signatures     W: Failed to mount '/dev/sr0' to '/media/cdrom/'     E: Unable to locate any package files, perhaps this is not a Debian disc or the wrong architecture      I prefer to install Xorg (60MB) and gnome-core (400MB) from the USB stick. The NGO that I am working with is in a developing country with a very basic internet access infrastructure. Internet access is very patchy and the average download speed is less than 2 Mbps. A solution will be much appreciated.


How to have Kate spell check ignore run together words?

I use Kate editor for scientific programming (Fortran, Python, matlab) and would like to leave spell check on, but have it automatically ignore words that have been run together to create a variable name, e.g., NewVariable or HugeMatrix. There is an option in the spelling menu, but the spell check still highlights these words. Any ideas?


Have bash script wait for password

I want to write a little script which sets up a socks proxy via ssh and then starts a browser using that proxy.               #!/bin/bash     ssh -D 1234 user@host #&     chromium-browser --proxy-server="socks5://127.0.0.1:1234"      If I add the `&`-sign at the end of the first line the script just asks for my password and then opens an `ssh` terminal. The browser is started not before the ssh terminal is closed which is pretty useless. If I add the `&`-sign the script doesn't wait until I typed in the password and I don't know how I can cleanly end the `ssh` session. I don't want to use automatic `ssh` login via `rsa`-keys. Any suggestions how I could circumvent the problems described above?


What is the definition of a regular expression?

I recently got into a friendly argument with Ghoti about what constitutes a regular expression in the comments to my answer to this question. I claimed that the following is a regular expression:               `[Rr]eading[Tt]est[Dd]ata`      Ghoti disagreed, claiming it is a file glob instead. The glob page on wikipedia claims that (emphasis mine): > Globs do not include syntax for the Kleene star which allows multiple > repetitions of the preceding part of the expression; **thus they are not > considered regular expressions, which can describe a larger set of regular > languages over any given finite alphabet.** However, there is no citation for this claim, indicating that it is just a particular wikipedia editor's opinion. The The Single UNIX ® Specification, Version 2, states that a Basic Regular Expression (BRE) can even be a single character: > An ordinary character is a BRE that matches itself: any character in the > supported character set, except for the BRE special characters listed in BRE > Special Characters . So, what is the definition of a regular expression in the *nix world, and does that definition exclude file globs?


Using Diff with -y to get side-by-side output

I am trying to use `diff` with `-y` to get side-by-side output, but my output gets messed up after about 18 lines. Here is an example, any clue why? (Check from `*.java_pool_size=134217728`) :               *._unnest_subquery=FALSE                    *._unnest_subquery=FALSE     *.archive_lag_target=1800                   *.archive_lag_target=1800     *.audit_file_dest='/u01/app/oracle/admin/xxxxxxx/adump'       <     *.audit_sys_operations=TRUE                 *.audit_sys_operations=TRUE     *.audit_trail='DB_EXTENDED'                 *.audit_trail='DB_EXTENDED'     *.compatible='11.2.0.1.0'                   *.compatible='11.2.0.1.0'     *.control_files='/u01/app/oracle/oradata/xxxxxxx/control01.ct | *.control_files='/u01/app/oracle/oradata/xxxxxxx/control01.ct     *.cursor_sharing='EXACT'                      | *.cursor_sharing='SIMILAR'                                       > *.cursor_space_for_time=TRUE     *.db_block_size=8192                        *.db_block_size=8192     *.db_domain='xxxxxxxxxx.com'                      | *.db_domain=''     *.db_file_multiblock_read_count=8                 | *.db_file_multiblock_read_count=32     *.db_name='xxxxxxx'                     *.db_name='xxxxxxx'     *.db_writer_processes=8                     *.db_writer_processes=8     *.diagnostic_dest='/u01/app/oracle'             *.diagnostic_dest='/u01/app/oracle'     *.dispatchers='(PROTOCOL=TCP) (SERVICE=xxxxxxxXDB)'     *.dispatchers='(PROTOCOL=TCP) (SERVICE=xxxxxxxXDB)'                                       > *.EVENT='1652 TRACE NAME ERRORSTACK LEVEL 3'     *.fast_start_mttr_target=300                    *.fast_start_mttr_target=300     *.java_pool_size=134217728                    | *.instance_name='xxxxxx'     *.job_queue_processes=10                      | *.log_archive_dest_1='LOCATION=/xxxxxxx-05/oradata/arch'     *.large_pool_size=167772160                   | *.log_archive_dest_state_1='enable'     *.log_archive_dest_1='LOCATION=/xxxxxxx-04/oradata/arch'      <     *.log_archive_format='arch_%t_%s_%r.arc'            *.log_archive_format='arch_%t_%s_%r.arc'     *.log_checkpoint_timeout=0                    | *.log_buffer=1048576     *.log_checkpoint_to_alert=TRUE                    | *.log_checkpoint_interval=0     *.log_buffer=14289920                         | *.log_checkpoints_to_alert=TRUE     *.open_cursors=4000                       | *.open_cursors=1500     *.parallel_adaptive_multi_user=FALSE                  | *.optimizer_features_enable='10.2.0.4'     *.pga_aggregate_target=2500M                      | *.optimizer_mode='ALL_ROWS'     *.processes=3000                          | *.pga_aggregate_target=527433728     *.query_rewrite_integrity='TRUSTED'               | *.processes=800                                       > *.query_rewrite_enabled='TRUE'                                       > *.query_rewrite_integrity='Trusted'     *.recyclebin='OFF'                      *.recyclebin='OFF'     *.remote_login_passwordfile='EXCLUSIVE'             *.remote_login_passwordfile='EXCLUSIVE'     *.sec_case_sensitive_logon=FALSE                  | *.SEC_CASE_SENSITIVE_LOGON=FALSE     *.session_cached_cursors=1000                     | *.session_cached_cursors=1200     *.session_max_open_files=30                   | *.session_max_open_files=20     *.sga_target=4G                           | *.sessions=2000     *.standby_file_management='AUTO'                  | *.sga_max_size=2600M                                       > *.sga_target=2600M                                       > *.sort_area_size=524288                                       > *.star_transformation_enabled='FALSE'     *.streams_pool_size=50331648                    *.streams_pool_size=50331648                                       > *.timed_statistics=TRUE     *.undo_management='AUTO'                    *.undo_management='AUTO'     *.undo_retention=18000                        | *.undo_retention=21600     *.undo_tablespace='UNDOTBS1'                    *.undo_tablespace='UNDOTBS1'


openSuse, new user cannot login

I am using openSuse 12.3. I have created a new user using:               linux-amvn:~ # useradd -m -G users,dev -s /bin/bash -p pass123 harbir-PC      The user `harbir-PC` is not able to login, when I try to log using `ssh`. I went ahead and looked into the `/etc/passwd` file and I see the following:               harbir:x:1000:100:harbir:/home/harbir:/bin/bash     kdm:x:489:487:KDM Display Manager daemon:/var/lib/kdm:/bin/false     harbir-PC:x:1001:100::/home/harbir-PC:/bin/bash      There is a difference between the user `harbir` and `harbir-PC`. I have no problem with the user `harbir` (who I have created during installation), but I need to login using the user `harbir-PC`. I also checked the `/etc/shadow`, and passwords are encrypted.


Handle local links to local files in emacs

I have a `LaTeX` document where I often have to insert pathnames of files on my machine of other `LaTeX` files. Is there a way in `emacs` do get the following:   1. A command which opens a file selection dialogue such that the choosen filename + path will be inserted at point.   2. A macro which opens the file under point. For example when the point is on `~/mytex.tex` and I press a certain key sequence it should open `~/mytex.tex` in a new buffer.   3. A macro which opens the corresponding `pdf` file of `tex` filename under point in `evince`, for example `~/mytex.pdf`.   4. A command which opens a file selection dialogue to change the filename under point. It is important to have the file-path names in a plain style because they should be proceed by latex as well.


run a script at shutdown in Debain

I am using Debain wheezy. My problem is , I am using a limited 2.5 GB net connection. My idea is simply running a script as               #!/bin/bash     date >> ~/mydatausage.txt     ifconfig -a >> ~/mydatausage.txt      at the time of shutdown.   * how to run this script at shutdown    * this script needs to run as root, how can I achieve this ?  Thanks in advance.


Change directory based on a pipeline's output

I want to go to a directory with using filter For example there is a file named `this-is-awsome`               ls | grep this-is-awsome | xargs cd      How can I go to a directory with filter?


Can I recursively print all current remote shells?

Is there a way to print out all of the local and remote shells I am currently in, recursively? For example, on my local machine, I will ssh into another machine. From there, I may switch users (opening another shell). Then I ssh to my local machine again, etc. And to complicate matters, I'll generally have multiple tabs (and even windows) of shells, so I can't usually remember my trail for each one. What I would like is to have each of those sessions print out in order where I am. Or at least what shell I will be kicked back into if I `exit` the current shell. After a few days or weeks of having multiple shells open, I have no idea where I will be sent if I type in `exit`. Will my shell window close (because I'm at the 'root' shell)? Will I be kicked back to another server? In other words, I'd like a trace of my SSH hops.


Linux : how to redirect stdout & stderr to logger?

I have a program I need to run at startup, it has output on stdout and stderr that I want to redirect to the system log using the logger command. What I have in my startup script is thie:               /home/dirname/application_name -v|logger 2>&1 &      This is redirecting the stdout to syslog just fine but stderr is coming to the console, so I need some help on refining the command.


memtester runs faster after couple of runs

I am using this test tool : http://pyropus.ca/software/memtester/ And I noticed that first 3 iterations take 4 hours but 30 iterations take only 12 hours. I was hoping that 30 iterations will take 40 hours. I looked at the code and I am surprised, because you see there is no file system i/o involved in this case and all it does is run bunch of tests on malloc'ed memory. Any pointers to the cause would be appreciated?


How to change from csh to bash as default shell

I have `csh` as my default shell, as shown by `echo $SHELL`. I want to switch to `bash` as my default shell. I tried the following approaches to no avail:   1. chsh. I get:              chsh: can only change local entries; use ypchsh instead.        2. ypchsh. I get:              ypchsh: yppasswdd not running on NIS master host ("dcsun2").      I only have `.chsrc` in my home directory and I cannot find any `.profile` files in `/etc`. How can I change my default shell to `bash`?


Bluetooth mouse disconnects every ~30 seconds

I am running Linux Mint 16 Petra, and I have a Bluetooth mouse that I would like to use with it. Unfortunately, the mouse disconnects around every 30 seconds and has to be rebooted by physically turning the power button on the mouse off and on again to reconnect. The Bluetooth adapter is identified as a `ASUSTek Computer, Inc. BT-253 Bluetooth Adapter`. How can I make the mouse stay connected?


/home partition

I am facing the following doubt. I installed Arch time ago with a home separate partition. My issue is that I need to reinstall the system and I don't have a backup of my `/home`. Would a new installation overwrite my home and leave it empty or keep my current files? The question is because theorically keeping the data is the main purpose of having one I guess, but it happened to me before that left my home partition empty as new (had a back-up before, but not now). In the installation, when specifying the mounting points, I selected home as `/home` mounting point and deleted the previous data it had. I will appreciate if someone passed through a similar issue and knows for sure a safe way of reinstalling the system, selecting home mounting point in `/home` partition and managed to keep the old home data intact. Would installing the system with home included in the partition A `/` and then manually specify in fstab partition B `/home` mounting point the cleanest/safer way to do it? EDIT: I finally backed up my data there as is the only real safe thing to do, and I dont feel so comfortable with luck. Anyway my old home partition I will divide it again, will left around 5 GB partition just to have my recovery partition and avoid having to deal with this again. I'm not sure if its correct to ask it here or should I open a new question but my doubt is if I copy `*.*` from my fresh installation `/` to my new 5 GB recovery partition, next time I run into a similar situation, I just boot with a live USB and copy `*.*` from recovery partition to normal `/` partition and it is restored as brand new, am I right?


rtorrent: Can't connect to trackers on CentOS 5.6

I'm trying to set up rtorrent on my CentOS 5.6 server, and it currently cannot connect to any trackers. I compiled `libtorrent-0.12.6` and `rtorrent-0.8.6`. I also compiled `libcurl 7.21.7` with `c-ares 1.7.5` because the in-repo version of curl didn't have c-ares so it couldn't resolve tracker host names (not asynchronously at least). I forwarded ports 6890-6999 through iptables using the following in `/etc/sysconfig/iptables`:               -A INPUT -p tcp --destination-port 6890:6999 -j ACCEPT     -A OUTPUT -p tcp --source-port 6890:6999 -j ACCEPT      But even if I stop iptables it doesn't work. When I start rtorrent it will say something like `Connecting to http://torrent.fedoraproject.org:6969/announce`, then quickly followed by `Couldn't connect to server`. I know there isn't much information about why it can't connect, but is there a way I can find out? **Edit** I tried rtorrent on my local machine running Fedora 15 using all in- repo software and I have the same problem. But ktorrent runs on Fedora 15 with no problem.


Books/Resources which explain TCP/IP kernel implementation

I only know about: 1) Internetworking with TCP/IP: Vol.II, Design, Implementation, and Internals 2) TCP/IP Illustrated, Vol. 2: The Implementation but these are quite dated. I am particularly interested in Open source implementations. Any ideas? EDIT: I found another book 1) TCP/IP Architecture, Design and Implementation in Linux


Files uploaded as root to the web server can't be overwritten by web application

Here is my problem. I am developing a web application in PHP/MySQL and I am having some problems setting up the accounts I need to use. Development workstation: WinXP SP3, Eclipse PDT Development server: Debian 6.0, Apache2, MySQL 5, XDebug Connected through a LAN. While I am developing I upload code that needs to be tested to the server. I use GIT and ssh:root@myserver. As expected, the files end up being owned by root in the server. My web application needs to update some of the files. To allow that I ran chmod in the server to change ownership of the files to www-data. This works fine. The problem is that every time I change a file and upload it again it reverts back to root ownership and I have to manually change it back to www-data. I don't think this will be a problem in the production environment because I can ensure the files will have the correct ownership when they go live. However it is a pain the development process. What I am thinking: 1 - I probably should not be uploading with a root account. I tried connecting to the server through ssh using the user www-data. However it asks for a password and after some reading I found out that it is probably not a good idea to mess with www-data user. 2 - I could probably create another account for development purposes and upload the files with that account. The problem is that I don't know how to configure my web application to use that account when connecting to the server and database. 3 - I could probably configure my application and database to run as root in the development environment. This would resolve the problem. However as stated in 2 above, I don't know how to do it and I something tells me that this would not be a good idea. So I am looking for advice on how to solve my problem. I could go with any one of the three alternatives above (or even a 4th one that I haven't considered). Thanks. ### Update - 2011-09-13 One solution from the responses below (thank you cdp1337) is to run a script to update the file permissions when I upload files to the development server. In my case, I could run               chown -R www-data:www-data *      in the root of my website. **_NOTE: this is NOT in the production environment and the development web server cannot be accessed outside our company. This is not a solution to deploy to production environment._** Any other ideas? Thanks.


What is the equivalent of update-modules in CentOS 6.4?

I am adding files to `/etc/modprobe.d`, and a README of some software that I'm installing advised to run `update-modules` afterwards.               $ sudo update-modules     -bash: update-modules: command not found      What is the equivalent of this program in CentOS 6.4? Or is `update-modules` deprecated? What is the new program called?


In an empty environment, how are executables found?

For experimentation purposes I created a binary that prints the `$PATH`, and calls `which` as follows:               #include <stdlib.h>     #include <stdio.h>          int main() {         char *path = getenv("PATH");              if (path)             printf("got a path: %s\n", path);         else             printf("got no path\n");              system("which which");         return 0;     }      when I run it in an empty environment via               env -i ./printpath      I get the following printout:               got no path     /usr/bin/which      My question is: **why is the correct`which` binary called, even if there is no `$PATH`?**


"$!" is used for?

While going through:               info coreutils 'dd invocation'      I came across:               dd if=/dev/zero of=/dev/null count=10MB & pid=$!      What is `$!` used for?


How to force crontab to check for changed files

I have a gentoo Linux system in which I am logged in as root. How can I force `crontab` to read new/changed files in `/etc/cron.d` immedeately, so that even a new cronjob is executed if even only seconds away?


I quite like mercurial .hgignore-style globbing. Is there a Linux shell that supports it?

I quite like mercurial .hgignore-style pattern globbing. > Globs are rooted at the current directory; a glob such as *.c will only > match files in the current directory ending with .c. > > The supported glob syntax extensions are ** to match any string across path > separators and {a,b} to mean "a or b". Is there a Linux shell that supports this?


Why gnustep-config outputs nothing for any parameter?

Regardless of what I run:               gnustep-config --debug-flags     gnustep-config --objc-flags     gnustep-config --base-libs      It outputs nothing. How would I debug this? PS: the OS details: Ubuntu 12.04.2 LTS, gnustep-make-2.6.1-1 PPS:               zerkms@ubuntu-1204-2-server-amd64:~$ . /usr/share/GNUstep/Makefiles/GNUstep.sh     zerkms@ubuntu-1204-2-server-amd64:~$ gnustep-config --debug-flags     zerkms@ubuntu-1204-2-server-amd64:~$ gnustep-config --base-libs     zerkms@ubuntu-1204-2-server-amd64:~$ gnustep-config --objc-flags      and after executing `GNUstep.sh` there are a lot of `GNUSTEP_*` environment variables added:               GNUSTEP_IS_FLATTENED=yes     GNUSTEP_LOCAL_ROOT=/usr/Local     GNUSTEP_HOST=x86_64-pc-linux-gnu     LD_LIBRARY_PATH=/home/zerkms/GNUstep/Library/Libraries:/usr/local/lib:/usr/lib     GUILE_LOAD_PATH=/home/zerkms/GNUstep/Library/Libraries/Guile:/usr/local/lib/GNUstep/Libraries/Guile:/usr/lib/GNUstep/Libraries/Guile     GNUSTEP_MAKEFILES=/usr/share/GNUstep/Makefiles     GNUSTEP_NETWORK_ROOT=/usr/Network     GNUSTEP_FLATTENED=yes     GNUSTEP_HOST_OS=linux-gnu     GNUSTEP_HOST_VENDOR=pc     PATH=/home/zerkms/GNUstep/Tools:/home/zerkms/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games     GNUSTEP_HOST_CPU=x86_64     GNUSTEP_USER_ROOT=/home/zerkms/GNUstep     GNUSTEP_SYSTEM_ROOT=/usr/System     GNUSTEP_PATHLIST=/usr/System:/usr/Network:/usr/Local:/home/zerkms/GNUstep     CLASSPATH=/home/zerkms/GNUstep/Library/Libraries/Java:/usr/local/lib/GNUstep/Libraries/Java:/usr/lib/GNUstep/Libraries/Java     INFOPATH=/usr/share/info::/usr/local/share/info::/home/zerkms/GNUstep/Library/Documentation/info:


Cannot find Audio Hardware for my Workstation

Audio is NOT working in HP workstation xw 4600. I cannot find any hardware present at > System-> Preferences -> Sound -> Hardware (Tab) The command `lspci -v` shows following output of Audio Device:               01:00.1 Audio device: nVidia Corporation Device 0bee (rev a1)         Subsystem: ZOTAC International (MCO) Ltd. Device 5194         Physical Slot: 2         Flags: bus master, fast devsel, latency 0, IRQ 5         Memory at fa000000 (32-bit, non-prefetchable) [size=16K]         Capabilities: [60] Power Management version 3         Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+         Capabilities: [78] Express Endpoint, MSI 00         Kernel modules: snd-hda-intel      And when I am configuring via `alsamixer` and press tab **F6** [Select Sound Card], there is only one **default** option is present. **Update 1:** The output of the commands shows no hardware present ! is it True?               [root@target ~]# cat /proc/asound/cards        --- no soundcards ---       [root@target ~]# rmmod snd-hda-intel; modprobe snd-hda-intel       ERROR: Module snd_hda_intel does not exist in /proc/modules      Is my hardware NOT properly installed OR I need proper drivers? If so, which?. **Update 2:** After reconnecting the hardware and following _Gilles_ instructions, the output is as below: > [root@target ~]# modprobe snd-hda-intel   >  [root@target ~]# lsmod |grep '^snd_hda_intel'   >  snd_hda_intel 25771 0   >  [root@target ~]# uname -rv   >  2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010   >  [root@target ~]# I **still** don't know which drivers should I install for proper functioning of this card, please help! **Update 3:** Yes, I have tried configuring with alsaconf. But I get following errors:   `[root@target ~]# alsaconf`   ![enter image description here](http://i.stack.imgur.com/2z3N6.png)   ![enter image description here](http://i.stack.imgur.com/uDugg.png)   ![enter image description here](http://i.stack.imgur.com/n5m1B.png) and after this I got following Error Output. > [root@target ~]# alsaconf   >  ERROR: modinfo: could not find module snd-opl3sa2   >  ERROR: modinfo: could not find module snd-cs4236   >  ERROR: modinfo: could not find module snd-cs4232   >  ERROR: modinfo: could not find module snd-cs4231   >  ERROR: modinfo: could not find module snd-es18xx   >  ERROR: modinfo: could not find module snd-es1688   >  ERROR: modinfo: could not find module snd-sb16   >  ERROR: modinfo: could not find module snd-sb8   >  [root@target ~]# Still NOT getting any hardware information:   ![enter image description here](http://i.stack.imgur.com/NUSoo.png)


Centreon Web Interface Slow

Our Centreon web interface is so slow ! about 3/4 mins to have my click's results ... While Nagios is working perfectly ... Thanks to Google, i guess it comes from mysql. But I can't understand anything with it ... If someone already solve this, would be perfect ! Thanks, Nico. P.S : also posted on centreon forum, and server fault P.S2 : can't add Centreon as tag, not enough reputation.


FFmpeg-php installation error on CentOS 6 x64 bit

I'm trying to install `ffmpeg` and `ffmpeg-php`. FFMpeg installed perfectly. When I try to install `ffmpeg-php`, I'm running `./configure` and it's configured fine. However, when I run `make` it gives me the following error:               /bin/sh /usr/local/src/ffmpeg-php-0.6.0/libtool --mode=compile cc  -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/  -DHAVE_CONFIG_H  -g -O2 -Wall -fno-strict-aliasing   -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c -o ffmpeg_movie.lo      cc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c  -fPIC -DPIC -o .libs/ffmpeg_movie.o     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie___construct’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:311: error: ‘list_entry’ undeclared (first use in this function)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:311: error: (Each undeclared identifier is reported only once     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:311: error: for each function it appears in.)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:311: error: ‘le’ undeclared (first use in this function)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:346: error: expected ‘;’ before ‘new_le’     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:356: error: ‘new_le’ undeclared (first use in this function)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getComment’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:531: warning: ‘comment’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:760)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:531: warning: ‘comment’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:760)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getTitle’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:546: warning: ‘title’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:757)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:546: warning: ‘title’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:757)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getAuthor’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:561: warning: ‘author’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:758)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:561: warning: ‘author’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:758)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getCopyright’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:575: warning: ‘copyright’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:759)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:575: warning: ‘copyright’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:759)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getAlbum’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:590: warning: ‘album’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:761)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:590: warning: ‘album’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:761)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getGenre’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:604: warning: ‘genre’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:764)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:604: warning: ‘genre’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:764)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getTrackNumber’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:619: warning: ‘track’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:763)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getYear’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:632: warning: ‘year’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:762)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘_php_read_av_frame’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:1215: warning: ‘avcodec_decode_video’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:3656)     make: *** [ffmpeg_movie.lo] Error 1      My OS is CentOS 6.4 x86_64 virtuozzo – VPS. How can I fix this?


What is the meaning of the errors from my cpio command?

I have been using the following command on my system to create the .cpio archive to create an initramfs for my embedded target device               sudo find . | cpio -H newc -oc > ~/initramfs.cpio      This has always worked for me without any problem. Yesterday I was generating a new archive and I received the following error:               cpio: Archive format multiply defined: Operation not permitted     cpio: ./etc/shadow: Function open failed: Permission denied     cpio: ./usr/lib/ssh-keysign: Function open failed: Permission denied     64842 blocks      I never received these errors in the past, the files mentions with failed opens have not been touched either so I cannot understand why this has started happening. I update my host system with Ubuntu package manager so it is possible that my `cpio` package has been updated too. I obviously have no faith in the initramfs generated here due to all of the errors which confuse me greatly. The only option I can think of is to try and find out if my `cpio` version has changed and if so remove and replace with the older version I had. Is there any way I can find out this information on my system (Ubuntu 12.04)? Or is there some other way I can get around this problem?


Permissions on an ext4 filesystem on a removable drive used in different machines

I have a USB flash drive with `ext4` file system and its files are owned by my user on my local machine, for example by `myuser@myhost` with `700` permissions. If I unplug my flash drive and plug it in other Linux machine, can users of that machine have access to files in the flash drive? What if there is also a user named `myuser`, can he access those files?


Automatically mount encrypted home folder on login

I'm looking into encrypting my home folder with Truecrypt, and mounting it after I've logged in, which should be pretty straightforward. However, it occurred to me that it should be theoretically possible to mount it _as_ I'm logging in, as long as my account password is the same as my Truecrypt password. Is there a way to get PAM to run a command on login and pass the command my password as an argument? Or is there some other way to accomplish the same effect, without me needing to provide the password multiple times?


How to find out how fc-match matches?

When I run `fc-mach Sans`, it returns `DejaVuSans.ttf: "DejaVu Sans" "Book"` but if it is run like `fc-match "Sans "` or `fc-match "Sans 9"` it returns `unifont.ttf: "unifont" "Medium"`. I prefer to always use DejaVu Sans but I can't figure out why fontconfig selects unifont. Neither the global nor the local config seems to mention unifont (`grep -ri unifont /etc/fonts/ ~/.fonts.conf` returns nothing). Playing with LC_DEBUG didn't help me either. Is there a way to get the information why fontconfig behaves like this?


How can I set environment variable permanently through shell script?

Let's say I have a script:               #!/bin/bash     echo $1     if [[ ! $1 ]];then     echo "True"     fi     export ABC="/home/aashish"      `ABC` is not available after the execution of this script. How can I make that variable persist after the execution as well?


Is it possible to change password database file(/etc/passwd) in linux?

Is it possible to change password database file(`/etc/passwd`) to some other file. How does this authentication mechanism work internally ? Does it depend on pam ?


Literally grep the only word in a line

I know `grep -F` can search for literal strings, but I want to do something like               while read word; do       grep -F "^$word$" FILE;     done < wordlist      i.e. the words need to be treated literally, at the same time, `^` and `$` conditions need to be satisfied. How to do this?


how to create php-fastcgi.sock for Nginx

I've installed Debian Wheezy and downgraded php5.4 to php5.3, and wanted to use fastCgi instead of php-fpm since it is not included in php5.3 package. now I run into a little issue and can't seem to find a way around it. This issue is unix:/var/run/php-fpm/php-fpm.sock can't be created. I have created a file for UNIX socket **/usr/bin/php-fastcgi**               #!/bin/bash          FASTCGI_USER=www-data     FASTCGI_GROUP=www-data     SOCKET=/var/run/php-fastcgi/php-fastcgi.socket     PIDFILE=/var/run/php-fastcgi/php-fastcgi.pid     CHILDREN=6     PHP5=/usr/bin/php5-cgi          /usr/bin/spawn-fcgi -s $SOCKET -P $PIDFILE -C $CHILDREN -u $FASTCGI_USER -g $FASTCGI_GROUP -f $PHP5      And this my Nginx vhost:               server {         server_name www.mydomain.com mydomain.com;         root /srv/www/www.example.com/public_html;              location / {             index  index.html index.htm;         }              location ~ \.php$ {             include /etc/nginx/fastcgi_params;             fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;             fastcgi_index index.php;             fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;         }     }      The main issue is always this:               connect() to unix:/var/run/php-fastcgi/php-fastcgi.socket failed (2: No such file or directory)      And this is for Enable and Start fastcgi service:               #!/bin/bash     ### BEGIN INIT INFO     # Provides:          php-fcgi     # Required-Start:    $nginx     # Required-Stop:     $nginx     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: starts php over fcgi     # Description:       starts php over fcgi     ### END INIT INFO          (( EUID )) && echo .You need to have root priviliges.. && exit 1     BIND=127.0.0.1:9000     USER=www-data     PHP_FCGI_CHILDREN=10     PHP_FCGI_MAX_REQUESTS=10000          PHP_CGI=/usr/bin/php-cgi     PHP_CGI_NAME=`basename $PHP_CGI`     PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND"     RETVAL=0          start() {           echo -n "Starting PHP FastCGI: "           start-stop-daemon --quiet --start --background --chuid "$USER" --exec /usr/bin/env -- $PHP_CGI_ARGS           RETVAL=$?           echo "$PHP_CGI_NAME."     }     stop() {           echo -n "Stopping PHP FastCGI: "           killall -q -w -u $USER $PHP_CGI           RETVAL=$?           echo "$PHP_CGI_NAME."     }          case "$1" in         start)           start       ;;         stop)           stop       ;;         restart)           stop           start       ;;         *)           echo "Usage: php-fastcgi {start|stop|restart}"           exit 1       ;;     esac     exit $RETVAL      I'm wondering what is missing?? any comment is appreciated!!


I/O schedulers for normal harddisks

For me figuring out what is the best choice for I/O in kernel was a challenge. First I learned that it is subjective then it is depend upon the File-System you use. **I know you should use`No-op` for Solid Sate Drives or SSD s for sure.** What I want to know is the best choice for normal (rotating) HDD containing ext4 and NTFS File systems. (MBR style). And does GPT or MBR style has any effect on the choice I make?


Can inotify be used to watch for a specific file to be created without monitoring the entire directory?

I want to be notified when a specific filename is created. I'm looking at `inotify`. The `IN_CREATE` flag is available for monitoring a directory for any changes within it, but I'd prefer not to monitor the entire directory since there may be a good deal of activity in that directory besides the file I'm interested in. Can this be done?


Apache refuses to start on any port

I can't seem to get Apache to start on any port. I'm always getting the error:               apache2(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80      I checked to make sure that nothing is running on port 80 with `netstat -plant|grep 80` and I even ran `sudo nc -l 80` with no problems just to be certain. I thought maybe it might be a permissions thing (it shouldn't since it should be starting from an initscript), so I changed the listening port for Apache to 8080, and got the same error except on port 8080 (and nothing is running on that port either). I even tried setting `ports.conf` to have `Listen 127.0.0.1:80` and even `Listen 127.0.0.1:8080` and still more or less the same error except for showing the corresponding address and port. I should note that I'm on Debian Unstable. At this point, I'm at a loss for what else to check.


Is there logitech gaming mouse programming software for any Linux Distro?

I happened upon an unopened Logitech G502 programmable gaming mouse. I would like to program buttons to do things like write commonly used lines in programs (which I know is possible in Windows; my college roommate did it earlier this year). The problem is, the device is meant to be programmed by software designed explicitly for Windows. The website download page only offers versions for different versions of Windows. A quick Google search yields nothing useful. Does anyone know if there is Linux/Unix software available for programming the mouse? I am using Fedora 20, but knowledge of any software for this mouse which will run on a Linux OS would be useful. The mouse's defaults work when simply plugged in (scroll, clicking/moving pointer, and page fwd/bkwd).


how to parse a file that is changed continuously using awk?

for example if we have a file contains :               Hello world     Hello earth     Hi everybody      we can easily parse it to get the first and second columns of the lines contains the word `Hello` using `awk`:               awk '/Hello/ { print $1 }' file     awk '/Hello/ { print $2 }' file      What if the content of the file is changed:               Hello world     Hello earth     Hi everybody     Hello sky     Hi madame     Hello USA      How can we parse only the new entries added to this file (using `awk`):               Hello sky     Hi madame     Hello USA      without re-parsing the already parsed Information?               Hello world     Hello earth     Hi everybody


load program/module at boot

I'm trying to load a program I wrote at boot. The program is also a module.ko and a small bash script. For the module I tried doing `depmod mymodule.ko` and `modprobe -a` and messing around with modprob libaries and .conf files without any success. So, I wrapped it all (module and my executed program) in a bash script. I tried to load it at boot with rc.d. I failed this one too cause I think rc.d runs only executed files and not bash. If I'm right how do I change my bash file to an executed one? And install it in rc.d too? Is my strategy right? Thank you all in advance :) *working on Linux CentOS


What firmware works with a D-Link DIR-600?

I'm planning on getting a D-Link DIR-600 to be used as a WLAN access point, and for WEP/WPA certificate management. I know it works with DD-WRT, and OpenWRT, but not Tomato. Now, I've been looking what firmware I can put on that device, prior to getting it. Tomato is my favorite option, but since it doesn't work with the router, I'm getting second thoughts about getting it at all. If you happen to have a better suggestion for a router, please do so, but I'd like to stay in the same price range as the DIR-600 (around 25€).


In new users's home directory create sub-directory with a specific group and permissions

Linux will copy the the contents of `/etc/skel` when a new user is created. I want to have a sub-directory in each user's home directory, `MyStevedore`. I want this directory to have the owner be the new user and the group to be the group `stevedore` with the permissions `drwxrwxr-x`. The user is not a member of the group `stevedore`.


Default username for Samba share that is not the user name on the client system

When mounting a Samba share the user name is defaulting to the user name from the client machine rather than the "User Name" field from the earlier "Connect to Server" dialogue. Accessing a Samba share over ssh from Linux with Nautilus where the client user name is "lfm" and the user name on the server system is "lastfirstmiddle":               $ who | awk '{print $1}'     lfm     lfm     $ sudo ssh lastfirstmiddle@example.com -L 445:samba.example.com:445 -L 139:samba.example.com:139 -f -N     [sudo] password for lfm:      lastfirstmiddle@example.com's password:     $ nautilus      The user home share does not exhibit the problem. The password dialog is using the user name as specified in the "Connect to Server" dialogue as expected:               lfm - File Brower     Location: [/home/lfm]     File>Connect To Server...>          Connect To Server     Service type: [Windows Share]     Server: [localhost]     Share: [lastfirstmiddle]     User Name: [lastfirstmiddle]     Domain Name: [example-com]     <Connect>          Password required for share lastfirstmiddle on localhost     [x]Forget password immediately     Password: [*******]     <Connect>          lastfirstmiddle on localhost - File Browser     Location: [smb://example-com;lastfirstmiddle@localhost/lastfirstmiddle/]      Using the "Connect to Server" dialogue one can get a list of "Windows Shares" by leaving the "Share" field blank.               lastfirstmiddle on localhost - File Browser     File>Connect To Server...>          Connect To Server     Service type: [Windows Share]     Server: [localhost]     Share: []     User Name: [lastfirstmiddle]     Domain Name: [example-com]     <Connect>          Password required for share lastfirstmiddle on localhost     [x]Forget password immediately     Password: [*******]     <Connect>          On localhost - File Brower     Location: [smb://localhost/]      Then select a share and "Open with Open Folder" produces the "Connect to Server" dialog which unlike the previous case defaults the "User name" to the user on the client system. It does not pick up the value used in the "Connect to Server" dialogue that produced the list of shares.               On localhost - File Brower     Location: [smb://localhost/]     ----------- ---- ----    -----     Name        Size Type    Date     ----------- ---- ----    -----     AShare      --   Folder Unkown     BShare      --   Folder Unkown     CShare      --   Folder Unkown     {{XShare    --   Folder Unkown}}     YShare      --   Folder Unkown     ZShare      --   Folder Unkown     File>Open with Open Folder>      One can use "Connect to Server" and specify a "Bookmark" which can be used later to mount a share without having to compete the "Connect to Server" dialog each time. To have access to all six shares listed above (ABCXYZ) one would need to create six bookmarks. This might be OK for six shares but if there are dozens of shares this would be a bit obnoxious. Is there a way to change the default user name to something other than the client system's user name?


How can I best copy large numbers of small files over scp?

I have a directory that's got several gigabytes and several thousand small files. I want to copy it over the network with scp more than once. CPU time on the source and destination machines is cheap, but the network overhead added by copying each file individually is huge. I would tar/gzip it up and ship it over, but the source machine is short on disk. Is there a way for me to pipe the output of `tar -czf <output> <directory>` to scp? If not, is there another easy solution? My source machine is ancient (SunOS) so I'd rather not go installing things on it.


How to deliberately activate cooling fan of laptop?

Hi I have a laptop (Fujitsu Siemens Amilo 4000), I'd like to control the cooling fan manually. How do I do that? `/proc/acpi/fan/` is empty, the fan is otherwise working well. Distro is Fedora 14.


internal speaker not working ubuntu 10.10

I have a dv6000 laptop . My speaker and mic were working few days ago . But now only external speaker works. Can anyone suggest me some solutions please. Thanks.


Why would SSH server not accept forwarded Kerberos ticket?

I have an environment where I can SSH in using forwarded Kerberos credentials (using ASP.NET delegation), however in another I cannot. I have               GSSAPIAuthentication yes      in the ~/.ssh/config on each machine, in fact both files on each machine are identical. Are there any other settings that could contribute to this behavior? I'm on Red Hat Enterprise Linux Client release 5.3 (Tikanga) where it's not working and CentOS release 5.7 (Final) where it is working both have OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008


Why does only mplayer play music in Debian?

I installed Debian 7. I wanted a music player, so I tried `banshee`, `xine`, `amorak`, `exaile`, `mp3blaster`, `totem`, `lxmusic`, `xmms2`. After trying all of these, the only that would play any sound was `mplayer` and various other software based on `mplayer`, such as `gnome-mplayer`, `gmplayer`, etc.   * I installed all necessary dependencies, recommendations, and suggested software listed for the other music players.   * I solved the codec problems for the other software. When played, the timers moved, but there was no sound. What makes `mplayer` different from the other players that allows it to play audio?


Bandwidth improvements expected from switching to Wayland or Mir?

I was intrigued by this answer regarding why X is not scalable. I'm unable to find any specific speed comparisons between x forwarding on these different protocols. How much % gain in network speeds should I expect and will these be at a compromise of significant memory/CPU resources? I'm into low resource computing, but about to transfer to a country with worse internet than Japan and fear I may have to compromise power for speed.


Is there a difference in resource use/requirements between Ubuntu and Debian versions of Linux Mint (under the same DE)?

I intend to use Linux Mint on a RAM/1GB laptop. I'm used with Xfce and LXDE and I see that both Linux Mint 14 Nadia and Linux Mint Debian have Xfce versions. Is there a reason to prefer one to the other - from this point of view?


how to limit dma address to specific range in linux kernel?

I want to limit the dma address the device can access to 0x0100_0000~0x03ff_ffff. But I don't know how to set the `dma_mask` and `coherent_dma_mask`. It's easy to set the "dma mask" for a range start from 0. Can anybody help about this?


fdisk -l shows ext3 file system as HPFS/NTFS

I have an external HDD which I formatted as NTFS partition in Windows. Now, I formatted this HDD in my linux system using the below command.               mkfs.ext3 /dev/sdb1      It was formatted successfully. However, when I run the `fdisk -l` command, it gives me the system as NTFS/HPFS.                  Device Boot      Start         End      Blocks   Id  System        /dev/sdb1               1      121601   976760001   83  HPFS/NTFS      However, the command `df -T /dev/sdb1` was still giving me the file system type as `ext3`. Why is it not showing me the system as Linux when I run the `fdisk -l` command?


Ubuntu crontab php not working

Yes, I have read many, many documentations but I can't get it to work. I have a simple single php file which I want to run once or twice in a minute. My php file is called: cronjob_refresh.php and I'm using Ubuntu 12. After typing > crontab -e I'm getting in terminal: > root@cron:~# crontab -e > > no crontab for root - using an empty one > > 888 I don't know what '888' is meaning... And I'm writing (after 888) my cronjob string > */1 * * * * php /var/www/cronjob/cronjob_refresh.php After hitting enter I'm getting '?' symbol after the cronjob string entered. > root@cron:~# crontab -e > > no crontab for root - using an empty one > > 888 > > */1 * * * * php /var/www/cronjob/cronjob_refresh.php > > ? Then I hit CTRL + Z to exit. After all this I'm executing > crontab -l to check if the cronjob is added to my cronjob list but it's saying that the list is empty. I don't know what I'm doing wrong. Also I wan't to execute twice in a minute, 30 - 30 sec. How to set the cronjob? I want to log everything in a file named logs.log in the same directory, is this is possible?


Finding dependencies for a compiled C++ program

I wrote and compiled a C++ program using Qt Creator in Ubuntu 13.10 (32 bit). I tried to run the compiled program in a newly installed Ubuntu 13.10 (64 bit). But it is not run. I think the problem is with dependencies. How can I find (=know the name and version of) necessary dependencies?


Why doesn't grep ignore binary files by default?

The manpage for `grep` describes the `-I` flag as follows: `-I Ignore binary files. This option is equivalent to --binary-file=without- match option.` It also says this about binary files: `\--binary-files=value Controls searching and printing of binary files. Options are binary, the default: search binary files but do not print them; without-match: do not search binary files; and text: treat all files as text.` I cannot think of a scenario where I would care about matches in binary files. If such a scenario exists, surely it must be the exception rather than the norm. Why doesn't `grep` ignore binary files by default rather than requiring setting this flag to do so?


How to migrate data from server to server with as little downtime as possible?

I have a server running dovecot using the maildir format with a fairly large userbase (10k users or so) with each user having around a GB quota. The actual mail directories are stored on a separate storage system that our email server mounts via NFS. Due to performance issues on our storage system, we are upgrading to a new storage system. We have been rsyncing data from the old system to the new system directly, but this process still takes a rather lengthy amount of time (16+ hrs). Our plan is to run rsyncs back to back, after the second one finishes, immediately take down dovecot/qmail/etc on the mail server, switch mount locations to the new system, and bring email back up. That'd only total a minute or two for downtime with luck. The problem is any E-Mail that came in while the last rsync was running is still not going to be copied over. So, to alleviate this, after the switch we would rsync again without the --delete flag we typically use. There are some issues with this, but the biggest from my perspective is users not having access to email they JUST had right before the switch. Does anyone have a suggestion on how to do this with having very minimal downtime still and NOT losing out on the data for any amount of time? The old storage system is a NetApp, the new system is just a freebsd box with a large san attached, and the email server is Ubuntu. It feels to me like there should be a way to overlap the storage systems from the user's perspective until the migration is complete, but I simply don't have the knowledge on how to do such a thing if it's even possible.


How can I upgrade MySQL in Debian using apt-get?

I'm using the Turnkey Linux virtual machine. The version of Debian in there is apparently on the "Wheezy" upgrade path (if that's what you call it). I'm not completely comfortable with Linux, as you can see. I need some new features that MySQL 5.6 offers, while my current installation is MySQL 5.5.35. I'd like to get the latest version (5.6.17 as of this posting) or at least any 5.6.x. I've tried `apt-get update`, `apt-get upgrade`, `apt-get dist-upgrade`. These updated a bunch of things successfully, but none were MySQL. I tried `apt-get upgrade mysql-server`, which says I already have the latest version. A Debian Wheezy package repository list on the web shows MySQL 5.5 and nothing else, when I need 5.6. I then read something about "backports", which sounds like it might be able to get me things that my particular Debian isn't supposed to have yet -- but I can't seem to get it working. It requires adding lines to `/etc/apt/sources.list.d/sources.list`. When I try doing that, then running `apt-get update`, I get 404 errors. I've tried several other routes as well, one being compiling the vanilla MySQL download, which I failed at miserably and would rather not try again. I'm positively baffled at how this is done. Most of the URLs listed on forums/blogs for `apt-get`, and even for `wget`, seem to die soon after they're posted, so I can't understand how anyone even goes about finding the right information. I've been trying to do this for two days straight now and can't get anywhere. So assuming you've read this far, I would love to know if anyone has any way of upgrading MySQL in Debian in some relatively painless automated way (one where I wouldn't have to use `make` or export/import my current databases and configs manually).


I hit Ctrl+d while in a screen session, how do I now send commands?

I was trying to `Ctrl``a``d`, and failed miserably and input `Ctrl``d` instead, now the screen won't respond to my commands. They appear, and the app running in the screen (a minecraft server) is still ticking along nicely, but I can't issue the server commands. `Ctrl``a``d` works and reconnecting with `screen -r -d -S minecraft` works fine, but no commands register. Any way to regain control?


theharvester.py "No such file or directory"

I just installed Kali Linux as a virtual machine in VMware Fusion, and I was following along in Patrick Engebretson's _The Basics of Hacking and Penetration Testing, 2nd Edition_ , in which I was prompted to open "The Harvester" in Kali. As instructed in the book, I tried the following command at top level in the terminal:               ./theharvester.py –d syngress.com –l 10 –b google      To which the system reported:               bash: ./theharvester.py: No such file or directory      Wondering if for some reason the software just wasn't included in the version of Kali I downloaded, I attempted to `locate theharvester` on the system. This returned a multitude of files under `/user/share` and a directory at `/usr/bin/theharvester` but no contained files. As expected though, `theharvester.py` was not on the list. I then tried uninstalling the current software/files and reinstalling with `apt-get`, just to get the same `No such file or directory` error. What do I need to do to get `theharvester.py` (and any other missing files) on my system in the right spot? **UPDATE:** Just running the command `theharvester` does indeed return the following screen: ![enter image description here](http://i.stack.imgur.com/mWa3u.png)


Why do ls and hexdump disagree about my file size?

I have a file I created (in vim), for testing purposes (testing UTF-8 output in an SSH client). Odd things, however, are happening to this file. I wondered what bytes were in the file, so I used `hexdump`:               username@computername:~$ hexdump -x intl.txt     0000000    9ecf    000a     0000003      Ok, there's four bytes in there, How the 00 and the 0a got in there, I'm not clear, but whatever. Here's where it gets weird, though:               username@computername:~$ ls -al intl.txt     -rw-rw-r-- 1 username username 3 Mar 26 15:14 intl.txt      Wait, it's three bytes? What's going on here? As if that wasn't odd enough, `hexdump -C` gives very different output:               username@computername:~$ hexdump -C intl.txt     00000000  cf 9e 0a                                          |...|     00000003      Vim is also a bit confused about the file. When I start it up, it gives this in the status line:               "intl.txt" 1L, 3C      Up top, however, I get this (using `set list`):               Ϟ$     ~     ~     ~     ~      So, it thinks there's 3 characters, but only prints one. I could understand if it printed the koppa and a blank line under it...


Can't install gnome shell extensions

Just did a fairly minimal install of OpenSUSE 13.1, including `gnome-shell` 3.10.1. [Long frustrated rant deleted] I can't get GNOME shell extensions to work at all. Initially when I went to the extensions website, I couldn't install anything. Eventually I discovered the secret, undocumented `gnome-shell-browser-plugin` package. Having installed that, the little on/off switch now appears on the website. However, when I switch it to On, nothing happens. And if I navigate off the page and back again, it's gone back to Off. Who do I have to murder to make this actually work again?


davfs2 keep files cached longer

I'm using `davfs2` to sync with my box.com account and I'm trying to play with the cache settings to get more Dropbox-like functionality. I've noticed that after I don't open a file for a little while it gets removed from the cache. I've set my cache size to 2GB and my account only has 700MB of data. The functionality I'm trying to achieve is to basically keep files in the cache until it's full. I realize that I could probably keep the files open in the background, but I'm wondering if there's a clean way to accomplish this. Here's my `davfs2.conf`:               use_locks 0     cache_size 2048     file_refresh 5      I'm not so sure I want to play with `dir_refresh` since I definitely want to detect updated files (or am I understanding this option poorly?).


Linux basic web server setup and access

very simple questions: I installed CentOS7 and Apache on my work PC (connected to my company's network with a given IP address). No other OS installed, just Linux. I created a simple hello.html file in /var/www folder. I typed /var/www/hello.html in the web browser and I could see the text hello world. So far so good.   1. Now, how do I access the same basic web page from a different computer on my company's network?    2. I know Apache listens to PORT 80 for incoming requests. So how do I open up PORT 80?   3. In my case, hello.html is the source file for my web page. On my Linux PC browser, I can type /var/www/hello.html to see the page. But suppose I want to call my website www.mywebsite.com. How do I translate from /var/www/html to www.mywebsite.com. In other words, when I direct other coworkers to my website, I want to give them www.mywebsite.com as a name, and not /var/www/hello.html, which would be meaningless to them.   4. Based on question 3, does this mean that I have to create a "local" DNS that somehow combines my IP address along with hello.html into www.mywebsite.com?


Add/delete workstation ip to /etc/sysconfig/iptables and then run service iptables reload

I need a script to add a users workstation ip to `/etc/sysconfig/iptables` and then run a `service iptables reload`. I need the same type of script for removing this rule from iptables. I found the code below on a different forum.   It's somewhat what I need to do. It includes _add_ and _remove_ options, but instead of `adduser` it needs to reflect the iptable rule such as   `iptables -I INPUT 1 -p tcp -s xxx.xxx.xx.xxx --dport 22 -m comment --**comment "testing for user1" -j ACCEPT`. The ip address itself needs to be passed as a parameter, so I can execute as   `./script 155.154.15.00` I am using RHEL version 6.4.   Any feedback is appreciated.               #!/bin/bash          clear       echo "########## MENU ############\n"       options=("add_user" "delete_user" "exit")       select opt in "${options[@]}"       do         case $opt in         "add_user")           clear           while [ 1 ]           do             clear             echo "1. Add user manually"             echo "2. Add user via TXT file"             read -p "Enter your choice" ch             case $ch in                1)                 read -p "Enter user name : " useradd                 read -p "Enter user password:" passwd                 echo -e "Successfully added the user"               ;;               2)               if [ $(id -u) -eq 0 ]; then                 for row in `more $1`                 do                   username=${row%:*}                   password=${row#*:}                       egrep "^$username" /etc/passwd >/dev/null                   if [ $? -eq 0 ]; then                     echo "$username exists!"                     exit 1                   else                     pass=$(perl -e 'print crypt($ARGV[0], "password")' $password)                     useradd -m -p $pass $username                     [ $? -eq 0 ] && echo "User has been added to system!" || echo "Failed to add a user!"                       fi                 done               else                 echo "Only root may add a user to the system"                 exit 2               fi                 esac             done         ;;         "delete_user")           read -p "Enter a User name to delete "UNAME           passwd           userdel $UNAME           echo "User $UNAME has been deleted"                     ;;         "exit")           break         ;;         esac       done


How do I make Kate indent with spaces on Python files but use tabs for text files and other files?

My goal is to set Kate up to work properly on Python files but to use different settings (tabs not spaces) on other documents. I'm sure others are doing this, but I can't figure out a convenient solution. I appreciate any advice. Kate has settings for indentation here:   1. Click the Settings menu   2. Click "Configure - Kate"   3. On the right expand "Editor"   4. Click "Indentation" One option is "Default indentation mode". One choice for that setting is Python. However, I cannot find where to set (or even display) the options used for the Python choice. Furthermore, it is not clear what is the interaction between "Default indentation mode" and the explicit settings for indentation on that page. Does one override the other?


How do I keep the .local TLD in my intranet

I use vagrant to launch VM's and bridge the network access to my local machine. Unfortunately exvery VM launch gives me a new IP address, and MAC address. I have a domain.local that I use and currently I have to change my computer's hosts file every launch to match. I have admin access to all the machines (local, VM, and the router for the intranet). How to I tell .local domains to resolve locally only in a way that won't require me to change (or set at all) my local hosts file?


Remove last character from line

I want to remove last character from a line:               [root@ozzesh ~]#df -h | awk  '{ print $5 }'     Use%     22%     1%     1%     59%     51%     63%     5% Expected result:               Use     22     1     1     59     51     63     5


Is the last new line on fstab important?

What happens if the last line of fstab is not terminated by a newline? Why do people get a warning when that last line is not terminated by a newline?


What do all the letters and numbers in a Red Hat RPM version number mean e.g. openssl-devel-0.9.8e-27.el5_10.1?

What do all the letters and numbers in the rpm name openssl- devel-0.9.8e-27.el5_10.1 mean? I recognize the openssl-devel-0.9.8e part because that's the same number applied by the developement team at openssl.org. But what do the numbers and letters in the 27.el5_10.1 part mean? I've googled and searched on Red Hat's web site for an explanation. The best explanation I've found is https://access.redhat.com/site/security/updates/backporting/ but it doesn't really go into the version string scheme/format. Context: We're developing software which compiles and links against openssl, so our code depends on openssl-devel. To make this convenient, we repackage some binaries from the openssl-devel installation (e.g. /usr/lib/libssl.a) as a maven artifact and upload the artifact to a private maven repo. Maven artifacts have version numbers, so I'm planning to version it identically to its RPM source. I'd like to simplify the version string a bit for example, if I know that all the 27.x versions of openssl-devel-0.9.8e-27.el5_10.1 will be compile and link compatible then I could get by with a simpler artifact version of 0.9.8e-27 rather than the full 0.9.8e-27.el5_10.1.


Is it true that the first version of Linux was based on parts of Unix?

Me and a friend had a discussion about Linux and Unix today and my friend kept saying that the first version of the Linux kernel was based on [parts] of the Unix kernel. This really surprised me because I always thought that the architecture of Linux is just similar to Unix — since the very first version. So, is it really true that the first Linux version was based on parts of Unix?


Multiple bindings for the same action

Like many `screen` users I'm used to `Ctrl``a`, so on my machine I changed the binding to `Ctrl``a`, however, I wish to keep `Ctrl``b` since on some machines it's the default and when sharing work with other people this can be very confusing. I tried putting two lines in my `.tmux.conf` but only one of them will work.


How to show time away from computer?

I was wondering how to measure the time elapsed after, say, screensaver starts and then show that time on a freedesktop notification when back.


How to transfer files over bluetooth?

How can I connect my mobile phone and Lubuntu 11.10 laptop over bluetooth so that I can transfer files between them?


Wrong Opera Icon in Gnome Shell

I am using Opera 11.60 on ArchLinux (64bit) with Gnome3 and KDE4. Since I installed KDE4 last week Gnome3 shows the wrong Icon for Opera in the upper left corner and in the task switcher (alt+tab). Here is a screenshot of what I see: http://i.stack.imgur.com/wAfGz.png Does anybody know how to get the correct icon and title back, as it also says "opera" instead of "Opera" (capital "O")? I already tried reinstalling and removing my `.opera` files but that did not help. Thanks in advance


get information about screen windows

I run two scripts simultaneously within `screen`. `screen` is started by a script. I am working on a method for automatic window selection depending on the state of the scripts. This works (`screen -S mysession select win1`) but for certain improvements I need information (i.e. a script need it thus interactive features are of little use) about the windows (and the processes within):   1. How can I determine the tty (`/dev/pts/xy`) that belongs to a certain window?   2. How can I determine which is the foreground / active window? Answering (1) would be possible by running `tty` after starting the new window and write its output somewhere. But a `screen`-internal solution would be more elegant and easier to implement (I guess). Interactively the commands `windowlist` and `windows` give the answer to (2) but I haven't managed to get this output as input into a script. Furthermore: Coding this information as highlighting is nice for the user but not so nice for a script.


file(1) and magic(5) : describing other formats

Can I use `file` and `magic` ( http://linux.die.net/man/5/magic ) to override the description of some other known formats ? for example, I would like to describe the following formats:   * BED: http://genome.ucsc.edu/FAQ/FAQformat.html#format1   * Fasta : http://en.wikipedia.org/wiki/FASTA_format   * ... that are 'just' text file Or   * BAM http://genome.ucsc.edu/FAQ/FAQformat.html#format5.1 that is 'just' a gzipped-file starting with the magic-number `BAM\1` ? do you know any example ? Is it possible to provide a custom C code to test the file instead of using the magic format ?


Having trouble reinstalling Grub from live CD

I have a 64-bit Sabayon Linux and Mac OS X dual boot. After using gparted to resize my partitions, I can no longer boot Sabayon. I've tried chrooting and fixing grub from several live CDs, but they have all said "command not found" about either grub or chroot. Knoppix came close but then said it couldn't restore grub because it's 32 bits, rather than 64 like my Sabayon installation. Tips?


Block specific IP from accessing gateway

Suppose you are on linux internet gateway/router. What would you do to block a client with specific IP using bash script. I prefer something like `./block_client.sh 192.168.1.123` to block and `./unblock_client.sh 192.168.1.123`


Oldest Linux machine you still run

What is your oldest machine you ever installed Linux on and currently still run? What are the specs, kernel version or distro, and for what purpose?


Install Ubuntu from a small USB stick

I'd like to install Ubuntu (Desktop or netbook edition, preferably latest version), onto a laptop using a small USB stick. (480 MB free space.) How can I do this?


Operation timeout (in /var/log/secure)

Sometimes when connecting via ssh to my RHEL server, I get the following message back from the client: > Operation Timeout Seems like a network problem, but when I look at /var/log/secure on the server I'm connecting to, it actually shows the same message: > Sep 5 10:47:53 servername sshd[3540]: Received disconnect from ::myip 11: > Operation timeout Some days cause more of these messages than others. Is this the fault of the client, the openssh server or something else, and how can I diagnose what the issue is?


Does Yum have an equivalent to apt / aptitude's DEBIAN_FRONTEND=noninteractive?

On Ubuntu you can use something like this:               export DEBIAN_FRONTEND=noninteractive     sudo -E apt-get update      Which will prevent things that require input (choosing grub versions or conflicts between configuration files, or even prompting for a `mysql` root password during install) I checked the `man` page for `yum` but didn't see anything related to non- interactive usage other than `check-update` which "Returns exit value of 100 if there are packages available for an update" Does Yum have an equivalent to apt / aptitude's `DEBIAN_FRONTEND=noninteractive` ?


On Arch, how can you set a WM to start on boot?

How would you go about getting X and a window manger to load on boot, and present a fancy-ish login screen like you would in other distros? I want to use something new to me like dwm or bspwm, but I have no experience configuring window managers from scratch.


Changing parent directory (../) with symlinks

I have a symlink               ~/link -> ~/a/really/long/path      When I do               cd ~/link     cd ..          it takes me to               ~      but I want to go to               ~/a/really/long      Is there a way to do this? I am using bash.


How to include files that are excluded in an rsync

I'm trying to set up an rsync that excludes all `.*` files except for `.htaccess` but unfortunately, this doesn't work:               rsync -avP --exclude=".*" --include="./.htaccess" ./. user@server:/dir      Is it possible to somehow exclude general exclude rules?


Is there a tool that I can use to create a diagram of my system's architecture?

I'm looking for a tool that can create both graphical files as well as text based ASCII representations of my system's CPU & motherboard architectures.


about UFS allocation on FreeBSD

I am wondering what allocation method does UFS use? I know there are several options: contiguous, linked allocation and indexed allocation. Which one is for UFS?


Samba local master browser cannot be found via broadcast

I have a Samba server (CentOS 6.5, Samba 3.6.9) that acts as a local master browser for a workgroup. I issued               $ setenforce 0     $ service iptables stop      to disable SELinux and get rid of the firewall. On that host, I can do a               $ smbtree -d3      and get (among other output)               name_resolve_bcast: Attempting broadcast lookup for name __MSBROWSE__<0x1>     Got a positive name query response from 192.168.1.10 ( 192.168.1.10 )      where 192.168.1.10 is the IP address of that host. I want to access this server from a Linux client (Fedora 20, Samba 4.1.6). When I execute               $ smbtree -d10      on the client, I get (among other output):               name_resolve_bcast: Attempting broadcast lookup for name __MSBROWSE__<0x1>     bind succeeded on port 0     ...     async_connect failed: No such file or directory     nmbd not around     samba_tevent: EPOLL_CTL_DEL EBADF for fde[0x7f6198c435c0] mpx_fde[(nil)] fd[7] - disabling     Unable to find master browser by broadcast      I have `name resolve order = bcast` on both hosts. Issuing the command               $ smbclient -L 192.168.1.10      on the client shows me all the servers and tells me that 192.168.1.10 is the local master browser. There is one other server involved, a Windows Server 2008 R2 that has NetBIOS over TCP disabled and can tell me about the shares that it offers, but not about any workgroups. Furthermore, the Windows Server as well as a Laptop running Ubuntu 12.04 do not have this problem and can browse the shares of the CentOS server. How can I configure my network such that the client finds the local master browser by broadcast?


fetch clipboard text and remove hyphens

I'm running Mac OS 10.9 and I use the `Text to Speech` feature which allows you to use a hotkey that reads selected text in any application. I use this feature for reading out-loud PDF documents in Preview (Apple's PDF viewer). The problem is that the selected text usually has word-break hyphens. The result is the `Text to Speech` feature doesn't read out the text properly. Example: ![enter image description here](http://i.stack.imgur.com/QCrQ8.png) Question: Can you write me a short bash shell script that removes hyphens from the text in the clipboard? I will use automator too, so I can assign a hotkey, and to send the script's output to the Speak Text feature. **Edit:** (in reply to goldilocks's comment) Automator allows me to copy selected text to the clipboard followed by a shell script followed by the Speak Text feature. See image below. ![enter image description here](http://i.stack.imgur.com/z7hgE.png) **2nd Edit:** in fact there might be a more concise way of accomplishing this: ![enter image description here](http://i.stack.imgur.com/pG7MW.png) under the 'Pass input' option there is a 'as argument' option. I'm not sure whether this means I can skip the 'copy to clipboard' action in the first image, but I thought I'd mention it just in case.


How to grep blocks? Or I should use awk/ack?

Say I have a file with information as follows:               ...     Entry '234238': some text       some text       some text       some text     Entry '899823': some text       some text       some text     Entry '234238': more text       more text       more text     Entry '645353': some text       some text       some text      I would like to extract a specific `Entry '<code>'`. For example, `grep_my_block 'Entry '234238'` should return:               Entry '234238': some text       some text       some text       some text     Entry '234238': more text       more text       more text      Note that:   1. The `<code>` that identifies a block may appear multiple times in the file. We want to extract all such blocks.    2. Blocks may consist of an unknown number of lines  How do I do this with `grep`, `awk` or `ack`?


Pinguy 11.04 wireless not working

I just installed Pinguy OS 11.04 (a derivative of Ubuntu) and I can't seem to get the wireless to work. I've tried everything on this question and a bunch of other stuff. I even reinstalled and that didn't solve anything. So could someone help me? It's my first real attempt with linux, so i'm a big noob when it comes to problem solving Linux problems (I don't have any experience with the command line, but I imagine that with time everything will seem clear). What do I have to do so that I can browse the web wirelessly?


coreutils that are utf aware?

When I used cut today, I found out it doesn't treat a utf-8 character as a character, but 3 characters because it's 3 bytes long. This seems to be generally true for many tools. Are there versions of the coreutils that are utf-8 aware? my locale output               LANG=en_US.UTF-8     LC_CTYPE="en_US.UTF-8"     LC_NUMERIC="en_US.UTF-8"     LC_TIME="en_US.UTF-8"     LC_COLLATE="en_US.UTF-8"     LC_MONETARY="en_US.UTF-8"     LC_MESSAGES="en_US.UTF-8"     LC_PAPER="en_US.UTF-8"     LC_NAME="en_US.UTF-8"     LC_ADDRESS="en_US.UTF-8"     LC_TELEPHONE="en_US.UTF-8"     LC_MEASUREMENT="en_US.UTF-8"     LC_IDENTIFICATION="en_US.UTF-8"     LC_ALL=      Here is when cut doesn't work               echo 哈哈 | cut -c 2-     ��哈      The right output should be               哈      if cut -c does work on multibyte characters.


What tools do I need to intercept and change an incoming packet on a WP2-Personal wifi hub

Which tools should I research into to intercept a plain text packet, edit it and then continue it on it's way. I am using Ubuntu 11.04 and Backtrack 5; my wifi is WPA2-person encrypted. I need to edit an item database of an ipod game :)


What are the different debian package repos?

I know about the ones at http://ftp.us.debian.org/debian/dists/README, but there are other ones such as:   * security.debian.org   * backports.debian.org   * archive.debian.org How many are there? Is there a list somewhere?


No installation candidate for compiz

I tried to install 3d effect on my Debian Wheezy using command               $ apt-get install compiz compizconfig-settings-manager compiz-fusion-plugins-main compiz-gnome compiz-gtk      But it gives the following               Reading package lists... Done     Building dependency tree            Reading state information... Done     Package compiz is not available, but is referred to by another package.     This may mean that the package is missing, has been obsoleted, or     is only available from another source     E: Package 'compiz' has no installation candidate     E: Unable to locate package compizconfig-settings-manager     E: Unable to locate package compiz-fusion-plugins-main     E: Unable to locate package compiz-gnome     E: Unable to locate package compiz-gtk      What should I do now?


No such process error with launch ctl start. Mac OSX 10.9

The goal is to set the machine's network name with the IP address of this machine. I have created a `plist` file and put it into `/library/launchagents/. For debugging reasons, I used the command`launctl start`. Here is my `plist` file:               <?xml version="1.0" encoding="UTF-8"?>     <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">     <plist version="1.0">     <dict>       <key>Label</key>       <string>com.myfile.hostname</string>            <key>ProgramArguments</key>       <array>         <string>/usr/sbin/ipconfig</string>         <string>getifaddr</string>         <string>en0</string>         <string>|</string>         <string>/usr/bin/tr</string>         <string>-d</string>         <string>'.'</string>         <string>|</string>         <string>sudo</string>         <string>/usr/sbin/scutil</string>         <string>--set</string>         <string>LocalHostName</string>       </array>            <key>RunAtLoad</key>       <true/>            <key>StandardErrorPath</key>       <string>/tmp/AlTest1.err</string>            <key>StandardOutPath</key>       <string>/tmp/AlTest1.out</string>     </dict>     </plist>      Then I used:               launchctl start /Library/LaunchAgents/com.myfile.hostname.plist      And got the error:               launchctl start error: No such process      As the error does not explain what exactly is wrong with that file, I'm struggling to find the reason. The command itself on the command worked fine. If this is the wrong section for this question please advise?


How do I hide/anonymise/defend a computer when on hostile networks?

I connect to a lot of open networks when I'm pootling around. I'm fairly careful to VPN home for anything important but that's not really my boggle. The laptop runs several services (nfs, dev http server, samba, avahi). Not only do I not want people on open networks connecting to these services, some of them (samba and avahi) are extremely slutty and advertise themselves all over the place to other computers. I also don't want my computer name available in public places. I already rotate random MAC addresses so hotspot owners can't track where I go on a day- to-day basis. Yeah, I'm pretty paranoid sometimes. Is there any way I can stop these services communicating (either way) on any network that isn't home?


Why are PATH variables different when running via sudo and su?

On my fedora VM, when running with my user account I have `/usr/local/bin` in my path:               [justin@justin-fedora12 ~]$ env | grep PATH      PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/justin/bin      And likewise when running `su`:               [justin@justin-fedora12 ~]$ su -     Password:      [root@justin-fedora12 justin]# env | grep PATH     PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/justin/bin      However, when running via `sudo`, this directory is not in the path:               [root@justin-fedora12 justin]# exit     [justin@justin-fedora12 ~]$ sudo bash     [root@justin-fedora12 ~]# env | grep PATH     PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/sbin:/bin:/usr/sbin:/usr/bin      Why would the path be different when running via `sudo`?


Quoting curly braces in the shell

I found examples of different quoting for curly braces for `find`, but I could not find an explanation. The possible choices are:   1. `{}`   2. `'{}'`   3. `"{}"`   And they all seem to work fine. Is there a difference between them?


find -exec {} vs. find -exec '{}'

I noticed in the man pages for find, that the {} always have single quotes around them. `find -exec '{}' \;` The description states: > Notice that the braces are enclosed in single quote marks to protect them > from interpretation as shell script punctuation. The semicolon is simi- > larly protected by the use of a backslash I have never had an issue using just `find -exec {} \;`   What is an example where the single quotes are required.


How to tweak Linux to run reliably on flash memory?

Since flash memory only has a limited number of writes, what tweaks are necessary for installing a Linux system onto flash media so that the OS can run reliably for a long period of time? Some examples of flash memory installations include burning a Linux image onto a wireless router's flash memory, or installing a linux distro onto a box that uses an SD card for it's hard drive. Also, besides wireless router firmware (OpenWRT, DD-WRT, etc) which presumably already implements such tweaks, are there any general-purpose distributions that either make these tweaks or allow you to use them as an option?


Can't find vgaswitcheroo directory in CentOS6

I've installed CentOS6 on my laptop, which has a built in VGA and a discrete (AMD) VGA. I used to switch AMD video off in other distro's (e.g. Fedora, Arch) using:               $ echo OFF > /sys/kernel/debug/vgaswitcheroo/switch      Because when both are running my battery drains quickly and the temperature rises. However in CentOS I can't find the `vgaswitcheroo` folder under `/sys/kernel`. How can I disable my AMD video device like I did before? Here's my `lsmod | grep radeon` :               radeon                917108  0      ttm                    80957  1 radeon     drm_kms_helper         40087  2 i915,radeon     drm                   265638  5 i915,radeon,ttm,drm_kms_helper     i2c_algo_bit            5935  2 i915,radeon     i2c_core               31084  7 videodev,i2c_i801,i915,radeon,drm_kms_helper,drm,i2c_algo_bit      And `lsmod | grep -i intel`:               snd_hda_intel          27823  4      snd_hda_codec         121518  3 snd_hda_codec_hdmi,snd_hda_codec_idt,snd_hda_intel     snd_pcm                86635  4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec     snd                    69907  16 snd_hda_codec_hdmi,snd_hda_codec_idt,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_seq,snd_seq_device,snd_pcm,snd_timer     snd_page_alloc          8470  2 snd_hda_intel,snd_pcm      I have AMD Radeon 7670M VGA card so i have no idea whether if these are the right modules or not. Here's `dmesg | grep -i switcheroo`:               VGA switcheroo: detected switching method \_SB_.PCI0.GFX0.ATPX handle     vga_switcheroo: enabled      Any help would be appreciated.


Where to handle packets between clients?

"Server": 192.168.1.1 I want to "theoretically" disable that the clients can "ping" each other. Can i use an iptables rule for it? e.g.:               iptables -A FORWARD -m iprange --src-range 192.168.1.2-192.168.1.255 --dst-range 192.168.1.2-192.168.1.255 -j DROP      Is it true that i cannot filter traffic between the clients?? [or at least redirect these packets to e.g.: the router?] If i run tcpdump on the router ["server"] i can see that a client [192.168.1.201] is pinging another [192.168.1.162]               # tcpdump     tcpdump: WARNING: eth0: no IPv4 address assigned     tcpdump: verbose output suppressed, use -v or -vv for full protocol decode     listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes     12:22:26.931343 IP 192.168.1.201 > 192.168.1.162: ICMP echo request, id 12547, seq 141, length 64     12:22:27.819373 IP 192.168.1.201 > 192.168.1.162: ICMP echo request, id 12547, seq 142, length 64     12:22:28.819640 IP 192.168.1.201 > 192.168.1.162: ICMP echo request, id 12547, seq 143, length 64


How to remove files except a list with names files

I need delete some `.desktop` files in various directories and a text file with a list of file names. I want to delete all these `.desktop` files except for those listed in my text file). Example               $ ls /home/makerpm/appdata/usr/share/app-install-data/applications/Education/ | tee /tmp/Education      Assuming that `/tmp/Education` is the file which includes the list of file names, I want to delete all the `.desktop` files in a set of directories except those listed in `/tmp/Education`. **Updated!** I can resolve it, with my script, but I don't like:               cd /home/makerpm/appdata/usr/share/app-data/applications/Education/     mkdir -p $HOME/newsapp/Education          file="/tmp/Education"     while IFS= read -r line; do         cp -f /home/makerpm/appdata/usr/share/app-data/applications/Education/$line.desktop $HOME/newsapp/Education/     done <"$file"


In linux, how to delete all files EXCEPT the pattern *.txt?

I know how to delete all `txt` file under current directory by `rm *.txt`. Does anyone know how to delete all files in current directory EXCEPT `txt` file?


tripwire report - inode number

Hi I am investigating tripwire and have stumbled upon something which i am unsure about. in a tripwire report generated after i modified hosts.deny to include an extra # I noticed the inode number changed from 6969 to 6915. I would like to know why this happened. I know inodes are records which store data about where data is stored on the file system, but would like to know why this number changed for a simple # being inserted.


ETL testing - Unix Commands

As part of etl testing I need to find record count for each different record. Currently we are having some 8 different record types in the flat file. Is there any unix command to find the record count of each record types.


Getting OpenGL to work under Ubuntu

I have an Intel graphics card, of which I can't tell whether or not it's being recognized. When I go through GUI to the System Info section, it states that my graphics card is unknown. Despite this, my `lspci` displays the graphics card perfectly fine. **Question** Is there any way to get OpenGL working correctly on Ubuntu 11.10, or, if this isn't possible (due to my graphics card), would there be any other distros recommended as far as getting this work? **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:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)     00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)     00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)     00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b4)     00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b4)     00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)     00:1f.0 ISA bridge: Intel Corporation HM65 Express Chipset Family LPC Controller (rev 04)     00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 04)     00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 04)     02:00.0 Ethernet controller: Broadcom Corporation NetLink BCM57785 Gigabit Ethernet PCIe (rev 10)     02:00.1 SD Host controller: Broadcom Corporation NetXtreme BCM57765 Memory Card Reader (rev 10)     02:00.2 System peripheral: Broadcom Corporation Device 16be (rev 10)     02:00.3 System peripheral: Broadcom Corporation Device 16bf (rev 10)     03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 (rev 34)


wpa_supplicant and signal strength

I use `wpa_supplicant` to handle a connection to specific `SSID`. I added the `wpa_supplicant` to `default` `runlevel` in order to start it at the boot time. I have this question however; Is it any program, script or even ncurses GUI to show me exact and live signal strength.   This is useful as it shows me if my location has poor reception or my ISP has low speed at each given time.   PS: I checked `iw` and its family like `iwlist` but they are not really what i want.


dpkg-reconfigure: not found when running in cron

I have a virtual server (debian) and the clock fails to sync from time to time (probably because i save/restore state with vboxheadlesstray). To fix this issue I run `dpkg-reconfigure ntp && ntpq -p`, it works when I run it as root, but doesn't work with cron. I have added it in `crontab -e` (as root user) and is using this line:               1 * * * * dpkg-reconfigure ntp && ntpq -p > /dev/null 2>&1      My ordinary user user get mail about it saying `/bin/sh: 1: dpkg-reconfigure: not found`, why is my ordinary user getting the mail and not root and what do I need to change to make it work?