Linux mint freezes on second account login - unable to handle kernel NULL pointer dereference at (null)

I have two accounts, `daniel` and `dn`. When I log in with `daniel` first, everything is okay. But I can't login with `dn`, it freezes. It's irrelevant if I log out `daniel` or try a parallel login. It's the same way round with the account `daniel` if I log in `dn` first. The desktop is shown, without any folders and I can't move the mouse. Some information about the system: 64 bit dual boot Mint 16 MATE / windows 8 Both Systems on the same SSD / Secondary HDD Error message from `syslog`               Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO rtkit-daemon[1843]: Successfully made thread 2507 of process 2507 (n/a) owned by '1001' high priority at nice level -11.     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO rtkit-daemon[1843]: Supervising 7 threads of 3 processes of 2 users.     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.630773] BUG: unable to handle kernel NULL pointer dereference at           (null)     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.630827] IP: [<ffffffffa01e0eb6>] nvc0_vm_map_sg+0x96/0x100 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.630891] PGD 0      Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.630905] Oops: 0000 [#1] SMP      Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.630927] Modules linked in: pci_stub vboxpci(OF) vboxnetadp(OF) vboxnetflt(OF) vboxdrv(OF) joydev(F) x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel(F) parport_pc(F) ppdev(F) kvm(F) crct10dif_pclmul(F) crc32_pclmul(F) ghash_clmulni_intel(F) cryptd(F) bnep rfcomm dm_multipath(F) scsi_dh(F) uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core videodev btusb arc4(F) bluetooth iwldvm mac80211 microcode(F) snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep(F) snd_pcm(F) psmouse(F) serio_raw(F) snd_page_alloc(F) snd_seq_midi(F) snd_seq_midi_event(F) iwlwifi snd_rawmidi(F) snd_seq(F) snd_seq_device(F) snd_timer(F) cfg80211 lpc_ich snd(F) mei_me mei soundcore(F) fujitsu_laptop mac_hid lp(F) parport(F) dm_mirror(F) dm_region_hash(F) dm_log(F) hid_generic usbhid hid nouveau i915 mxm_wmi wmi i2c_algo_bit ttm drm_kms_helper drm r8169 ahci(F) libahci(F) mii(F) video(F)     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631442] CPU: 3 PID: 2281 Comm: Xorg Tainted: GF          O 3.11.0-12-generic #19-Ubuntu     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631489] Hardware name: FUJITSU LIFEBOOK AH531/GFO/FJNBB10, BIOS 1.16 06/21/2011     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631534] task: ffff8801fcacddc0 ti: ffff880230c4e000 task.ti: ffff880230c4e000     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631578] RIP: 0010:[<ffffffffa01e0eb6>]  [<ffffffffa01e0eb6>] nvc0_vm_map_sg+0x96/0x100 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631649] RSP: 0018:ffff880230c4f5f0  EFLAGS: 00010206     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631679] RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000500000000     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631718] RDX: 000000000000041f RSI: 0000000000000003 RDI: ffff88022dc84e80     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631758] RBP: ffff880230c4f640 R08: 0000000000000420 R09: 0000000000000000     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631799] R10: 0000000000000000 R11: 0000000000008000 R12: 0000000000001db0     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631833] R13: ffff88022ec75240 R14: ffff88022dc84e80 R15: 0000000000000000     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631870] FS:  00007f065be1d980(0000) GS:ffff88023fac0000(0000) knlGS:0000000000000000     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631917] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631951] CR2: 0000000000000000 CR3: 000000022f4d7000 CR4: 00000000000407e0     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631990] Stack:     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632002]  ffff88020e237940 00001db40e237940 0000000000002100 0000000000000000     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632048]  0000000500000000 0000000000000420 ffff88022e913d00 ffff88022ec75240     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632091]  ffff88020e237940 ffff88020e237900 ffff880230c4f698 ffffffffa01dedcc     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632136] Call Trace:     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632173]  [<ffffffffa01dedcc>] nouveau_vm_map_sg+0xdc/0x150 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632235]  [<ffffffffa021ab81>] nouveau_vma_getmap.isra.14+0x61/0x90 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632295]  [<ffffffffa021ac2a>] nouveau_bo_move_m2mf.isra.15+0x7a/0x130 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632351]  [<ffffffffa021b530>] nouveau_bo_move+0xa0/0x430 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632391]  [<ffffffffa008ee9d>] ttm_bo_handle_move_mem+0x24d/0x5c0 [ttm]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632432]  [<ffffffffa008f8d9>] ? ttm_bo_mem_space+0x179/0x360 [ttm]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632475]  [<ffffffffa008fecf>] ttm_bo_move_buffer+0x11f/0x140 [ttm]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632517]  [<ffffffff810bf944>] ? tick_program_event+0x24/0x30     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632558]  [<ffffffffa008ff7a>] ttm_bo_validate+0x8a/0x100 [ttm]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632612]  [<ffffffffa021bf3a>] nouveau_bo_pin+0xda/0x170 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632667]  [<ffffffffa023e42c>] nv50_crtc_swap_fbs.isra.12+0x2c/0xd0 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632725]  [<ffffffffa021c27c>] ? nouveau_bo_rd32+0x2c/0x30 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632782]  [<ffffffffa0240481>] nv50_crtc_mode_set+0x121/0x3f0 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632826]  [<ffffffffa010f02c>] drm_crtc_helper_set_mode+0x27c/0x450 [drm_kms_helper]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632877]  [<ffffffffa011067e>] drm_crtc_helper_set_config+0x99e/0xaf0 [drm_kms_helper]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632936]  [<ffffffffa0052f8d>] drm_mode_set_config_internal+0x5d/0xe0 [drm]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.634614]  [<ffffffffa00559c7>] drm_mode_setcrtc+0xf7/0x650 [drm]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.636343]  [<ffffffffa0226db0>] ? nouveau_user_framebuffer_create+0x60/0xb0 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.638033]  [<ffffffff816e8902>] ? mutex_lock+0x12/0x2f     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.639735]  [<ffffffffa0046212>] drm_ioctl+0x532/0x660 [drm]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.641378]  [<ffffffff811b8ba5>] do_vfs_ioctl+0x2e5/0x4d0     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.643044]  [<ffffffff811a91f1>] ? __sb_end_write+0x31/0x60     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.644726]  [<ffffffff811a6d82>] ? vfs_write+0x172/0x1e0     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.646494]  [<ffffffff811b8e11>] SyS_ioctl+0x81/0xa0     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.648122]  [<ffffffff816f521d>] system_call_fastpath+0x1a/0x1f     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.649646] Code: 45 d0 48 8d 04 d5 08 00 00 00 48 89 45 c0 41 8d 44 24 04 89 45 bc eb 0c 0f 1f 44 00 00 48 8b 45 b0 8b 70 30 48 8b 45 c8 4c 89 f7 <4a> 8b 14 38 48 c1 ea 08 49 89 d5 48 83 ca 03 49 83 cd 01 83 e6      Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.652856] RIP  [<ffffffffa01e0eb6>] nvc0_vm_map_sg+0x96/0x100 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.654394]  RSP <ffff880230c4f5f0>     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.655842] CR2: 0000000000000000     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO pulseaudio[2507]: [pulseaudio] pid.c: Daemon already running.     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.666275] ---[ end trace fae09bf583a1a106 ]---      xorg.20.log (what does resizing framebuffer to 2390x768 mean? It's not my screen resolution):               [    74.441] reporting 5 6 34 244     [    74.461] reporting 5 6 34 244     [    74.467] reporting 5 6 34 244     [    74.517] (II) XKB: reuse xkmfile /var/lib/xkb/server-1BCDDEFD4E35562D3483623A3498B96EFC960598.xkm     [    74.532] reporting 5 6 34 244     [    74.546] reporting 5 6 34 244     [    74.575] reporting 5 6 34 244     [    74.577] reporting 5 6 34 244     [    74.592] reporting 5 6 34 244     [    74.595] (II) intel(0): EDID vendor "LGD", prod id 732     [    74.595] (II) intel(0): Printing DDC gathered Modelines:     [    74.595] (II) intel(0): Modeline "1366x768"x0.0   70.00  1366 1402 1450 1492  768 771 776 782 -hsync -vsync (46.9 kHz eP)     [    74.596] (II) intel(0): EDID vendor "LGD", prod id 732     [    74.596] (II) intel(0): Printing DDC gathered Modelines:     [    74.596] (II) intel(0): Modeline "1366x768"x0.0   70.00  1366 1402 1450 1492  768 771 776 782 -hsync -vsync (46.9 kHz eP)     [    74.612] reporting 5 6 34 244     [    74.623] (II) intel(0): resizing framebuffer to 2390x768     [    74.623] (II) intel(0): switch to mode 1366x768@60.0 on pipe 0 using LVDS1, position (0, 0), rotation normal     [    74.640] have a master to look out for     [    74.640] adjust shatters 0 2390     [    74.640] need to create shared pixmap 1      output of df               Filesystem     1K-blocks      Used Available Use% Mounted on     /dev/sda6      148860244  34569704 106705824  25% /     none                   4         0         4   0% /sys/fs/cgroup     udev             4028988         4   4028984   1% /dev     tmpfs             808724      1232    807492   1% /run     none                5120         0      5120   0% /run/lock     none             4043620       416   4043204   1% /run/shm     none              102400        36    102364   1% /run/user     /dev/sdb1      527771640 143074604 384697036  28% /media/sw/Volume     /dev/sdb2      201586656   4858500 186488108   3% /media/sw/LINPROG


Why does this not work when the load average exceeds 1?

I have been testing this script and its behavior has been odd. The script should generate notifications whenever the load average exceeds a specified limit. Whenever I pass a CPU_LOAD_LMT >=60, no notification is generated whenever the load average exceeds 2 * 0.6 or 1.20 (2 since my system has 2 cores, explained below). There doesnt seem to be anything wrong with the script since notifications **are** generated uptill I pass 50. The CPU_LOAD_LMT is multiplied with number of cores (`nprocs`) and is then compared to the 100 * loadaverage. Here is the relevant portion of the code.                  list=`cat /proc/loadavg`        set -- $list             load=$CPU_LOAD_TIME #Extract required cpu load                load=`echo "scale=2; $load * 100" | bc` #Convert to integer        load=`printf "%.0f" $load` #Remove decimal digits              highload=$((`nproc`*$CPU_LOAD_LMT)) #Calculate high load threshold based on number of cores              if test $load -ge $highload         then                  if [ "YES" == $AUDIO ]              then                  paplay /usr/share/sounds/ubuntu/stereo/system-ready.ogg &             fi                  #Generates visual notification             if [ "YES" == $GRAPHICAL ]             then                 notify-send -i /usr/share/icons/default.kde4/128x128/devices/cpu.png "High CPU Load"'!' \                 "The CPU has been hard at work in the past minute." #No support for timeouts. Default is 5 seconds.             fi            What could be the reason?


2pass encoding by ffmpeg at once

I encode a video file by using ffmpeg like this.               $ ffmpeg -i input.avi -pass 1 -an output.mp4     $ ffmpeg -i input.avi -pass 2 -ab 128k -y output.mp4      So I typing always 2 times, is there way to encode a video by 2-pass at once? I change a options often and of course input and output file name is different each times.


How do I disable and re-enable Java whenever I want?

For me Java is just a security threat. Not many legitimate Linux apps use Java. However there is an abundance in Java malware and malicious remote administration tools like Jrat among others. But one legitimate app I run like the "Arduino IDE" may unfortunately need Java. So, I want an option to enable or disable Java whenever I want without uninstalling it. I was thinking of denying Java permission to execute using `chmod`. Would this work? Is there a better alternative? Would moving Java from a "bin" folder work? Edit: I just realized that Java may be deeply integrated with the OS and `chmod` method may work for `.jar` files but may not actually work for all Java executables. **Important:** I am not talking about Java browser plugin. I'm talking about Java on my linux system. I chose linux because it didn't have many **malicious rats** and **botnets** like **Darkcomet** , **Poison IVy** , **Zeus**. However there are **Java rats** like **Jrat**. Which could be autostarting once I accidentally gave them root.


Is space not allowed in a filename?

It is said that on Unix and Linux in general, you should avoid having spaces in a filename of a file (ordinary file, dir, link, device file, ...). But I do that all the time. For a filename with a space inside,   * In Nautilus, the space character is shown as a space.    * In Bash terminal, I either use `\ ` to represent a space, or enclose the filename within a pair of double quotes.   * in some applications's files (Nautilus, not sure if OS will also do so), the filename is written with the space replaced with `%20`. Is a space really not allowed in a filename? How do you use or deal with a space in a filename correctly?


Creating shell script on Desktop and not getting a prompt?

I have created a shell script on Desktop. Whenever I open it , I get a prompt to either run in terminal, display and etc. How to remove this prompt?


What is the difference between OSX, Linux and Windows System Authorisation?

Last week my lab instructor started giving us introduction about linux and how to use CLI commands. Anyway, he started insulting and joking about Mac OSX systems and how they are a joke systems. He said that, he used it for a week in my university department and he faced a problem, "you don't have a fully control on your machine; you always have to sudo to be a superuser -- that's why I use Windows" he said. "Mac is a **_linux_** based, Apple basically modified some codes, and mixed some to make this OS" he said. I've been a Mac user since a kid, and I have learned that having a root access to do any daily work is a very bad and dangerous practice. What do you guys think about what he said? did he really misunderstood Unix machines? I'm not trying to prove or argue with anyone nor him, I just want to know if what he said could possibly be true? or he was just sharing his biased opinion? **Update:** _**What I meant is, if there is any difference between OSX, Linux and Windows authentication system?_**


How to install Intel Graphics drivers for Mint 13

I have **choppy video** and my **windows are choppy** when I move them around. Also when my PC 'turns off monitor' it **does not turn off normally but like the cable was unplugged**. I guess I need to install a driver for my new 'graphics' chip. Can someone please provide the 'best' way of installing graphics drivers for my **Celeron G1820** CPU. Here is what I get from `lspci`:               00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)      I can provide any additional info if needed.


How to permanantly disable /var/log/secure?

When I delete /var/log/secure this file will be recreated. How do I disable the recreation of this file?


Debian: An MTA just to solve dependencies, not because I really need one

It has bothered me for years that with every new Debian installation, a full MTA (Mail Transport Agent) was installed even if I had no desire to use the machine as a mail server. The MTA was necessary to satisfy package dependencies, though. I ended up with exim (which took forever to load during boot on some machines) and others (which seemed to run memory-heavy background stuff that slowed down the entire system). Removing one required installing another...


questions on find and grep

With respect to the following `find` command-line               find . -type f -exec grep -l strings {} \;      I do not understand the usage of `-exec` and `{} \`.


Restore /etc/hosts on SuSE

I have lost my `/etc/hosts` file on SuSE Enterprise 11.3 64 bit. Is there any way to get the original file back?


Does /var keep growing in size?

tldp.org quotes /var as: > Files in /var/log can often grow indefinitely, and may require cleaning at > regular intervals. So without cleaning, using a system for a long enough period will fill up all of /var. Do some distros rotate logs automatically or is in generally accepted it's the user's role. With so many new people getting into *nix, this be better know, and how should this be handled?


16 Colors in ZShell

I only seem to be able to call 8 colors in my zshell prompt. Example:               PROMPT="[%n@%{$fg[magenta]%}%m%{$reset_color%} %.]     %# "      Works fine. However,               PROMPT="[%n@%{$fg[brmagenta]%}%m%{$reset_color%} %.]     %# "      Doesn't work. Basically, none of the "bright" color variations appear. After doing some research, I found that zsh's colors are called by the "colors" setopt. doing               echo ${(o)color}      yields this output:               00 01 02 03 04 05 07 08 22 23 24 25 27 28 30 30 30 30 31 31 32 32 33 33 34 34 35 35 36 36     37 37 39 39 40 40 41 42 43 44 45 46 47 49 bg-black bg-blue bg-cyan bg-default bg-green     bg-magenta bg-red bg-white bg-yellow black blink blue bold conceal cyan default faint green     magenta no-blink no-conceal no-reverse no-standout no-underline none normal red reverse     standout underline white yellow      As you can see, only the standard 8 colors are available. I've tried using the "bg-" variants, which also leave the output as the default text color. Any help you can provide will be greatly appreciated. I could, of course, just use one of the normal colors, but then I'd learn nothing!


Problem with path MTU discovery over pppd

I'm having an issue with pppd doing PPPoE on CentOS 6.3. The CentOS system is a dedicated router/gateway which performs NAT (both directions) and various packet filtering. It has separate NICs for the LAN and Internet side, eth0 and eth1, respectively. On the Internet side is a DSL modem. The modem likes doing everything itself, including NAT. In order to prevent it from doing so I have to give it invalid account info and then implement PPPoE on the CentOS system. I had a problem when doing PPPoE on the CentOS system with Internet connectivity being very flaky. Clients could access some sites and not others, some web pages would half-load and then always stop at the same position, and TCP connections would often reset. I've isolated this down to an MTU issue. I can get any given client system (all Windows) on the LAN side working fine by reducing its MTU down to 1492 from the standard 1500. On the other hand, if I allow the modem to do PPPoE and NAT, enable IP and the DHCP client on eth1, and set my IP filtering script to route to eth1 instead of ppp0, clients work fine with their MTU set to 1500. (The problem with this config is that double NAT can impact performance and makes inbound connection routing trickier.) Ping testing (with DF) reveals that the Internet-bound MTU is actually still limited to 1492, even though the clients don't need to be set as such. It therefore seems that clients are normally doing path MTU discovery but that pppd (or perhaps NetFilter) is somehow getting in the way of it. I normally have NetFilter (iptables) on the CentOS system set to drop all INPUT and OUTPUT traffic (since the system's only job is forwarding). I tried temporarily changing these policies to ACCEPT, in case path MTU discovery was depending on ICMP errors from it, but the problem remained. I'm not at all experienced in PPPoE and am hoping someone might be able to point me in the right direction. Thanks!


Any command to view the file system internal fragmentation size under a directory?

If the block size of a file system is 4KB, then for a 1KB file, 3KB space(which is internal fragmentation) is wasted. So, under a directory, is there any command to summarize how much disk space is wasted due to internal fragmentation?


Netbook w/ Fedora 17 and USB Numpad at Boot Disables Internal Keyboard

I have a netbook with F17 installed. No X, just text console. The system boots fine and the internal keyboard works. I can plugin a USB numpad after boot and it functions reliably. However, if the system is booted with the USB numpad attached the entire internal keyboard is frozen until the USB numpad's numlock key is pressed. I've tried using usbreset and setleds to reset the numlock programatically - unsuccessfully. The only thing that works is to press numlock on the USB numpad or unplugging and replugging.


HTTPS Redirecting to Subdomain

I have a subdomain at `https://mail.example.com` with a valid certificate. However, if someone were to accidentally type in `https://example.com` to the address bar, the certificate for the mail server is picked up instead, and thus displays the subdomain contents. How can I fix this using apache's vhost config files?


VPS freezes every few days (rcu_sched_state detected stall on CPU x)

**Background:** I have an Ubuntu 12.04 (64bit) in Xen virtualization environment. 1 GB RAM, 1 processor. Every few days I get the following error message: > rcu_sched_state detected stall on cpu 0 (t=xxxxx jiffies) Before when I had Ubuntu 11.01; after a distribution upgrade the error is still occurring. The server runs (don't ask, I'm just a Linux rookie developer who has to "maintain" this): OEMPro, Apache2/MySQL/PHP, on main website with 2 Wordpress blogs. Daily page-loads are not more then 5-7K. There are no huge peaks of memory or CPU usage before the stall (as tracked on our Munin graphs). ### Questions   1. The freeze can be caused via huge sql queries?   2. How can I fix it?


Only one CPU core is active on Fedora 16

I've upgraded from F15 to **F16** and noticed that I have a problems with hardware detection. Upon loading I can see message like               ...     CPU#1 not responding     ...      on the screen. It disappears and I can login then as usually. But I have **only 1 CPU** in System Monitor and it is **always loaded** by 80-100%. So my PC is very noisy. :) I've noticed also that Caps Lock indicator is always on irregardless of actual caps lock status. And the system freezes out after 5-10 minutes. :( I've tried **clean install of F16** and the problem is the same. My PC is **Compaq Presario CQ56-118EO** with **Intel Pentium Dual Core T4500 CPU**. I've tried to google but failed. Is my hardware/BIOS/karma incompatible with Linux 3.x? dmesg output P.S. I upgraded my BIOS to the last version available at HP site dated back to April of 2011. No changes... P.P.S. Not Foedora specific. Exactly the same situation with openSUSE 12.1


Cannot install Debian on QEmu-arm

I'm trying to run Debian 6 network install with this command:               sudo qemu-system-arm -M versatilepb -kernel ./vmlinuz-2.6.32-5-versatile -initrd ./initrd.gz -hda ./debianlxde.img -m 256 -append "root=/dev/ram"      where kernel and initrd are taken from:               http://ftp.de.debian.org/debian/dists/squeeze/main/installer-armel/current/images/versatile/netboot/initrd.gz     http://people.debian.org/~aurel32/qemu/armel/vmlinuz-2.6.32-5-versatile      The installer runs but when it tries to recognize hard drives, it cannot. My OS is Fedora 16, qemu-system-arm version is 0.15.1 How can I fix it?


CentOS doesn't know what the internet is

So I've done my share of investigating this problem... I just recently created a CentOS 6 VM on my LinuxMint box using VirtualBox. I left all the recommended values the same upon creation (8GB HDD, 512MB RAM, blah blah blah...). But it DOESN'T connect to the internet! When I try to ping an external network (google.com) it doesn't recognize the host:               ping: unknown host google.com      and when I try to ping my internal IP of my host box it says that:               connect: Network is unreachable      (perhaps it can see my host network, just doesn't know a route to it?) I've cleared my `iptables`, used every single given network adapter VirtualBox offers, and used both NAT and Bridged Adapter modes. I also reaped Google of all that I could mentally find. When I `ifconfig` it only shows the `lo` interface (loopback), unless I manually enable the `eth0` interface via the `ifcfg-eth0` file (set `ONBOOT="yes"`) and restart. But when I enable the `eth0` interface, it doesn't show an IP; just the MAC and IPv6 one. I don't think its the host's internet or link to the Guest OS at all... I have a WinXP VM set up and it can access the internet. Perhaps the answer is more obvious than I think?


Display all the dates in week numbers in UNIX

I know the command to get the week number of a date is `date +%W` Output: `03` Now, is there a way of giving a week number it will display all the dates in that week? Or should I write a script? Eg: Input: `03` Output:               Jan 20     Jan 21     Jan 22     Jan 23     Jan 24     Jan 25     Jan 26      First week (Jan 1, 2, 3,4 and 5) are considered as week no '0'. So the first week starts from 6th jan(First Monday in Jan 2014), 2nd week starts from 13th and third week starts from 20th


Running any kind of login script when sh is linked to bash

My problem: My web host offers ssh to their shared server. I want to set up a couple of aliases and such, so I'm trying to get a login script of any flavor to run. If my shell was plain bash, I would simply add my stuff to one of the dotfiles and be done with it. Now, as it happens, my shell is specified as `/bin/sh`, which is linked to bash:               sh-3.2$ /bin/sh --version     GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)     Copyright (C) 2005 Free Software Foundation, Inc.     sh-3.2$ /bin/bash --version     GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)     Copyright (C) 2005 Free Software Foundation, Inc.     sh-3.2$      I've tried creating all the usual suspects, `~/.bash_profile`, `~/.bash_login`, `~/.bashrc`, `~/.profile` and `.login` without luck. What can I do to execute a command on startup? Any file names I've forgotten to try? **Should** any of these work under my conditions? I.e. has my host done something to disable login script? I'd prefer not asking my host to set a different shell for me until I've gotten my facts straight about this.


How to utilize XDG directories and paths in Bash?

I wonder how to access not only the variables defined in `~/.config/user- dirs.dirs` with `xdg-user-dir`, e.g. `"$(xdg-user-dir VIDEOS)"`, but also the following standard variables:   1. `XDG_CACHE_HOME:-$HOME/.cache`   2. `XDG_CONFIG_HOME:-$HOME/.config`   3. `XDG_DATA_HOME:-$HOME/.local/share`   4. `XDG_RUNTIME_DIR:-"/run/user/$USER"`   5. `XDG_CONFIG_DIRS:-/etc/xdg`   6. `XDG_DATA_DIRS:-/usr/local/share:/usr/share` For that purpose I do the following in my `~/.bash_login` file:               # Define standard directories.     declare -gx XDG_CACHE_HOME=~/.cache     declare -gx XDG_CONFIG_HOME=~/.config     declare -gx XDG_DATA_HOME=~/.local/share     declare -gx XDG_RUNTIME_DIR="/run/user/$USER"     declare -gx XDG_CONFIG_DIRS="$(IFS=: path /etc/xdg)"     declare -gx XDG_DATA_DIRS="$(IFS=: path /usr/local/share:/usr/share)"     # Source supplementary directories to export or overwrite existing standard ones.     declare a="$XDG_CONFIG_HOME/user-dirs.dirs"     if [[ -e $a ]]; then       source "$a"       declare b=""       for b in ${!XDG_*}; do         if [[ $b =~ ^XDG_[_[:alnum:]]+_DIR$ ]]; then           declare -gx "$b"         fi       done     fi      Is there a mechanism to access the above directory and path variables other than the user directory variables defined by the "XDG" directory structure specification?


Linux Mint 13 XFCE freezes when external monitor connected

I am running Linux Mint 13. The problem is that whenever I connect/disconnect an external monitor to my laptop it freezes. If the monitor is connected on boot it works fine. Any ideas ? Output from inxi -SGxc 0               System:    Host: ****-VGN-NS140E Kernel: 3.2.0-23-generic x86_64 (64 bit, gcc: 4.6.3)                 Desktop: Xfce 4.10.0 (Gtk 2.24.10) Distro: Linux Mint 13 Maya     Graphics:  Card: Intel Mobile 4 Series Chipset Integrated Graphics Controller bus-ID: 00:02.0                 X.Org: 1.11.3 drivers: intel (unloaded: vesa,fbdev) Resolution: 1280x800@59.9hz                 GLX Renderer: Mesa DRI Mobile Intel® GM45 Express Chipset GLX Version: 2.1 Mesa 8.0.4 Direct Rendering: Yes


How to access a machine behind a restricted NAT gateway I don't manage?

I have a linux machine that I'd like to be able to access remotely for SSH, FTP, HTTP, and so forth. I signed up for Dynamic DNS with No-IP.com, but this isn't adequate because I am on a college campus network, behind an NAT, and don't have permission to access the router to set up port forwarding. I don't know if the campus routers support UPnP or NAT-PMP but I doubt it. Anyways, I was wondering if there was a way to get around this using a VPN. I know that a VPN would allow me to, for instance, access my linux box from my laptop if I had the VPN software installed on both machines. But I'd like to be able to access my linux box from any computer, without having to install software. Or at the very least be able to access the HTTP part that way. And while I know that many VPN services offer web interfaces for file transfer, etc., I'd rather be able to access my linux box using regular FTP and SSH client software. Anyways, is this something you can do with a VPN? Or is there a way to chain a VPN with Dynamic DNS somehow? I looked at the website for Hamachi VPN, but it described all the features in nontechnical terms, so I wasn't able to figure out these questions and I'd prefer to know before creating an account.


Script to insert line into files in sub-dirs

I have a sub-dir tree with varying number of branches and most of the branches contain .cpp files (many of them). I have a header-file at the root of the tree that I want to have as a               #include "<constructed-relative-path-to-root>/headerfile.h"      as the first line of each .cpp.      an alternative to `constructed-relative-path-to-root` would be the hard-coded path, which would have to be adjusted whenever the project is relocated)      a second alternative would be to copy the content of the header-file in at the top of each .cpp file I have no idea how to write such a script. Can anyone please help?


how to write a script that will run commands after su, without using -c

I'm trying to automate a standard activity on a system I do not have root access on. The administrator of the systems have given me authority to run `sudo su - 'user'` command, and _only_ that command. I can not add a `-c` argument or `sudo` will fail. My script will have to start with my permissions, and midway through change to running with the user's permissions. I'm trying to figure out if there is a way to make a script do this for me in a single command? Before anyone asks, trying to get my `visudo` permissions extended is quite difficult. While I could probably `su` using the password I do not know the password of the user, don't want to change it, and really should hardcode it in my script anyways, so regular `su` without `sudo` isn't really an option. It seems like there has to be some way to work with the command I'm authorized to use?


ranger image-preview with transparent terminal background

I like the image-preview in ranger, but I also like my terminal transparent. Is there really no way to get the image-preview work with w3m and transparent background? (I'm willing to change my terminal-emulator if that's necessary, currently urxvt)


Universal Node.js shebang?

Node.js is very popular these days and I've been writing some scripts on it. Unfortunately, compatibility is a problem. Officially, the Node.js interpreter is supposed to be called `node`, but Debian and Ubuntu ship an executable called `nodejs` instead. I want portable scripts that Node.js can work with in as many situations as possible. Assuming the filename is `foo.js`, I really want the script to run in two ways:   1. `./foo.js` runs the script if either `node` or `nodejs` is in `$PATH`.   2. `node foo.js` also runs the script (assuming the interpreter is called `node`) * * * **Note:** The answers by xavierm02 and myself are two variations of a polyglot script. I'm still interested in a pure shebang solution, if such exists.


Process auto starts itself not by cron

My linux server was hacked. and now there is a file in root directory that generates big traffic. when i kill this process it autostarts itself again. then i did chmod -x. but it returned x option. there is no crontab job. i have installed auditd to check what is going on. but i cannot find how it autostarts itself? and maybe some other processes (daemons) work there to autostart it. how can i trace the daemons activity that starts this process? thanks.


Bash expansion of ${@} as command

I have a parent script               while read cmd      do       nohup ./script ${cmd[@]} &>> log &     done < ~/list       that executes this child script               while true     do        eval "${CMD[@]}"       #${CMD[@]}       #./panic     done      with this list of commands               node ~/www/splash/app.js     node ~/www/splash-two/app.js      When the child script calls `eval ${CMD[@]}` it executes the way I expect running that command with no complaints but when I try to remove the eval and run the command using `${CMD[@]}` it throws the error:               Error: Cannot find module '/home/rumplefraggle/SYS/RABBOT/~/www/splash/app.js'      Now I thought possibly this had something to do with the node command so I tried to execute   `ls ~`   as the command and it throws the error that `~` can not be found. Echoing `${@}` and not running it expands as I would expect it to. Also manually inserting the command into the child script also works as expected I don't understand why `eval` works and simply running the command using `${@}` does not. What is causing `${@}` to not expand the `~`? Why is node appending the directory name to the command when `${@}` is used?


Regex to Cisco Interface

I would like to know if have some `sed`, `grep` or `awk` regex to parse Cisco interface section and exclude if interface is down (shutdown), like example below. Example:               !     interface FastEthernet0/1      ip address 10.16.0.1 255.255.255.224     !     interface FastEthernet0/2      ip address 10.17.0.1 255.255.255.224      shutdown     !      I'm using `sed` regex below to parse interface section:               sed -n -e '/^interface/,/^!/p' file.txt      But the regex above, parse all interface and not exclude interface down.


When running to a run level does it execute previous run levels?

If I tell my system to go to run level 3 does that mean that it first runs through run level 0, 1, 2, and then finally runs through run level 3? I thought the answer to this question was yes. But when I look on my RHEL 6 system I see that many of rcX.d directories contain same symbolic links. In My **/etc/rc.d/rc0.d/**               [root@centos6 rc.d]# ls -lah /etc/rc.d/rc0.d/     total 8.0K     drwxr-xr-x.  2 root root 4.0K Jun 27 11:59 .     drwxr-xr-x. 10 root root 4.0K Jul  9 15:06 ..     lrwxrwxrwx.  1 root root   13 Jun 12 13:02 K05atd -> ../init.d/atd     lrwxrwxrwx.  1 root root   14 Jun 12 13:01 K10cups -> ../init.d/cups     lrwxrwxrwx.  1 root root   19 Jun 12 10:57 K10saslauthd -> ../init.d/saslauthd     lrwxrwxrwx.  1 root root   18 Jun 12 12:51 K15svnserve -> ../init.d/svnserve     lrwxrwxrwx.  1 root root   14 Jun 12 10:58 K25sshd -> ../init.d/sshd     lrwxrwxrwx.  1 root root   17 Jun 12 10:57 K30postfix -> ../init.d/postfix     lrwxrwxrwx.  1 root root   17 Jun 12 12:26 K50dnsmasq -> ../init.d/dnsmasq     lrwxrwxrwx.  1 root root   20 Jun 12 10:57 K50netconsole -> ../init.d/netconsole     lrwxrwxrwx.  1 root root   15 Jun 12 10:57 K60crond -> ../init.d/crond     lrwxrwxrwx.  1 root root   25 Jun 27 11:59 K65vboxadd-service -> ../init.d/vboxadd-service     lrwxrwxrwx.  1 root root   17 Jun 27 11:58 K70vboxadd -> ../init.d/vboxadd     lrwxrwxrwx.  1 root root   21 Jun 27 11:59 K70vboxadd-x11 -> ../init.d/vboxadd-x11     lrwxrwxrwx.  1 root root   17 Jun 12 12:26 K73winbind -> ../init.d/winbind     lrwxrwxrwx.  1 root root   19 Jun 12 12:26 K74haldaemon -> ../init.d/haldaemon     lrwxrwxrwx.  1 root root   26 Jun 12 10:58 K75blk-availability -> ../init.d/blk-availability     lrwxrwxrwx.  1 root root   15 Jun 12 11:15 K75netfs -> ../init.d/netfs     lrwxrwxrwx.  1 root root   19 Jun 12 10:57 K75udev-post -> ../init.d/udev-post     lrwxrwxrwx.  1 root root   24 Jun 12 12:26 K84NetworkManager -> ../init.d/NetworkManager     lrwxrwxrwx.  1 root root   24 Jun 27 11:59 K84wpa_supplicant -> ../init.d/wpa_supplicant     lrwxrwxrwx.  1 root root   19 Jun 12 10:58 K85mdmonitor -> ../init.d/mdmonitor     lrwxrwxrwx.  1 root root   20 Jun 12 12:25 K85messagebus -> ../init.d/messagebus     lrwxrwxrwx.  1 root root   20 Jun 12 10:58 K87multipathd -> ../init.d/multipathd     lrwxrwxrwx.  1 root root   21 Jun 12 10:57 K87restorecond -> ../init.d/restorecond     lrwxrwxrwx.  1 root root   16 Jun 12 10:58 K88auditd -> ../init.d/auditd     lrwxrwxrwx.  1 root root   15 Jun 27 11:59 K88iscsi -> ../init.d/iscsi     lrwxrwxrwx.  1 root root   17 Jun 12 10:57 K88rsyslog -> ../init.d/rsyslog     lrwxrwxrwx.  1 root root   16 Jun 12 10:58 K89iscsid -> ../init.d/iscsid     lrwxrwxrwx.  1 root root   21 Jun 12 13:01 K89portreserve -> ../init.d/portreserve     lrwxrwxrwx.  1 root root   15 Jun 12 11:15 K89rdisc -> ../init.d/rdisc     lrwxrwxrwx.  1 root root   17 Jun 12 11:15 K90network -> ../init.d/network     lrwxrwxrwx.  1 root root   19 Jun 12 10:57 K92ip6tables -> ../init.d/ip6tables     lrwxrwxrwx.  1 root root   18 Jun 12 10:57 K92iptables -> ../init.d/iptables     lrwxrwxrwx.  1 root root   22 Jun 12 10:58 K99lvm2-monitor -> ../init.d/lvm2-monitor     lrwxrwxrwx.  1 root root   17 Jun 12 11:15 S00killall -> ../init.d/killall     lrwxrwxrwx.  1 root root   14 Jun 12 11:15 S01halt -> ../init.d/halt     lrwxrwxrwx.  1 root root   15 Jun 26 12:32 S95jexec -> ../init.d/jexec      And in **/etc/rc.d/rc1.d/** I see the same set of symbolic links as in rc0.d plus extra links. This seems to indicate that the directories rc0.d, rc1.d are independent and that to get to run level 1 it does not execute the stuff in run level 0. Which means that bad things can happen if some how the symbolic links in rc0.d were not exactly replicated in rc1.d, ... etc. So how does it really work? Does it just scan the files in a specific rc.X dir or run through all rc.X dirs that have a lower level than rc level passed to init?               [root@centos6 rc.d]# ls -lah /etc/rc.d/rc1.d/     total 8.0K     drwxr-xr-x.  2 root root 4.0K Jun 27 11:59 .     drwxr-xr-x. 10 root root 4.0K Jul  9 15:06 ..     lrwxrwxrwx.  1 root root   13 Jun 12 13:02 K05atd -> ../init.d/atd     lrwxrwxrwx.  1 root root   14 Jun 12 13:01 K10cups -> ../init.d/cups     lrwxrwxrwx.  1 root root   19 Jun 12 10:57 K10saslauthd -> ../init.d/saslauthd     lrwxrwxrwx.  1 root root   18 Jun 12 12:51 K15svnserve -> ../init.d/svnserve     lrwxrwxrwx.  1 root root   14 Jun 12 10:58 K25sshd -> ../init.d/sshd     lrwxrwxrwx.  1 root root   17 Jun 12 10:57 K30postfix -> ../init.d/postfix     lrwxrwxrwx.  1 root root   17 Jun 12 12:26 K50dnsmasq -> ../init.d/dnsmasq     lrwxrwxrwx.  1 root root   20 Jun 12 10:57 K50netconsole -> ../init.d/netconsole     lrwxrwxrwx.  1 root root   15 Jun 12 10:57 K60crond -> ../init.d/crond     lrwxrwxrwx.  1 root root   25 Jun 27 11:59 K65vboxadd-service -> ../init.d/vboxadd-service     lrwxrwxrwx.  1 root root   17 Jun 27 11:58 K70vboxadd -> ../init.d/vboxadd     lrwxrwxrwx.  1 root root   21 Jun 27 11:59 K70vboxadd-x11 -> ../init.d/vboxadd-x11     lrwxrwxrwx.  1 root root   17 Jun 12 12:26 K73winbind -> ../init.d/winbind     lrwxrwxrwx.  1 root root   19 Jun 12 12:26 K74haldaemon -> ../init.d/haldaemon     lrwxrwxrwx.  1 root root   15 Jun 12 11:15 K75netfs -> ../init.d/netfs     lrwxrwxrwx.  1 root root   24 Jun 12 12:26 K84NetworkManager -> ../init.d/NetworkManager     lrwxrwxrwx.  1 root root   24 Jun 27 11:59 K84wpa_supplicant -> ../init.d/wpa_supplicant     lrwxrwxrwx.  1 root root   19 Jun 12 10:58 K85mdmonitor -> ../init.d/mdmonitor     lrwxrwxrwx.  1 root root   20 Jun 12 12:25 K85messagebus -> ../init.d/messagebus     lrwxrwxrwx.  1 root root   20 Jun 12 10:58 K87multipathd -> ../init.d/multipathd     lrwxrwxrwx.  1 root root   21 Jun 12 10:57 K87restorecond -> ../init.d/restorecond     lrwxrwxrwx.  1 root root   16 Jun 12 10:58 K88auditd -> ../init.d/auditd     lrwxrwxrwx.  1 root root   15 Jun 27 11:59 K88iscsi -> ../init.d/iscsi     lrwxrwxrwx.  1 root root   17 Jun 12 10:57 K88rsyslog -> ../init.d/rsyslog     lrwxrwxrwx.  1 root root   16 Jun 12 10:58 K89iscsid -> ../init.d/iscsid     lrwxrwxrwx.  1 root root   21 Jun 12 13:01 K89portreserve -> ../init.d/portreserve     lrwxrwxrwx.  1 root root   15 Jun 12 11:15 K89rdisc -> ../init.d/rdisc     lrwxrwxrwx.  1 root root   17 Jun 12 11:15 K90network -> ../init.d/network     lrwxrwxrwx.  1 root root   19 Jun 12 10:57 K92ip6tables -> ../init.d/ip6tables     lrwxrwxrwx.  1 root root   18 Jun 12 10:57 K92iptables -> ../init.d/iptables     lrwxrwxrwx.  1 root root   22 Jun 12 10:58 S02lvm2-monitor -> ../init.d/lvm2-monitor     lrwxrwxrwx.  1 root root   26 Jun 12 10:58 S25blk-availability -> ../init.d/blk-availability     lrwxrwxrwx.  1 root root   19 Jun 12 10:57 S26udev-post -> ../init.d/udev-post     lrwxrwxrwx.  1 root root   15 Jun 26 12:32 S95jexec -> ../init.d/jexec     lrwxrwxrwx.  1 root root   16 Jun 12 11:15 S99single -> ../init.d/single


What is the recommended way of checking running services?

I'm often exposed to various GNU/Linux systems including CentOS, SLES and Debian. I want to know: what is the recommended method of checking all running services across these systems? I am aware of `service --status-all` and `chkconfig` but they are not always available. Please advise.


Smooth font rendering with xmonad in linux mint

I am using the xmonad windows manager under Linux Mint 13 and is lacking a smooth font rendering. Under MATE or Cinnamon, the fonts are smoothed, and choosing the session `xmonad with Gnome`, fonts are smoothed also. In addition, if I run `gnome- settings-daemon` while in xmonad, the fonts become smoothed also. But is there a way to have nice looking fonts without resorting to Gnome?


What makes ext3 determine how frequently to perform file system checks when no options are specified?

I created two partitions on a 1.5 TB drive, the first was 1 TB, the latter was the remaining .5 TB. Both were formatted as ext3. I don't mind the automatic filesystem checks occurring every so often, so I never bother configuring the frequency of it. What I found odd was that it decided to make the automatic check occur every 39 mounts for the 1 TB, and 27 mounts for the .5 TB partition. I attempted to look in the man pages as well as various forums, but I couldn't find any mention about how it determines the frequency for file system checks. I assume it is a simple formula, so does anyone know what it is?


sed: multi-line replace of config block

I have some configuration files that basically look like               (...content...)     # BEGIN DYNAMIC BLOCK - DO NOT EDIT MANUALLY     (... more content ...)     # END DYNAMIC BLOCK     (... even more content ...)      Now, in bash using `CONTENT=`wget -O - http://$SERVER/get_config.php``, I have the replacement for the dynamic block. How do I do the replace now and how do I make the script insert the block at file's end if it isn't there?


Simplest screen echo server?

What is the simplest way to do the following thing? Run a program which will open specified port, listen for it, and display whatever it receives. Also if type something -- then send back to connected peer. This is for debug purposes.


Optimal way to setup user account / accesses?

I have a (home) Ubuntu machine; upon installation I created the "x" user during the installation (who is not the root) so often when I want to run apt- get or other things that require write access to `/usr` or `/var` I need to sudo. My question is is there a safe way to setup the "x" user in such a way that he has more rights so that I don't have to sudo or su? What would be the optimal way to do the user account management? (On a home machine - so no production.)


vim: How to switch to the directory listing from file view?

I have opened a dir `vim some/dir`. I can navigate within the tree, yet once I opened a file I wonder, how do I close the file view in order to go back to the directory listing to navigate to another file. `:wq` is no option, as it closes the whole vim session. I guess there is a for mode to that, yet I do not know what it is called nor how I start it. How to close the file to file navigation view?


How do I get my Virgin Media wireless internet to work on Crunchbang linux?

I am struggling to get my internet to work on Linux. I am able to connect to my wireless internet through any other device I choose but my laptop will not find it. I have tried using the hidden connection option but still cannot find it. Is there anything else I can do?


Trying to compress avi file using ffmpeg

I used the command below to compress an avi file(using ubuntu)               ffmpeg -i input.avi -vcodec msmpeg4v2 output.avi      but I am getting these errors               Incompatible sample format 's16' for codec 'ac3', auto-selecting format 'flt'     [ac3 @ 0x9cd1fa0] invalid bit rate          Error while opening encoder for output stream #0.1 - maybe incorrect           parameters such as bit_rate, rate, width or height      What's wrong?


bash: escape individual lines from `-x` echoing

In bash, when running with the `-x` option, is it possible to exempt individual commands from echoing? I'm trying to make the output as neat as possible, so I am running certain parts of my script in a subshell with `set +x`. However, the row `set +x` itself is still echoed and adds no valuable information to the output. I remember back in the bad old `.bat` days, when running with `echo on`, individual lines could be exempted by starting them with a `@`. Is there any equivalent in bash?               #!/bin/bash -x          function i_know_what_this_does() {       (         set +x         echo do stuff       )     }          echo the next-next line still echoes 'set +x', is that avoidable?     i_know_what_this_does     echo and we are back and echoing is back on      When running the above, output is:               + echo the next-next line still echoes 'set +x,' is that 'avoidable?'     the next-next line still echoes set +x, is that avoidable?     + i_know_what_this_does     + set +x     do stuff     + echo and we are back and echoing is back on     and we are back and echoing is back on


Xorg and Xserver not starting up after hibernate

I'm currently running Mint 14 on this computer, but it also previously happened with Fedora 16 so I'm guessing it's a general problem with my drivers. The display will not start up after the laptop hibernates. If I close the lid it will just show a weird snowy display from which I need to reboot, If I don't close the lid it will show some errors and take me to the console where i can reboot. The log files are pretty massive, but I've pulled out the bits that looked to give the most vital information. It looks most likely a driver issue and I've been to http://wiki.x.org/ to have a hunt around but it's not really something I'm familiar with. Running lsmod | grep nouveau               nouveau               895609  3      ttm                    83595  1 nouveau     drm_kms_helper         46784  1 nouveau     drm                   275528  5 nouveau,ttm,drm_kms_helper     i2c_algo_bit           13413  1 nouveau     mxm_wmi                12979  1 nouveau     video                  19335  1 nouveau     wmi                    19070  3 asus_wmi,nouveau,mxm_wmi      Running lspci               01:00.0 VGA compatible controller: NVIDIA Corporation Device 1251 (rev a1)      /var/log/syslog:               Jan  2 18:13:30 user-G74Sx mdm[1586]: WARNING: Failed to start X server several times in a short time period; disabling display :0      /var/log/X.org.log:               [    23.428]      X.Org X Server 1.13.0     Release Date: 2012-09-05     [    23.428] X Protocol Version 11, Revision 0     [    23.428] Build Operating System: Linux 3.2.0-30-generic x86_64 Ubuntu     [    23.428] Current Operating System: Linux user-G74Sx 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64     [    23.428] Kernel command line: BOOT_IMAGE=/vmlinuz-3.5.0-17-generic root=UUID=e7c94e41-c243-45b2-9cdc-e851b5cf16d0 ro quiet splash     [    23.428] Build Date: 08 October 2012  03:34:01PM     [    23.428] xorg-server 2:1.13.0-0ubuntu6 (For technical support please see http://www.ubuntu.com/support)      [    23.428] Current version of pixman: 0.26.0     [    23.429]    Before reporting problems, check http://wiki.x.org     to make sure that you have the latest version.     [    23.429] Markers: (--) probed, (**) from config file, (==) default setting,     (++) from command line, (!!) notice, (II) informational,     (WW) warning, (EE) error, (NI) not implemented, (??) unknown.     [    23.429] (==) Log file: "/var/log/Xorg.0.log", Time: Wed Jan  2 18:15:32 2013     [    23.438] (==) Using system config directory "/usr/share/X11/xorg.conf.d"     [    23.439] (==) No Layout section.  Using the first Screen section.     [    23.439] (==) No screen section available. Using defaults.     [    23.439] (**) |-->Screen "Default Screen Section" (0)     [    23.439] (**) |   |-->Monitor "<default monitor>"     [    23.439] (==) No monitor specified for screen "Default Screen Section".     Using a default monitor configuration.     [    23.440] (==) Automatically adding devices     [    23.440] (==) Automatically enabling devices     [    23.440] (==) Automatically adding GPU devices     [    23.440] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.     [    23.440]    Entry deleted from font path.     [    23.440] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.     [    23.440]    Entry deleted from font path.     [    23.440] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.     [    23.440]    Entry deleted from font path.     [    23.440] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.     [    23.440]    Entry deleted from font path.     [    23.440] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.     [    23.440]    Entry deleted from font path.     [    23.440] (WW) The directory "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" does not exist.     [    23.440]    Entry deleted from font path.      It also tries to load the modules nv and nvidia a few times but fails each time because the modules do not exist so I'm guessing I'll have to install the modules. It looks like it eventually uses the module nouveau               [    23.473] (II) NOUVEAU driver Date:   Wed Sep 12 13:42:43 2012 +0200     [    23.473] (II) NOUVEAU driver for NVIDIA chipset families :     [    23.473]    RIVA TNT        (NV04)     [    23.473]    RIVA TNT2       (NV05)     [    23.473]    GeForce 256     (NV10)     [    23.473]    GeForce 2       (NV11, NV15)     [    23.473]    GeForce 4MX     (NV17, NV18)     [    23.473]    GeForce 3       (NV20)     [    23.473]    GeForce 4Ti     (NV25, NV28)     [    23.473]    GeForce FX      (NV3x)     [    23.473]    GeForce 6       (NV4x)     [    23.473]    GeForce 7       (G7x)     [    23.473]    GeForce 8       (G8x)     [    23.473]    GeForce GTX 200 (NVA0)     [    23.473]    GeForce GTX 400 (NVC0)      Any help in the right direction would be great as this isn't really an area I'm particularly strong with. If there are any parts of the log files which might help please let me know and I'll paste them in


Where to get UUID libraries and code

What is the difference between the libuuid that comes with the util-linux-ng package and the one that comes with e2fsprogs? Also, if I want to compile libuuid from source, where should I get said source?   * https://www.kernel.org/pub/linux/utils/util-linux/   * https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.42.8/ Those are my best guesses, are they trustworthy and correct?


tftpput in U-Boot: error: 'Access violation' (2)

I have enabled `CONFIG_CMD_TFTPPUT` in U-Boot, but I am not able to use it. I have set the `serverip` and `ipaddr` environment variables. When I use it as follows, it times out:               u-boot# tftpput                 link up on port 0, speed 100, full duplex     Using cpsw device     TFTP to server 192.168.1.3; our IP address is 192.168.1.106     Filename 'uImage'.     Save address: 0x0     Save size:    0x0     Saving: ##T ###T ####        If I set the bootfile name to `temp`, it gives the following error:               u-boot# tftpput               link up on port 0, speed 100, full duplex     Using cpsw device     TFTP to server 192.168.1.3; our IP address is 192.168.1.106     Filename 'temp'.     Save address: 0x0     Save size:    0x0     Saving: *     TFTP error: 'Access violation' (2)     Not retrying...      Wireshark capture: ![Wireshark log](http://i.stack.imgur.com/8OrsW.png) Any help/pointers/suggestion?


How to make a secure-boot compliant boot CD

I've found quite a bit of information floating around on the Internet about how to _install_ Linux onto a _harddisk_ and get Secure Boot to work with it. But I can't find a single shred of information about how to make a _bootable live CD_. Does anybody know how to accomplish this? I'm using Kiwi to build a CD based on OpenSUSE 13.1. The actual OpenSUSE installation DVD boots in Secure Boot mode, but I'm unsure how to replicate this feat myself. Does anybody know what magic button I need to press? I can't test this, but I imagine the boot CD already works with EFI. But it doesn't work with Secure Boot. (And why would it? It isn't signed with anything.) (Just to clarify: The test machine I have available does not allow you to disable Secure Boot. You can disable EFI completely and revert to legacy BIOS, but you can't turn off just the Secure Boot part. Which isn't terribly helpful, but anyway...)


VirtualBox abnormal behavior when mouse focus from iMac Maverick to vm running Debian wheezy

I am experimenting this really **annoying** behavior. I never had this problem with other platform combination. In this combination:   * Hardware OS Host: iMac Maverick   * Oracle VirtualBox 4.3.2 r90405   * Vm Debian Wheezy. When I unfocus the mouse from the vm I normally can interact with any iMac window. As soon as I click in the vm, then either one of these scenario happen:   * some text becomes selected, in an app like (xterm, chrome, ...) or any window opened in the Debian XWindow running environment.   * worse, one of the Debian XWindow gets resized or moved, I loose the window title bar, and I have to play with the maximize, minimize, ... to get back the apps window to the correct position and size. The only solution to avoid this behavior is to do, before interacting with the Debian Xwindow environment, the following:   * click to the VirtualBox surrounding window to get the vm be the active window from iMac context, and only then interacting with the apps windows in the vm without any side effect. Since I am switching between the host and the vm many times a minute, every now and then, I unfortunately forget this trick and here we go again... I am considering hosting this vm on Windows7, where I do not seem to have the same problem. Any suggestions would be really appreciated.


Unique lines with unique words

Help me to print unique lines in Linux. Word examples like               A B     B C     C D     A E     F G     H I     I J      the output should be               F G     H I      I.e., the line should be unique at first and the words in the line should also appear only once as in above example “F G” is a unique line and neither “F” or “G” never exists in any other line similarly “H I”.


rc.status equivalent in Redhat

I need to have `rc.status` file in RedHat Linux, to install one software(java app). Is there any way to enable it on RedHat? Or is there an equivalent on RedHat?


How can my server detect IP changes in order to notify my dynamic-DNS provider?

Just set up ubuntu server, which has a dynamic ip. I am looking for a way to keep my dns server updated. Im using entrydns to do this and they provide the following command to update the server.               curl -k -X PUT -d "" https://entrydns.net/records/modify/TOKEN      What I need is a way of checking whether the ip has changed so I can update the dns server.


rsync server/daemon security

I have a NAS (Netgear Readynas NV+) at home and a linux (Arch) box at work that is always on. The linux box is already running an ssh server/daemon and the NAS is already running an rsync server/daemon. The NAS does not support rsync over ssh. The way I understand it is I can either enable port forwarding on my home router to enable my linux box to initiate an rsync with the NAS or I can enable an rsync server on the linux box and allow the NAS to initiate the sync. Since my home router does not have a static ip address, I am leaning towards running an rsync server on the linux box. Is one way more secure than another? Are there major security drawbacks to doing either?


Fedora 17 Performance Issues

I have a Dell Latitude E4310. I have Windows 7 and Fedora installed on it. I rarely use windows and I have been using fedora for a good 9 months now. Recently the performance on my machine degraded considerably. I got a hardware servicing done as well however it continues to worsen each day. What tools can I use to analyze and further resolve the problem? I have ample of disk space > 30 GB unused.


Multiple gcc and linking between them

I'm running centOS 6.3 which comes with gcc 4.4.6 and I installed gcc 4.6.3 using these instructions. But when I type `gcc -v` it still says gcc 4.4 is the version I'm using. The newer version is under /opt/gcc-4.6.3. When I run a `make` command do I have to specify a path to use the newer gcc? If so how do I do this, or can I replace the older version fully with the newer one? Thanks in advance.


gawk with gawkextlib

In my system (Slackware64-14.1) `gawk` is installed in version 4.1.0. I'd like to install gawkextlib to have access to some of its features, namely `xml`. From the `README` file of `gawkextlib-0.4.9`: > To use this library, you must first build the new version of gawk containing > shared extension library support. Please use gawk 4.1 or later, or use this > recipe to build from the git sources: > > git clone git://git.savannah.gnu.org/gawk.git cd gawk   >  ./bootstrap.sh ./configure --prefix=/tmp/newgawk make && make check && make > install > > After you build and install that in /tmp/newgawk, you can then build > gawkextlib like so: > > Using git: git clone git://git.code.sf.net/p/gawkextlib/code gawkextlib cd > gawkextlib ./update-autotools > > Or it may be easier from a tarball if you do not have current autotools > installed: tar xf gawkextlib-.tar.gz cd gawkextlib- > > Either way, the steps to build are the same: ./configure --with- > gawk=/tmp/newgawk --prefix=/tmp/newgawk make && make check && make install The process fails with: > /usr/bin/mkdir -p '/tmp/newgawk/lib/gawk' /bin/sh ../libtool   >  --mode=install ../build-aux/install-sh -c xml.la gd.la mpfr.la > '/tmp/newgawk/lib/gawk' libtool: install: error: cannot install `xml.la' to > a directory not ending in /usr/lib/gawk make[2]: _*_ [install- > pkgextensionLTLIBRARIES] Error 1 This is not a big problem, as I'd really like `gawkextlib` to integrate with existing `gawk` residing in `/usr`. So, when:               $ ./configure --prefix=/usr --with-gawk=/usr     $ make && make test      # make install      Everything installs fine.               # ls /usr/lib/libgawkextlib.*     /usr/lib/libgawkextlib.la  /usr/lib/libgawkextlib.so  /usr/lib/libgawkextlib.so.0  /usr/lib/libgawkextlib.so.0.0.0      but               $ awk -l xml     awk: fatal: can't open shared library `xml' for reading (No such file or directory)      From `gawk` man page: > -l > > --load lib Load a shared library lib. This searches for the library using > the AWKLIBPATH environment variable. If the initial search fails, another > attempt will be made after appending the default shared library suffix for > the platform. The library initialization routine is expected to be named > dl_load(). After setting up `AWKLIBPATH`:               $ export AWKLIBPATH=/usr/lib     $ echo $AWKLIBPATH               /usr/lib     $ awk -l xml     awk: fatal: can't open shared library `xml' for reading (No such file or directory)      `awk` aka `gawk` can't find the shared library. What am I missing here?


Bash parameter expansion - greedy versus non-greedy

It's a bit of a contrived example but here goes: Say I have a variable `1.2.3.4` containing version information and need to replace the `.4` at the end with `.5`               version=1.2.3.4     echo ${version%.*}.5     1.2.3.5    #no problem      But when I attempt to "in-line" the substitution with `/` and a `%` anchor               echo ${version/%.*/.5}     1.5      Bash does a greedy substitution. Is there a way to have bash take the substitution up "non-greedily" so I can use substitution as a replacement for the earlier delete+append approach?


Ubuntu plus whonix

I have a dual boot Ubuntu 12.04 and Windows 7 Professionl 32 bit. Is it possible to install Whonix OS inside of Ubuntu? Or.. LXDE OS inside Ubuntu? Any suggestions are welcome.


Time running a Ruby script is different locally than over SSH

Has anyone else seen this behavior? I created a simple Ruby script for giggles to see how fast it would count up on a couple machines I have. Here's the source:                   for n in 1...1000000 do             puts "#{n}"     end      I ran the script using "time ruby ./rubytest.rb" On my not-newest-generation MacBook, running this locally took about 15 seconds. If I SSH from work to my MacBook and run it over that SSH session (over the Internet), it takes nearly 55 seconds. If I use "ssh localhost" on my MacBook, from the local console, running the script takes about 10 seconds. Questions: Do Ruby scripts somehow get blocked when dumping output to a console, so it is slowed down when pumping data to a remote terminal? Does SSH compress a connection, so that when I SSH'd in locally the script was faster because it was compressing the display of data fast enough that even with the compression overhead the script could run faster because it was somehow acknowledging the output faster?


Linux splitting array into separate variables

I've been programming on MVS for years and recently have been using Linux so my Linux skills are not that great yet but I understand development concepts well. What I'm trying to do is to read a directory of files and take the name of all files with an extension of .trg. Then, I need to take those names and store them in separate variables so I can use them later in my script to refer to components and use them for file naming. I have gotten the file names using the find command:               param=`find *${file_name}*.trg      This produced the $param variable loaded with the values (ABC1099R ABC1099C) as their are two files in the directory named ABC1099R.trg and ABC1099C.trg I now need to assign those values to individual variables so I can use them later in my script. I have searched high and low on the web, but every example I find is using echo to just display them or they are using a do while loop and using the individual values within the loop. I need to have them assigned to their own variables so they are available to me later in the script. Initially I tried a for do loop like this:               for trigger_files in $param; do         app1=(basename "{trigger_files}" .trg).dat     done      But that only gives the first occurrence app1=ABC1099R I need to have all occurrences saved to their own individual variable. There could be potentially 20 filenames, but I figured I just needed to get it working with two, therefore it would be able to handle many.


Installing Linux on UEFI ASUS Machine

I have been having troubles for weeks trying to get Linux Mint on my new computer. It is a ASUS F75V-NS1 with UEFI Bios and Windows 8 install. So far, I was able to get a Linux Mint 64-bit Bootable ISO from USB installed on a partition of my HD. However, when I installed, my wireless was not working. `rfkill list all` would always show my phy0 having a physical block on it. So I thought maybe it was because it was 64-bit and not 32-bit. But when I went to install 32-bit ISO on my USB it says the ISO is not UEFI compatible even tho it is exactly like the 64-bit version. So does UEFI only work with 64-bit images? If so then I don't know what else to try. Thanks


Cannot remove file on NTFS partition, event as root

I have a dual boot system, and use a NTFS partition as universal storage between Windows 7 and Ubuntu. Lately, that partition has been throwing CHKDSK prompts on Windows boot, so I thought it was a symptom of a failing drive. As a result, I cloned the drive to a larger 1TB drive and resized the partitions in Linux. Still, the CHKDSK prompt is showing up, but this time there were a few filenames printed out in the scan, which later froze at 50% completion. These files are a set of Perl scripts that I used to create an automated panorama generation script a few years back. Now, when I try to `rm -r *` in the folder where the files are held, I get               jason@asus:/media/Storage/Programming/Libraries/Linux$ rm -r *     rm: cannot remove `Image-Size-3.232/blib/man3/Image::Size.3pm': No such file or directory     rm: cannot remove `Panotools-Script-0.26/blib/man3/Panotools::Makefile.3pm': No such file or directory     rm: cannot remove `Panotools-Script-0.26/blib/man3/Panotools::Makefile::Comment.3pm': No such file or directory     rm: cannot remove `Panotools-Script-0.26/blib/man3/Panotools::Makefile::Rule.3pm': No such file or directory     rm: cannot remove `Panotools-Script-0.26/blib/man3/Panotools::Makefile::Utils.3pm': No such file or directory     ...     ...      Now, inside `Image-Size-3.232/blib/man3/`, I executed `ls -il` which printed out               3723 -rwxrwxrwx 0 root root 25473 Jun 19  2012 Image::Size.3pm      Now, `stat 3723` prints out               jason@asus:/media/Storage/Programming/Libraries/Linux/Image-Size-3.232/blib/man3$ stat 3723     stat: cannot stat `3723': No such file or directory      How can I remove these files that have so far proven fireproof to any convential removal function?


How exactly is tzdata database used?

Different operating systems seem to handle daylight-saving time(DST) differently. I really like the Cisco IOS approach which is very simple and allows one to change the date and time when DST starts and ends. For example:               clock summer-time EDT recurring 2 Sun Mar 2:00 1 Sun Nov 2:00 60      ..sets clock 60 minutes ahead on the Sunday of second week of March at 2:00 and shifts clock 60 minutes back on first Sunday on November at 2:00. How Linux handles DST? I know that there is a `tzdata` package which contains timezone data files and those files are installed to `/usr/share/zoneinfo/` directory. How and by which utilities are those files used? I can see the the shift from UTC(2) and time-zone names(EET and EEST) in file:               T60:~# strings /usr/share/zoneinfo/posix/Europe/Helsinki     TZif2         HMT     EEST     TZif2     EEST     EET-2EEST,M3.5.0/3,M10.5.0/4     T60:~#       In addition, `M3` is probably third month and `M10` is a tenth month? In addition, offset should be also specified somewhere. For example in IOS one can configure that once the DST happens, the clock shifts for example 90 or 120 minutes instead of 60.


Ubuntu 12.04 LTS doesn't auto-mount DVD drive

For some reason, my Ubuntu has ceased to auto-mount DVD media. I can do manually               sudo mount /dev/dvdrw /mnt/dvdrw      and mounting happens fine and I can access the media. But it doesn't do it automatically though. I have no idea when this started to happen because it's been quite long since I used that device last time.


Building example device driver error: insmod invalid module format

I am following the tutorial @ http://www.embeddedsystemonline.com/home/embedded- system/embedded_linux/lab3-linux-device-driver on step #7 of this tutorial,               $ cd /usr/src/kernels/linux-2.6.20.1/drivers/char/examples     $ /sbin/insmod hello1.ko      I then receive the following error (after `sudo /sbin/insmod hello1.ko`)               insmod: error inserting 'hello1.ko': -1 Invalid module format      Using the lsmod command, I do not see the module in the kernel


will tinycore work with S110 wireless adapter?

will tinycore work out of the box with S110 lenovo netbook? Wireless is obviously the first issue to be encountered? can anybody report that it will work out ofthe box? or i will have to spend some time on it?


On Red Hat Enterprise Linux 6.2 how can I use Python 2.7 as default not Python 2.6? I did but still showing 2.6?

RHEL 6.2 I have python 2.6 but I need default python 2.7 using `yum` packaging (so that nothing goes messed up, cause its a heavy duty working system, all I need the python 2.7 on it, without messing up). I did following but still I see `python` version as 2.6, any pointer to this please?               $ cat /etc/issue     Red Hat Enterprise Linux Server release 6.2 (Santiago)     Kernel \r on an \m          $ python --version     Python 2.6.6          $ sudo sh -c 'wget -qO- http://people.redhat.com/bkabrda/scl_python27.repo >> /etc/yum.repos.d/scl.repo'          $ yum search python27     Loaded plugins: amazon-id, rhui-lb, security     scl_python27                                                                                | 2.9 kB     00:00          scl_python27/primary_db                                                                                |  38 kB     00:00          ========================================================================= N/S Matched: python27 =========================================================================     python27.i686 : Package that installs python27     python27.x86_64 : Package that installs python27     python27-expat-debuginfo.i686 : Debug information for package python27-expat     python27-expat-debuginfo.x86_64 : Debug information for package python27-expat     python27-python-coverage-debuginfo.i686 : Debug information for package python27-python-coverage     python27-python-coverage-debuginfo.x86_64 : Debug information for package python27-python-coverage     python27-python-debuginfo.i686 : Debug information for package python27-python     python27-python-debuginfo.x86_64 : Debug information for package python27-python     python27-python-markupsafe-debuginfo.i686 : Debug information for package python27-python-markupsafe     python27-python-markupsafe-debuginfo.x86_64 : Debug information for package python27-python-markupsafe     python27-python-simplejson-debuginfo.i686 : Debug information for package python27-python-simplejson     python27-python-simplejson-debuginfo.x86_64 : Debug information for package python27-python-simplejson     python27-python-sqlalchemy-debuginfo.i686 : Debug information for package python27-python-sqlalchemy     python27-python-sqlalchemy-debuginfo.x86_64 : Debug information for package python27-python-sqlalchemy     python27-runtime.i686 : Package that handles python27 Software Collection.     python27-runtime.x86_64 : Package that handles python27 Software Collection.     python27-babel.noarch : Tools for internationalizing Python applications     python27-build.i686 : Package shipping basic build configuration     python27-build.x86_64 : Package shipping basic build configuration     python27-expat.i686 : An XML parser library     python27-expat.x86_64 : An XML parser library     python27-expat-devel.i686 : Libraries and header files to develop applications using expat     python27-expat-devel.x86_64 : Libraries and header files to develop applications using expat     python27-expat-static.i686 : expat XML parser static library     python27-expat-static.x86_64 : expat XML parser static library     python27-python.i686 : An interpreted, interactive, object-oriented programming language     python27-python.x86_64 : An interpreted, interactive, object-oriented programming language     python27-python-babel.noarch : Library for internationalizing Python applications     python27-python-coverage.i686 : Code coverage testing module for Python     python27-python-coverage.x86_64 : Code coverage testing module for Python     python27-python-debug.i686 : Debug version of the Python runtime     python27-python-debug.x86_64 : Debug version of the Python runtime     python27-python-devel.i686 : The libraries and header files needed for Python development     python27-python-devel.x86_64 : The libraries and header files needed for Python development     python27-python-docutils.noarch : System for processing plaintext documentation     python27-python-jinja2.noarch : General purpose template engine     python27-python-libs.i686 : Runtime libraries for Python     python27-python-libs.x86_64 : Runtime libraries for Python     python27-python-markupsafe.i686 : Implements a XML/HTML/XHTML Markup safe string for Python     python27-python-markupsafe.x86_64 : Implements a XML/HTML/XHTML Markup safe string for Python     python27-python-nose.noarch : Discovery-based unittest extension for Python     python27-python-nose-docs.noarch : Nose Documentation     python27-python-pygments.noarch : Syntax highlighting engine written in Python     python27-python-setuptools.noarch : Easily build and distribute Python packages     python27-python-simplejson.i686 : Simple, fast, extensible JSON encoder/decoder for Python     python27-python-simplejson.x86_64 : Simple, fast, extensible JSON encoder/decoder for Python     python27-python-sphinx.noarch : Python documentation generator     python27-python-sphinx-doc.noarch : Documentation for python-sphinx     python27-python-sqlalchemy.i686 : Modular and flexible ORM library for python     python27-python-sqlalchemy.x86_64 : Modular and flexible ORM library for python     python27-python-test.i686 : The test modules from the main python package     python27-python-test.x86_64 : The test modules from the main python package     python27-python-tools.i686 : A collection of development tools included with Python     python27-python-tools.x86_64 : A collection of development tools included with Python     python27-python-virtualenv.noarch : Tool to create isolated Python environments     python27-python-werkzeug.noarch : The Swiss Army knife of Python web development     python27-python-werkzeug-doc.noarch : Documentation for python-werkzeug     python27-tkinter.i686 : A graphical user interface for the Python scripting language     python27-tkinter.x86_64 : A graphical user interface for the Python scripting language      **EDIT:** (alternative option I also tried as following):               #!/bin/bash     # Install Python 2.7.3 alternatively     yum groupinstall "development tools" -y     yum install readline-devel openssl-devel gmp-devel ncurses-devel gdbm-devel zlib-devel expat-devel libGL-devel tk tix gcc-c++ libX11-devel glibc-devel bzip2 tar tcl-devel tk-devel pkgconfig tix-devel bzip2-devel sqlite-devel autoconf db4-devel libffi-devel valgrind-devel -y          mkdir tmp     cd tmp     wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tgz     tar xvfz Python-2.7.3.tgz     cd Python-2.7.3     ./configure --prefix=/opt/python2.7 --enable-shared     make     make altinstall     echo "/opt/python2.7/lib" >> /etc/ld.so.conf.d/opt-python2.7.conf     ldconfig     cd ..     cd ..     rm -rf tmp               [root@ip-10-59-143-73 bin]# pwd     /opt/python2.7/bin     [root@ip-10-59-143-73 bin]# tree     .     ├── 2to3     ├── idle     ├── pydoc     ├── python2.7     ├── python2.7-config     └── smtpd.py          0 directories, 6 files     [root@ip-10-59-143-73 bin]# ./python2.7 --version     Python 2.7.3          [root@ip-10-59-143-73 bin]# python --version     Python 2.6.6


How do I keep my display output from toggling by itself?

It happens with a Vostro 3550, Debian, Gnome and Philips 1080p television. As soon as I connect the HDMI it starts doing it and goes from mirror to just the laptop display to just the TV to conjugated at intervals of 15 seconds to 5 minutes. The Fn F1 command and the display tab change it only for it to continue happenning. I should also mention that the TV shifts from 1080p and a more contrasted image with less quality throughout this toggling. xrandr               >Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192     LVDS1 connected (normal left inverted right x axis y axis)        1366x768       60.0 +   40.1          1360x768       59.8     60.0          1024x768       60.0          800x600        60.3     56.2          640x480        59.9       VGA1 disconnected (normal left inverted right x axis y axis)     HDMI1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 640mm x 360mm        1920x1080      60.0*+   50.0     30.0     25.0     30.0     25.0     24.0          1280x1024      60.0          1360x768       59.8          1280x720       60.0     50.0          1440x576       25.0          1024x768       60.0          1440x480       30.0          800x600        60.3          720x576        50.0          720x480        59.9          640x480        60.0     59.9       DP1 disconnected (normal left inverted right x axis y axis)      after               xrandr --output LVDS1 --mode 1360x768 --output HDMI1 --same-as LVDS1          Screen 0: minimum 320 x 200, current 1360 x 768, maximum 8192 x 8192     LVDS1 connected 1360x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm        1366x768       60.0 +   40.1          1360x768       59.8*    60.0          1024x768       60.0          800x600        60.3     56.2          640x480        59.9       VGA1 disconnected (normal left inverted right x axis y axis)     HDMI1 connected 1360x768+0+0 (normal left inverted right x axis y axis) 640mm x 360mm        1920x1080      60.0 +   50.0     30.0     25.0     30.0     25.0     24.0          1280x1024      60.0          1360x768       59.8*         1280x720       60.0     50.0          1440x576       25.0          1024x768       60.0          1440x480       30.0          800x600        60.3          720x576        50.0          720x480        59.9          640x480        60.0     59.9       DP1 disconnected (normal left inverted right x axis y axis)      I tried stopping `udev` in case that was causing the toggling:               root@mach:/home/rt# sudo service udev stop     [ ok ] Stopping the hotplug events dispatcher: udevd.          root@mach:/home/rt# xrandr     Screen 0: minimum 320 x 200, current 3286 x 1080, maximum 8192 x 8192     LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm        1366x768       60.0*+   40.1          1360x768       59.8     60.0          1024x768       60.0          800x600        60.3     56.2          640x480        59.9       VGA1 disconnected (normal left inverted right x axis y axis)     HDMI1 connected 1920x1080+1366+0 (normal left inverted right x axis y axis) 640mm x 360mm        1920x1080      60.0*+   50.0     30.0     25.0     30.0     25.0     24.0          1280x1024      60.0          1360x768       59.8          1280x720       60.0     50.0          1440x576       25.0          1024x768       60.0          1440x480       30.0          800x600        60.3          720x576        50.0          720x480        59.9          640x480        60.0     59.9       DP1 disconnected (normal left inverted right x axis y axis)


console-kit-daemon Hogging CPU and RAM

We have a system that's been a bit sluggish. `top` reports that console-kit- daemon takes anywhere from 18-30% CPU and about 50% memory. There are only two users logged in, one on X and one via ssh. Any ideas how to resolve this? Running Debian. `uname` reports: Linux bulls5 2.6.32-5-686 #1 SMP Sun Sep 23 09:49:36 UTC 2012 i686 GNU/Linux First few lines of `top`:                9456 root      20   0 2006m 1.8g 2020 S   19 50.2   1788:50 console-kit-dae        1501 messageb  20   0  425m 397m  796 S    0 10.6 230:20.64 dbus-daemon        3799 tomcat6   20   0  932m 450m 7208 S    0 12.0 106:36.35 java      24383 postgres  20   0 48312 7956 5640 S    0  0.2   0:00.44 postgres      27239 root      20   0  8672 3092 2544 S    0  0.1   0:00.01 sshd      27304 root      20   0  8672 3092 2544 S    0  0.1   0:00.01 sshd


Best way to handle lots of mail on server?

Due to some bad cron jobs I now have ~1600 mail messages, most of them containing the same error log. I would like to quickly group them by subject and delete them, while limiting the chances of missing some important message. I couldn't figure out a way to do anything using the `mail` command other than deleting each message individually. I tried installing `pine`, but it seems that even there I have to go over each message individually and hit the D key. Surely there's a way to script this. Right? I'm using ubuntu server 10.04.


Running a statically linked binary with a different glibc

I have a statically linked binary for a tool that I'm trying to run on RHLE4. The tool complains about glibc. It needs 2.4 and the one in the system is 2.3. Here is the message that it spits out:               ./wkhtmltoimage-i386: /lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by ./wkhtmltoimage-i386)      Is there a way to build glibc2.4 and use it just for this tool, without replacing the glibc2.3 in the system ? While building glibc2.4 what prefix should I use for configure ?


Why are the fonts all screwy for remote X11 apps on one Mac client?

I have two Mac OS X clients, both running XQuartz 2.1.6 (xorg-server 1.4.2-apple33). When I SSH into a remote linux system enabling X11 forwarding and launch gnome-terminal, on one Mac the terminal looks correct while on the other, the fonts are all screwy! `[jnet@Stan ~]$ ssh -X jnet@kyle.local gnome-terminal` produces: ![Lookin good!](http://i.stack.imgur.com/VLxc5.png) `powerbook:~ hp$ ssh -X jnet@kyle.local gnome-terminal` produces: ![OH MY GOD, MY EYES!!!!!](http://i.stack.imgur.com/0EosJ.png) The problem goes away on the powerbook if I zoom in twice: ![Looks OK only because the image is scaled down to fit](http://i.stack.imgur.com/ppQkx.png) **Edit:** This affects a number of apps, not just gnome-terminal. It also affects Thunderbird, for example.


Sort data in descending order of first column, for equal values, use second column in ascending order

Allow me to clarify: Assume I have some keywords with frequency of their usage:               12 Hi     7  Hash     7  C++       9  Superuser     17 Stackoverflow     9  LaTeX       42 Life     9  Ubuntu      What I want, is to sort this data based on frequency in descending order and if there are some equal values, it should use the second column in ascending order.               sort -n -r foo.txt      Does the first part but then second column are also `reversed`:               42 Life     17 Stackoverflow     12 Hi     9  Ubuntu     9  Superuser     9  LaTeX       7  Hash     7  C++      How can I achieve the following results?               42 Life     17 Stackoverflow     12 Hi     9  LaTeX       9  Superuser     9  Ubuntu     7  C++      7  Hash      I think I have to use `-k` argument but I can't figure out how! I want to know how this can be done using solely `sort` command of `bash`. However if it's not possible to achieve this only by `sort`, other commands should be Bourne shell compatible.


How does Ubuntu lock my Live USB?

I notice that, after booting from my Live USB (with Ubuntu inside) and shutdown, I won't be able to boot it again, unless I unplug the USB and plug it in again. Is this a side-effect of something, or is it intentional? I wonder what mechanism is used to do this?


I need to swap displays in Gnome 3 login screen

I use two monitors with Debian Jessie and Gnome 3. Everything works fine, but there is one cosmetic bug. However a bit annoying. I cannot figure out, how to swap the displays on Gnome login screen. I have the left side on right and the right one on left. I'm googling whole day, but nothing found...


Can't apply brightness to terminal's background color

I have a problem with colors in my terminal emulator. I am using `LXTerminal` as my terminal emulator and `LXDE` as my desktop environment. The following command is supposed to print red text on grey background:               printf "\n\033[1;31;40m"hello"\033[00m\n\n"      but that does not work. The grey background is missing (red text is OK). On my older machine (`Gnome/Gnome Terminal`) everything works fine I have tried installing several other terminal emulators, but the problem persists. I am not even sure whether this issue is related to terminal emulator, or something else. In Console (CTRL+ALT+F1) the background grey color does not work on either machine) This problem is limited to grey background only. All other colors work OK, for instance the following prints red text on green background.               printf "\n\033[1;31;42m"hello"\033[00m\n\n"      I would appreciate any help. I don't even know where to start troubleshooting.


Why is bluetooth-agent getting stuck on authorizing?

I am trying to manually connect between my laptop and phone. I have `bluez- utils` version `4.98-2ubuntu7` installed. When I run the agent on the terminal, I get:               asheesh@U32U:~$ sudo bluetooth-agent 4835     Pincode request for device /org/bluez/980/hci0/dev<id>     Authorizing request for /org/bluez/980/hci0/dev<id>      The pincode request line gets printed when I try to pair from my phone. After I enter the passkey on being prompted, the device gets authorized. I can now send files to the laptop from my phone. However, the application gets stuck after authorizing request and control is not passed back to the terminal. Why is this happening? How do I get back control? _This seems to be contrary to examples I have seen across the internet, where the terminal becomes available after authorization to run further commands._ ~~I realise that running it in the background is a possible solution, but since I need to run certain other tasks once pairing is completed, I would prefer to have it run in the foreground.~~ I tried using this:               bluetooth-agent "$PIN" 1> ./bluelog #Background run tested also      However, the process does not write its output to file till it completes (or is killed), so I cannot test the output in `bluelog`. Is there a way to force the process to write output before completion?


Appending text to end of a textfile

How can I append a new line to a text file followed by current date and time?


How to set up ssh server with VPN tunnel? (Policy routing for sshd service)

It's difficult to me to explain in words, so I made diagrams. In short, I want this to work: ![The Goal](http://i.stack.imgur.com/etGkh.png)   Basically I want to be able to connect from my laptop [A] to my desktop [B] via ssh, and run terminal program over OpenVPN connection, let's say IRC client for example. So far I have working sshd, OpenVPN tunnel, and port forwarding on my router, but seems like port is closed (or not being forwarded), I get connection timeout. ~~I also tried without VPN and that failed as well~~. > Edit:   >  When [B] runs without OpenVPN it accepts connections to External IP, when > it runs with OpenVPN it doesn't. I have no idea what is wrong. * * * Strangely (for me) this is working ok: ![enter image description here](http://i.stack.imgur.com/eRl4H.png) I can connect from [A] to [B] `[A]$ ssh [B].local_IP`,   and connect from [B](over VPN) to [B](WAN IP) `[B]$ ssh [B].WAN_IP`.   I hope this makes sense. In this configuration port forwarding seems to work, also sshd working locally; in previous configuration port forwarding is not working(?). * * * I thought it should be easy, but it's not. Searching google is futile. ~~My router is Belkin F5D8636-4 v1 (01), potential candidate for causing trouble, but I would rather exclude every other possibility before buying new one.~~ > Edit 2):   >  I stumbled upon this post, but the answer doesn't work for me. After > fiddling with policy routing I had some success, however it created some > other problems, and I learned I have no comprehension of routing tables :(   > I believe however, the solution is in policy routing. **Any advice appreciated.**


Why does my CMS run extremely slow in my workstation (Ubuntu)

For over a year I have been struggling with the response speed on my Drupal v7.2x CMS install. Let me explain. I'm running Drupal 7.2x on an Ubuntu 12.10 (upgrade to 13.xx pending) for the purpose of webdev projects for pure Drupal CMS (though Symfony may follow also later). I have never installed Xammp or any similar web services preferring to run on localhost with the LAMP (Apache etc) included with the Ubuntu install. It is becoming impossible to make even the smallest changes as the whole process seems to take the best part of 1-3 mins to write to the CMS and though I have persevered, it's become a serious pain! I have asked similar on other stack exchanges I'm on with no real answer given (other than get a faster machine! It's the second one and it's a good spec machine..running PURELY Ubuntu and is not shared with any other OS). I have done all the normal things, cache clearings, reduction on logs and turned on/off every possible option 'button' in the backend of Drupal config. I want to stay with the Drupal framework. The machine is my primary home workstation which I use for the normal 'everyday' things; browsing web, WebDev, Office etc and I installed the Ubuntu desktop. To this some have said I should really go for a 'server' box, others has said that it could be I need something like Nginx; some have said it could be a DNS issue, which I have not implemented for fear of 'ballsing' up my current projects LOL, but the speed of re-writes takes ages and I really need some quality advice on what is happening behind the Linux scenes and how I can overcome these problems. I would prefer to stay with one single desktop workstation box as this helps my everyday working and simplifies my uploads to any future live sites to my webspace provider. MAY I ALSO ADD: that whilst the page load/write is taking place during this slow period there is a significant amount of HD activity* as if data is being accessed, unlike a normal write (*of course this happens as part of data access, but not as massive as it happens here!) :-) Edit (amend from my Comments): The computer is an AMD X2 (3.2Ghz) 260; 16G Ram, Gigabyte (GA-MA68MT-D3P) Mobo, 3*500Gig HDs. 2*20" LCDs. I'll see if I can view System output. I'm using mySQL (see below) but whilst I'm open to learning, I'm a bit wet across all areas (-: Server:Localhost via UNIX socket Server version: 5.5.32-0ubuntu0.12.10.1 Protocol version: 10 User: paulb@localhost MySQL charset: UTF-8 Unicode (utf8) Web server Apache/2.2.22 (Ubuntu) MySQL client version: 5.5.32 PHP extension: mysqli Documentation May I add, that there are periods where it seems to post what I would say is acceptable in speed response, if I do a 'refresh' page (whether in Chrome or Firefox) it will take a perceived 200-300ms, then maybe some time later a mind boggling 1.5 mins. You can imagine trying to make multiple edits to a View setup, or Config change, I'm sitting here wondering if I should go make (another!) brew LOL Just realised what I thought 'TOP' would be so I opened TERM and entered 'TOP'! If If put TERM in one LCD, and Firefox in other and 'reload' Firefox Drupal page I see activity in TERM, not sure to output it at the moment mind.


How to move files between servers with PubKey authentication?

I have two servers and for both I'm using PubKey authentication only. Can I somehow scp files between them (with private key being only on my local machine?) ? Can I somehow use my private key for authenticating login from another machine?


Configure Centos 6.3 to direct all traffic through a proxy server

Is there a way to configure CentOS 6.3 to direct all internet traffic through a proxy server? Forgive me if this is a really dumb question, I know very little about how proxy servers work and how traffic is directed through them. I am basing this question off using the HideMyAss on my windows desktop. After downloading their program, they were able to direct all of my web traffic through their proxy servers no matter which web browser I was using.


"no such file or directory" message when deleting a file that exists on NTFS

I have a directory with images. Suddenly I found out that there's a new image with a new name. The image content is similar to another image in another directory but with a different name. I didn't copy this image to this directory. Also a directory with the same name as the image suddenly appeared there. I didn't create any of them. When I tried to delete them I got this message "No such file or directory" even though it already existed there. I used the command `sudo rm -rf imagename.jpg` to delete it but it didn't work. Can anyone explain why this is happening and how to solve it? The output of `ls -l "large (2).jpg"`:               -rw------- 1 alaa alaa 2859942 Jun  8 04:01 large (2).jpg      The output of `rm "large (2).jpg"`:               rm: cannot remove ‘large (2).jpg’: No such file or directory      The output of `printf %s\\\0\\\n ./large* | sed -n l`               ./large (20).jpg\000$     ./large (26).jpg\000$     ./large (2).jpg\000$     ./large (5).jpg\000$      The filesystem is NTFS.


cannot 'ls' /mnt directory

I have a CentOS-6 machine that I'm working on that is running a live database. It's having a problem with the `/mnt` directory. I cannot `ls` the directory for some reason. `stat` is working and shows this output:                 File: `/mnt/'       Size: 4096        Blocks: 8          IO Block: 4096   directory     Device: ca02h/51714d    Inode: 16321       Links: 9     Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)     Access: 2011-09-23 06:50:20.000000000 -0500     Modify: 2012-10-29 11:46:33.000000000 -0500     Change: 2012-10-29 11:46:33.000000000 -0500      I can also `cd` into the directory and issue both the `touch` and `mkdir` commands successfully (or at least without errors. However, if I try to run `ls` in the directory it just hangs. At that point neither `Ctrl`+`C` nor `Ctrl`+`Z` have any effect and my system locks up. I have to close my ssh window and reconnect to do anything else. I'm at a bit of a loss here, does anyone have any ideas what might be causing this? Or, does anyone know how I can try to fix it, without rebooting the machine (I've encountered this once before on the same directory on a different machine and it was corrected by rebooting) since this is a live machine, I can't actually reboot. These are the filesystems which are mounted in that directory:               blob.XXXXX.com:/blend on /mnt/blend type fuse.glusterfs (rw,allow_other,default_permissions,max_read=131072)     blob.XXXXX.com:/new_log on /mnt/new_log type fuse.glusterfs (rw,allow_other,default_permissions,max_read=131072)     blob.XXXXX.com:/new_backup on /mnt/new_backup type fuse.glusterfs (rw,allow_other,default_permissions,max_read=131072)     blob.XXXXX.com:/vz on /mnt/vz type fuse.glusterfs (rw,allow_other,default_permissions,max_read=131072)     blob.XXXXX.com:/git on /mnt/git type fuse.glusterfs (rw,allow_other,default_permissions,max_read=131072)      Interestingly enough, the output of `strace ls /mnt` shows the mount directories in there.


Running rsync as a daemon for a local transfer

My coworker is trying to talk me into running rsync as a daemon on my EM server. I'm currently using rsync to copy a NFS share on my storage cluster to USB external drives so the data can be reviewed else where. The NFS share can get up to 200GBs+ in size. My coworker thinks that running rsync as a daemon on the system would improve performance, but it's my understanding that you run rsync as a daemon when you are doing remote transfers(a client/server relationship). Would running rysnc as a daemon improve performance when its a local transfer?


Why am I getting so many hits searching for "git" in the aptitude cache?

When I give the following command:                apt-cache search git | wc -l      I get the answer 756. How can I list just the half-dozen or so apps associated with git?