title: How to get the maximum info for a USB drive by looking at the debugfs output?

text: I inserted an usb into my Fedora 11 PC.   Gave a `mount` command and the output was as shown below:               /dev/sdc1 on /media/8d079aad-038c-4667-9186-e21bed0928d5 type ext2 (rw,nosuid,nodev,uhelper=devkit)        Now i gave `debugfs /dev/sdc1` and the output is as shown below:               [root@Android04 Android-STB-Source]# debugfs /dev/sdc1     debugfs 1.41.4 (27-Jan-2009)     debugfs:  stats     Filesystem volume name:   <none>     Last mounted on:          <not available>     Filesystem UUID:          8d079aad-038c-4667-9186-e21bed0928d5     Filesystem magic number:  0xEF53     Filesystem revision #:    1 (dynamic)     Filesystem features:      ext_attr resize_inode dir_index filetype sparse_super large_file     Filesystem flags:         signed_directory_hash      Default mount options:    (none)     Filesystem state:         not clean     Errors behavior:          Continue     Filesystem OS type:       Linux     Inode count:              981120     Block count:              3921916     Reserved block count:     196095     Free blocks:              3847778     Free inodes:              981101     First block:              0     Block size:               4096     Fragment size:            4096     Reserved GDT blocks:      957     Blocks per group:         32768     Fragments per group:      32768     Inodes per group:         8176     Inode blocks per group:   511     Filesystem created:       Thu Jan  6 19:14:41 2011     Last mount time:          Thu Jan  6 19:58:09 2011     Last write time:          Tue Jan 11 16:36:05 2011     Mount count:              10     Maximum mount count:      22     Last checked:             Thu Jan  6 19:14:41 2011     Check interval:           15552000 (6 months)     Next check after:         Tue Jul  5 19:14:41 2011     Reserved blocks uid:      0 (user root)     Reserved blocks gid:      0 (group root)     First inode:              11     Inode size:           256     Required extra isize:     28     Desired extra isize:      28     Default directory hash:   half_md4     Directory Hash Seed:      df25de9d-4b30-4408-ab43-66f3176c4469     Directories:              4      Group  0: block bitmap at 959, inode bitmap at 960, inode table at 961                31290 free blocks, 8165 free inodes, 2 used directories      Group  1: block bitmap at 33727, inode bitmap at 33728, inode table at 33729                31296 free blocks, 8176 free inodes, 0 used directories      Group  2: block bitmap at 65536, inode bitmap at 65537, inode table at 65538                32255 free blocks, 8176 free inodes, 0 used directories      Group  3: block bitmap at 99263, inode bitmap at 99264, inode table at 99265                31296 free blocks, 8176 free inodes, 0 used directories      Group  4: block bitmap at 131072, inode bitmap at 131073, inode table at 131074                32255 free blocks, 8176 free inodes, 0 used directories      Group  5: block bitmap at 164799, inode bitmap at 164800, inode table at 164801                31296 free blocks, 8176 free inodes, 0 used directories      Group  6: block bitmap at 196608, inode bitmap at 196609, inode table at 196610                32255 free blocks, 8176 free inodes, 0 used directories      Group  7: block bitmap at 230335, inode bitmap at 230336, inode table at 230337                31296 free blocks, 8176 free inodes, 0 used directories      Group  8: block bitmap at 262144, inode bitmap at 262145, inode table at 262146                32255 free blocks, 8176 free inodes, 0 used directories      Group  9: block bitmap at 295871, inode bitmap at 295872, inode table at 295873                31296 free blocks, 8176 free inodes, 0 used directories      Group 10: block bitmap at 327680, inode bitmap at 327681, inode table at 327682                29321 free blocks, 8173 free inodes, 1 used directory      Group 11: block bitmap at 360448, inode bitmap at 360449, inode table at 360450                32207 free blocks, 8171 free inodes, 1 used directory      Group 12: block bitmap at 393216, inode bitmap at 393217, inode table at 393218                32255 free blocks, 8176 free inodes, 0 used directories      Group 13: block bitmap at 425984, inode bitmap at 425985, inode table at 425986                32255 free blocks, 8176 free inodes, 0 used directories      Group 14: block bitmap at 458752, inode bitmap at 458753, inode table at 458754                32255 free blocks, 8176 free inodes, 0 used directories      Group 15: block bitmap at 491520, inode bitmap at 491521, inode table at 491522                32255 free blocks, 8176 free inodes, 0 used directories      Group 16: block bitmap at 524288, inode bitmap at 524289, inode table at 524290                32255 free blocks, 8176 free inodes, 0 used directories      Group 17: block bitmap at 557056, inode bitmap at 557057, inode table at 557058                32255 free blocks, 8176 free inodes, 0 used directories      Group 18: block bitmap at 589824, inode bitmap at 589825, inode table at 589826                32255 free blocks, 8176 free inodes, 0 used directories      Group 19: block bitmap at 622592, inode bitmap at 622593, inode table at 622594                32255 free blocks, 8176 free inodes, 0 used directories      Group 20: block bitmap at 655360, inode bitmap at 655361, inode table at 655362                32255 free blocks, 8176 free inodes, 0 used directories      Group 21: block bitmap at 688128, inode bitmap at 688129, inode table at 688130                32255 free blocks, 8176 free inodes, 0 used directories      Group 22: block bitmap at 720896, inode bitmap at 720897, inode table at 720898                32255 free blocks, 8176 free inodes, 0 used directories      Group 23: block bitmap at 753664, inode bitmap at 753665, inode table at 753666                32255 free blocks, 8176 free inodes, 0 used directories      Group 24: block bitmap at 786432, inode bitmap at 786433, inode table at 786434                32255 free blocks, 8176 free inodes, 0 used directories      Group 25: block bitmap at 820159, inode bitmap at 820160, inode table at 820161                31296 free blocks, 8176 free inodes, 0 used directories      Group 26: block bitmap at 851968, inode bitmap at 851969, inode table at 851970                32255 free blocks, 8176 free inodes, 0 used directories      Group 27: block bitmap at 885695, inode bitmap at 885696, inode table at 885697                31296 free blocks, 8176 free inodes, 0 used directories      Group 28: block bitmap at 917504, inode bitmap at 917505, inode table at 917506                32255 free blocks, 8176 free inodes, 0 used directories      Group 29: block bitmap at 950272, inode bitmap at 950273, inode table at 950274                32255 free blocks, 8176 free inodes, 0 used directories      Group 30: block bitmap at 983040, inode bitmap at 983041, inode table at 983042                32255 free blocks, 8176 free inodes, 0 used directories      Group 31: block bitmap at 1015808, inode bitmap at 1015809, inode table at 1015810                32255 free blocks, 8176 free inodes, 0 used directories      Group 32: block bitmap at 1048576, inode bitmap at 1048577, inode table at 1048578                32255 free blocks, 8176 free inodes, 0 used directories      Group 33: block bitmap at 1081344, inode bitmap at 1081345, inode table at 1081346                32255 free blocks, 8176 free inodes, 0 used directories      Group 34: block bitmap at 1114112, inode bitmap at 1114113, inode table at 1114114                32255 free blocks, 8176 free inodes, 0 used directories      Group 35: block bitmap at 1146880, inode bitmap at 1146881, inode table at 1146882                32255 free blocks, 8176 free inodes, 0 used directories      Group 36: block bitmap at 1179648, inode bitmap at 1179649, inode table at 1179650                32255 free blocks, 8176 free inodes, 0 used directories      Group 37: block bitmap at 1212416, inode bitmap at 1212417, inode table at 1212418                32255 free blocks, 8176 free inodes, 0 used directories      Group 38: block bitmap at 1245184, inode bitmap at 1245185, inode table at 1245186                32255 free blocks, 8176 free inodes, 0 used directories      Group 39: block bitmap at 1277952, inode bitmap at 1277953, inode table at 1277954                32255 free blocks, 8176 free inodes, 0 used directories      Group 40: block bitmap at 1310720, inode bitmap at 1310721, inode table at 1310722                32255 free blocks, 8176 free inodes, 0 used directories      Group 41: block bitmap at 1343488, inode bitmap at 1343489, inode table at 1343490                32255 free blocks, 8176 free inodes, 0 used directories      Group 42: block bitmap at 1376256, inode bitmap at 1376257, inode table at 1376258                32255 free blocks, 8176 free inodes, 0 used directories      Group 43: block bitmap at 1409024, inode bitmap at 1409025, inode table at 1409026                32255 free blocks, 8176 free inodes, 0 used directories      Group 44: block bitmap at 1441792, inode bitmap at 1441793, inode table at 1441794                32255 free blocks, 8176 free inodes, 0 used directories      Group 45: block bitmap at 1474560, inode bitmap at 1474561, inode table at 1474562                32255 free blocks, 8176 free inodes, 0 used directories      Group 46: block bitmap at 1507328, inode bitmap at 1507329, inode table at 1507330                32255 free blocks, 8176 free inodes, 0 used directories      Group 47: block bitmap at 1540096, inode bitmap at 1540097, inode table at 1540098                32255 free blocks, 8176 free inodes, 0 used directories      Group 48: block bitmap at 1572864, inode bitmap at 1572865, inode table at 1572866                32255 free blocks, 8176 free inodes, 0 used directories      Group 49: block bitmap at 1606591, inode bitmap at 1606592, inode table at 1606593                31296 free blocks, 8176 free inodes, 0 used directories      Group 50: block bitmap at 1638400, inode bitmap at 1638401, inode table at 1638402                32255 free blocks, 8176 free inodes, 0 used directories      Group 51: block bitmap at 1671168, inode bitmap at 1671169, inode table at 1671170                32255 free blocks, 8176 free inodes, 0 used directories      Group 52: block bitmap at 1703936, inode bitmap at 1703937, inode table at 1703938                32255 free blocks, 8176 free inodes, 0 used directories      Group 53: block bitmap at 1736704, inode bitmap at 1736705, inode table at 1736706                32255 free blocks, 8176 free inodes, 0 used directories      Group 54: block bitmap at 1769472, inode bitmap at 1769473, inode table at 1769474                32255 free blocks, 8176 free inodes, 0 used directories      Group 55: block bitmap at 1802240, inode bitmap at 1802241, inode table at 1802242                32255 free blocks, 8176 free inodes, 0 used directories      Group 56: block bitmap at 1835008, inode bitmap at 1835009, inode table at 1835010                32255 free blocks, 8176 free inodes, 0 used directories      Group 57: block bitmap at 1867776, inode bitmap at 1867777, inode table at 1867778                32255 free blocks, 8176 free inodes, 0 used directories      Group 58: block bitmap at 1900544, inode bitmap at 1900545, inode table at 1900546                32255 free blocks, 8176 free inodes, 0 used directories      Group 59: block bitmap at 1933312, inode bitmap at 1933313, inode table at 1933314                32255 free blocks, 8176 free inodes, 0 used directories      Group 60: block bitmap at 1966080, inode bitmap at 1966081, inode table at 1966082                32255 free blocks, 8176 free inodes, 0 used directories      Group 61: block bitmap at 1998848, inode bitmap at 1998849, inode table at 1998850                32255 free blocks, 8176 free inodes, 0 used directories      Group 62: block bitmap at 2031616, inode bitmap at 2031617, inode table at 2031618                32255 free blocks, 8176 free inodes, 0 used directories      Group 63: block bitmap at 2064384, inode bitmap at 2064385, inode table at 2064386                32255 free blocks, 8176 free inodes, 0 used directories      Group 64: block bitmap at 2097152, inode bitmap at 2097153, inode table at 2097154                32255 free blocks, 8176 free inodes, 0 used directories      Group 65: block bitmap at 2129920, inode bitmap at 2129921, inode table at 2129922                32255 free blocks, 8176 free inodes, 0 used directories      Group 66: block bitmap at 2162688, inode bitmap at 2162689, inode table at 2162690                32255 free blocks, 8176 free inodes, 0 used directories      Group 67: block bitmap at 2195456, inode bitmap at 2195457, inode table at 2195458                32255 free blocks, 8176 free inodes, 0 used directories      Group 68: block bitmap at 2228224, inode bitmap at 2228225, inode table at 2228226                32255 free blocks, 8176 free inodes, 0 used directories      Group 69: block bitmap at 2260992, inode bitmap at 2260993, inode table at 2260994                32255 free blocks, 8176 free inodes, 0 used directories      Group 70: block bitmap at 2293760, inode bitmap at 2293761, inode table at 2293762                32255 free blocks, 8176 free inodes, 0 used directories      Group 71: block bitmap at 2326528, inode bitmap at 2326529, inode table at 2326530                32255 free blocks, 8176 free inodes, 0 used directories      Group 72: block bitmap at 2359296, inode bitmap at 2359297, inode table at 2359298                32255 free blocks, 8176 free inodes, 0 used directories      Group 73: block bitmap at 2392064, inode bitmap at 2392065, inode table at 2392066                32255 free blocks, 8176 free inodes, 0 used directories      Group 74: block bitmap at 2424832, inode bitmap at 2424833, inode table at 2424834                32255 free blocks, 8176 free inodes, 0 used directories      Group 75: block bitmap at 2457600, inode bitmap at 2457601, inode table at 2457602                32255 free blocks, 8176 free inodes, 0 used directories      Group 76: block bitmap at 2490368, inode bitmap at 2490369, inode table at 2490370                32255 free blocks, 8176 free inodes, 0 used directories      Group 77: block bitmap at 2523136, inode bitmap at 2523137, inode table at 2523138                32255 free blocks, 8176 free inodes, 0 used directories      Group 78: block bitmap at 2555904, inode bitmap at 2555905, inode table at 2555906                32255 free blocks, 8176 free inodes, 0 used directories      Group 79: block bitmap at 2588672, inode bitmap at 2588673, inode table at 2588674                32255 free blocks, 8176 free inodes, 0 used directories      Group 80: block bitmap at 2621440, inode bitmap at 2621441, inode table at 2621442                32255 free blocks, 8176 free inodes, 0 used directories      Group 81: block bitmap at 2655167, inode bitmap at 2655168, inode table at 2655169                31296 free blocks, 8176 free inodes, 0 used directories      Group 82: block bitmap at 2686976, inode bitmap at 2686977, inode table at 2686978                32255 free blocks, 8176 free inodes, 0 used directories      Group 83: block bitmap at 2719744, inode bitmap at 2719745, inode table at 2719746                32255 free blocks, 8176 free inodes, 0 used directories      Group 84: block bitmap at 2752512, inode bitmap at 2752513, inode table at 2752514                32255 free blocks, 8176 free inodes, 0 used directories      Group 85: block bitmap at 2785280, inode bitmap at 2785281, inode table at 2785282                32255 free blocks, 8176 free inodes, 0 used directories      Group 86: block bitmap at 2818048, inode bitmap at 2818049, inode table at 2818050                32255 free blocks, 8176 free inodes, 0 used directories      Group 87: block bitmap at 2850816, inode bitmap at 2850817, inode table at 2850818                32255 free blocks, 8176 free inodes, 0 used directories      Group 88: block bitmap at 2883584, inode bitmap at 2883585, inode table at 2883586                32255 free blocks, 8176 free inodes, 0 used directories      Group 89: block bitmap at 2916352, inode bitmap at 2916353, inode table at 2916354                32255 free blocks, 8176 free inodes, 0 used directories      Group 90: block bitmap at 2949120, inode bitmap at 2949121, inode table at 2949122                32255 free blocks, 8176 free inodes, 0 used directories      Group 91: block bitmap at 2981888, inode bitmap at 2981889, inode table at 2981890                32255 free blocks, 8176 free inodes, 0 used directories      Group 92: block bitmap at 3014656, inode bitmap at 3014657, inode table at 3014658                32255 free blocks, 8176 free inodes, 0 used directories      Group 93: block bitmap at 3047424, inode bitmap at 3047425, inode table at 3047426                32255 free blocks, 8176 free inodes, 0 used directories      Group 94: block bitmap at 3080192, inode bitmap at 3080193, inode table at 3080194                32255 free blocks, 8176 free inodes, 0 used directories      Group 95: block bitmap at 3112960, inode bitmap at 3112961, inode table at 3112962                32255 free blocks, 8176 free inodes, 0 used directories      Group 96: block bitmap at 3145728, inode bitmap at 3145729, inode table at 3145730                32255 free blocks, 8176 free inodes, 0 used directories      Group 97: block bitmap at 3178496, inode bitmap at 3178497, inode table at 3178498                32255 free blocks, 8176 free inodes, 0 used directories      Group 98: block bitmap at 3211264, inode bitmap at 3211265, inode table at 3211266                32255 free blocks, 8176 free inodes, 0 used directories      Group 99: block bitmap at 3244032, inode bitmap at 3244033, inode table at 3244034                32255 free blocks, 8176 free inodes, 0 used directories      Group 100: block bitmap at 3276800, inode bitmap at 3276801, inode table at 3276802                32255 free blocks, 8176 free inodes, 0 used directories      Group 101: block bitmap at 3309568, inode bitmap at 3309569, inode table at 3309570                32255 free blocks, 8176 free inodes, 0 used directories      Group 102: block bitmap at 3342336, inode bitmap at 3342337, inode table at 3342338                32255 free blocks, 8176 free inodes, 0 used directories      Group 103: block bitmap at 3375104, inode bitmap at 3375105, inode table at 3375106                32255 free blocks, 8176 free inodes, 0 used directories      Group 104: block bitmap at 3407872, inode bitmap at 3407873, inode table at 3407874                32255 free blocks, 8176 free inodes, 0 used directories      Group 105: block bitmap at 3440640, inode bitmap at 3440641, inode table at 3440642                32255 free blocks, 8176 free inodes, 0 used directories      Group 106: block bitmap at 3473408, inode bitmap at 3473409, inode table at 3473410                32255 free blocks, 8176 free inodes, 0 used directories      Group 107: block bitmap at 3506176, inode bitmap at 3506177, inode table at 3506178                32255 free blocks, 8176 free inodes, 0 used directories      Group 108: block bitmap at 3538944, inode bitmap at 3538945, inode table at 3538946                32255 free blocks, 8176 free inodes, 0 used directories      Group 109: block bitmap at 3571712, inode bitmap at 3571713, inode table at 3571714                32255 free blocks, 8176 free inodes, 0 used directories      Group 110: block bitmap at 3604480, inode bitmap at 3604481, inode table at 3604482                32255 free blocks, 8176 free inodes, 0 used directories      Group 111: block bitmap at 3637248, inode bitmap at 3637249, inode table at 3637250                32255 free blocks, 8176 free inodes, 0 used directories      Group 112: block bitmap at 3670016, inode bitmap at 3670017, inode table at 3670018                32255 free blocks, 8176 free inodes, 0 used directories      Group 113: block bitmap at 3702784, inode bitmap at 3702785, inode table at 3702786                32255 free blocks, 8176 free inodes, 0 used directories      Group 114: block bitmap at 3735552, inode bitmap at 3735553, inode table at 3735554                32255 free blocks, 8176 free inodes, 0 used directories      Group 115: block bitmap at 3768320, inode bitmap at 3768321, inode table at 3768322                32255 free blocks, 8176 free inodes, 0 used directories      Group 116: block bitmap at 3801088, inode bitmap at 3801089, inode table at 3801090                32255 free blocks, 8176 free inodes, 0 used directories      Group 117: block bitmap at 3833856, inode bitmap at 3833857, inode table at 3833858                32255 free blocks, 8176 free inodes, 0 used directories      Group 118: block bitmap at 3866624, inode bitmap at 3866625, inode table at 3866626                32255 free blocks, 8176 free inodes, 0 used directories      Group 119: block bitmap at 3899392, inode bitmap at 3899393, inode table at 3899394                22011 free blocks, 8176 free inodes, 0 used directories      I would like to get the maximum info (info i can get from giving `lspci`) from this printed info. I would like to know how i can do that. What i have in my mind is like, I give a command :               dd bs=<some size> skip=<some size> count=1 if=/dev/sdc1 | od -Ax -tx1z -v         And this shows the needed details. Basically i need to get the USB hardware details form the filesystem. Please suggest on this idea, or if you have some other idea for doing the same.


title: Autofs home directories with passwordless logins

text: I want a setup where a user home directory is mounted on login (`autofs`). This is working with password based authentication. However, I want passwordless authentication, by generating public keys. Passwordless authentication works well if the user's home directory is stored locally (no `autofs`). In my case the keys are on the remote server and the home directory is mounted only when accessed and the server cannot verify you unless it has the public key. Is this even possible? (Both servers are running Solaris 10 x86 on VirtualBox.)


title: USB connect/disconnect notification

text: I use Linux Mint 13 MATE, and I'm trying to set up notifications when I plug/unplug devices. First of all, I found udev-notify package, but unfortunately it almost doesn't work for me: it works for very little time (1-2 minutes), and then, if I connect/disconnect any device, it crashes:               Traceback (most recent call last):       File "./udev-notify.py", line 319, in <module>         notification.show()     glib.GError: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name :1.1061 was not provided by any .service files      I haven't found any solution, so I had to remove it. (filed bugreport also) Surprizingly, there're no similar utilities I've found so far. Then I tried to write udev rules that should match all devices. I have added new file `/etc/udev/rules.d/notify.rules` :               ACTION=="add",    RUN+="/bin/bash /home/dimon/tmp/device_plug.sh"     ACTION=="remove", RUN+="/bin/bash /home/dimon/tmp/device_unplug.sh"      And two scripts: device_plug.sh:               #!/bin/bash          export DISPLAY=":0"     notify-send "device plugged"          /usr/bin/play -q /path/to/plug_sound.wav &      device_unplug.sh:               #!/bin/bash          export DISPLAY=":0"     notify-send "device unplugged"          /usr/bin/play -q /path/to/unplug_sound.wav &      It works, but it works very dumb. My questions are:   1. How to get actual title of the device attached, the same as I can see in `lsusb` output? Currently, I just got notifications like "plugged" and "unpugged", and I can't find how can I retrieve the name of the device in my udev rule (If I can, then I'd pass it to my script as a parameter)   2. Currently, too many notifications are activated. Say, when I attach my USB stick, I got about 15 notifications! But, if I run `lsusb`, attached USB stick is displayed as just single device. So, it seems I should add some more argument to rule filter, but I can't find it out.   3. Probably there's some better solution for device plug/unplug notifications? Please suggest if you know something. Any help appreciated.


title: Awk field separator bug?

text: This is the expected way for the awk field separator to work:               $ echo 'fooXbar' | awk 'BEGIN {FS="X"} {print $1}'     foo     $ echo 'fooXbar' | awk 'BEGIN {FS="X"} {print $2}'     bar     $       but if the FS is "-|-" then things get strange:               $ echo 'foo-|-bar' | awk 'BEGIN {FS="-|-"} {print $1}'     foo     $ echo 'foo-|-bar' | awk 'BEGIN {FS="-|-"} {print $2}'     |     $ echo 'foo-|-bar' | awk 'BEGIN {FS="-|-"} {print $3}'     bar     $       Why? Why is the $2 a "|" in the second example?? UPDATE:               $ echo 'foo-|-bar' | awk 'BEGIN {FS="-\|-"} {print $2}'     awk: warning: escape sequence `\|' treated as plain `|'     |     $


title: How to detect the desktop environment in a bash script?

text: I am writing a `bash` script that needs to know which desktop environment (XFCE, Unity, KDE, LXDE, Mate, Cinnamon, GNOME2, GNOME3,... ) is running. How can I obtain that information?


title: Building deb: How to put arch independent files into separated .deb package?

text: When you build a deb how do you make it so arch independent data such as plugin files to be packaged into a separated .deb?


title: suspend AND lock screen on closing lid in arch/systemd

text: what is the most straightforward way to lock the screen AND suspend when closing the lid? I'm using event hooks in `/etc/systemd/logind.conf` and successfully suspend upon closing the lid. However I'm lost when it comes to the locking part - am I supposed to enable some screensaver service and how can I trigger two events at once in `logind.conf`?


In Terminal, one can enter 'xkill' as a command which lets you select a window whose client you wish to kill. In fact, it can even be used to kill panels. How can I restore an xkilled panel in Linux Mint without a reboot? Something that I generally do in Windows is Ctrl+Alt+Delete and then restart the explorer.exe service.


title: Updates/applications/packages for Ubuntu 10.10 with no internet connection

text: I recently installed Ubuntu Desktop 10.10 (i.e 2h ago :D) from ISO CD. All went smoothly but now I have an issue. I don't have a network connection. I do not mean that there is a configuration problem and I have no internet connection. I mean I don't have an internet connection to install updates and extra programs. I use a wireless USB modem for Internet and the thing only works in Windows. *nix systems are not supported. I'm asking this question after booting from Windows. And the question is, is there some DVD, files of something which contains a collection of programs to chose from and install? I want to download it in Windows, burn a DVD/CD and boot Ubuntu to install them. I could'n find anything on the Ubuntu site. Is there a way to update Ubuntu "off-line" or is is dependent on Internet connection?


title: VirtualBox bug[?] when Chainloading Grub2

text: Regarding this: How to install Fedora&Ubuntu with encrypted VG's on one disk?      So booted into Ubuntu..and I run this script:                 #!/bin/bash          # show the bootlist of grub when booting pc     sed -i.backup 's/^GRUB_HIDDEN_TIMEOUT=/#GRUB_HIDDEN_TIMEOUT=/' /etc/default/grub     sed -i 's/^GRUB_TIMEOUT=10/GRUB_TIMEOUT=5/' /etc/default/grub     # update-grub # we will use this later too.. don't need it here          # add the "chainload grub" function     cp /etc/grub.d/40_custom /etc/grub.d/40_custom.backup     echo "#!/bin/sh     exec tail -n +3 \$0     menuentry 'FEDORA' {         insmod chain         set root=(hd0,3)         chainloader +1     }" > /etc/grub.d/40_custom     chmod 755 /etc/grub.d/40_custom     update-grub          sync     sync     sync      ok, great no error messages..      I'm using: VirtualBox-3.2-3.2.12_68302_fedora14-1.i686      Now I want to reboot the virtualbox machine to test the whole thing..this is what I get a few seconds after i select "FEDORA" in the grub2 bootlist:      pichost #1 - pichost #2      great! .. :(   other things: VBox.log; 2011-04-17-15-23-37.048-VirtualBox-12365.log   Can anyone help me? Is there a workaround for this bug?      Thank you!


title: How to disable "Resize Window" shortcut (Alt-F8)?

text: I disabled this shortcut it via System->Preferences->Keyboard Shortcuts, but it still persists. Furthermore, it takes precedence over Alt-F8 in other apps. How do I really disable this shortcut? Do I need a reboot after disabling it in Preferences?


title: Cannot enter in centOS with any user

text: I am using **cent OS** Operating system without **GNOME**. In the starting, it asks               localhost login:     Password:      It has one user named **service** under group name **service** whose password is also **service**. I want to enter in OS by this user named **service**. When I do this, it shows this lines               Last Login: Mon Feb 18 16:16:26 on tty1     -bash: /home/service/.bashrc: Permission denied     -bash-3.2$      I changed in **/etc/sudoers** , and add **service ALL=(ALL) ALL** , right below **root ALL=(ALL) ALL** , but it didn't work. when I try to switch from root to service, it shows the same error. **EDITED** When I run `ls -a -l | grep .bashrc`, it shows               lrwxrwxrwx 1 root  root   41 Feb 18 11:40 .bashrc -> /home/service/etc/version.symlink/.bashrc     -rw-r--r-- 1 service service 124 Feb 15 13:06 .bashrc-moved-1361167832      Help me. Looking for your kind response.


title: Can no longer boot after updating Arch

text: I am running Arch Linux with the Gummiboot boot manager. Everything was fine until I updated. I can't remember the exact packages that were updated but I'm pretty sure Gummiboot was one of them. Now when I boot I am just left with the Lenovo logo on my screen. The Gummiboot option is still appearing in my boot menu. Update: I have wiped my ESP and reinstalled gummiboot using the instructions here: https://wiki.archlinux.org/index.php/Beginners%27_Guide#Gummiboot I then messed around with downgrading gummiboot and also installing GRUB instead to no avail. I have since reinstalled the latest version of gummiboot and downgraded the kernel and now I can boot again so I'm assuming its a bug.


title: Properly Set Permission to /home/user folder for webserver

text: I'm currently setting up my own Linux server running CentOs 6. To test the security on my server I wrote a PHP script that acts like a sort of "navigator". I can go one directory up, open the files, etc. etc. The problem is, my tools allows me to go up till "/" and I am not very happy with this. Although Apache is being run as "nobody" it seems like it can reach every folder and file on the whole server. I tried to solve this like cPanel did it, but since I don't have cPanel I don't exactly know how this is done. Basically I have this: /home/account/public_html /home/anotherAccount/public_html I want to make it so that "anotherAccount" can not access the files of "account". Actually I would love it so "anotherAccount" can't even get outside it's own directory! Yes, I know you are thinking: Install suPHP/fastcgi/suExec, but I can't do this because they are eating resources. I know it's possible without installing either one of them! I uploaded my script to some professional yet not very known webhost and I was able to go inside / with it, but not inside the home directories except my own. /home/ listed as empty! How do I secure my home folders?


title: "./configure" command does not work

text: Fairly newbie. Fresh Debian install. I need to compile a package but the "./configure command" does not work ? Getting the following error : > -bash ./configure : No such file or directory Where is that script ? Locate did not give something


title: How to set a custom keymap and make sure, that it is not overwritten by system?

text: I use custom keymap, that diffentiates between left and right `Ctrl`:               remove control = Control_R     clear mod3     add Mod3 = Control_R      When I load it with `xmodmap myxmap`, it works only as long, as one of the events happens:   * Connect a HID (USB mouse, keyboard)   * Press `Ctrl``Alt``Fx` to switch to text terminal After that, I have to repeat the `xmodmap myxmap` command. I lived with it for over a year now, but it gets more and more annoying. Is there any way to tell the Linux Mint (Cinnamon edition) to keep my own version of assignment of `Control_R` key? The issue concerns (but is not limited to) Linux Mint 14-16 Cinnamon 64 bit.


title: Is it possible to remove Windows 7 from dual-boot?

text: I have Windows 7 as primary OS with Linux Mint as secondary OS. I am just feeling comfortable with Linux and want to remove Windows from the disk. Is it possible to remove it without damaging data? Should I keep the disk partitions the same (C, D ,E, F, Linux Mint partition) and will that hurt Linux performance ? Linux is on 100GB partition at the end of Disk (with LVM), should I move it to primary partition ? How to handle the GRUB ? Any other thoughtful suggestions?


title: Why doesn't ln -s tell that it fails when creating a symlink to an existing symlinked directory?

text: When running (on linux different ubuntu variations):               >ln -s dir_1 symlink_dir     >ln -s dir_2 symlink_dir      It fails without telling that it fails. But if you do the same thing on a file instead or, add v to the option it does tell you that it fails:               >ln -s file_1 symlinkg_file     >ln -s file_2 symlinkg_file      **or**               >ln -sv dir_1 symlink_dir     >ln -sv dir_2 symlink_dir      It fails with the error msg:               ln: failed to create symbolic link      For me this seems to be a very strange behaviour? Is there a reason for this?


title: Shell Script for collecting user login dates

text: I'm having trouble making a shell script that will make a list of all the dates when users log in. I want the most recent entries to be on the top (because I know if you just use `date >> logdates` it'll get displayed on the bottom. So I'd want the columns to be date, sv, and then the dates when logged in - so log in dates from the most recent to the old ones.


title: Suse filesystem turns read-only

text: I've installed openSUSE 11.2 (64bit) a while ago, and am mainly using it as a dedicated Apache hosting machine. Everything has been working properly for a while (~1 month), but as of a few days back, the filesystem seems to have been turned to read-only (!?). Pretty much every task fails, be it starting vi or even man pages (can't create files on disk). Has anyone seen something like this before ? If so, what did you do to recover? I tried googling for solution but failed to find a helpful answer. Nota bene - no significant changes were made in this period, and machine load is very, very lightweight.


title: How to perform custom sort

text: I have the following line in a file :               [[0, [0, '1']], [1, [0, '2']], [2, [0, '3']], [3, [0, '4']]]     [[0, [1, '5']], [1, [1, '6']], [2, [1, '7']], [3, [1, '8']]]     [[0, [2, '9']], [1, [2, '10']], [2, [2, '11']], [3, [2, '12']]]      Is there a way to sort them on the first character (0,1,2 or 3) in the inner list element so that I will end up with the following:               [[0, [0, '1']], [0, [1, '5']],[0, [2, '9']]]     [[1, [0, '2']], [1, [1, '6']],[1, [2, '10']]]       and so on?


title: How do restore printer settings from a backup

text: I recently re-installed my system from Mint 12 to Mint 14. Pretty much everything is set as before but I had apparently forgotten about the printers. In order to avoid resetting all the small details and presets, I wanted to restore the settings from my backup, taken immediately before the re- installing process. So I copied `~/.cups/` and `/etc/cups/` from the backup to the new installation. Then I restarted the Cups daemon, `cupsd`. When I try to print a paper, all my printers and settings are there and my computer seems to think that the paper prints out fine. The printer, on the other hand, is stuck with the "receiving data" light blinking which eventually leads to the job being deleted from the queue due to an error (with no further information). What could be the problem here? How does one normally restore CUPS settings? EDIT: The printer seems to be working fine for all my colleagues; running mac, win and Linux. So it's got to be something with the settings here on my machine.


title: How to limit log file size using >>

text: How can I limit the size of a log file written with `>>` to 200MB?               $ run_program >> myprogram.log


title: What does m represents in VIRT column using TOP command

text: When we run top command it shows all the processes information. But under VIRT column there is m written against some values **what does that m represents** , is it MB . If yes then why it is only showing 12k in SWAP Header. Because if we do total the size is much much more than 12k.               top - 15:43:19 up 3 days, 55 min,  2 users,  load average: 0.01, 0.08, 0.08     Tasks: 259 total,   1 running, 258 sleeping,   0 stopped,   0 zombie     Cpu(s):  1.7%us,  0.3%sy,  0.0%ni, 97.8%id,  0.0%wa,  0.0%hi,  0.1%si,  0.0%st     Mem:   8177292k total,  6988680k used,  1188612k free,   417064k buffers     Swap:  8385920k total,       12k used,  8385908k free,  4535416k cached            PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND     29948 oracle    18   0  898m 269m  41m S 14.6  3.4   1:28.77 java     29947 oracle    18   0  863m 203m  34m S  1.3  2.5   0:51.60 java     29912 oracle    18   0  405m 199m  18m S  0.0  2.5   1:57.79 java     29943 oracle    18   0  376m 148m  19m S  0.0  1.9   0:18.00 java     29909 oracle    18   0  821m 104m  27m S  0.0  1.3   0:13.91 java     31008 oracle    15   0  512m  91m  28m S  0.0  1.1   0:10.28 java     30245 oracle    15   0  559m  82m  19m S  0.0  1.0   0:11.70 rwserver     29945 oracle    18   0  296m  68m  18m S  0.0  0.9   0:29.24 java     29961 oracle    17   0  298m  66m  18m S  0.0  0.8   0:10.32 java     30341 oracle    15   0  554m  64m  24m S  0.0  0.8   0:08.26 java     29936 oracle    18   0  302m  61m  16m S  0.3  0.8   0:08.25 java      2543 oracle    15   0  553m  60m  24m S  0.0  0.8   0:04.45 java      8546 oracle    25   0  367m  56m  13m S  0.0  0.7   0:19.78 emagent     29942 oracle    17   0  307m  56m  18m S  0.0  0.7   0:08.00 java     29946 oracle    18   0  293m  53m  16m S  0.0  0.7   0:08.58 java     32324 oracle    15   0  361m  51m  22m S  0.0  0.6   0:03.21 frmweb     29905 oracle    18   0  290m  48m  15m S  0.0  0.6   0:06.02 java      5014 oracle    15   0  355m  45m  23m S  0.0  0.6   0:02.16 frmweb      1135 oracle    15   0  355m  44m  22m S  0.0  0.6   0:01.90 frmweb      4280 oracle    15   0  355m  44m  22m S  0.0  0.6   0:01.35 frmweb      6727 oracle    15   0  353m  42m  22m S  0.0  0.5   0:00.84 frmweb     31043 oracle    16   0  452m  42m  12m S  0.0  0.5   0:03.01 java     29944 oracle    18   0  279m  42m  15m S  0.0  0.5   0:05.30 java     29941 oracle    15   0 98716  40m 4356 S  0.0  0.5   0:20.50 webcached      8682 oracle    15   0 72536  29m  12m S  0.0  0.4   0:01.59 frmweb


title: Cannot ssh from my laptop

text: I have a server on Linode and I'm trying to ssh from my laptop. I'm getting permission denied. I'm trying the same from a different laptop and it is working fine. I'm not understanding the issue. can someone help?


title: Unix Date command not working for few servers

text: I am trying to execute date command in unix server for yesterday. The commands tried are :               date --date ="1 day ago"     date --date ="1 days ago"       date --date ="yesterday     date --date ="-1 day"      These command work in a server but the same command does not work in few other servers, where date prints properly the current date. Could anyone suggest what could be the issue with the other servers? The server details: SunOS wupsa02a0014 5.10 Generic_147440-15 sun4u sparc SUNW,SPARC-Enterprise


title: Jump to the first position of text "<CURSOR>"

text: I'm using a file template directory for newly created files, `autocmd! BufNewFile * silent! 0r ~/.vim/skel/tmpl.%:e` Now I want to add another function, that move the cursor to somewhere (defined in each ~/.vim/skel/tmpl.%), i.e the first location of text `<CURSOR>`, is that possible? In summary, when a new file is created, use the template, and jump to `<CURSOR>`.


title: vi backspace problem

text: I have to work on a really old AIX workstation with vi version 3.10 in it. I have done a little work in vim, but that was much more easy to use than the old vi (atleast untill I get used to the old vi). Since I have been using the backspace key to erase my previous character for ever since I was born, I would like to have that functionality in vi as well. I did search for a solution. I found the following:   1. `:set backspace=2` (:set all does not have a backspace option, nor nocompatible)   2. `stty erase ^?` (Didn't work)   3. In .exrc file in my home directory, I can set up a mapping. ie, map . However, in the edit mode in vi, pressing backspace actually takes my cursor to one position on the left, but does not remove it. How do I map a supposedly arrow key to make it perform the function of a backspace? AIX Version: 5 5300 something. uname -a gives AIX << hostname >> 3 5


title: Swap space not used

text: I recently installed Debian 6.0.6. Here are the machine's states:   * CPU - AMD XP 3000+   * RAM - 1 Gig   * HDD - IDE 80 Gig I primarily use this machine for developing toy personal projects. When I run NetBeans, I sometimes get a low memory error. Running `top` shows that, sure enough, RAM is at almost 100% usage. However, swap space usage is at 0. Does this mean that the swap partition that I created during installation is not enabled. I assumed that after creating the swap partition the installation process would automatically enable it. What do I need to do to enable swapping?


title: Sometimes I feel like a directory, some times I feel like a regular file

text: For organizational purposes I would like a certain filesystem object which most of the time appears as a file, on occasion, to appear as a directory. The basic idea is that generically for `cp`, `mv`, `find`, `updatedb`/`locate`, I would like the object to appear as an individual file. For other applications such as `vlc`, `rythmbox`, `feh`, and `okular`, I would like it to appear as a directory. Can someone suggest a mechanism for doing this? To illustrate let me give an example: I will give the object I have in mind the name _my_books_on_m4_programming.arch_. For the purposes of moving/copying or find/locate this object looks like a file, but when I want to read a book in the object it looks like a directory ie: for the command `okular my_books_on_m4_programming.arch/beginner/m4_for_dummies.pdf`. I have thought of two and a half possible solutions but would need help with either one.   * The first is to modify my linux to use a special attribute of the file system. If the attribute is set then I look for an environmental for example `SPECIAL_OBJECT_IS_FILE`. If it is set I treat it as a file. If it is not set I treat it as a directory. The problem with this approach is that I do not see how to implement it without modifying virtually the whole system.   * The second technique would be to store the files in an archive (e.g. tar, zip, rar) which I mount (rw) to some directory. To treat the object as an archive refer to the original archive, to treat the object as a directory refer to the mount point. Is this possible?   * The half technique is simply a twist on the second instead of mounting an archive I create someking of link to it. Is anything like this possible? I can't believe that no-one else ever wanted to do a similar thing so I suspect that there is some way. Suggestionss? Ok. I confess I had trouble coming up with a title for my question, so I tried to make a joke out of a very old commercial--sorry.


title: Redirect linux console on boot

text: Is it possible on boot to redirect the console output to a `screen` session? The server has no monitor attached, and I'd like to be able to see the primary console output. I've seen other posts about redirecting to a serial port, but I'd rather use `screen` if possible, or another method to see the console output when logged in over SSH. The box is running Raspbian Linux (Debian Wheezy).


title: Fedora 17 : Nautilus, after mount manually, device will not see again in Device section

text: In Nautilus, I see left pane is useful. It contains shortcut to another place. Such as : At **device** : I can see Windows Partition (although I does not mount yet) or at **my computer** , some shortcut to go Home/Desktop/Documents/Downloads.... When I mount Windows partitions in Nautilus (double click, a confirm windows appear to ask...). After I mount, I still can see this device in left pane. But, if I mount by hand, (I do by hand because I want auto mount every time I start using Linux). I do this by go to terminal and type : > mount -t ntfs /dev/sda1 /mnt/C It will lost this icon in left pane. Of course, no problem here, but if I want to go to these location, I must go to by hand : root -> mnt --> C So, does anything if I mount by hand, and still can see it in Nautilus ?


title: Firewall/routing rule in Centos for this setup

text: I have two ethernet interfaces, namely `eth0` and `eth1`. I want to implement an advanced routing rule but I am totally new to firewall/routing rules in CentOS. Here is what I am trying to do: Both my interfaces are up and connected to internet. I want to be able to decide dynamically based on the type of traffic through which interface it should go out. For example, if it is HTTP traffic, I want it to use `eth0` and if it is FTP etc traffic, I want it to use `eth1`, while different type of traffic could have the SAME destination IP address. How can I accomplish this task?


title: How to make bash think `-mthreads` word as `-pthread`?

text: So I want to make my bash to replace word ``-mthreads` each time I input it with word `-pthread`. Is such thing possible and how to do it?


title: Emacs windows, frames, server and clients: threads or processes?

text: From http://www.gnu.org/software/emacs/tour/ > Emacs server > > Some people like to keep only a single **instance** of Emacs open and edit > all their files in there. Doing this has a few advantages: > > You can kill/yank text between buffers in the same **instance** of Emacs. > Emacs remembers argument histories (what commands you've used, what files > you've opened, terms you've searched for, etc.), but only within each > **instance**. If you have many customizations, starting new **instances** of > Emacs is slow. Alas, when you type emacs in a shell to edit a file (or when > $EDITOR is invoked by an external program), a new **instance** of Emacs is > started. You can avoid this by using emacsclient, which instead opens a new > **frame** connected to an existing **instance** of Emacs: > > In your existing **instance** of Emacs, type M-x server-start. Or add > (server-start) to your .emacs file to make it do that automatically at > startup. To edit a file, type emacsclient -t FILENAME at a prompt. You can > also change your $EDITOR to emacsclient -t if you're using programs that > automatically invoke $EDITOR. (emacsclient -t opens a new **frame** on the > terminal; alternatively, emacsclient -c opens a new X **frame**.) When > you're done editing, type C-x C-c, which closes the **frame**.   1. By a "instance" of Emacs, is it the same as an Emacs process, or a thread?   2. Are different buffers (or windows, or frames) under the same Emacs window different threads of the emacs process? (I guess so) So do they communicate via shared memory?   3. Are an Emacs server and its clients different processes, or the different threads of the same emacs process? (I guess not, but the quote same that a client is a frame of the server, and I guess a frame is just a thread of the same process)   4. Generally, in the server-client model of an application, do the server and the clients run as different processes or threads? Is the communication between the server and clients done by shared memory or inter-process communication?


title: Why am I getting "Job for httpd.service failed...," and how do I go about fixing it?

text: I am running Arch Linux 3.12.25-1-ARCH and httpd.service is now giving me problems.               $ sudo systemctl enable httpd.service     $ sudo systemctl start httpd.service     Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.      `systemctl status httpd.service` returns...               Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)      Active: failed (Result: exit-code) since...      Process: 341 ExecStart=/usr/bin/apachectl start (code=exited, status=1/FAILURE)`      `journalctl -xn` returns many entries, but there are none that are of an erroneous nature. I had initially followed this guide That did the trick, but after a reboot, it isn't working any longer. I went back through and verified that the `httpd.conf` file was the same, and I also tried to do reinstall with `pacman -S apache php php-apache`


title: is "ServerAdmin email@domain.tld" required in the VirtualHost in Apache?

text: I rather not have                ServerAdmin      in my VirtualHost because all it does is attract spam. has no use what so ever. can it be ignored ?


title: If you want to get a future date, why can't you just get the current date and use sed/awk/etc?

text: I've just looked at this question. The first answer states how to get a future date directly from the date command. Why couldn't you just use text manipulation to increment the date? Basically:               date | # increment the time string by some amount here      I'm not familiar with `awk` or `sed` or I'd give a better example. _Edit:_ so basically there is no technical reason? Just portability and the fact that it's harder than it looks?


title: How to boot Chromium OS verbosely?

text: I'm attempting to boot the latest Chromium OS 32-bit build from this site. Whilst I'm currently experiencing a typical installation issue (stuck at a black screen after initial loading screen), not being able to get a verbose output of the boot process is challenging. Are there any keyboard shortcuts which can be fired before/while the loading screen appears?


title: wget rotated backup problem

text: I'm calling `wget` 1.11.4 as follows               $ wget -nd -S -N --backups=4 -r --no-parent --reject="index.html*" -e robots=off <url>      to repeatedly download all files from a server. My problem is, existing files won't get a rolled backup. Or only up to 1 file. So in the end there exists only 2 files, `myfile` and `myfile.1`. There is never a `myfile.2`. Why is that? I specifically told `wget` to make 4 backup files.


title: SSH E-mail login alert if SSH port is as NAT

text: Can you help me with this problem please? How can I set e-mail alerting after SSH login when port 22 is NATed? I use Linux Debian 7. I have used these iptables rules:               eth0 - external network, eth1 - internal network         iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE     iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT     iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT      Thanks for your replies.


title: Unable to access a folder through group permissions

text: In order to secure data on my webserver, I have moved the PHP includes to a folder called /var/www-includes (outside of /var/www, the server root). I also ran `chown root:wwwadmin` and `chmod 770` on that folder. When I run `ls -ld` on the folder, it verifies the settings: `drwxrwx--- ... root wwwadmin ... www-includes` Although I am able to cd to the folder from my main user (adam) who is a member of wwwadmin, I cannot view its contents in a graphical file browser. Any idea why? Edit: Also, when trying to edit the contained files in nano, it shows me an error message: `Error reading /home/adam/.nano_history: Permission denied` then opens the contents of the file. Is this relevant at all to what may be going on?


title: Why can't I connect to my Linux bluetooth serial port?

text: I have a USB bluetooth dongle on a Linux 3.12.5 ARM system. I've been attempting to make a bluetooth serial connection from my android phone to the USB dongle on Linux. I've referenced this question among other sources in my attempts. Any suggestions would be great. I have been able to make it pairable via:               bluetooth-agent 0000 &      And then pairing via from my phone. Then, I create a serial port on the device via:               sudo mknod -m 666 /dev/rfcomm0 c 216 0     sudo sdptool add --channel=22 SP     sudo rfcomm listen /dev/rfcomm 22 Then, from my phone, I use BlueTerm to attempt to connect to the serial port. However, it loses connection immediately. On the Linux side, the following appears in the terminal:               Waiting for connection on channel 22     Authorizing request for /org/bluez/317/hci0/dev_xx_xx_xx_xx_00_46      It doesn't seem to be kicking the phone off the connection, so what's happening?


title: Where are RPM postinstall scripts located?

text: I have found a bug in an RPM that I have been provided.               rpm -qp --scripts foo.rpm > /tmp/badscript          cat /tmp/badscript     postinstall scriptlet (using /bin/sh):     ...     if [ 'some bug' == true ]....      I have access to the source code and the spec files, but I am unable to find which file is the postinstall scriptlet. Is it possible for me to fix this bug? If so where do I find the script? I assumed it would be in buildutils/rpmbuild/SPEC, yet when I grep the entire source code, I can't find the string that contains the bug.


title: Fedora Update and /var space problems

text: I have just installed Fedora 20 (KDE) and the system informed me that I should get updates. I checked everything and accepted to install additional ones. It got to a certain point (around 10%) and it failed because of the low space in `/var` (total space 1024Mb). I'm aware now that I should have probably set the `/var` to be larger, but can't `yum` resolve the issue and do the downloading and installing step by step? And I can't get the space cleaned with `yum clean` command which some forum guys said should fix the problem. Should I do complete reinstall and set `/var` to be larger, or there's some better way to deal with this? I also get the error when I try to open display configuration: > Executable: kcmshell4 PID: 1863 Signal: Bus error (7) Time: 03/27/14 > 06:18:15 PM I'm not sure if it's an issue that the update would fix.


title: Create random data with dd and get "partial read warning". Is the data after the warning now really random?

text: I create a 1TB file with random data with `dd if=/dev/urandom of=file bs=1M count=1000000`. Now I check with `kill -SIGUSR1 <PID>` the progress and get the following:               691581+0 Datensätze ein     691580+0 Datensätze aus     725174190080 Bytes (725 GB) kopiert, 86256,9 s, 8,4 MB/s     800950+1 Datensätze ein     800950+0 Datensätze aus     839856947200 Bytes (840 GB) kopiert, 99429,5 s, 8,4 MB/s     dd: warning: partial read (809620 bytes); suggest iflag=fullblock     803432+1 Datensätze ein     803431+1 Datensätze aus     842459273876 Bytes (842 GB) kopiert, 99791,3 s, 8,4 MB/s      I can't interpret the warning. What does it say? Is my file really random after the warning or is there a problem? What does +0 or +1 in `800950+1 Datensätze ein` and `800950+0 Datensätze aus` mean? After the warning it is +1. Is it a errorcount?


title: How to hibernate in Debian Jessie

text: When I use the "hibernate" button in the Xfce menu on Debian Jessie (testing) The system seems to correctly hibernate and power off. Then when I power on again to resume it hangs before X is started (I can see the normal console boot message though). So I wanted to install the `uswsusp` package, but it seems to be not available on Jessie. Any ideas how I can enable hibernation on Jessie without `uswsusp`?


title: ssh key authentication not working from network/if-up.d/ scripts

text: I have two nearly identical scripts in `network/if-up` that need to access SSH keys. Permissions on SSH private keys are 600, so how can my scripts access these keys? I would prefer to keep the SSH keys associated with a user account I set up for the task that these scripts perform. I don't know how to find the user that runs the scripts in `network/if-up` and I also have not had any luck trying to use `su -l -c "my_command" mytaskuser` in my scripts. Hopefully I'm just making a simple mistake. On Ubuntu my scripts are located in `/etc/network/if-up.d` and in other distros (e.g., openSuse) they are in `etc/sysconfig/network/if-up.d`. Both my scripts look similar to this (I'll just use one example to keep the question focused):               #!/bin/sh     LOGDATE="_`date +%Y-%m-%d_%H%M`"     scp -i /home/mytaskuser/.ssh/id_rsa /home/mytaskuser/some.log  mytaskuser@example.com:somelog${LOGDATE}.log     exit 0      The script works totally correctly if I log in as mytaskuser and run it manually. It fails without any obvious error messages when run automatically from `if-up.d/`. I have tried variations like this:               #!/bin/sh     LOGDATE="_`date +%Y-%m-%d_%H%M`"     su -l -c "scp -i /home/mytaskuser/.ssh/id_rsa /home/mytaskuser/some.log  mytaskuser@example.com:somelog${LOGDATE}.log" mytaskuser     exit 0      That hasn't worked. The only way the script works is when I run it while logged in as the user that owns the SSH key (id_rsa).


title: Proper way to add a user account via bash script

text: I cross posted this question to AskUbuntu because my problem seems most acute on Debian/Ubuntu, but it was suggested that I ask here. Whatever method is suggested for solving this problem should work on most distros (e.g., openSuse & Ubuntu). Here's the script code I'm using now:               getent group $MYGROUP     if [ $? -ne 0 ] ; then         sudo su -c "groupadd $MYGROUP"     fi     sudo su -c "useradd mynewuser -p mypassword -m -g $PRIMARYGRP -G $MYGROUP"      There are several problems with the user account it creates on Ubuntu.   * the terminal prompt isn't set (`echo $PS1` returns nothing)   * the arrow keys and tab key do not work correctly in the terminal   * the password doesn't seem to work (although I'm still unclear exactly what this issue is)   * the /etc/sudoers rights set for this new user are not honored If instead I manually create the user with `adduser` (instead of useradd) I don't have these problems. But I need a non-Debian-exclusive script or method of adding user accounts via my bash script. I also had a previous question on this topic, but it was different enough that it is not relevant to this problem.


title: How to add a Linux Partition on FreeBSD

text: Today I installed FreeBSD 9.0 PPC on my Mac mini G4 with 40GB HDD. During installation, (using the FSBD utility 'gpart') I have allocated a total of about 23GB for FreeBSD leaving 17GB totally free (neither partitioned, nor formatted) for a later Linux installation. Now, when try to install Linux (Ubuntu 10.10 PPC) on the remaining 17GB, the Linux/Ubuntu installer (or Linux's Disk Utility for the same matter) wants presumably a linux partition and when I try to add a (Linux) partition on that area using Linux DU it fails with this message:               Error creating partition: helper exited with exit code 1: In part_add_partition:      device_file=/dev/hda, start=23363101696, size=16644660224, type=     Entering MS-DOS parser (offset=0, size=40007761920)     No MSDOS_MAGIC found     Exiting MS-DOS parser     Entering Apple parser     Mac MAGIC found, block_size=512     map_count = 17     Leaving Apple parser     Apple partition table detected     containing partition table scheme = 2     got it     Error: The partition's data region doesn't occupy the entire partition.     ped_disk_new() failed      Now, I'm trying to add a Linux partition on FreeBSD running on the harddisk. I use seemingly most suitable tool for this job: gpart. Here is the 'gpart show ad0' ![enter image description here](http://i.stack.imgur.com/rCtqC.jpg) But it seems unable to add a Linux partition because "man gpart" doesn't list either "Linux Partition" nor anything like Ext2 or Ext3/Ext4. The closest thing to Linux Partition in gpart is "mbr" but it doesn't work: `#gpart add -t mbr ado` So, how to add properly a Linux Partition on FreeBSD? Thanks.


title: rsync: samba vs ftp for backup

text: I need to back up ~0.5 TB of files (about 600,000 of them) from a Windows Server 2003 machine to a CentOS 6.4 machine across a 100MB network, and update them once a night. The backup script would be hosted on CentOS. Will SlimFTPd server+standard CentOS ftp client, or Windows AD fileshare+Samba 4 client be faster for synchronizing the backup via rsync? I.e. once it's going, say there are about 15 GB of changes, which one will be faster at comparing the directory structure to mirror them?


title: Email client that understands both HTML and maildir

text: I'm using Mutt as my main email client, but I'm looking for another one for my work email (because of HTML email). I need one that can handle my existing Maildir email, to be able to switch between Mutt and the new one without having to import/export my old emails. Does anyone know such email client?. Also I don't want to stop using Fetchmail, Procmail and Exim4. It would be nice to find something similar to Mutt, but with better HTML answering abilities.


title: reading entries from multiple files

text: I have few files like A.txt, B.txt and C.txt, each having a only single number in it i.e A.txt has 45 B.txt has 35 and C.txt has 100. How could I read these entries from each files and report with its corresponding file name. output: 45 A.txt 35 B.txt 100 C.txt thanks!


title: Why Bash unable to find command even if $PATH is specified properly?

text: I am specifying path to my command in the file **/etc/profile** :               export PATH=$PATH:/usr/app/cpn/bin      My command is located in:               $ which ydisplay      /usr/app/cpn/bin/ydisplay      So, when I performing "echo $PATH" output is looks like:               $ echo $PATH     ...:/usr/app/cpn/bin      And everything is OK, but when I am trying to launch my command via SSH I am getting error:               $ ssh 127.0.0.1 ydisplay     $ bash: ydisplay: command not found      But the my path is still present:               $ ssh 127.0.0.1 echo $PATH     ...:/usr/app/cpn/bin      Please explain me why Bash unable to find ydisplay during SSH session and how to properly configurate SSH to avoid this issue. More over, if I specifying $PATH in local file .bashrc in the current user all works correctly. But I want to modify only one file instead specifying a lot of files for each user. This is why I am asking.


title: Configuring jackd (JACK daemon) with ALSA

text: I'm trying to wrap my head around ALSA config files and jackd, but I'm not getting anywhere, other than crashing my machine. The microphone is a USB type and specified in ALSA arecord as `-D plughw:1,0`. Is there a way to use jackd to duplicate that microphone source? Ideally, I want it to appear as a new device, so that `arecord -l` lists it separately, and I can open one or the other independently.


title: Boot everywhere live USB

text: I want to create a live Linux USB, that would have support for old and new devices (probably having two kernels installed, that you chose on boot, depending on the PC using). I would also like to be able to boot from a Mac. So basically, I would like to create a boot everywhere live USB. I was using Puppy Linux with a retro kernel, but I would also like to have new features from the new kernel, if the device supports them. The second problem is when trying to boot from a Mac, since Macs use GPT partition table where older machines use MBR. So I am wondering if this is even remotely possible to achieve? I don't want to carry 3 USB drives with me all the time and I want to use my system everywhere I go :) The next step, IF this works would be to have the same USB for ARM, Intel...


title: Auto connect to the wired net?

text: I've installed Arch linux, and planned to used it remote and putty my way in. But it does not seem to start up the interface at boot. I also want a static ip. Is there a config file like /etc/network/interfaces like on debian i can config, reboot and everything is ok?


title: How to specify username password for ftp

text: ftp ftp://bapte:b2p7Ua2@ftp.backupte4.rsyncbackup.info      And I got               ftp: ftp://bapte:b2p7Ua2@ftp.backupte4.rsyncbackup.info: Name or service not known      I tried a bunch of different things. I looked at manual. No luck I tried               ftp -user username password ftp.backupte4.rsyncbackup.info      as said in manual               ftp: u: unknown option      All I need is a sample that works. The manual said http://linux.about.com/od/commands/l/blcmdl1_ftp.htm user user-name [password ] [account ] Identify yourself to the remote FTP server. If the password is not specified and the server requires it, ftp will prompt the user for it (after disabling local echo). If an account field is not specified, and the FTP server requires it, the user will be prompted for it. If an account field is specified, an account command will be relayed to the remote server after the login sequence is completed if the remote server did not require it for logging in. Unless ftp is invoked with auto-login disabled, this process is done automatically on initial connection to the FTP server. So what exactly I should put?


title: file path in variable from user input

text: I'm trying to create script where user will give path to some file, and script will check if file exists and do some stuff... I've wrote this code:               read -p "Enter path: " $path          #check if path is not empty string     if [ -z $path ]     then       echo "path is empty string"       exit     fi     #check if file exist     if [ ! -f $path ]      then       echo "file doesnt exists"     fi      my problem is with secound condition - if I change `$path` with some string everything is OK, but when I enter path via variable it is always "file doesnt exists" I was trying with               if [ ! -f `$path` ]      but if file doesnt have execute permission result is fail too. Can someone help me fix above code? :) **EDIT** sorry, I meant `-z` and `-f` not double `-z` condition


title: root login silently fails

text: After some months of not touching it I wanted to login to one of our virtual servers to update OpenSSL, because of the heartbleed thing. The server is running Debian 7, `sudo` is not installed. I tried three ways:   1. `ssh root@server`, password is accepted and then:              Could not chdir to home directory /home/root: No such file or directory     Connection to server closed.        2. Logging in as some other user and then `su - root`.              No directory, logging in with HOME=/      Then I am back to my usual shell, not logged in as root.   3. Logging in as some other user and then `su root`. This gives nothing, I am simply back to the usual prompt, still logged in as the other user and not root.  I have no chance to manually restart the server before monday. Is there anything I could try to do to get a root shell? May the server be compromised and how could I check that (without root access)? Thank you! In all cases, when typing the wrong password the machine complains as usual. `/root` does exist and `/etc/passwd` lists the correct directory. I have no idea why ssh believes differently. * * * This may be important: Checking `$?` after the unsuccessful `su` call gives me a `1`, which is `System or authentication failure` according to the man page of su. How can I make it more verbose? * * * As requested below, the output of `ssh -v`:               Last login: Fri Apr 11 17:47:46 2014 from some_client     Could not chdir to home directory /home/root: No such file or directory     debug1: client_input_channel_req: channel 0 rtype exit-status reply 0     debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0     debug1: channel 0: free: client-session, nchannels 1     Connection to server closed.     Transferred: sent 3136, received 2448 bytes, in 0.0 seconds     Bytes per second: sent 299688.7, received 233940.7     debug1: Exit status 1


title: How to switch xsessions?

text: I run xmonad/slock/lxdm currently, and I cannot find a way to get a "switch user" system working. Here's what I'd like:   * key combination returns me to login (applications still run in the background)   * another user can log in to a different desktop environment/window manager (e.g. GNOME, openbox)   * other DE's switch user feature will let me get back into my existing session I know I can use virtual terminals and avoid the whole issue, but I'd really prefer to have it work like other DEs. I'm completely ok with switching login managers or screen lockers. What utilities exist for managing something like this?


title: How would a script know when running locale-gen is necessary?

text: One of the basic steps in setting up a new system is getting the right glibc locale files generated. At least in ArchLinux and Gentoo, one is expected to do this step by hand. I am trying to setup a script that deploys ArchLinux. For various reasons, my script is limited by not knowing where in the config process it is and testing for each step as it goes along. The process includes several reboots. Throwing the right locale into /etc/locale.gen and running `local-gen` every time doesn't seem to hurt, but on the embeded platform I'm using it takes a long time and running this several times really hurts. What would be the **proper** way to test this -- not just that a locale is set in the config but that the proper files for it are generated?


title: Simplest way to set up multiple subdomains to separate VMs running on single host

text: **Problem:** I´m planning to set up several virtualized centos, rhel or ubuntu guest machines on a single centos host server (most likely using KVM). Each guest VM is running an instance of a webapp + some other services/protocols, and each guest VM needs to be reachable from outside the host, on any open port, as if each of them was a separate, DNSed box. I´m (apparently) weak in networking tech/config, so I am simply trying to find the first edges of this problem ie. the main approaches I need to look into to get a foothold on this. Networking config "pseudocode" if you will. :) **Example:** Let´s say I own the domain foo.com. I have a physical CentOS machine DNSed as guests.foo.com. On this physical host machine I've got three VMs running. I want the guest VMs to be reachable as 1.guests.foo.com, 2.guests.foo.com and 3.guests.foo.com. The guest VMs run centos, rhel and ubuntu distros. Each VM needs to respond to any (locally open) port, not just http traffic, but also ssh connections and git: protocol operations. Where do I start, what is the most elegant approach? What, roughly, does the host and guests each, minimally, need set up for this to work well? **Note:** I´ll update the question text + comments as I learn more.


title: How to share internet connection over Ethernet using Network Manager?

text: I have 2 computers, both with Gigabit controllers, connected with a regular Ethernet cable. I have a host machine, which is connected to the internet, and a client machine, which is only connected to the host machine. I would like to share the host's internet connection with the client machine. I have read online, and I found out the best way to do this is by opening Network Manager's GUI on my host machine, editing my Ethernet connection and setting the IPv4 settings to "Shared to other computers". On my client machine, I have it set to automatically get an IP address using DHCP. My host machine does not detect the cable as being plugged in under these settings, and my client machine reports me it cannot connect to the network. ![enter image description here](http://i.stack.imgur.com/7uhrG.png) How do I properly share my internet connection from the host machine to my client machine, preferably using Network Manager.


title: How to install mod_mono on Linux Mint?

text: I'm a linux newbie trying to install mod_mono on Linux Mint Maya/Cinnamon. I can't seem to find any tutorials or anything on how to do this. So far, XSP and MonoDevelop seem to be working. I created an MVC solution, started it and it seemed to work fine. I am also new to apache. This is a learning experience for me. :) Can someone help me? Is there some "sudo apt-get mod_mono_for_apache" command that I can execute? Thanks for any assistance you can provide.


title: Migrating from archlinux to gentoo

text: Is there an easy way to migrate from archlinux to gentoo? For example I get a list of manually installed packages in archlinux by `pacman -Qeq`, save it to file and edit (to delete all unneeded packages). I'd like then to install that list of packages by `emerge`, but many packages have different names in gentoo and arch. Is there a way of automation of such package names conversion? Or I need to install package from list by hands, one by one?


title: In a Bash Script how does the continue command work with embedded loops?

text: I am writing a bash script in a busybox session. The script has to initiate an external executable numerous times in sequence in daemonised form then monitor the output.               while read LINE; do       VARIABLEPARAMETER=`echo "$LINE" | sed -e 's/appropriateregex(s)//'`       externalprog --daemonize -acton $VARIABLEPARAMETER -o /tmp/outputfile.txt       until [ "TRIGGERED" = "1" ]; do         WATCHOUTPUT=`tail -n30 /tmp/outputfile.txt`         TRIGGERED=`echo "$WATCHOUTPUT" | grep "keyword(s)"`          if [ -z "$TRIGGERED" ]; then           PROGID=`pgrep externalprog`           kill -2 "$PROGID"           continue         fi       done     done < /tmp/sourcedata.txt      My question is which of the two loops will the continue command be executed against? The initial while read line, or the subsequent, until triggered? Please don't get to focused on the actual code I've thrown this together as an example to try to explain this question, the actual code is much more detailed.


title: Mitigating BEAST Centos 6.5 Apache 2.2

text: I'm trying to get my system to pass a BEAST scan, it seems no matter what settings I use, an error is always returned stating that TLS 1.0 is enabled. I'm using Qualys SSL Labs to test Apache/2.2.15 (Unix) CentOs 6.5 Final httpd.conf: > SSLProtocol all -SSLv2 -SSLv3 > > SSLHonorCipherOrder on > > SSLCipherSuite AES256+EECDH:AES256+EDH Error: **BEAST ATTACK Not mitigated server-side (more info) TLS 1.0: 0x39** Upgrading to Apache 2.4 is not an option. How do I protect my box from a BEAST attack with these version of Centos and Apache?


title: Linux Heartbeat options possibilities

text: I would like to understand if my below scenarios are possible in Heartbeat in Linux. Setup: Two Database Servers running Mysql in Active/Passive mode in replication mode having Heartbeat setup for HA or failover mechanism. Application connects to DB using VIP that is started at the time of Heartbeat.   * Failover VIP to passive site if primary Mysql intance is shut down.   * Bring down the heartbeat in primary if the role has been given to passive/secondary site inorder to avoid split brain.


title: git diff of copies that only added lines

text: Say I have two processes that **append lines** to copies of the same original (parent) file (`copy_A` and `copy_B`). If I `diff` these copies, can `diff` ever conclude that we have a conflict? (i.e. can it ever conclude that `copy_A` and `copy_B` made edits to the **same line** )? Note that none of the processes remove lines, they both **add** lines, but I wonder if `diff` (specifically `git`) could ever conclude that they were editing the same line (as opposed to concluding that they both **added different lines** ) In my case specifically, I am working with `csv` files (both processes append records to their own copies of a `csv` file, i.e. the original `csv` file being the same at the beginning), and I am hoping to **git merge** these csv files hopefully automatically without conflicts. Can I make that assumption? ### Update: Assuming that both processes are **appending** lines to the same file on their own branches that we hope to merge onto master at some point. Is there any way to tell git (diff) that they both correspond to additions to have it automatically merge the changes (adding entries perhaps in block, e.g. all of A's additions followed by B's additions)


title: How can I launch the sub applets in the GNOME's Control Center (v3) directly from the command line?

text: Is there a trick to launching these applets via the command line directly vs. having to launch the GNOME Control Center (aka. Settings) and then navigating to them through the UI?


title: lsmod returns nothing on my embedded device

text: I have put a vendor supplied embedded Linux installation (called X-Linux) onto a hardware device. I ran `lsmod` to see what modules are loaded and nothing at all is shown. Also there is no /proc/modules directory on the system. What does this mean? Does it mean that no drivers are loaded to communicate with the rest of the devices on the board (ethernet, serial etc?). I don't see how this can be as I have been able to configure the static IP of the board and am able to successfull `ftpget` files from my desktop development machine. I really am unsure about what is going on and about the stability of the system. Is this is a problem or is it expected behaviour?


title: how can I make cron run a job right now, for testing/debugging? without changing the schedule!

text: I have a cron job that is scheduled to run everyday, other than changing the schedule, is there any other way to do a test run of the command right now to see if it works as intended?


title: Open html attachments externally in mutt

text: I recently managed to set up the my mailcap so that mutt can show html e-mails in the message window:               # ~/.mailcap     text/html; lynx -dump '%s' | more; nametemplate=%s.html; copiousoutput;      which is automated by:               # ~/.muttrc     auto_view text/html      Although I think `lynx` does a decent job on decripting the html to text, sometimes this doesn't cut it and I would like to be able to open the html attachment in my web-browser (`luakit`). Is there a way to transparantly do this? A good workflow for me would look like:   1. open mail (`lynx` converts it)   2. see that it is to complilcated for `lynx`   3. press "v"   4. navigate to html attachment   5. press "enter" to open in `luakit`.


title: How to exclude all files except specific files with Duplicity?

text: I'm trying to only backup specific files with Duplicity so I first used this command:               duplicity /source-path --include "**/*/*.txt" --include "**/*/*.xml" /dest-path      However this gives the following error:               Last selection expression:         Command-line include glob: **/*/*.txt     only specifies that files be included.  Because the default is to     include all files, the expression is redundant.  Exiting because this     probably isn't what you meant.      Then I tried to exclude everything and then include just what I need:               duplicity /source-path --exclude "**/*" --include "**/*/*.txt" --include "**/*/*.xml" /dest-path      But I'm still getting the same error. How would I go about doing this, basically only backup the .txt and .xml on the source?


title: why does find command use {} for a placeholder variable?

text: I'm curious as to why `find` uses `{}` as the syntax for variable substitution (e.g., as in `find . -name "*~" -exec rm {} \;`). It's a rather unusual syntax, and I don't know any other programs or languages that use `{}` as a placeholder.


title: Why doesn't sudo -S work for 'mysql' command?

text: I generally run `sudo mysql database < database.dump` and type the password on prompt. In order to automate this, I tried to execute `echo 'password' | sudo -S mysql database < database.dump` but it is not recognizing my password. I have also tried without success:               mysql_cmd="mysql database < database.dump"     echo 'password' | sudo -S $mysql_cmd      I can `sudo -S` other commands normally. What might be the problem?


title: why do I get no output from zenity in shell script under gnome-schedule

text: I am using Fedora Linux 12, and intend to update to an up-to-date version soon. To prepare for this I have made a full backup on an external drive. I want to keep this backup up to date, using rsync, with the system described in: `http://webgnuru.com/linux/rsync_incremental.php`. To schedule the backups I want to use gnome-schedule, and to output reassuring messages to my computer screen with zenity. I am testing this on a small scale before I commit all my precious to it, and here is a listing of my shell script. The updates work perfectly, so my question is: why do I get no output from the zenity command at the end?               #!/bin/bash     # Adapted from: http://webgnuru.com/linux/rsync_incremental.php     #  Website Backup Script     #======================================================================     # Define Variables     # Todays date in ISO-8601 format e.g. 2013-10-19:     DAY0=`date -I`      # Yesterdays date in ISO-8601 format:     DAY1=`date -I -d "1 day ago"`     # The source directory:     SRC="/home/Harry/testrsync/bravo/"     # The target directory:     TRG="/home/Harry/testrsync/backups/$DAY0"      # The link destination directory:     LNK="/home/Harry/testrsync/backups/$DAY1"     #The rsync options:     OPT="-avh --delete --link-dest=$LNK"     #======================================================================     #Execute the backup     rsync $OPT $SRC $TRG     #Delete old backups cyclically     # for my tests I am going to use a three day cycle     DAY4=`date -I -d "4 days ago"`     #Delete the backup from 4 days ago, if it exists     if [ -d /home/Harry/testrsync/backups/$DAY4 ]     then     rm -r /home/Harry/testrsync/backups/$DAY4     fi     zenity --info --text='Backup complete' --title="Backup Test"


title: Accessing a different computer on the network

text: At work we have a large network of computer, some linux, some windows. On a windows machine I can go in to my computer and access a network drive simply by typing \ip-address\folder. It'll often ask me for a user name and password and I'll be in. How can I access these network drives from the command line in linux (ubuntu and red hat)?


title: How to identify process accesing usb port (scale)?

text: I'd like to identify through terminal which processes are using the scale connected to my mac, I need to kill those processes or clean the port to be used only by my app. Thanks a lot in advance.


title: Replace multiple spaces with one using 'tr' only

text: I have a file, `f1.txt`:               ID     Name     1      a     2         b     3   g     6            f      The number of spaces is _not_ fixed. What is the best way to replace all the white spaces with one space using only `tr`? This is what I have so far:               cat f1.txt | tr -d " "      But the output is:               IDName     1a     2b     3g     6f      But I want it to look like this:               ID Name     1 a     2 b     3 g     6 f      Please try and avoid `sed` :)


title: FreeBSD gettytab configuration

text: I have a serial port on my system which is named cuau3 under FreeBSD. I want to change the properties of this port, I can change the device's speed using `/etc/ttys` and `/etc/gettytab` files, but I can't change other properties e.g. parity, stopbits, etc ... . I've added the following entry to the `/etc/gettytab` file :               test.std.115200:\     :ep:sp#4800:tc:Pc      And also I've changed `/etc/ttys` file               cuau3   "/usr/libexec/getty test.std.115200"    cons25  on secure      I expect the `/dev/cuau3` device to use even parity and a speed of4800, but when I check the device properties using `stty -f /dev/cuau3`, only the speed changes to 4800 and the parity value doesn't change. Here's the output of `stty -f /dev/cuau3` after applying the changes using `kill -HUP 1` command.               speed 4800 baud;     lflags: -icanon -isig -iexten -echo     iflags: -icrnl -ixon -ixany -imaxbel -brkint     oflags: -opost tab3     cflags: cs8 -parenb


title: Problem with chown directory

text: i'm login with root account i want to chown my directory i do this:               [root@sop /]# chown -R webadm:webgrp /ap/P12B/      I have this error: > chown: changement de propriétaire pour `/ap/P12B/': Système de fichiers > accessible en lecture seulement > > chown: changing ownership of `/ ap/P12B / ': file system read-only My directory is mount like this:               /dev/vg_ap/lv_p12b           /ap/P12B             ext3    defaults        1 2


title: vim search numbers containing specific number of digits

text: I need to find specific length numbers in a big document. I tried to use regex for this. For example, If I need to search for numbers with exactly 2 digits, I use `/d/d` (i.e. /d twice followed by a space). This works well. But for finding 10 digit numbers it's not really feasible to type in `/d` 10 times. Tried `/d{2}`, says ' _E486: Pattern not found: \d{2}_ ' Is there any quicker/easier way to achieve this?


title: resolve the server hostname of a dnsmasq server with multiple subnets

text: I have a self-made Linux router running dnsmasq. It has two different NICs through which clients are connected; one of them has the subnet `192.168.1.` and one the subnet `192.168.2.`. My `/etc/dnsmasq.conf` looks like this:               except-interface=enp1s0     dhcp-range=interface:wlp2s0,192.168.1.10,192.168.1.25,255.255.255.0,48h     dhcp-range=interface:enp0s29f7u4,192.168.2.10,192.168.2.25,255.255.255.0,48h      Resolving the clients works between subnets, but from neither subnet can I resolve the hostname of the server itself. If I add a static rule using `address=/name/IP` I have to choose on of the subnets and pinging (among other things) does not work from the other subnet. So for example if I set               address=/name/192.168.1.1      then I can resolve the hostname from the `192.168.2.` subnet, but pings are unanswered. How do I solve that situation? I would like not having to bridge the interfaces or something like this.


title: Autocomplete newest file

text: I have a process which creates text files whose filenames are based on the timestamp of their moment of creation:               $ ls     1378971222.txt     1378971254.txt     1378971482.txt     1378971488.txt     1378972089.txt     1378972140.txt     1378972141.txt     1378972153.txt     1378972155.txt     1378972241.txt      **How might I auto-complete the filename of the latest created file** , i.e. the file with the latest mtime? There is no way to use Tab-completion for these files as almost every character in the filename is shared with another file. I am hoping to find a shortcut (such as `Alt .` which autocompletes the last argument of last command). I have managed to concoct the following alias which is great for `VIM`, but I would love to know if a general-purpose shortcut exists that I could use with `kde-open`, `sqlite3`, and other applications.               alias lastest="vim `ls -t | grep -vE "^total [0-9]*$" | head -n1`"


title: traceroute and ping from school network

text: I have a server in my school. If I do a `traceroute` command for some host within our school network, I am able to reach the host. So for example,               traceroute hostname.xxx.edu          traceroute to hostname.xxx.edu (xxx.xxx.xx.xx), 30 hops max, 40 byte packets      1  reserved-xxx-2.xxx.edu (xxx.xxx.xxx.x)  0.858 ms  0.924 ms  0.980 ms      2  hostname.xxx.edu (xxx.xxx.xx.xx)  0.446 ms !X  0.438 ms !X  0.423 ms !X      Similarly, `ping hostname.xxx.edu` also works successfully. However, if I try,               traceroute to www.google.com (64.233.160.99), 30 hops max, 40 byte packets      1  reserved-xxx-2.xxx.edu (xxx.xxx.xxx.x)  34.605 ms  34.658 ms  34.711 ms      2  * * *      3  * * *      4  * * *      5  * * *      6  *      So, when I tried `ping www.google.com`, it failed as expected. **QUESTIONS** So as per my understanding, the firewall of my school network is blocking my server from contacting the outside world. Is this correct? However, if I do command like `curl www.google.com` I get the perfect output. In fact, I had extracted so much information from websites using my shell script in this server. How did the shell script work if the firewall is blocking the outside world from accessing my server?


title: privoxy: rewrite html "http" links to "https"

text: I'm using the Privoxy proxy on my PC. What is the rewrite rule in the `user.action` file to rewrite e.g.: `http://foo.org` to `https://foo.org`? Note that I want to rewrite, not redirect. So if I search google for `foo.org` then on the search page there would be `https://foo.org`. Would the rewrite work on e.g.: `https://encrypted.google.com/`? Or is redirecting better because there could be e.g.: `<img src="foo.org/pic.jpg"></img>`?


title: What bit of the xfce DE controls the wallpaper?

text: I want to have the glmatrix xscreensaver running as my desktop background, which works well on pure openbox, but in xfce I need to kill whatever is is running the root window (as far as I understand). What process is this in xfce?


title: vim: delete lines before cursor

text: We can delete lines after the cursor (e.g.: the next 3 lines) with:                 3dd      But how can we delete the lines before the cursor? (e.g.: 3 lines before cursor)?


title: How to work around missing 'last-modified' headers?

text: I'm running **`wget`** like this:               wget --mirror --adjust-extension --convert-links --no-cookies http://tshepang.net -o log-main      I get a bunch of these messages:               Last-modified header missing -- time-stamps turned off.      I suppose that means that pages keep getting re-downloaded, even though I have them locally. **NOTE** : I want this so that I don't have to re-download existing files each time I run the command mirror.


title: Can you further integrate and present sequential moreutils vipe command output in vim using successive splits etc?

text: I have used the `moreutils` suite a few times and I find it makes you think further about base utilities and is insightful(and fun). For instance, `vipe` allows running an editor - like `vim` - in the middle of a pipeline and editing the data before continuing the execution1. For instance:               function refcheck_vipe() { echo -n "$@ documentation last udate: "; links -dump "http://www.gnu.org/software/$@/manual"| vipe | grep 'last updated' | vipe | cut -d ' ' -f 7,8,9 | vipe ; }     # refcheck_vipe grep      Every time(3) `vipe` is arbitrarily placed in the pipeline, and therefore called, you are presented with the data in vim, and once you quit, the execution continues. So here you'll get the _webpage_ , the matched _line_ and finally the isolated _string_. Maybe what is missing is that I keep the used buffers along the way to compare the contents in some cases... * * * I did not know you could _multiplex_ the layout of the buffers in `vim`(!). Now I wonder if I were to launch my command on the vim _cli_ , could there be a way to redirect every vipe execution "step" to a different buffer. And allow the `tmp` file to continue displaying the contents in some way after I quit. Indeed, you must do `:q` for the execution to continue until the next "step" so I don't know how to reconcile what I've just said with this. On the other hand I note that I can do `:split new` then `:r! ls` and the output of this goes into that. * * * To summarize and add context, I'm thinking about something like this:               command1 | vipe1 | command2 | vipe2 | command n | vipe n          would be wrapped by the answer to produce this in vim(the vipe part):     -------------------------     |       |       |       |           A buffer would open to the right side     | vipe  | vipe  | vipe  |           for every vipe command in the pipeline.     | step1 | step..| step n|                |       |       |       |     |       |       |       |     -------------------------     |           |           |           Bottom left you see a "file manager".     |find . | \ | whatever  |           Its contents could be refreshed, from     |vidir -    |           |           time to time.     -------------------------     :cli      I know `vim` is not a _window manager_ or _multiplexer_. The goal here is showcasing the processing of data in shell commands, while improving my vim skills2. The focus is `vim`, but considering `vipe` reads the EDITOR variable, I would also read with interest a solution leveraging `emacs`. So is there some alias/function/setup I could implement to accomplish what I have described(allowing comparison of the output I get in a sort of integrated way by adding buffers visually to the right side in the editor, for every `vipe` command in the pipeline)? * * * 1. If I string together some commands with regular expressions and it doesn't work(often the case), I'll backtrack, removing commands and simplifying expressions in the pipeline until I can isolate the issue. So `vipe` can assist in some cases. 2. As well as coping with the scenario where I have to use a system and _Openbox_ or _i3_ is not present!! [..] Not referenced but making an appearance in the code sample, `vidir`.


title: Which IPC is supported in Ubuntu 12.04: POSIX or System V

text: How do I know which type of IPC is supported in Ubuntu 12.04: System V or POSIX Is there any command to get this ?


title: Modify $READLINE_LINE and $READLINE_POINT values inside bash script

text: I already asked this question on stackoveflow, but received no answer and very few views. I thought I would post here as there should be more bash users and someone might have already stumbled upon this problem. According to SO Meta, it should be ok to do so as long as I link to the cross-website post. Tell me if I'm wrong though, and I'll just delete this question. * * * I tried to implement some features of `ksh` path autocompletion in `bash` by binding a custom script to a key. In order to do that, my script read the informations from `bind` variables `$READLINE_LINE` and `$READLINE_POINT` and attempts to update those values. While I can read the line buffer without issues, I can't seem to modify those variables and update the current line. Quotting bind mand page, this should work though : > When shell-command is executed, the shell sets the READLINE_LINE variable to > the contents of the readline line buffer and the READLINE_POINT variable to > the current location of the insertion point. If the executed command changes > the value of READLINE_LINE or READLINE_POINT, those new values will be > reflected in the editing state I bound my scipt with `bind -x '"\t":autocomplete.sh'`, and did something like this :               #!/bin/bash     #autocomplete.sh     echo $READLINE_LINE $READLINE_POINT   #I can read the current line values     EXPANSION=($(magical_autocomplete $READLINE_LINE))     #we store the desired value for the line in ${EXPANSION[0]}     [[ ${#EXPANSION[@]} -gt 1 ]] && echo ${EXPANSION[@]:1} #we echo the match if there are more than 1          READLINE_LINE=${EXPANSION[0]}     READLINE_POINT=${#READLINE_LINE}     #echo READLINE_LINE READLINE_POINT echoes the correct values found by magical_autocomplete     #however the current line & the current point is not updated      As I am echo-ing some informations, I can't just redirect the ouptut of my script to `$READLINE_LINE` in the `bind` call. Why can I read from the variables but not write into them ?


title: cannot find device "eth0"

text: **Hey Arch linux users out there!** I am new to arch linux( coming from ubuntu), and have just installed arch linux on my machine. After rebooting I wanted to install some packages using `pacman -S`, but I saw that my machine wasn't able to fetch the files from the servers, I interrupted the installation ustn `<Ctrl-C>`. So I tried to update my repositorys using `pacman -Sy`, this didn't work because pacman wasn't able to fetch the packages. So I tried to `ping` a few IPs, wich didn't work because `network is unreachable` After that I tried to set my eth0 up using `ip link set eth0 up` it returned me this error: `cannot find device "eth0"` the command `ip link` showed that `lo` (of course) and `emp1s0`(what the heck is that?) are up. I tried to set `emp1s0` down using `ip link set emp1s0 down` wich returned `cannot find device "emp1s0"` I also tried to load the kernel module `tg3` manually and to start `dhcpd` manually, both didn't work. I actually do't know how to go on.


title: Alert notification for unauthorized users

text: ![enter image description here](http://i.stack.imgur.com/KlmGu.jpg)![enter image description here](http://i.stack.imgur.com/JVmyi.png) Hi I'm using a Phidgets SBC (Single Board Computer ) connected to my PC. So I would like to create an Alert Notification so that whoever enters the Phidgets SBC, triggers an alert notification to the Main User. I'm not sure how to do it, I've searched and there is only results about Email notification. However the PC and Phidgets SBC are not connected to the internet, so I don't think email notification is possible, I was thinking if it could show a pop up banner with alert. Is it possible? I'm using Putty for SSH.


title: How to make a script for run apps for 1 second?

text: I have the following bash script for running some apps in a folder for 1 second each (for testing):               #!/bin/bash     for app in ./*.app     do         myrunner $app &         sleep 1         killall -9 myrunner     done      But I think using "killall -9" is not the real best way for doing it, is there a better one?


title: How can I monitor serial port traffic?

text: Is there any port monitoring tool to watch the packets written on the port? I especially want to check if my program written in Java works so I need some kind of tool to see if my little application is writing the messages to the port. How do I do this?


title: How to make wget save the web page contents to a file?

text: I'm trying to use wget to save the text of a web page. I run:               wget "http://www.finance.yahoo.com/q/op?s=GOOG" > goog.txt       to try and save the web page to goog.txt, but instead wget tells me:               Saving to: `op?s=GOOG'      Why is wget acting like this, and how can I get the expected behavior?


title: How does TAB auto-complete find options to complete?

text: And how does it also autocomplete aliases?