Moving software RAID 1 to Linux

I'm using a RAID 1 (mirrored pair) configuration in my Media Center/ NAS system. Currently it's running Windows 8 (yeah, big mistake I know) and I'm regretting it (did it for the games, not worth it). Currently I'm having two software RAID 1s (3TB + 2TB) configured with Storage Spaces and unfortunately formatted with NTFS. Now I would like to switch to Fedora (or maybe Ubuntu if there are advantages) for good. Is there a way that I could continue using the disks as they are without the need to format them with ext or something? I'm glad for every tip. Oh, the system disk is of cause not in a raid configuration.


X11 bad access at first try but working on successive tries

I use the following setup to forward `X11` output from my local machine to the server. I will outline the setup:   1. `X11` server and the client are on the same local machine.   2. The `X11` server runs on my local machine `A`.   3. The client runs on my local machine as a docker container and is called `B`.   4. I try to forward graphical output from a program (`R`) on the client `B` to the server on host `A`. Here is how the access works:   * My client `B` has read access to `/tmp/.X11-unix`. Hence, it has access to the unix domain socket `unix:0`.   * I allow access to this socket to the client `B` by issuing `xhost +si:localuser:$(USER)` on the host `A`. (Which is a server interpreted address which grants access to a single local user.) All of this works as expected BUT whenever I try to access the socket the first try is not working and I get the error `X11 protocol error: BadAccess (attempt to access private resource denied)`. When I close the `X11` graphics device again and reopen it everything works. The problem persists even when I use a totally different setup that relies on `ssh`-based `X11-forwarding`. I could trace the problem back to the `cairo` device if I use a `Xlib` device access is successful at first try. Does anyone have experience with programs that access the `X11` server's unix domain socket with a `cairo` device or has any kind of idea why this is happening?


Limiting processes to not exceed more than 10% of CPU usage

I operate a Linux system which has a lot of users but sometimes an abuse occurs; where a user might run a single process that uses up more than 80% of the CPU/Memory. So is there a way to prevent this from happening by limiting the amount of CPU usage a process can use (to 10% for example)? I'm aware of `cpulimit`, but it unfortunately applies the limit to the processes I instruct it to limit (e.g single processes). So my question is, how can I apply the limit to all of the running processes and processes that will be run in the future without the need of providing their id/path for example?


acpi, pm-util and xautolock all happy together

I'm currently using the xfce4 power manager on my laptop to manage sleeping and screen locking and dimming and all that good stuff. But I get the feeling that this is just some candy on top of the lower level `pm-util` and `acpi` scripts that live in `/etc` so I'd like to just do it with config files, making it easier to move between the various flavours of Linux that I use in several locations. I have been able to successfully setup my `sudo pm-suspend` to lock the screen on wake-up using this script: https://github.com/fommil/unix/blob/master/etc/pm/sleep.d/00lock-screen but I can't see how to listen to similar triggers for inactivity timeouts. The ideal setup for me is (I use `i3lock` for screen locking):   * dim the screen after 2 minutes of inactivity, and to brighten the screen again if activity is detected (with hotcorners)   * screen locks after 5 minutes of inactivity (with hotcorners to allow watching videos). I am using `xautolock` to spawn this.   * suspending to RAM after 15 minutes of inactivity (again with hotcorners). I looked into using `xautolock`'s `killer` feature for this, but it doesn't seem to ever succeed in calling `sudo pm-suspend`, even though I'm in the sudoers file to not need a password.   * screen is locked when waking from sleep (sleep may be caused by pressing a physical button, closing the lid, or calling `pm-suspend`). Currently I'm relying on the xfce4 power manager to setup the lid closing calls, but it looks like I can use `/etc/acpi/local/lid.sh.post` (at least on Debian) to setup a hook. With relation to screen locking, I'm finding that I have to repeat `i3lock` commands and config in each of   * my `xmonad` config file (so I can force a screen lock)   * the above script for waking from sleep   * in the `xautolock` command which feel clunky. With this in mind, I'd be greatly obliged if the following questions could be answered:   1. **How do I attach idle activity hooks that can suspend to RAM?**   2. **Is there a cleaner way to globally specify the screen locker?**   3. **How do I attach idle / active hooks that can dim/brighten the screen?**


What is the modern equivalent of reading `/dev/audio`?

Recently my trusty home PC died after 10 years. The ensuing upgrade (from SuSE 10 to OpenSuSE 12.3) was something of a culture shock for me - none of the convenient shortcuts and utilities I had collected work anymore. Today I'm trying to get sound input working again. I used to record late-night programmes from my local radio station via the line input of my sound card via a tiny little utility that does nothing but open `/dev/audio`, perform a few ioctls and then read bytes from it (and write it to a WAV file with libsndfile). Nothing fancy, just a tiny "autorecord" utility that can record N seconds of sound, and can run through `cron`, without a front-end, without requiring X, and indeed without me having to be logged on. (It was originally adapted from xawtv's `record.c`.) Now this no longer works. Although my sound card is configured, I can no longer record sound with this tool - in fact, there doesn't seem to be a `/dev/sound` anymore! From what I've gathered, even in 2004 it was a grudgingly-supported legacy feature, while all the cool people were supposed to program against the much fancier and capable ALSA interface. What is the present-day recommended way of quickly grabbing input from the sound device? Can I re-enable `/dev/sound` emulation somehow? I suppose a third-party program might do the trick as well, as long as it doesn't require me to provide an X session or press buttons in the middle of the night.


Monitoring Linux user activities and auditing them

`var/log/secure` provides us below information :               Mar 20 08:07:07 testing sshd[29749]: Accepted password for oracle from 10.51.1.12 port 49239 ssh2     Mar 20 08:07:07 testing sshd[29749]: pam_unix(sshd:session): session opened for user oracle by (uid=0)     Mar 20 08:12:16 testing sshd[29759]: Received disconnect from 10.51.1.12: 11: Disconnect requested by Windows SSH Client.     Mar 20 08:12:16 testing sshd[29749]: pam_unix(sshd:session): session closed for user oracle But what commands that `oracle` user executed we can not get from the above information? `/home/oracle/.bash_history` provides us information like this about what commands are executed:               cat /u01/up_apps.sh      cd daily/work     less Auto_Clone.log      cat Auto_Clone.log      exit     exit     cat /home/oracle/ashfaq/Auto_Clone/Auto_Clone.sh      cat /u01/down.sh      cd /u01/oracle/inst/apps/TESTING_testing/admin/scripts/     ./adstpall.sh apps/apps     ./adstrtal.sh apps/apps     cat /home/oracle/ashfaq/Auto_Clone/Auto_Clone.sh      cat /home/oracle/ashfaq/demo/main_exec.sh     cd /home/oracle/ashfaq/demo/     ls -ltr     cat main_exec.sh but does not tell us that user from which IP or hostname and at what time executed these commands. Can we create some custom file where we can store all this information in one file with time, IP, user name (`root`, `oracle`, `ricky` ) and commands executed by these users ?


installation causing error

I have downloaded g2ipmsg from http://www.ipmsg.org/archive/g2ipmsg-0.9.6.tar.gz while installation this package it causing some error                checking for G2IPMSG... configure: error: Package requirements (libgnomeui-2.0 >= 2.14                     gtk+-2.0 >= 2.4                     glib-2.0 >= 2.8) were not met:              No package 'libgnomeui-2.0' found              Consider adjusting the PKG_CONFIG_PATH environment variable if you         installed software in a non-standard prefix.              Alternatively, you may set the environment variables G2IPMSG_CFLAGS         and G2IPMSG_LIBS to avoid the need to call pkg-config.         See the pkg-config man page for more details      . How to resolve this error please let me know.


How to switch the first letters of two words?

$ echo 'foo bar' | sed SOMEMAGIC     boo far     $ echo 'one two' | sed SOMEMAGIC     tne owo      **Q:** in general, how can I replace the "b" from the "bar" to the "f" of the "foo"? And in reverse too, replace the "f" from the "foo" to the "b" of the "bar".


Linux Mint 14 - Segfault in steam.sh (cannot launch steam)

Here is my output when I try to launch steam:               tetra@nick-Inspiron ~ $ steam     Running Steam on linuxmint 14 64-bit     STEAM_RUNTIME is enabled automatically     Installing breakpad exception handler for appid(steam)/version(1373503443_client)     Gen6+ requires Kernel 3.6 or later.     steam: ../../../../../src/mesa/main/context.c:1499: _mesa_make_current: Assertion `newCtx->Version > 0' failed.     [2013-07-13 21:15:04] Startup - updater built Apr 30 2013 10:04:24     [2013-07-13 21:15:04] Opted in to client beta 'publicbeta' via beta file     /home/tetra/.local/share/Steam/steam.sh: line 704:  4342 Segmentation fault      (core dumped) $STEAM_DEBUGGER "$STEAMROOT/$PLATFORM/$STEAMEXE" "$@"     Installing bootstrap /home/tetra/.local/share/Steam/bootstrap.tar.xz     Running Steam on linuxmint 14 64-bit     STEAM_RUNTIME has been set by the user to: /home/tetra/.local/share/Steam/ubuntu12_32/steam-runtime     Installing breakpad exception handler for appid(steam)/version(1373503443_client)     Gen6+ requires Kernel 3.6 or later.     steam: ../../../../../src/mesa/main/context.c:1499: _mesa_make_current: Assertion `newCtx->Version > 0' failed.     [2013-07-13 21:15:05] Startup - updater built Apr 30 2013 10:04:24     [2013-07-13 21:15:05] Opted in to client beta 'publicbeta' via beta file     /home/tetra/.local/share/Steam/steam.sh: line 704:  4430 Segmentation fault      (core dumped) $STEAM_DEBUGGER "$STEAMROOT/$PLATFORM/$STEAMEXE" "$@"      I don't understand why I can't launch steam. I've reinstalled the package.


Why can't cron job find basic Linux commands?

I'm trying to set up a cron job to run a PHP script daily as part of a web- based booking system. It's been running perfectly for several years on a different Apache server using this in the crontab:               0 3 * * * wget -q -O /dev/null http://www.my_other_domain.org.uk/scheduled/my_script.php      I've just installed the script on another Apache server, and it runs correctly when called through the browser. However when I try to use cron, the cron daemon gives the message:               -: warning: setlocale: LC_ALL: cannot change locale (en_GB.utf-8)     -: wget: command not found      When I tried               0 3 * * * /usr/bin/env wget -q -O /dev/null http://www.mydomain.org.uk/scheduled/my_script.php      I got the message:               -: warning: setlocale: LC_ALL: cannot change locale (en_GB.utf-8)     -: /usr/bin/env: No such file or directory      Firstly, am I right in assuming that the setlocale warning is not relevant to the problem? I've also tried               0 3 * * * /usr/bin/php /var/www/vhosts/mydomain/httpdocs/scheduled/my_script.php      which gives               -: /usr/bin/php: No such file or directory      I also tried putting a shebang as the first line of my script, and getting cron to call it using the full path. The cron daemon reported that there was no such file or directory as /[full_path]/my_script.php . Trying to use curl was no better. I haven't got shell access to the server and I've been setting up the cron job through the Plesk control panel. The cron job seems to be running as scheduled. The system administrator did the following for me:               #which php     /usr/bin/php          #which wget     /usr/bin/wget          #which curl     /usr/bin/curl      That seems to confirm that the commands are in the right location. The above is an abbreviated history - I've lost count of the permutations and combinations I've tried, mostly as a result of reading advice in this and other forums. Can anyone tell me why the cron job is unable to find the commands and suggest a solution?


Debian wheezy C++11 source package

I'm currently learning debian packaging and I am making a source package for a C++11-based software. Debian wheezy does not have a 4.8+ g++ package, so how could I make a source package on this platform ? EDIT: I have successfully built my package with gcc 4.9 under wheezy using jessie repos, but when installing the package on a vanilla debian wheezy, the program execution errors about a libc conflict (that was to be expected).


How to enable someone to SSH to my server from Windows?

I want someone from windows to log in into my server using SSH, so he can edit files and install things. Is there a step to step how to do it? I need to:   1. Create his user account.   2. Configure it, giving him access to a single folder and nothing else (how?)   3. Generate a public key for him on Windows (how?)   4. Add his public key to authorized_keys correctly.   5. Tell him the command he needs to use to actually log in from Window's terminal. I pretty much only know how to create the account. How to accomplish the latter steps?


Print fields from file only if line starts with a specific word

I have the following file:               …        LINK=dummy 172.17.100 => 10.218.11 [PATH=/etc]           FILE=hosts 172.17.100 => 10.218.11 [PATH=/etc]            FILE=network 172.17.100 => 10.218.11 [PATH=/etc/sysconfig]          LINK=empty 172.17.100 => 10.218.11 [PATH=/etc]        FILE#TEST 172.17.100 => 10.218.11 [PATH=/etc/sysconfig]      … How to print the first field and the fifth field only if line start with the word `FILE`? The word `FILE` could be located immediately in the begging of line or after space or TAB in the line. Example of what I expected to get                 FILE=hosts   [PATH=/etc]       FILE=network [PATH=/etc/sysconfig]       FILE#TEST    [PATH=/etc/sysconfig]      I try this awk but doesn't work               awk '$1 == "^[[:blank:]]*FILE*" && '{print $1" "$5}'  file


kvm guest Network interface no Authenication

i have a kvm host based on ubuntu 10.04 host , and the guest is rhel 5.3 64-bit, on the guest i tried to execute mii-tool eth0               SIOCGMIIREG on eth0 failed: Input/output error     SIOCGMIIREG on eth0 failed: Input/output error     eth0: no autonegotiation, 100baseTx-FD, link ok      and mii-tool -v eth4               eth0: no autonegotiation, 100baseTx-FD, link ok       product info: vendor 00:50:43, model 2 rev 0       basic mode:   software reset, autonegotiation enabled       basic status: autonegotiation complete, link ok       capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD       advertising:  100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control       link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD      and mii-tool -r eth0 this is output /var/log/message               Feb 20 13:16:44 xil1 kernel: [ 1289.790780] e1000: eth4 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX      so that it is supposed to work with 1000MB/s but it still working with 100MB/s any suggestion what may be the problem ?


How can I merge two ddrescue images?

I have two ddrescue images created from contiguous recovery attempts of the same media. The two images are the same size but have complementary data:               $ od part-one/ddrescue_image --skip-bytes 227966006774 --read-bytes 32     3242365232766 113056 016517 102014 074371 144073 000000 000000 000000     3242365233006 000000 000000 000000 000000 000000 000000 000000 000000     3242365233026     $ od part-two/ddrescue_image --skip-bytes 227966006774 --read-bytes 32     3242365232766 000000 000000 000000 000000 000000 124616 163450 064251     3242365233006 074567 134433 012742 022160 044301 054235 140604 020633     3242365233026      How can I merge them into a single, complete image? ## Details   * The second image is simply a continuation of the first recovery attempt, à la:              $ ddrescue corrupt-partition part-one/ddrescue_image part-one/ddrescue_log     $ mkdir part-two; cp part-one/ddrescue_log part-two/ddrescue_log     $ ddrescue corrupt-partition part-two/ddrescue_image part-two/ddrescue_log        * The second image is almost entirely zeros, but contains 18 KB of recovered data spread across 1847 isolated regions.   * I tried using the technique mentioned on this mailing list,              $ ddrescue --domain-logfile=part-two/ddrescue_log part-two/ddrescue_image part-one/ddrescue_image part-one/ddrescue_log               GNU ddrescue 1.16     Press Ctrl-C to interrupt     Initial status (read from logfile)     rescued:   937286 MB,  errsize:   62976 B,  errors:     122     Current status     rescued:   937286 MB,  errsize:   62976 B,  current rate:        0 B/s        ipos:         0 B,   errors:     122,    average rate:        0 B/s        opos:         0 B,     time since last successful read:       0 s     Finished      but it doesn't appear to have changed anything.


Solaris 10 modified time

In Solaris 8, when we access the file, the access time changes but modified time remains same. But in Solaris 10, we see that both access and modified time changes when accessing the file. We checked the `at`, `mt` using `truss -v lstat -t lstat ls -l <file>`. Is this the behavior of Solaris 10?


When connected by VNC all files are read only

For some reason when I'm connected to my server with VNC, I do not have permission to edit system files, even when I su - root I can only access system files in read only mode. Please can someone help me figure this out?


Renaming a Hard Drive

I have a secondary internal HDD to store auxiliary data. I want to give it a better name. How do I do it?


Kali Linux webcrawling with credentials entered

I'm looking for a tool in which I can provide credentials and it should login the webapplication and try to crawl to pages etc. I've found **Vega** but I have to enter a cookie. Is there a tool which I can use providing plaintext username and password? It does not have to be natively in Kali, but it would be welcome.


Why does kill not have a parameter for file and not for port number?

If I want to stop a program given its tcp port number or its file or named executable, can I run something like `kill -tcpPortNumber $1` where the parameter `$1` is a tcp port number or `kill -filename $1` where the parameter is a filename? The background is a problem in the following question: http://stackoverflow.com/questions/11583562/how-to-kill-process-running-on- particular-port-in-linux The problem does occur in practice and I think that user Bepetersn has a solution that looks like what I mean. `sudo kill $(fuser -n tcp <port_number> 2> /dev/null)` But what I'd like to achieve is that the kill program could take tcp port number and/or filename as a parameter system-wide for any user, including sudo. So is it possible to add parameters system-wide to a system program like kill so that the tcp port number and/or a fileename can be parameters and that this change is permanent for any user including ubuntu sudo?


flashcache tuning

I installed flashcache version 3.1.1 and created a write-back cache. The performance is good as long as the percentage of dirty blocks is not too high. My application does heavy IO at the beginning and then calculates for a long time. So flashcache has enough time to write the dirty blocks to the hdd but it writes the data with a very small rate (2 MB/s). I tried to change that with sysctl but it didn't have any effect. How can I change the rate properly? Here is my sysctl output.               $sysctl -a | grep flash     dev.flashcache.sda6+sdb9.cache_all = 1     dev.flashcache.sda6+sdb9.clean_on_read_miss = 0     dev.flashcache.sda6+sdb9.clean_on_write_miss = 0     dev.flashcache.sda6+sdb9.dirty_thresh_pct = 20     dev.flashcache.sda6+sdb9.do_pid_expiry = 0     dev.flashcache.sda6+sdb9.do_sync = 0     dev.flashcache.sda6+sdb9.fallow_clean_speed = 100     dev.flashcache.sda6+sdb9.fallow_delay = 600     dev.flashcache.sda6+sdb9.fast_remove = 0     dev.flashcache.sda6+sdb9.io_latency_hist = 0     dev.flashcache.sda6+sdb9.lru_hot_pct = 75     dev.flashcache.sda6+sdb9.lru_promote_thresh = 2     dev.flashcache.sda6+sdb9.max_clean_ios_set = 40     dev.flashcache.sda6+sdb9.max_clean_ios_total = 80     dev.flashcache.sda6+sdb9.max_pids = 100     dev.flashcache.sda6+sdb9.new_style_write_merge = 0     dev.flashcache.sda6+sdb9.pid_expiry_secs = 60     dev.flashcache.sda6+sdb9.reclaim_policy = 0     dev.flashcache.sda6+sdb9.skip_seq_thresh_kb = 0     dev.flashcache.sda6+sdb9.stop_sync = 0     dev.flashcache.sda6+sdb9.zero_stats = 0      PS: My system is Debian testing.


UNIX ACL disadvantages

I have read a lot about how great UNIX ACLs are. For example, one good example can be viewed here. However, are there any disadvantages or configurations that cannot be expressed using ACL?


Trying to improve sound quality with ALSA

I'm trying to make ALSA 1.0.23 to use different resampling algorithm. I did some research on the Internet and found that putting the line `defaults.pcm.rate_converter "<library>"` into either `/etc/asound.conf` or `~/.asoundrc` will tell ALSA to use different resampling algorithm. However, it doesn't seem to work. Putting the following line into ~/.asoundrc `defaults.pcm.rate_converter "speexrate_best"` doesn't have any effect on either CPU usage or the list of loaded libraries (doing `lsof -n | grep speex` while playing something yields nothing). Although, the following snippet forces ALSA to use new resampling algorithm:               pcm.!default {         type rate         slave {             pcm "hw:0,0"             rate 48000         }         converter "speexrate_best"     } Doing so makes CPU usage to 10-15% and makes two new shared libraries appear in the list of `lsof`, but software mixing stops working and I can't play multiple audio files. I'm probably missing something obvious, but I'm complete noob. What can be an issue here?


What is the best tool/tools to record video from webcam on linux?

My webcam is detected correctly (and i can use it in skype without any issues), but how can i record video on linux preferably with gui tool ?


Randomise or shred memory of an application

Is it possible to randomise or shred memory of a particular application just after its life ends, or better, whenever it deallocates some memory? A command-line utility like this would be perfect: shred-memory [options] [{params to the application...}]


Install of pycrypto [Errno 28] No space left on device

I am installing this tool to Debian GNU/Linux 7.5 x64 (wheezy) and when I run `install_mnemosyne.sh` I get this error when the pycrypto installation is running:               Downloading/unpacking pycrypto (from -r requirements.txt (line 8))       Downloading pycrypto-2.6.1.tar.gz (446kB): 446kB downloaded     Cleaning up...     Exception:     Traceback (most recent call last):       File "/opt/mnemosyne/env/local/lib/python2.7/site-packages/pip/basecommand.py"         status = self.run(options, args)       File "/opt/mnemosyne/env/local/lib/python2.7/site-packages/pip/commands/instal         requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundl       File "/opt/mnemosyne/env/local/lib/python2.7/site-packages/pip/req.py", line 1         do_download,       File "/opt/mnemosyne/env/local/lib/python2.7/site-packages/pip/req.py", line 1         self.session,       File "/opt/mnemosyne/env/local/lib/python2.7/site-packages/pip/download.py", l         unpack_file(temp_location, location, content_type, link)       File "/opt/mnemosyne/env/local/lib/python2.7/site-packages/pip/util.py", line         untar_file(filename, location)       File "/opt/mnemosyne/env/local/lib/python2.7/site-packages/pip/util.py", line         destfp.close()     IOError: [Errno 28] No space left on device          Storing debug log for failure in /root/.pip/pip.log      But `df -i` shows this:               Filesystem                                               Inodes IUsed   IFree IUse% Mounted on     rootfs                                                    85344  20381    64963   24% /     udev                                                     214285    350   213935    1% /dev     tmpfs                                                    216800    287   216513    1% /run     /dev/disk/by-uuid/aa26072b-e0f4-4962-ba44-76d5e65346de    85344  20381    64963   24% /     tmpfs                                                    216800      3   216797    1% /run/lock     tmpfs                                                    216800      2   216798    1% /run/shm     /dev/sda9                                              35323904    576 35323328    1% /home     /dev/sda8                                                 97536    270    97266    1% /tmp     /dev/sda5                                                549440  57132   492308   11% /usr     /dev/sda6                                                183264   8085   175179    5% /var      and `du -sh /*`:               6,0M    /bin     16M     /boot     0       /dev     3,5M    /etc     14M     /home     0       /initrd.img     94M     /lib     12K     /lost+found     3,0K    /media     1,0K    /mnt     158M    /opt     19M     /pokus     0       /proc     294K    /root     808K    /run     5,6M    /sbin     1,0K    /selinux     1,0K    /srv     0       /sys     6,7M    /tmp     1,7G    /usr     2,2G    /var     0       /vmlinuz      If I run `df -i` during installation increase is about 1%:                 Filesystem                                               Inodes IUsed   IFree IUse% Mounted on         rootfs                                                    85344  20381    64963   25% /         udev                                                     214285    350   213935    1% /dev         tmpfs                                                    216800    287   216513    1% /run         /dev/disk/by-uuid/aa26072b-e0f4-4962-ba44-76d5e65346de    85344  20381    64963   25% /         tmpfs                                                    216800      3   216797    1% /run/lock         tmpfs                                                    216800      2   216798    1% /run/shm         /dev/sda9                                              35323904    576 35323328    1% /home         /dev/sda8                                                 97536    270    97266    1% /tmp         /dev/sda5                                                549440  57132   492308   11% /usr         /dev/sda6                                                183264   8085   175179    5% /var      But `df -h`:               Filesystem                                                Space Used Free Use% Mounted on     rootfs                                                     323M  311M     0 100% /     udev                                                        10M     0   10M   0% /dev     tmpfs                                                      406M  832K  405M   1% /run     /dev/disk/by-uuid/aa26072b-e0f4-4962-ba44-76d5e65346de     323M  311M     0 100% /     tmpfs                                                      5,0M     0  5,0M   0% /run/lock     tmpfs                                                      2,4G     0  2,4G   0% /run/shm     /dev/sda9                                                  531G  211M  504G   1% /home     /dev/sda8                                                  368M   18M  332M   5% /tmp     /dev/sda5                                                  8,3G  1,9G  6,0G  24% /usr     /dev/sda6                                                  2,8G  2,3G  402M  85% /var      So how can I expand rootfs please?


Automated mounting for usb drives in linux

I have a five 4TB usb drives. I want to setup a mount point, `/mnt/backups` so that when I plug in any of those drives, they get automatically mounted to `/mnt/backups`. The problem is that when the drive path changes all the time for the drives even though I put them in the same usb slot. I've seen /dev/sde1 through /dev/sdh1... OS is Ubuntu.


Why does Linux use a swap partition rather than a file?

It seems to me a swap file is more flexible.


SysV init run levels

On a system that uses SysV init run levels such as _Centos 5_ , when the OS is booting, does it go straight to the run level defined in `/etc/inittab`? If I change my run level using the `init` command do the kill scripts for my current run level execute and then the start up scripts for the new run level execute? For example if I was at run level 3 and entered `init 1`, would the kill scripts in `/etc/rc.d/rc3.d` be executed and then upon entering run level 1 would the startup scripts in `/etc/rc.d/rc1.d` be run?


How to call a service URL from bash shell script in parallel?

I have a service which I am calling from another application. Below is my service URL which I am calling -               http://www.betaservice.domain.host.com/web/hasChanged?ver=0      I need to do some load test on my above service URL in multithreaded way instead of calling sequentially one by one. Is there any way from bash shell script, I can put a load on my above service URL by calling it in multithreaded way? I can have 60-70 threads calling above URL in parallel very fast if possible?


WMI-based hotkeys on not working

On my `Dell latitude e6540`, the WMI hotkeys `Fn+UP` and `Fn+DOWN` are not working. I have all necesary modules compiled in my kernel:               CONFIG_DELL_LAPTOP=m     CONFIG_DELL_WMI=m     CONFIG_DELL_WMI_AIO=m      On the predecessor model (Latitude e6520), all worked fine, without any need for additional setup. I can still change the brightness with `echo`:               echo 35 > /sys/class/backlight/acpi_video0/brightness      but only as `root`, obviously. Pressing `Fn+UP` and `Fn+DOWN` does not change the walue in `/sys/class/backlight/acpi_video0/brightness`. On the previous model, it does change the value. One thing I noticed, on the older model, the max value is `15`. On the new model it is `95`. Looks like something might have changed inside this mechanism. Thus my question: How can I make WMI hotkeys work on my new laptop? # UPDATE: I have just noticed that the WMI hotkeys work fine when I am in BIOS !!! That is quite surprising that they don't work when I boot into linux. following is output of dmesg. The mention of `dell_wmi: Received unknown WMI event` looks relevant to my problem, but I get the same messages on the old laptop, where wmi hotkeys are working. So this alone does not seeem the be the issue.               dmesg | egrep -i '(dell|wmi)'     [Tue Apr 15 22:04:30 2014] DMI: Dell Inc. Latitude E6540/05V0V4, BIOS A05 09/03/2013     [Tue Apr 15 22:04:30 2014] ACPI: RSDP 00000000000eee60 00024 (v02 DELL  )     [Tue Apr 15 22:04:30 2014] ACPI: XSDT 00000000d8fe0080 0007C (v01 DELL    CBX3    01072009 AMI  00010013)     [Tue Apr 15 22:04:30 2014] ACPI: FACP 00000000d8fed7e8 0010C (v05 DELL    CBX3    01072009 AMI  00010013)     [Tue Apr 15 22:04:30 2014] ACPI: DSDT 00000000d8fe0188 0D659 (v02 DELL    CBX3    00000014 INTL 20091112)     [Tue Apr 15 22:04:30 2014] ACPI: APIC 00000000d8fed8f8 00072 (v03 DELL    CBX3    01072009 AMI  00010013)     [Tue Apr 15 22:04:30 2014] ACPI: FPDT 00000000d8fed970 00044 (v01 DELL    CBX3    01072009 AMI  00010013)     [Tue Apr 15 22:04:30 2014] ACPI: HPET 00000000d8feed38 00038 (v01 DELL    CBX3    01072009 AMI. 00000005)     [Tue Apr 15 22:04:30 2014] ACPI: MCFG 00000000d8fef148 0003C (v01 DELL    CBX3    01072009 MSFT 00000097)     [Tue Apr 15 22:04:38 2014] dcdbas dcdbas: Dell Systems Management Base Driver (version 5.6.0-3.2)     [Tue Apr 15 22:04:39 2014] wmi: Mapper loaded     [Tue Apr 15 22:04:39 2014] input: Dell WMI hotkeys as /devices/virtual/input/input10     [Wed Apr 16 18:30:04 2014] dell_wmi: Received unknown WMI event (0x0)     [Fri Apr 18 17:09:41 2014] dell_wmi: Received unknown WMI event (0x0)     [Fri Apr 18 17:09:41 2014] dell_wmi: Received unknown WMI event (0x0)     [Fri Apr 18 17:09:49 2014] dell_wmi: Received unknown WMI event (0x0)      # UPDATE2 after patching the WMI module, I get following messages for `Fn+UP` and `Fn+DOWN`               2014-04-18 19:00:49  kernel: [  120.731480] dell_wmi: WMBU = 0002 0010 0048     2014-04-18 19:00:49  kernel: [  120.731496] wmi: DEBUG Event GUID: 9DBB5994-A997-11DA-B012-B622A1EF5492          2014-04-18 19:00:53  kernel: [  123.935400] dell_wmi: WMBU = 0002 0010 0050     2014-04-18 19:00:53  kernel: [  123.935415] wmi: DEBUG Event GUID: 9DBB5994-A997-11DA-B012-B622A1EF5492


detect process eating cpu without: top, htop, ps?

I went thru a problem where I could only guess what process was eating the cpu. My cpu usage was about 80% for all cores at psensor. I tried `htop`, `top` and `ps -A -o pcpu,pid,cmd --sort +pcpu` (the last one I even tried with sudo to no avail).   All these shown the culprit pid (that I was aware of) using about 7% only... When I SIGKILL on that pid, all get back to normal. To test, I did an infinite loop on terminal `while true;do echo -n;done` but that I could clearly see at htop; so my guess what was causing trouble was not similar to that... So I wonder if there are other ways I could have found the culprit without having to guess? Thinking again, I think I would like to know what calculations `psensor` and "system load indicator applet" uses that was able to show that value but the others were unable to? PS.: linking about wait time, linking about load average


Working DNS-DHCP combo for LAN

Can anyone recommend a working DNS-DHCP combo for a small mixed-platform LAN? Preferably one where hosts can be assigned IP addresses and/or names with a web-GUI. The typical DHCP package on Linux claims to support BIND, but last I checked, it did not actually work. Of course, this might be out of date.


starting from last line processed when processing log file several times

I am designing a logging and reporting system for a web application.   Within the web application some events can happen ("user logged in", "user performed action X", etc..).   I would like the application to log these events in a flat log file.   Then I would like to write another program that would periodically get run and extract data from this file to maintain a running aggregate report in a database table (like "how many events of type X happen per hour", or "get the daily total of event X"). One of the challenges is to make sure that the reporting program doesn't process the same line twice. Is there a Unix way to design this type of system or to deal with the "keep track of lines already processed" kind of problem? I already thought about rotating the logs just before processing them and assigning unique line numbers to each line, but they both seem hacky. Thank you.


Unclaim a device

So I am using Ubuntu and trying to use some hardware which I had some problems with before. The problem before was that the company who made my hardware sold their internal parts to another company who made some different hardware with the same ID. Someone kindly made a driver for it which came with Ubuntu, but stopped the driver for my device from working. On my last system I just tracked down the kernel module and disabled it. I am getting the same message as on my previous machine: > Could not claim device (Vid: 0x2457, Pid: 0x1002, iface: 0) but plugging in the device does not seem to create an entry in /dev like before. How can I find what is claiming my device? I assume that the dmesg: > usb 4-1: new full speed USB device using ohci_hcd and address 16 is just saying that it is being detected and it is not ohci that is blocking my access.


rsync: colon in file names

Other than by renaming the files first, how can I `rsync` files that may have colons in their names?


What would cause vim not to retain command history?

On other distros I have run, vim remembers your command history even between sessions; this is especially handy when doing a lot of similar operations on different files. For some reason, it has been flushing in Ubuntu 12.04, and I can't figure out why. Here is my `:set` info:               :set     --- Options ---       background=dark     helplang=en         history=1000      nomodeline   scroll=27           showmatch           ttyfast       expandtab           hidden              incsearch           ruler      showcmd             softtabstop=4       ttymouse=xterm2       backspace=indent,eol,start       fileencoding=utf-8       fileencodings=ucs-bom,utf-8,default,latin1       printoptions=paper:letter       runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim73,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after       suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc


Can't kill process, not in zombie or uninterruptable sleep

I can't figure out how to kill this process. I ran `du`, but it took too long so I tried to kill it. It didn't die. I've tried SIGKILL, SIGSTOP, SIGINT, etc, with no effect (can't kill it, can't stop it). It is **not** in `D` or `Z` state, as you can see in the following `top` output:                 PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND                                                                                12047 alex      39  19  5656  496  408 R  99.6  0.0 209:10.04 du --max-depth=1 -h      Since it won't stop, I can't attach to it with gdb either. Does anyone have any ideas how to kill this without rebooting?


Dereferencing hard links

In the manual page of `tar` command, an option for following hard links is listed.               -h, --dereference           follow symlinks; archive and dump the files they point to          --hard-dereference           follow hard links; archive and dump the files they refer to      How does `tar` know that a file is a hard link? How does it _follow_ it? What if I don't choose this option? How does it **not** hard-dereference?


What steps do I need to take to successfully install multiple linux distros on my computer?

I want to put my old laptop to use and install several of the most popular Linux distros on it. I currently have Windows 7 on it. My question is: How do I create a set up such that when I start the laptop a list of all the different distros appear as options?


Print shell arguments in reverse order

I am a bit stuck. My task is to print the arguments to my script in reverse order except the third and fourth. What I have is this code:               #!/bin/bash          i=$#     for arg in "$@"     do         case $i         in             3) ;;             4) ;;             *) eval echo "$i. Parameter: \$$i";;         esac         i=`expr $i - 1`     done      As I hate eval (greetings to PHP), I am looking for a solution without it but I am not able to find one. How can I define the position of the argument dynamically? PS: No its not a homework, I am learning shell for an exam so I try to solve old exams.


How come Debian has no time(1) manpage?

Searching for manpage for `time` command does not yield any result (search form). As a sidenote, it appears to be a BASH built-in command since `dpkg --search bin/time` cannot find it. Perhaps such commands don't have their own manpages?


Internet not working

I am using Linux mint. And this is my kernel.               uname -a     Linux nithesh-desktop 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux      I was having a networking problem, when I had used Lubuntu. So, I installed Linux Mint, thinking that it was a software issue. But even when I had linux mint, the internet didn't work. Critical info: During a lightning strike, my modem's motherboard fried, along with the ethernet port attached in the computer. I bought a new modem, and a new External Ethernet Port [RTL-8139/8139C/8139C+]. It had worked for a few days, before the internet crashed again. I was downloading a torrent (for about 26 hours), when it abruptly stopped working. I was wondering whether this was due to 'collision'. EDIT: Through BIOS settings, I have disabled the inbuilt ethernet card.Even after that, the network isn't working. `ifconfig` gives me this result.               eth0      Link encap:Ethernet  HWaddr 00:e0:5c:00:42:aa             UP BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)               lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:65536  Metric:1           RX packets:190 errors:0 dropped:0 overruns:0 frame:0           TX packets:190 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:27879 (27.8 KB)  TX bytes:27879 (27.8 KB)      I later found out that eth0 is my new ethernet card, and eth1 is the old, fried, non-working one. [Note: The following was requested by M_dk ] `cat /etc/network/interfaces` gives me the following output:               # interfaces(5) file used by ifup(8) and ifdown(8)     auto lo     iface lo inet loopback      `sudo iptables -L -nv` gives me the following output:               Chain INPUT (policy ACCEPT 0 packets, 0 bytes)     pkts bytes target     prot opt in     out     source               destination                   Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)     pkts bytes target     prot opt in     out     source               destination                   Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)     pkts bytes target     prot opt in     out     source               destination      [Note: The following was requested by michas] `ip link` gives the following output:               1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000     link/ether 00:e0:5c:00:42:aa brd ff:ff:ff:ff:ff:ff      I have a question though. Is this a software problem or a hardware problem? Please help! I've been suffering without internet for a month!


mmap() failed: Cannot allocate memory - how do I find out who's complaining?

mmap() failed is popping up in my .xsession-errors in bursts. But there's no indication about what application it is failing with. How do I look into this after it has happened? I usually discover the failures only when I occasionally switch to my "tail -f .logs/*" workspace.


Selecting icon for tray notifications from Bash scripts (KDE)

Q: How to make Qt KDE tray notification from Bash script ? A: @SO: Activating KDE 4 notifications from bash scripts Q: How to make notifications from scripts running as root ? A: @Unix.SE: Show a notification across all running X displays **Q1:** Ok... I see `kdialog` and `notify-send` send tray notification. Am I right only `notify-send -i` allows to setup notification icon? **Q2:** In example there is `notify-send -i 'dialog-information'` icon -> what are other icons available by default ? Q3: Will it work with other window managers ?


Difference in file listing for SSH and SFTP

I have `SSH` access to a server and I have never bothered to use `SFTP` until now. I transferred a file using `FileZilla` to the server. However, the weird thing is that the file _doesn't_ show up when I `SSH` into the server and do a `ls` or even a `ls -a` (just in case). The vice versa is also true, when I `SSH`, I am able to see the file I created via `SSH` access. However, when I fetch the directory listing via `SFTP`, that file is nowhere to be seen! What is the reason for this -- files created via SSH and SFTP are not shown in the directory listing of each other? I can provide more information if required that might assist in understanding this problem.


Measuring internet link downtime

My ISP is known for having frequent downtimes. I use a ubuntu 10.04 based server as a primary gateway for my NAT network. I am looking for a tool or script that will measure the duration of each down time.


Linux kernel 2.6.38 compilation error

When I try to compile the Linux 2.6.38 kernel on my Linux PC, I get:               $ make defconfig     $ make      I get:               ubuntu/ndiswrapper/iw_ndis.c:1966:2: error: unknown field ‘num_private’ specified in initializer     ubuntu/ndiswrapper/iw_ndis.c:1966:2: warning: initialization makes pointer from integer without a cast     ubuntu/ndiswrapper/iw_ndis.c:1967:2: error: unknown field ‘num_private_args’ specified in initializer     ubuntu/ndiswrapper/iw_ndis.c:1967:2: warning: excess elements in struct initializer     ubuntu/ndiswrapper/iw_ndis.c:1967:2: warning: (near initialization for ‘ndis_handler_def’)     ubuntu/ndiswrapper/iw_ndis.c:1970:2: error: unknown field ‘private’ specified in initializer     ubuntu/ndiswrapper/iw_ndis.c:1970:2: warning: initialization makes integer from pointer without a cast     ubuntu/ndiswrapper/iw_ndis.c:1970:2: error: initializer element is not computable at load time     ubuntu/ndiswrapper/iw_ndis.c:1970:2: error: (near initialization for ‘ndis_handler_def.num_standard’)     ubuntu/ndiswrapper/iw_ndis.c:1971:2: error: unknown field ‘private_args’ specified in initializer     ubuntu/ndiswrapper/iw_ndis.c:1971:26: warning: initialization from incompatible pointer type     make[2]: *** [ubuntu/ndiswrapper/iw_ndis.o] Error 1     make[1]: *** [ubuntu/ndiswrapper] Error 2     make: *** [ubuntu] Error 2      Any ideas how to solve this and why it happen with default configuration?


Graphical archive manager that uses /tmp

I am looking for a (preferably) graphical archive manager that can be configured to use `/tmp` as a scratch area for decompressing. My setup is as follows: I have my local workstation with `/home` mounted from a NFS partition which works well in general and I also have a good chunk of RAM so I have `/tmp` setup as a RAM disk. I also need to work with large (100-300MB) `tar.*` and `zip` archives on a regular basis. In my testing, I've found that decompressing to `/tmp` and then moving the files into the NFS mount is orders of magnitude faster, however doing this currently requires me to drop out to a shell and do it all manually so I rarely bother unless I need something done quickly. So, does anyone have any thoughts on applications that I could use to hopefully automate this a little more? I could easily write a console level wrapper to do the job, but I'm hoping for something that I can use from/with nautilus.


Rsync problem with cron and no problem manually

I have a backup.sh file that launch an rsync command. This rsync is to backup my dedicated server on a RaspberryPi running raspbian. (I use keychain so I don't need to type any password etc ...) The problem is that when I launch the batch manually everything works, but when it's crontab (with the same user) I have the following error :               2013/10/07 19:36:02 [6456] rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]     2013/10/07 19:36:02 [6456] rsync error: error in rsync protocol data stream (code 12) at io.c(605) [Receiver=3.0.9]      Here is my backup.sh file               #!/bin/bash          echo "_ backup start "$(date +%H:%M:%S)     echo " "          /usr/bin/rsync -avh --rsync-path='/usr/bin/rsync' --delete --log-file='/home/user/rsync.'$(date +%d%m%Y-%H%M%S)'.log' --rsh='ssh -p 1234' user@server.com:/path/to/archives/ /media/backup/          echo " "     echo "_ backup end "$(date +%H:%M:%S)      And now the crontab line (crontab -e)               # m h  dom mon dow   command      30 5  *   *   *     /home/user/backup.sh | mail -s "Backup RPi "$(date +\%d/\%m/\%Y-\%X) user+rpibackup@gmail.com      Regards


Why can't I install Debian amd64 in VirtualBox?

I'm trying to install the Debian ISO, `debian-live-7.2-amd64-standard.iso` into a virtual machine in VirtualBox but it just hangs. I'm running this version:               $ virtualbox -h     Oracle VM VirtualBox Manager 4.3.6_RPMFusion     (C) 2005-2013 Oracle Corporation     All rights reserved.


VNC: Text/fonts not showing up on XFCE tip of day window?

Using FreeBSD 8.2. Setup a vncserver on my FreeBSD machine. Accessing it from Windows using Tightvnc Viewer. Most fonts show up fine. However my Xfce tip of the day window shows up blank. If I log directly into the machine the text is there but over VNC it is not. I assume this is some kind of font issue? My vnc options are: > vncserver_options="-geometry 800x600 -compatiblekbd -fp > '/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/75dpi/,/usr/X11R6/lib/X11/fonts/100dpi/'" What's causing this problem and how can I fix it? I'm wondering if I need to add another font directory?


Debian unstable chroot security issues

This page describes how you can use the `debootstrap` utility to install a base Debian unstable/sid system on an existing Linux machine. The new install is accessible using `chroot`. When doing this, what security issues should be kept in mind? For example, what needs to be done to stop background/startup processes from starting in the new chroot or otherwise interfering with the main system?


What are some alternatives to virtualbox

I have a lot of trouble lately installing on a box that i can't reboot or change the kernel. Is there any other package that supports gre tunnels (if the os supports ) that i can run on linux? Basically i want linux on linux. I can't yum upgrade or reboot.


When is dd suitable for copying data? (or, when are read() and write() partial)

_Short version:_ In what circumstances is `dd` safe to use for copying data, safe meaning that there is no risk of corruption due to a partial read or write? _Long version — preamble:_ `dd` is often used to copy data, especially from or to a device (example). It's sometimes attributed mystical properties of being able to access devices at a lower level than other tools (when in fact it's the device file that's doing the magic) — yet `dd if=/dev/sda` is the same thing as `cat /dev/sda`. `dd` is sometimes thought to be faster, but `cat` can beat it in practice. Nonetheless, `dd` has unique properties that make it genuinely useful sometimes. _Problem:_ `dd if=foo of=bar` is not, in fact, the same as `cat <foo >bar`. On most unices¹, `dd` makes a single call to `read()`. (I find POSIX fuzzy on what constitutes “reading an input block” in `dd`.) If `read()` returns a partial result (which, according to POSIX and other reference documents, it's allowed to unless the implementation documentation says otherwise), a partial block is copied. Exactly the same issue exists for `write()`. _Observations_ : In practice, I've found that `dd` can cope with block devices and regular files, but that may just be that I haven't exercised it much. When it comes to pipes, it's not difficult to put `dd` at fault; for example try this code:               yes | dd of=out bs=1024k count=10      and check the size of the `out` file (it's likely to be well under 10MB). _Question_ : In what circumstances is `dd` safe to use for copying data? In other words, what conditions on the block sizes, on the implementation, on the file types, etc, can ensure that `dd` will copy all the data? (GNU dd has a `fullblock` flag to tell it to call `read()` or `write()` in a loop so as to transfer a full block. So `dd iflag=fullblock oflag=fullblock` is always safe. My question is about the case when these flags (which don't exist on other implementations) are not used.) ¹  I've checked on OpenBSD, GNU coreutils and BusyBox.


Where to find this specific source (centos 2.6.18-53.el5PAE)

okay all my looking around on the normal kernel site ftp can't find it. I need specifically, the PAE version. I am compiling virtualbox and if you don't use the right source you get this lovely: vboxdrv: disagrees about version of symbol struct_module


Setgid won't work

I'm struggling with the SGID command. Given the following situation:               ----rws--- 1 simon simon 233 nov 24 13:52 hosts      Why can't a user open/edit this file?


Connecting to multiple XServers

I've got a simple xserver setup: Ubuntu workstation running xserver, to which a remote Beaglebone computer running linuxcnc is connecting. So I'm using the mouse, keyboard and screen of the workstation to control the linuxcnc application. The machines are physically standing next to eachother, but I find that the controls of linuxcnc are a bit laggy... Therefore, I wonder if it is possible to attach a mouse and keyboard to the Beaglebone directly, and only use the screen of the workstation to display the application. It would look like this (adapted from the basic schema on Wikipedia): ![wanted configuration](http://i.stack.imgur.com/im1AR.png) I didn't find any description of this, so I guess it's not possible? I don't know really how xserver internals work, but I can imagine that the mouse needs information about the screen to send relative position events... For the keyboard I can't imagine what the problem could be, somehow I should be able to forward the keystrokes from the remote keyboard to the application, no?


Cannot install java after apt-get upgrade

When I execute java -version, I get this:               bash: /usr/bin/java: No such file or directory      I followed multiple online guides towards installing java. I followed all the steps but I still get that error. Maybe I did it wrong - I don't know. Output of: `dpkg -l jdk*`               dpkg-query: no packages found matching jdk*      Output of: `ls -l /usr/bin/java`               lrwxrwxrwx 1 root root 22 Nov 16 17:21 /usr/bin/java -> /etc/alternatives/java      Output of: `sudo add-apt-repository ppa:webupd8team/java`               add-apt-repository: command not found      Output of: `file "$(readlink -e "$(type -P java)")"`               /usr/local/java/jdk1.7.0_45/bin/java: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, BuildID[sha1]=0x6849323f527575e206a1b6449617e809158e82be, not stripped      Output of `ldd "$(readlink -e "$(type -P java)")`               not a dynamic executable      Debian version, Ouput of `uname -a`:               Linux Cyneox 3.7-trunk-amd64 #1 SMP Debian 3.7.2-0+kali8 x86_64 GNU/Linux      @Teresa E Junior Sorry, I can't comment to these posts for some reason, static linking problem. The python-software-properties returned this error, which is what I get for most of the programs I try to install:                   E: Package 'python-software-properties' has no installation candidate      Also, I ran the command that you stated above, and typing java -version still doesn't do anything. Joseph R, this was all I typed:               root@Cyneox:/usr/bin# apt-get install ia32-libs ia32-libs:i386     Reading package lists... Done     Building dependency tree            Reading state information... Done     Package ia32-libs 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 'ia32-libs' has no installation candidate     E: Unable to locate package ia32-libs          root@Cyneox:/usr/bin# apt-get install openjdk-7-jre     Reading package lists... Done     Building dependency tree            Reading state information... Done     Package openjdk-7-jre 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 'openjdk-7-jre' has no installation candidate      But the first 2 lines that you gave me worked. The output of `cat /etc/apt/sources.list /etc/apt/sources.list.d/*`:               #           # deb cdrom:[Debian GNU/Linux 7.0 _Kali_ - Official Snapshot amd64 LIVE/INSTALL Binary 20130905-07:57]/ kali contrib main non-free          #deb cdrom:[Debian GNU/Linux 7.0 _Kali_ - Official Snapshot amd64     LIVE/INSTALL     Binary 20130905-07:57]/ kali contrib main non-free          ## Security updates     # Line commented out by installer because it failed to verify:     #deb http://security.kali.org/kali-security kali/updates main contrib non-free     deb http://http.debian.net/debian/ wheezy-backports main contrib     deb http://archive.canonical.com/ lucid partner     cat: /etc/apt/sources.list.d/*: No such file or directory      Joseph, I applied your fix in the update, and everything was going smoothly... until:               Setting up openjdk-7-jre-headless:amd64 (7u25-2.3.10-1~deb7u1) ...     update-alternatives: error: cannot stat file '/etc/alternatives/java': Too many levels of symbolic links     dpkg: error processing openjdk-7-jre-headless:amd64 (--configure):      subprocess installed post-installation script returned error exit status 2     dpkg: dependency problems prevent configuration of ca-certificates-java:      ca-certificates-java depends on openjdk-6-jre-headless (>= 6b16-1.6.1-2) | java6-runtime-headless; however:       Package openjdk-6-jre-headless is not installed.       Package java6-runtime-headless is not installed.       Package openjdk-7-jre-headless:amd64 which provides java6-runtime-headless is not configured yet.          dpkg: error processing ca-certificates-java (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of openjdk-7-jre:amd64:      openjdk-7-jre:amd64 depends on openjdk-7-jre-headless (= 7u25-2.3.10-1~deb7u1); however:       Package openjdk-7-jre-headless:amd64 is not configured yet.          dpkg: error processing openjdk-7-jre:amd64 (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of icedtea-7-jre-jamvm:amd64:      icedtea-7-jre-jamvm:amd64 depends on openjdk-7-jre-headless (= 7u25-2.3.10-1~deb7u1); however:       Package openjdk-7-jre-headless:amd64 is not configured yet.          dpkg: error processing icedtea-7-jre-jamvm:amd64 (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of openjdk-7-jre-lib:      openjdk-7-jre-lib depends on openjdk-7-jre-headless (>= 7~b130~pre0); however:       Package openjdk-7-jre-headless:amd64 is not configured yet.          dpkg: error processing openjdk-7-jre-lib (--configure):      dependency problems - leaving unconfigured     Errors were encountered while processing:      openjdk-7-jre-headless:amd64      ca-certificates-java      openjdk-7-jre:amd64      icedtea-7-jre-jamvm:amd64      openjdk-7-jre-lib     E: Sub-process /usr/bin/dpkg returned an error code (1)      Then I tried `apt-get -f install` but that still failed...


Remove all but one ( or more ) kind of filetype

I've been trying to find a command to remove all files in a folder but not a kind of filetype. But I seems to not have any luck. What I've tried so far :               set extended_glob     rm !(*.dmg)     # this returns zsh:number expected          rm ./^*.dmg     # this returns no matches found       The version of zsh I'm using is `zsh 5.0.2 (x86_64-apple-darwin13.0.1)` .


Ubuntu installation 11.10

I seem to be having problems installing Ubuntu on windows 7 and I'm getting an error message once boot up saying:               Unable to find a medium containing a live file system      and the drivers are ahci which have been set as default.


What is the point of the 'operator' user?

Many un*x systems ship with a user account named 'operator'. What is the purpose of this account? Do some systems actually make use of this account, or is this more of a historical legacy? Have you ever made use of this account in your organization? The 'operator' account tends have a home directory set to something like `/root` or `/`. Why is this? Linux:               Login: operator                         Name: operator     Directory: /root                        Shell: /sbin/nologin      Or FreeBSD:               Login: operator                         Name: System Operator     Directory: /                            Shell: /usr/sbin/nologin      On FreeBSD, some files are actually owned by user 'operator':               # find / -user operator -exec ls -ld {} \;     drwx------  2 operator  operator  512 Apr 20 17:11 /var/db/entropy      This question is surprisingly hard to google, since nearly all google results are regarding shell or code operators.


FFMPEG video to FLV conversion optimization

Would anyone have any tips on optimizing video to FLV conversion using `ffmpeg` so I would get a medium quality video which is not very large? I have a video site where users can upload videos which will be converted to FLV and displayed. Those videos are shown at the size 420x350. I'm using FFMPEG to convert then to FLV, through the following command:               ffmpeg -i $in $out      I find the result to be pretty low quality and whenever I try to change settings, the output will be a very large file. For instance, I've tried this:                 ffmpeg -i $in -sameq -ar 11025 -ab 32 -deinterlace -nr 500 -r 20 -g 500 -s 420x350 -aspect 4:3 -me_range 20 -b 270k -f flv -y $out


Name resolution issues in Ubuntu 10.04

I am having an error with name resolution that I am not able to figure out. The system is able to resolve names, say, www.google.com when using a graphical browser like chrome or firefox. But on the command line it is not able to (unless I add the domain in /etc/hosts). This extends to all operations on the command line like ping and others. We have a proxy in this environment and the proxy information is set using environment variables. ETA: I noticed that it does seem to resolve IP addresses but it is still not able to reach them. This makes it even more perplexing.               farhat@farhat:~$ traceroute www.google.com     traceroute to www.google.com (209.85.153.104), 30 hops max, 60 byte packets      1  192.168.4.1 (192.168.4.1)  0.496 ms  1.033 ms  1.294 ms      2  210.212.187.65 (210.212.187.65)  0.872 ms  0.942 ms  0.930 ms      3  * * *      4  * * *      5  * * *      6  * * *      7  * * *          farhat@farhat:~$ ping www.google.com     PING www.l.google.com (209.85.153.104) 56(84) bytes of data.     ^C     --- www.l.google.com ping statistics ---     100 packets transmitted, 0 received, 100% packet loss, time 99131ms      pinging www.google.com fails.


I want to run commands like make, make install, python setup install without changing directories

I have written a script which will download software from the internet to the current user's home directory and then untar it. And then I have to `make` and `make install` it and in some software I have to run `python setup.py install`. The problem is that I do not want to change the current directory to run all those commands. Is there is any way to specify path in commands like:               python /home/username/Desktop/urllib/setup.py install     make /home/username/Desktop/somedir/     make install /home/username/Desktop/somedir/


No pppoe-server in Fedora 14?

$ yum list | grep -i ppp     ppp.i686                                   2.4.5-12.fc14                @updates     rp-pppoe.i686                              3.10-6.fc12                  @fedora/$releasever     ppp-devel.i686                             2.4.5-12.fc14                updates      $       There isn't any pppoe server in Fedora 14?? Wow! Why?


Screen session running as root? (it shouldn't be) node.js

cd /serv       screen -R node       {in the screen}       node test.js       C^a d        initially,               ls -l /dev/pts       total 0       crw--w---- 1 tick-tock tty 136, 0 2011-04-19 16:41 0       crw--w---- 1 tick-tock tty 136, 1 2011-04-19 16:41 1       but after just a few seconds               ls -l /dev/pts       total 0       crw--w---- 1 tick-tock tty 136, 0 2011-04-19 16:47 0       crw--w---- 1 root      tty 136, 1 2011-02-21 20:00 1        How is the screen's terminal getting switched to root? Does this mean the node server is actually running with root permissions? It shouldn't be. The only other factor that might be an issue is that iptables forwards port 80 to port 8000 where the node server listens, so it doesn't have to run as root. I apologize if this is the wrong place to ask this, perhaps I should ask in a node.js community? I have not su root or done any sudo commands beforehand, either.


How to dump mysql dbs in live boot

I can't log in to my fedora linux because of I/O errors(system halts after grub). Now I want to create a backup from my mysql databases. I tried `chroot /path/to/root` and then `mysqldump`, but I get the following error: `mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) when trying to connect ` I'm using an ubuntu live disk. Why does it show this error? Is there a better way to dump dbs?


USB2.0 device not recognized anymore

I have a Ubuntu 10.10 (x86) system which I use to test GNU Radio applications. I have successfully been using a USRP1 with a USB2.0 connection for some time now, yet at some point yesterday it appears to have stopped working.   * With `lsusb` I don't even see the device listed anymore. I tried multiple ports with no luck.   * A USB1.0 mouse seems to work fine.   * Windows XP seems to recognize the device (no driver, but I see the device ID)   * USRP works fine on my Fedora machine   * tried different cables and another USRP This is a rather old laptop, so part of me thinks the hardware may just be dying. However, Windows still at least recognizes the USRP, so I am hopeing maybe a driver install will fix the problem. So, a USB mouse works fine, but somehow my USB2.0 based USRP stopped working. How can I debug this problem? Can I somehow reinstall the USB2.0 drivers? Thanks!


How do I make the 'super' key open the app menu?

I'm running LXDE on Mint atm, and I was wondering if there is a practical way to make the super key open the menu up, somewhat like it does in Windows.


Ubuntu 10.10 notification system area , many icons disappeared like network manager

When I restarted the computer I found no network icon. I tried to access internet but no connection was found. I also didn't have the Bluetooth, sound, battery, and power icon. Its really crazy that I have to use these commands to display them: * * *               bluetooth-applet     nm-applet --sm-disable     gnome-power-manager      * * * Every time I start the system I face this trouble! How can I fix it? Is there anyway to restore previous configuration? the history log               Start-Date: 2011-03-16  11:35:58     Install: hijra-applet:amd64 (0.1.18-3), python-hijra:amd64 (0.1.18-3, automatic), python-eggtrayicon:amd64 (2.25.3-5ubuntu2, automatic)     End-Date: 2011-03-16  11:36:15          Start-Date: 2011-03-16  19:12:49     Upgrade: libkrb5-3:amd64 (1.8.1+dfsg-5ubuntu0.4, 1.8.1+dfsg-5ubuntu0.6), libk5crypto3:amd64 (1.8.1+dfsg-5ubuntu0.4, 1.8.1+dfsg-5ubuntu0.6), chromium-browser:amd64 (10.0.648.127~r76697-0ubuntu0.10.10.1, 10.0.648.133~r77742-0ubuntu0.10.10.1), chromium-browser-l10n:amd64 (10.0.648.127~r76697-0ubuntu0.10.10.1, 10.0.648.133~r77742-0ubuntu0.10.10.1), chromium-codecs-ffmpeg:amd64 (10.0.648.127~r76697-0ubuntu0.10.10.1, 10.0.648.133~r77742-0ubuntu0.10.10.1), libkrb5support0:amd64 (1.8.1+dfsg-5ubuntu0.4, 1.8.1+dfsg-5ubuntu0.6), libtiff4:amd64 (3.9.4-2ubuntu0.1, 3.9.4-2ubuntu0.2), chromium-browser-inspector:amd64 (10.0.648.127~r76697-0ubuntu0.10.10.1, 10.0.648.133~r77742-0ubuntu0.10.10.1), libgssapi-krb5-2:amd64 (1.8.1+dfsg-5ubuntu0.4, 1.8.1+dfsg-5ubuntu0.6)     End-Date: 2011-03-16  19:13:11          Start-Date: 2011-03-16  20:52:52     Install: gpredict:amd64 (1.1-7)     End-Date: 2011-03-16  20:53:03          Start-Date: 2011-03-16  20:55:55     Install: libwxbase2.6-0:amd64 (2.6.3.2.2-5ubuntu1, automatic), tipptrainer-data-de:amd64 (0.6.0-17, automatic), libwxgtk2.6-0:amd64 (2.6.3.2.2-5ubuntu1, automatic), tipptrainer:amd64 (0.6.0-17), wx2.6-i18n:amd64 (2.6.3.2.2-5ubuntu1, automatic)     End-Date: 2011-03-16  20:56:02          Start-Date: 2011-03-16  21:28:07     Remove: libwxbase2.6-0:amd64 (2.6.3.2.2-5ubuntu1), tipptrainer-data-de:amd64 (0.6.0-17), libwxgtk2.6-0:amd64 (2.6.3.2.2-5ubuntu1), tipptrainer:amd64 (0.6.0-17), wx2.6-i18n:amd64 (2.6.3.2.2-5ubuntu1)     End-Date: 2011-03-16  21:28:16          Start-Date: 2011-03-16  21:28:22     Install: libwxbase2.6-0:amd64 (2.6.3.2.2-5ubuntu1, automatic), tipptrainer-data-de:amd64 (0.6.0-17, automatic), libwxgtk2.6-0:amd64 (2.6.3.2.2-5ubuntu1, automatic), tipptrainer:amd64 (0.6.0-17), wx2.6-i18n:amd64 (2.6.3.2.2-5ubuntu1, automatic)     End-Date: 2011-03-16  21:28:27          Start-Date: 2011-03-16  21:28:53     Remove: libwxbase2.6-0:amd64 (2.6.3.2.2-5ubuntu1), tipptrainer-data-de:amd64 (0.6.0-17), libwxgtk2.6-0:amd64 (2.6.3.2.2-5ubuntu1), tipptrainer:amd64 (0.6.0-17), wx2.6-i18n:amd64 (2.6.3.2.2-5ubuntu1)     End-Date: 2011-03-16  21:28:56          Start-Date: 2011-03-16  21:31:49     Install: klavaro:amd64 (1.5.0-1build1), libgtkdatabox-0.9.1-1:amd64 (0.9.1.1-3.1, automatic)     End-Date: 2011-03-16  21:31:57      Another problem that I didn't notice is that there is a problem with the graphics card also the visual effects can't be applied as in these photos![the drivers aren't installed](http://i.stack.imgur.com/XBEC4.gif)![the effect can't be applied](http://i.stack.imgur.com/eFRmX.gif)   it was working before. * * * another problem appeared I can't install any software from software center i click the install but nothing happens i tried many programs but the same result!! the internet connection is ok!!   I think it is virus but heard that Linux is so powerful in security.      I haven't seen a thing like this since windows 98 and XP first edition when viruses change desktop background and disable some menu items


Can I mount a microsoft mirrored dynamic disk?

I'm testing out sw raid in windows 7, but I almost always use linux and I would like to know if it's possible to mount such a mirrored dynamic disk. I can already mount each members separatly but accessing both of them at the same time would keep it consistent!


Encrypted USB 2.5" to unencrypted internal 3.5" hard drive copy speed

I am moving data from an external USB 2.5" hard drive (encrypted with `cryptsetup`) to an unencrypted internal 1TB 3.5" hard drive on a GNU/Linux quad-core headless server with 2GB RAM, using Midnight Commander over an SSH connection. The USB drive is connected directly to the server; I am not copying data **over** the SSH connection. Copying speed, according to Midnight Commander, is **maxing** at around 950 KB/s. Is this **very** slow? I'm sure it should copy faster than that? Less than 1MB/s is very slow? The machine, which is otherwise idle, has a load average now of over 2.0. I am moving the files across as a backup, because I am experiencing input/output errors in one folder on the USB drive. I have not selected that folder for copying now, and all other files are copying via Midnight Commander without any errors. **Edit:** Follow-up question here for reference.


Open kickoff via shell/script

Is there any (undocumented) way to open the KDE Kickoff menu via dbus or some similar mechanism?


How to use libraries installed with a package manager in GNU/Linux

I hope this is not a very stupid question as I am very new to development in GNU/Linux. I installed a library(for example `lzma-dev`) using a package manager(for example `apt-get` for `Debian` or `Ubuntu`). How can I use it? Where can I find the `libs` and `headers`? How about `so`s(dynamic libraries)?


sshd process inoperative

I have an AIX server which suddenly stopped servicing SSH connections. When I try to start the service through startsrc -s sshd it says:               0513-059 The sshd Subsystem has been started. Subsystem PID is 258300.      However, right after issuing the command, the services status shows up as inoperative:                sshd             ssh                           inoperative      The init scripts are well located and throw the same result as above. EDIT: Here's the odmget command output:               SRCsubsys:         subsysname = "sshd"         synonym = ""         cmdargs = "-D"         path = "/usr/sbin/sshd"         uid = 0         auditid = 0         standin = "/dev/console"         standout = "/dev/console"         standerr = "/dev/console"         action = 1         multi = 0         contact = 2         svrkey = 0         svrmtype = 0         priority = 20         signorm = 15         sigforce = 9         display = 1         waittime = 20         grpname = "ssh"      When trying to start the service manually, the following error appears:               exec(): 0509-036 Cannot load program /usr/sbin/sshd because of the following errors:     0509-150   Dependent module libz.a(libz.so.1) could not be loaded.     0509-022 Cannot load module libz.a(libz.so.1).     0509-026 System error: A file or directory in the path name does not exist.      Any help would be greatly appreciated.


FreeBSD 9.1 buildworld fails in libclangsema

I just went thru and updated a dozen or so machines from 9.0-RELEASE to 9.1-RELEASE and the last one is dieing during `buildworld`:               c++  -O2 -pipe -I/usr/src/lib/clang/libclangsema/../../../contrib/llvm/include -I/usr/src/lib/clang/libclangsema/../../../contrib/llvm/tools/clang/include -I/usr/src/lib/clang/libclangsema/../../../contrib/llvm/tools/clang/lib/Sema -I. -I/usr/src/lib/clang/libclangsema/../../../contrib/llvm/../../lib/clang/include -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DLLVM_DEFAULT_TARGET_TRIPLE=\"i386-unknown-freebsd9.0\" -DDEFAULT_SYSROOT=\"\" -fstack-protector -fno-exceptions -fno-rtti -c /usr/src/lib/clang/libclangsema/../../../contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp -o SemaExpr.o     {standard input}: Assembler messages:     {standard input}:108560: Warning: end of file not at end of a line; newline inserted     c++: Internal error: Killed: 9 (program cc1plus)     Please submit a full bug report.     See <URL:http://gcc.gnu.org/bugs.html> for instructions.     *** Error code 1          Stop in /usr/src/lib/clang/libclangsema.     *** Error code 1          Stop in /usr/src/lib/clang.     *** Error code 1          Stop in /usr/src/lib.     *** Error code 1          Stop in /usr/src.     *** Error code 1          Stop in /usr/src.     *** Error code 1          Stop in /usr/src.     *** Error code 1          Stop in /usr/src.     [Exit 1 ]      Things I have tried:               rm -rf /usr/src/* && cvsup     rm -rf /usr/obj/*      `/etc/make.conf` is pretty benign at this point with most optimizations turned off:               # Optimize when possible based on CPU     #CPUTYPE?= pentium4          # Set optimization and use pipes to speed up compiles     #CFLAGS= -O -pipe     NO_CPU_CFLAGS=  true    # Don't add -march=<cpu> to CFLAGS automatically     NO_CPU_COPTFLAGS= true  # Don't add -march=<cpu> to COPTFLAGS automatically          # Set kernel compile with special options.     # CFLAGS is not applicable to kernel builds.     #COPTFLAGS= -O -pipe      I'm feeling a little dumb at this point; so any suggestions are welcome. Thanks for your time.


Command-line file reader (like “less”) that can tell the line where the user stopped reading

[Context] I'm developing a little app, as a hobby to learn ncurses, that catalogs and lists and searches within a set of documents (for now, they are the HOWTOs from TLDP). The most tricky part of the app is, I believe, the file reader (show the contents of a file nicely). To really be able to provide a good enough user experience, given that the HOWTOs are somewhat long, it would be a valuable feature if I can "save" the line where the user stopped reading, and start on that same line the next time the user opens up that same HOWTO [/context] So to the real question: is there a command-line reader that can not only get a line X as a parameter and position the cursor at that line, but also tell me the line that was last shown? I understand that an app can't "return" that value, given that returns are either 0 or an ERROR#, so maybe some kind of system variable or shared memory or... ? Given that I'll be doing the call from a C app, maybe a different solution that's not an external app will also serve me just right, I'm open to suggestions.


Minor upgrades and version numbers on CentOS

I installed CentOS 6.0. Later I ran `yum update` to apply software updates. After that my operating system version changed to 6.3. Why did the version change? How far up will it go? How can I choose whether to keep running 6.0 or apply minor upgrades, and why should I change one or the other?


Choppy audio CD playback with mplayer

When playing audio CDs with mplayer, I always get a choppy playback. Playing audio from files, like MP3 (from any optical media, or other drives), etc. works fine. Watching video DVDs is also ok. Listening to uncompressed media that's on my hard drives, like WAV or CDR, works fine as well. But when playing audio CDs like so:               mplayer cdda://      It spins the CD, plays for a few seconds until the buffer runs out, then it spins the CD again, fills the buffer and the whole procedure repeats. I tried `-nocache`, that didn't help. How do I make mplayer keep a constant buffer fill, i.e. read the CD continuously?


Why do I get this error installing virtualbox-4.1 on Arch?

I'm trying to install Virtualbox 4.1 from the .run file since Pacman had the 4.0 version only. But when I try installing the file using `sh filelocation/filename.run`, it gives me the following error- > Please install the build and header files for your current Linux kernel. The > current kernel version is 2.6.38-ARCH Is something broken in the kernel, or do I need to install something?


why is this init.d-script not being executed at system reboot?

I have a selfmade init.d script on a Linux box that worked fine with Debian 4 and Debian 5 but with Debian 6 (fresh install) it gets only executed at system boot but not before rebooting. The script is pratically this one:               ### BEGIN INIT INFO     # Provides:          selfheal     # Required-Start:     # Required-Stop:     # X-Start-Before:    mountall     # X-Stop-After:      umountfs     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: selfheal tool     # Description:       Saves/restores the user partition at (re)boot     ### END INIT INFO          echo $0 $*     sleep 3          # some useful stuff follows here...      At `reboot` I see the system switching to `runlevel 6` and unmounting the file systems (see that `X-Stop-After: umountfs` above). No sign of life from my `selfheal` script. At system _boot_ however, I see the `echo` line and the script is being executed. I've installed the script using:               rm /etc/rc*.d/[SK]??selfheal && update-rc.d selfheal defaults      no errors/warnings there. The symlink exists:               root@intermodul:~# ls -al /etc/rc6.d/     total 12     drwxr-xr-x  2 root root 4096 May 16 16:09 .     drwxr-xr-x 68 root root 4096 May 16 16:07 ..     <snip>     lrwxrwxrwx  1 root root   18 May 16 15:09 K09umountfs -> ../init.d/umountfs     lrwxrwxrwx  1 root root   18 May 16 16:09 K10selfheal -> ../init.d/selfheal     lrwxrwxrwx  1 root root   20 May 16 15:09 K10umountroot -> ../init.d/umountroot     lrwxrwxrwx  1 root root   16 May 16 15:09 K11reboot -> ../init.d/reboot     -rw-r--r--  1 root root  351 Jan  1 06:34 README      Note that with Debian 6 came concurrent booting and I guess there is something wrong with my "INIT INFO". What is wrong here? ## Update The script gets executed when setting `CONCURRENCY=none` in `/etc/init.d/rc` but I'd like to have makefile concurrency enabled. So, why doesn't the script get executed in makefile concurrency mode?


How to modify a partitioning layout (which may involve converting a primary partition to an extended one)

I am having trouble thinking through how I can achieve my partitioning goals. Now my partitions are:   * sda1 (winA) (primary)   * sda2 (winB) (primary)   * sda3 (/ for linux) (primary) What I want to migrate into is (obviously partition numbers need not be exactly like that)   * sda1 (winA) (primary)   * sda2 (winB) (primary)   * sda3 (/boot) (primary)   * sda4 - extended which will contain      * sda5 (/home)     * sda6 (/)     * sda7 (swap) One way I have thought is:   1. Create a new primary partition for /boot and split it from the root partition into the new one. It shouldn't be too hard. Then the disk will have 4 primary partitions.   2. Somehow convert the root ubuntu partition from primary to extended.   3. Split that last partition in 3 extended partitions (root, /home, swap) and split the contents there. I am obviously stuck on the 2nd part. Another way could be (maybe easier):   1. Create an extended partition (or two)   2. Split /home there   3. Somehow move everything except /boot to the extended partition. This way /boot will stay on the primary partition that exists now, and will be shrunk as needed, and everything else will end up to the extended partitions. This may sound better, but I'm not too sure how to do the 3rd part and I'd like some feedback. Some details: The disk is almost empty, so I have space to move things around in it, shrink the linux partition etc. I don't want to touch the windows partitions in any way. Reinstallation is not an option. Also using a different partitioning scheme with fewer partitions is not an option (for example not having a separate /boot) Any ideas?


Does using lvextend destroy data already on the volume?

Does resizing a logical volume with lvextend and e2resize destroy data already on the volume? See also this related unanswered question and some examples of the process: Can I resize the root partition without uninstalling and reinstalling Linux (or losing data)?


Problematic booting process

About a month ago I installed `Lubuntu 11.10`. Since that time there is a problem with booting and shutting down.   1. Booting is endless. This screen never disappears, so I have to manually press the shutdown button of my laptop   2. I turn the laptop on and have the possibility of choice. I choose the second option - `Linux 3.0.0-14-generic (recovery mode)`   3. I will choose `resume normal boot` option   4. Success Sometimes `Lubuntu` boots normally but in most cases I have to go through steps 1-4. When I shutdown the OS I will see this screen forever, so I have to press my laptop button to turn it off. Do you know where is the problem and how to solve it? I'm asking rather here (not in Ubuntu), because this is system problem what I'm interested in (not the matter of one distribution) but booting process and here are more experts interested in the system (what is under the hood). thank you


How do you redirect audio output in FreeRDP?

I have trouble redirecting audio during my rdp connection with freerdp. When I use this command:               xfreerdp /v:ServerName /u:User /p:Password /d:Domain /audio      I get this error:               Warning rdpsnd_process_connect (/home/USER/Desktop/FreeRDP-master/FreeRDP/channels/rdpsnd/client/rdpsnd_main.c:801): no sound device.


Why doesn't my command work when aliased?

I use `ps -ef | grep catalina | grep -v grep` to print the tomcat process running on the system:               kshitiz   7099     1  0 May11 ?        00:02:29 /usr/lib/jvm/jdk1.8.0/bin/java -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:38156 -Dcatalina.base=/home/kshitiz/Documents/workspaces/ggts/.metadata/.plugins/org.eclipse.wst.server.core/tmp1 -Dcatalina.home=/opt/tomcat-7.0.42 -Dwtp.deploy=/home/kshitiz/Documents/workspaces/ggts/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps -Djava.endorsed.dirs=/opt/tomcat-7.0.42/endorsed -Dfile.encoding=UTF-8 -classpath /opt/tomcat-7.0.42/bin/bootstrap.jar:/opt/tomcat-7.0.42/bin/tomcat-juli.jar:/usr/lib/jvm/jdk1.8.0/lib/tools.jar org.apache.catalina.startup.Bootstrap start      Then I use `ps -ef | grep catalina | grep -v grep | awk -F' ' '{print $2}'` to extract the process id:               7099      But when I alias the whole command `alias tomcat_id="ps -ef | grep catalina | grep -v grep | awk -F' ' '{print $2}'"` and use it via alias, it prints the whole text and `awk` doesn't seem to work. `type tomcat_id` gives:               tomcat_id is aliased to `ps -ef | grep catalina | grep -v grep | awk -F' ' '{print }''


Trying to SSH into my Android phone, but connection closed

I am trying to use the ssh/sftp Daemon app on Android, and SSHing into the phone using an openssh client. Here is the verbose output I get right before the connection breaks               debug1: Authentication succeeded (password).     Authenticated to 10.0.0.9 ([10.0.0.9]:22).     debug1: channel 0: new [client-session]     debug1: Entering interactive session.     debug1: Sending environment.     debug1: Sending env LANG = en_US.UTF-8     debug1: client_input_channel_req: channel 0 rtype exit-signal reply 0     debug1: channel 0: free: client-session, nchannels 1     Connection to 10.0.0.9 closed.     Transferred: sent 3064, received 1088 bytes, in 0.2 seconds     Bytes per second: sent 19445.0, received 6904.7     debug1: Exit status -1      Anyone have any idea what the above output means, and if so, whether there's anything I can do client-side to fix this?


How to Install Broadcom Corporation BCM4312 Driver onto Linux Mint

I had just recently downloaded Linux Mint onto my computer, and I downloaded a 64-bit driver for wireless, but I don't know how to install it. I've never used linux before now, and the person who downloaded the software already left for vacation. I understand the concept of opening a terminal and writing commands, from previous forums, but none of what I try seems to work. I wrote _/home/uname -r~/Desktop/broadcom-wl-4.80.53.0 2/kmod_ and I get a reply saying _bash: /home/uname -r~/Desktop/broadcom-wl-4.80.53.0 2/kmod: No such file or directory_. But the file is on the desktop. I continued with writing _/home/uname -r~/Desktop/broadcom-wl-4.80.53.0 2/kmod_ which results in a reply saying _sudo: b43cutter: command not found_. Another forum told me to go to: _System->Administrator->Additional Drivers(Hardware drivers)_. The only 'system' I have is: System Log, System Monitor, System Settings. I'm not sure what to do. All the forums are confusing, and I'm new to this.


How to add a key binding to maximize/close all windows?

Lubuntu uses LXDE with Openbox. I can configure key bindings in `~/.config/openbox/lubuntu-rc.xml` I want to add key bindings to maximize all windows and have the current active one on top. I also need to have a key binding to close all windows. **Example**               <keybind key="KP_Prior">       <action name="Execute">         <startupnotify>           <enabled>true</enabled>           <name>File manager</name>         </startupnotify>         <command>lxsession-default file_manager</command>       </action>     </keybind>


Changelog of deb package

I'm using `dpkg -b` to build packages with python scripts. (DEBIAN format). In the DEBIAN folder I'have added the following files:               compat     control     copyright     changelog      The changelog is using the right format.               7zrecover (1.0-1) UNRELEASED; urgency=low            * Initial release. (Closes: #XXXXXX)           -- Lars Wirzenius <liw@liw.fi>  Thu, 18 Nov 2010 17:25:32 +0000      When I install the package, and I try to display the changelog, I always get               This change is not coming from a source that supports changelogs.          Failed to fetch the changelog for 7zrecover     URI was: http:/// . changelog      (the URI is .///. Changelog, the site does not let me post it right) "This change is not coming from a source that supports changelogs." is there anyway to fix this? I was thinking in redirect the source to the computer, and putting a changelog at /usr/share/doc/7zrecover/


Reading a filesystem from a whole disk image

I ran these commands:               VBoxManage clonehd d6b9f0a5-98df-48ca-83c8-91a0809ec349 --format RAW Debian.raw     sudo dd if=~/.VirtualBox/HardDisks/Debian.raw of=/dev/sda5      When I try to mount the partition, I get this complaint:               EXT4-fs (sda5): VFS: Can't find ext4 filesystem      Now I know that the VM had an ext4 partition. What did I do wrong?


Mounting Disk Image in Raw format

While Trying to mount a disk image in Raw(dd) format using the following command               mount  nps-2010-emails.dd /media/manu/      I get the following error message               mount: you must specify the filesystem type      I know that using -t we can specify the file system but what is the terminology for a RAW (dd) file, which can pe passed as an argument to the mount command. If my method to mount this file system is wrong please help me out in doing the same. On typing the command **file -s nps-2010-emails.dd** The output is as follows: **nps-2010-emails.dd: x86 boot sector; partition 1: ID=0xb, starthead 254, startsector 1, 20479 sectors, extended partition table (last)\011, code offset 0x0**


What's meaning the of a pair of parentheses after a string literal?

I accidentally input the the following command into the Bash terminal:               exit()      And the Bash keeps read the next line until I input a string literal and Bash gives the error of "-bash: syntax error near unexpected token". So I test some other similar inputs like:               foobar ()      The Bash gives the similar output. The following is the result I got:               ~ $ foo ()     > bar     -bash: syntax error near unexpected token `bar'      Can someone explain why. I only know the parentheses are used to create arrays or subshell. I don't know what this one actually does.


MySQL Backup folder permissions - Non downloadable by others

I created a PHP script which takes backup of the mysql database every day and then saves it to a folder called "BkPath". All the backups will be saved here. But am trying learn the `chmod` command to change permission of this folder. I know a bit about `read, write and execute`. But it isn't enough. I want to change its permission with `chmod` so that only i can access this folder that means view the files inside the folder , change them and also download them. But i don't want anyone else to view these files, change or download them. What will the correct `chmod` command for me? Note: I want to make this folder non accessible and downloadable by others over the internet.


Does `sed` exist in all *nixes?

My application will be running on all versions of Unix-based OS, say, Linux, MacOS, HP-UX, Sun Solaris , OSX, etc. I'm using the following `sed` command in a common place to delete the string matched in a text file:               sed -i '/string1/d' mytextfile      Will this work in all *nixes?


Anyway to read NFS vhdx from Hyper-V under Windows?

Quick of it is: I have an Ubuntu 12.10 server instance, running under Hyper-V on Win 8. It has worked wonderfully for about 4 months. Now, when I need to pull data back to Windows, inexplicably, it refuses to mount the swap drive, and will not acquire an IPv4 address from my local router. Even though the system boots, and I can connect to it via the Hyper-V console, I cannot transfer data via scp, for instance. Also, connects via ssh also fail (e.g. hostname is unknown). My question is: is there a way to get Win8 to be able to recognize and read NFS from VHDXs? Apologies: want to add tags "Hyper-V" and "Windows 8".


How to prevent wpa_supplicant from connecting to a network

How can I persistently prevent a wireless interface using `wpa_supplicant` in roaming mode from connecting to a particular open network `foo`? This doesn't work:               $ sudo wpa_cli     > blacklist 00:11:22:33:44:55     FAIL      Nor does the following: ### /etc/network/interfaces:               allow-hotplug wlan0     iface wlan0 inet manual       wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf      ### wpa_supplicant.conf:               network={      ssid="foo"      key_mgmt=NONE      priority=0     }


What are the interface prefix meanings in ifconfig?

I'm not sure if these have a name, but on most computers I use the interface prefixes are usually:   * eth- : Ethernet/Wired   * wlan- : Wireless/WiFi However, on my ASUS RT-N56U, I have the following:   * br0 : 'Ethernet' - Bridge?   * eth2 : 'Ethernet', IPv6 (where are 0 and 1?)   * eth3 : 'Ethernet', IPv4 (the one with my WAN IP)   * lo : 'Local Loopback' - What's this for?   * ra0 : 'Ethernet' - ?   * rai0 : 'Ethernet' - ? Are there others? What do they mean?


quick filter of IP that's causing sendmail DOS under FreeBSD

I've got what appears to be a malicious/spam host that is overloading my Sendmail server causing it to refuse connections to other hosts. I'm overloaded by connections from one particular IP address. This IP is blocked in /etc/access from us accepting mail but it's causing a DOS via the mail server which is limiting the number of simultaneous connections. How can I block a particular IP address so it doesn't even get to sendmail? I can't use inetd because sendmail is operating as a daemon. Can I use something like ifpw? I've never used it before. This is FreeBSD 7.0 Any help would be greatly appreciated!


Replacing xfce with awesome in Xubuntu

I'm using Xubuntu 13.04 with xfce 4.10. I'm trying to entirely replace xfce 4.10 (not uninstall, but replace) with awesome. So far, I have yet to even get awesome to run. The steps that I have tried thus far:   1. Install awesome with `sudo apt-get install awesome`   2. ~/.xinitrc now just contains `exec awesome`.   3. `mkdir ~/.config/awesome/` and `cp /etc/xdg/awesome/rc.lua ~/.config/awesome/` I've tried restarting, I've tried just running awesome (I get `E: awesome: main:445: another window manager is already running`, which is expected, but I'd really like to start up my session in awesome, not have to manually quit xfce and then start awesome). What am I missing?


How to flash a router from FreeWRT to OpenWrt?

How can I change the firmware on a router from FreeWRT to OpenWrt? The router is a Linksys WRT54GL, so it should have enough memory for OpenWrt and I have SSH connection as root to the system.


No CD-Rom on IBM 9228 with 631xESB/632xESB IDE Controller

I've got an IBM 9228 Server running Gentoo Linux. Everything works except for the CD-ROM drive, which is connected via a PATA cable/controller. I know the CD-ROM works and is connected correctly because I can boot from it. However with my current kernel, I can't see /dev/sr*. If I do an lshw, I see my controllers here:                   *-ide UNCLAIMED              description: IDE interface              product: 631xESB/632xESB IDE Controller              vendor: Intel Corporation              physical id: 1f.1              bus info: pci@0000:00:1f.1              version: 09              width: 32 bits              clock: 33MHz              capabilities: ide bus_master              configuration: latency=0              resources: ioport:18a0(size=8) ioport:1894(size=4) ioport:1898(size=8) ioport:1890(size=4) ioport:1880(size=16)         *-storage              description: SATA controller              product: 631xESB/632xESB SATA AHCI Controller              vendor: Intel Corporation              physical id: 1f.2              bus info: pci@0000:00:1f.2              version: 09              width: 32 bits              clock: 66MHz              capabilities: storage pm ahci_1.0 bus_master cap_list              configuration: driver=ahci latency=0              resources: irq:17 ioport:18b8(size=8) ioport:18ac(size=4) ioport:18b0(size=8) ioport:18a8(size=4) ioport:18c0(size=32) memory:f0504400-f05047ff      In the PATA section of my kernel configuration I have the following:               CONFIG_PATA_MPIIX=y      According to other posts I've found, this should be the correct option for the 631/2xESB, but as you can see above, it's UNCLAIMED and I can't find my CD device anywhere in /dev. What configuration setting needs to be enabled for my CD/DVD device to show up?


Applications for annotating djvu?

For pdf files, I use Xournal to add comments, draw underlines and highlight texts in pdf files. I wonder what applications I can use to annotate djvu files? My OS is Ubuntu. Thanks!


How to use casper-rw file for persistance

I have my USB stick setup using Easy2Boot. It allows me to drop ISO files onto the USB drive and boot from there no config or tweaking needed. I have been doing research on making it persistent. I have found that you can use a file or a partition called casper-rw. It has info on how to use the file, but my question is. Can you have the casper-rw file directly in the root of the bootable ISO or does it need to go into a special folder on the ISO? For that matter can I even have the file in the ISO or do I need to have it directly on the USB drive?


linux mint booting to black screen

I was installing virtualbox and lost the ability to open new terminal windows. Thinking it would fix itself I restarted after I got virtualbox installed. Now I am booting to a blank screen. Hitting esc reveals it stops after "stopping startpar bridge for Notification of upstart job start/stop" which has the status of ok. I can access other TTY, and startx will bring the gui up if I sudo, if I don't it will tell me there is a timeout in locking .Xauthorizatuon in the my home directory.


ssh ControlMaster exceptions

Most ssh connections I make benefit from the ControlMaster being turned on, for example most of the connections I make over VPN. However, there are a few that don't, such as github. So I've got the following in my ~/.ssh/config file:               Host *       ControlMaster auto       ControlPath   ~/.ssh/%r,%h,%p       ControlPersist 30m          Host github.com       ControlMaster no       ControlPath none       ControlPersist no      (Among other such exceptions) However, from what I can tell (pgrep -fla mux), the mux process is still being created, and this seems to provide some minor annoyances for the connections that don't benefit from muxing. Is there some way to specify, on a host-by-host basis, in my config file, not to create the master connection?