title: Networking not working on ubuntu server 12.10 on B75MA-P45 mobo

text: Just got some new parts to but together a local development server with Ubuntu server 12.10 and I can't get networking working. I have an airport extreme for my router and it works find with CentOS boxes I have running now. it uses DHCP. I have tried using auto and static configurations in `/etc/network/interfaces` with no luck I also followed this guide to install the rtl8168 driver http://unixblogger.wordpress.com/2011/10/18/the-pain-of-an-realtek- rtl8111rtl8168-ethernet-card/ `ping 8.8.8.8` gives the error "Network is unreachable" `ifconfig`:               eth0    Link encap:Ethernet HWaddr ***             UP BROADCAST MULTICAST MTU:1500 Metric:1             RX packets:0 errors:0 dropped:0 overruns:0 frame:0             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0             collisions:0 txqueuelen:0             RX bytes:1184 (1.1 KB) TX bytes:1184 (1.1 KB)             ....      removed HWadder and left the Local loopback in the above output I tried changing ethernet cables This is a new install on a new box, it was never able to connect to the internet, even during initial install and after a reinstall I am using the B75MA-P45 motherboard from MSI. I also have a PWLA8391GT pci adapter if that would help. I have tried without the adapter installed. Any suggestions? **UPDATE** After fixing the issue with the driver my ethernet card is now working so I can ssh to the server. But I would like to get the tcp on the actual motherboard working. this is the current output of `ifconfig -a`               eth0      Link encap:Ethernet  HWaddr ***                inet addr:10.0.1.99  Bcast:10.0.1.255  Mask:255.255.255.0               inet6 addr: fe80::92e2:baff:fe39:5c9c/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:160632 errors:0 dropped:0 overruns:0 frame:0               TX packets:84432 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:214002238 (214.0 MB)  TX bytes:11277417 (11.2 MB)          lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:275 errors:0 dropped:0 overruns:0 frame:0               TX packets:275 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:20610 (20.6 KB)  TX bytes:20610 (20.6 KB)          p1p1      Link encap:Ethernet  HWaddr ***                 BROADCAST MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)               Interrupt:42 Base address:0xc000           virbr0    Link encap:Ethernet  HWaddr ***                inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0               UP BROADCAST MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)      What is `p1p1` and `virbr0`? How do i use them/configure them so that I can use the other tcp port?


title: Difference between wget versions

text: I have problem with wget behavior for 1.10 and later versions. I am using wget to download a report from my app. **version 1.10.2:**               >wget-1.10.2.exe --http-user=trader --http-passwd=trader http://192.168.1.222:8080/myapp/reports/FP201010271100      --11:52:46--  http://192.168.1.222:8080/myapp/reports/FP201010271100                => `FP201010271100.5'     Connecting to 192.168.1.222:8080... connected.     HTTP request sent, awaiting response... 200 OK     Length: unspecified [text/csv]         [ <=>                  ] 82,068        --.--K/s     11:52:46 (1019.65 KB/s) - `FP201010271100' saved [82068]      **version 1.11.4:**               >wget-1.11.4.exe --http-user=trader --http-passwd=trader http://192.168.1.222:8080/myapp/reports/FP201010271100     --2010-10-27 12:15:10--  http://192.168.1.222:8080/myapp/reports/FP201010271100     Connecting to 192.168.1.222:8080... connected.     HTTP request sent, awaiting response... 302 Found     Location: http://192.168.1.222:8080/myapp/spring_security_login [following]     --2010-10-27 12:15:10--  http://192.168.1.222:8080/myapp/spring_security_login     Reusing existing connection to 192.168.1.222:8080.     HTTP request sent, awaiting response... 404 Not Found     2010-10-27 12:15:10 ERROR 404: Not Found.      Do I need to add some parameter for version 1.11 and later? ## Update - Wireshark dump **version 1.10.2:**               No.     Time        Source                Destination           Protocol Info          17 13.756462   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1          18 13.767667   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=1460          19 13.767721   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=1 Ack=1 Win=64240 Len=0          20 13.774991   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [PSH, ACK] Seq=1 Ack=1 Win=64240 Len=189          21 13.776327   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [ACK] Seq=1 Ack=190 Win=65535 Len=0          22 13.933894   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [ACK] Seq=1 Ack=190 Win=65535 Len=1420          23 13.934039   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=1421 Ack=190 Win=65535 Len=1276          24 13.934180   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=2697 Win=64240 Len=0          25 13.935194   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=2697 Ack=190 Win=65535 Len=1348          26 13.945109   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=4045 Ack=190 Win=65535 Len=1348          27 13.945473   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=5393 Win=64240 Len=0          28 13.948389   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [ACK] Seq=5393 Ack=190 Win=65535 Len=1420          29 13.948443   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [ACK] Seq=6813 Ack=190 Win=65535 Len=1420          30 13.948491   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=8233 Win=64240 Len=0          31 13.948555   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [ACK] Seq=8233 Ack=190 Win=65535 Len=1420          32 13.948604   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=9653 Win=62820 Len=0          33 13.948650   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=9653 Ack=190 Win=65535 Len=1132          34 13.954507   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=10785 Win=64240 Len=0          35 13.955210   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=10785 Ack=190 Win=65535 Len=1348          36 13.972055   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=12133 Ack=190 Win=65535 Len=1348          37 13.972179   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=13481 Win=64240 Len=0          38 13.973166   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=13481 Ack=190 Win=65535 Len=1348          39 13.973230   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=14829 Ack=190 Win=65535 Len=1348          40 13.973290   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=16177 Win=64240 Len=0          41 13.975002   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=16177 Ack=190 Win=65535 Len=1348          42 13.975035   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=17525 Ack=190 Win=65535 Len=1348          43 13.975057   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=18873 Win=64240 Len=0          44 13.975210   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=18873 Ack=190 Win=65535 Len=1348          45 13.975523   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=20221 Ack=190 Win=65535 Len=1348          46 13.975553   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=21569 Win=64240 Len=0          47 13.983036   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=21569 Ack=190 Win=65535 Len=1348          48 13.983260   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [ACK] Seq=22917 Ack=190 Win=65535 Len=1420          49 13.983290   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=24337 Win=64240 Len=0          50 13.983324   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=24337 Ack=190 Win=65535 Len=1276          51 13.983833   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=25613 Ack=190 Win=65535 Len=1348          52 13.983867   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=26961 Win=64240 Len=0          53 13.984210   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=26961 Ack=190 Win=65535 Len=1348          54 13.984641   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [ACK] Seq=28309 Ack=190 Win=65535 Len=1420          55 13.984672   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=29729 Win=64240 Len=0          56 13.984705   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=29729 Ack=190 Win=65535 Len=1276          57 13.984946   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=31005 Ack=190 Win=65535 Len=1348          58 13.984968   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=32353 Win=64240 Len=0          59 13.986763   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=32353 Ack=190 Win=65535 Len=1348          60 13.986792   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [ACK] Seq=33701 Ack=190 Win=65535 Len=1420          61 13.987044   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=35121 Win=64240 Len=0          62 13.987088   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=35121 Ack=190 Win=65535 Len=1276          63 13.987180   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=36397 Ack=190 Win=65535 Len=1348          64 13.987194   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=37745 Win=64240 Len=0          65 13.993156   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [ACK] Seq=37745 Ack=190 Win=65535 Len=1420          66 13.993181   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=39165 Ack=190 Win=65535 Len=1276          67 13.993220   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=40441 Win=64240 Len=0          68 14.013124   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=40441 Ack=190 Win=65535 Len=1348          69 14.014498   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [ACK] Seq=41789 Ack=190 Win=65535 Len=1420          70 14.014539   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=43209 Win=64240 Len=0          71 14.014574   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=43209 Ack=190 Win=65535 Len=1276          72 14.014585   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=44485 Ack=190 Win=65535 Len=1348          73 14.014595   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=45833 Win=64240 Len=0          74 14.015232   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=45833 Ack=190 Win=65535 Len=1348          75 14.015248   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=47181 Ack=190 Win=65535 Len=1348          76 14.015263   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=48529 Win=64240 Len=0          77 14.015911   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=48529 Ack=190 Win=65535 Len=1348          78 14.016112   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=49877 Ack=190 Win=65535 Len=1348          79 14.016132   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=51225 Win=64240 Len=0          80 14.016643   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=51225 Ack=190 Win=65535 Len=1348          81 14.016865   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=52573 Ack=190 Win=65535 Len=1348          82 14.016887   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=53921 Win=64240 Len=0          83 14.017095   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=53921 Ack=190 Win=65535 Len=1348          84 14.018786   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [ACK] Seq=55269 Ack=190 Win=65535 Len=1420          85 14.018823   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=56689 Win=64240 Len=0          86 14.018981   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=56689 Ack=190 Win=65535 Len=1276          87 14.018994   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=57965 Ack=190 Win=65535 Len=1348          88 14.019008   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=59313 Win=64240 Len=0          89 14.024666   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [ACK] Seq=59313 Ack=190 Win=65535 Len=1420          90 14.024685   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=60733 Ack=190 Win=65535 Len=1276          91 14.024712   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=62009 Win=64240 Len=0          92 14.025221   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=62009 Ack=190 Win=65535 Len=1348          93 14.026959   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=63357 Ack=190 Win=65535 Len=1348          94 14.027000   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=64705 Win=64240 Len=0          95 14.027035   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=64705 Ack=190 Win=65535 Len=1348          96 14.027045   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=66053 Ack=190 Win=65535 Len=1348          97 14.027053   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=67401 Win=64240 Len=0          98 14.027637   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=67401 Ack=190 Win=65535 Len=1348          99 14.028162   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=68749 Ack=190 Win=65535 Len=1348         100 14.028190   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=70097 Win=64240 Len=0         101 14.028634   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=70097 Ack=190 Win=65535 Len=1348         102 14.029058   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=71445 Ack=190 Win=65535 Len=1348         103 14.029076   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=72793 Win=64240 Len=0         104 14.029392   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=72793 Ack=190 Win=65535 Len=1348         105 14.029819   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=74141 Ack=190 Win=65535 Len=1348         106 14.029841   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=75489 Win=64240 Len=0         107 14.030139   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=75489 Ack=190 Win=65535 Len=1348         108 14.030510   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [ACK] Seq=76837 Ack=190 Win=65535 Len=1420         109 14.030530   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=78257 Win=64240 Len=0         110 14.030557   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=78257 Ack=190 Win=65535 Len=1276         111 14.031644   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=79533 Ack=190 Win=65535 Len=1348         112 14.031673   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=80881 Win=64240 Len=0         113 14.032084   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [PSH, ACK] Seq=80881 Ack=190 Win=65535 Len=1411         114 14.032093   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [FIN, ACK] Seq=82292 Ack=190 Win=65535 Len=0         115 14.032104   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [ACK] Seq=190 Ack=82293 Win=62829 Len=0         116 14.040620   10.0.2.15             172.25.9.238          TCP      kazaa > glrpc [FIN, ACK] Seq=190 Ack=82293 Win=62829 Len=0         117 14.041564   172.25.9.238          10.0.2.15             TCP      glrpc > kazaa [ACK] Seq=82293 Ack=191 Win=65535 Len=0      **version 1.11.4:**               No.     Time        Source                Destination           Protocol Info           1 0.000000    10.0.2.15             172.25.9.238          TCP      mpc-lifenet > glrpc [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1           2 0.021323    172.25.9.238          10.0.2.15             TCP      glrpc > mpc-lifenet [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=1460           3 0.021379    10.0.2.15             172.25.9.238          TCP      mpc-lifenet > glrpc [ACK] Seq=1 Ack=1 Win=64240 Len=0           4 0.026476    10.0.2.15             172.25.9.238          giFT     Response: GET /intraday/faces/reports/FP201010271100 HTTP/1.0           5 0.026990    172.25.9.238          10.0.2.15             TCP      glrpc > mpc-lifenet [ACK] Seq=1 Ack=143 Win=65535 Len=0           6 0.040137    172.25.9.238          10.0.2.15             giFT     Request: HTTP/1.0 302 Found           7 0.078133    10.0.2.15             172.25.9.238          giFT     Response: GET /intraday/spring_security_login HTTP/1.0           8 0.078741    172.25.9.238          10.0.2.15             TCP      glrpc > mpc-lifenet [ACK] Seq=237 Ack=278 Win=65535 Len=0           9 0.097840    172.25.9.238          10.0.2.15             giFT     Request: HTTP/1.0 404 Not Found          10 0.102113    10.0.2.15             172.25.9.238          TCP      mpc-lifenet > glrpc [RST, ACK] Seq=278 Ack=1585 Win=0 Len=0          11 0.103253    172.25.9.238          10.0.2.15             giFT     Request: ipt src="/myapp/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js" type="text/javascript"          12 0.103481    10.0.2.15             172.25.9.238          TCP      mpc-lifenet > glrpc [RST] Seq=278 Win=0 Len=0          13 0.103657    172.25.9.238          10.0.2.15             giFT     Request: .startBody = new Date();          14 0.103906    10.0.2.15             172.25.9.238          TCP      mpc-lifenet > glrpc [RST] Seq=278 Win=0 Len=0          15 0.104174    172.25.9.238          10.0.2.15             TCP      glrpc > mpc-lifenet [RST, ACK] Seq=3779959295 Ack=278 Win=0 Len=0          16 0.112019    172.25.9.238          10.0.2.15             TCP      glrpc > mpc-lifenet [RST, ACK] Seq=3779959295 Ack=278 Win=0 Len=0


title: Solaris: Script for finding the physical device path of all installed fiber cards

text: I have a number of systems (with quite varying type, generation and architecture unfortunately). I need to create a list of fiber cards on these varying systems. I am able to use prtconf -v, and correlate with prtdiag -v, and if need be luxadm or fcinfo to find this info, but with a large number of systems ahead of me, I am wondering two things. 1, if anyone has a script they've already made for themselves that finds this info. 2, If someone knows a super nifty one liner that would get the info I need out of the above command(s) so I can just script a wrapper on it and not spend a week logging into 4000 boxes. Again, not so much looking to learn how to find them, (although as always with unix, TMTOWTDI, so your input is welcome), but rather seeking a script that will hopefully take some work off me.


title: Resizing a Logical Volume holding a live virt guest

text: I've got a Red Hat Enterprise Linux Server release 5.5 (Tikanga). That I'm running four virtual guests on. In /dev/VolGroup01 I have the following partitions   xenvm01 xenvm02 xenvm03 Then I have snapshots like so   vm01_backup vm02_backup vm03_backup I'm wondering if there is any way for me to resize (grow) the LV /dev/VolGroup01/xenvm01 without first shutting down the virt. But it also seems as if I have to remove the snapshots before I can resize.


title: Arclinux running xfce4 fails to start

text: I run archlinux xfce4 with auto-login and auto start. After upgrading today 07-MAY-13 the X fails without leaving a error message in Xorg.0.log.


title: How to switch between users on one terminal?

text: I'd like to log in as a different user without logging out of the current one (on the same terminal). How do I do that?


title: Remove all capital letters from a particular column in a CSV file

text: I am having a CSV file containing 3000+ lines in the following format:               R1C1, ABC123abc, R1C3     R2C1, DEFG456defg, R2C3     R3C1, HIJKL789hijkl, R3C3      I need to remove all the capital letters from the second column of the file so that it reads as follows:               R1C1, 123abc, R1C3     R2C1, 456defg, R2C3     R3C1, 789hijkl, R3C3      How can this be done?


title: PHP 5.5.13 on CentOS 6.5 with yum

text: I've got problems with installing PHP 5.5.13 (last stable build) on a CentOS 6.5 (64 bit) machine, through `yum`. Can somebody guide me through this a little bit? It is not a part of the CentOS, EPEL or REMI repos as far as I can see. I get 5.4.29 with either of those repositories.


title: When adding a user to a new group when does the user group permissions become active when its a /nologin user?

text: I have a service level account to run my webserver, and this user is setup with `/sbin/nologin`. Normally when you add a user to a group you must logout and login to use the new group permissions. I'd like to add this user to another group to extend some of its permissions but since my webserver user never logs in, when or how will the user gain access to the new group permissions?


title: Can you set a program to open "always on top" by default in XFCE4 (xfwm4)?

text: For some reason I can't seem to find the answer to this. Setting "always on top" in the program's titlebar doesn't seem to persist after the program shuts down or the computer reboots. Please note that I do not use (and do not intend to use) XFCE sessions.


title: awk to Read between two Particular Strings and discard the rest

text: I'm using `awk` to just read text between two strings "Check" and "Result". I've used many variations of it found on the internet and still can't get the favored result. I've tried:               awk "/Check:/,/Result:/ {print}"  BMSCA209-040-transfer-report.18-Jun-2014.11:18.csv.tmp | more      And I also tried:               sed -n "/Check:/,/Result:/p" BMSCA209-040-transfer-report.18-Jun-2014.11:18.csv.tmp | more      And still not getting what I want. Each time I get it, this is what I get:               ata>    <data fieldName="Timepoint ID" value="B01 SCREENING"/>  <data fieldName="SQCSummary" value=" Nothing Submission Quality and Compliance Report - 201     4-06-03T14:30:00.547-07:00Check: Ensure slice thickness is between 2mm and 5mmResult: FailReason: Image(s) found with slice thickness out of range.   Instanc     e 1.2.840.113619.2.55.3.4094358250.93.1395417628.479.369 found with slice thickness out of range : 1.25   Instance 1.2.840.113619.2.55.3.4094358250.93.139541     7628.479.368 found with slice thickness out of range : 1.25   Instance 1.2.840.113619.2.55.3.4094358250.93.1395417628.479.367 found with slice thickness out     of range : 1.25   Instance 1.2.840.113619.2.55.3.4094358250.93.1395417628.479.366 found with slice thickness out of range : 1.25   Instance 1.2.840.113619.2.     55.3.4094358250.93.1395417628.479.365 found with slice thickness out of range : 1.25   Instance 1.2.840.113619.2.55.3.4094358250.93.1395417628.479.364 found     with slice thickness out of range : 1.25   Instance 1.2.840.113619.2.55.3.4094358250.93.1395417628.479.363 found with slice thickness out of range : 1.25   I     nstance 1.2.840.113619.2.55.3.4094358250.93.1395417628.479.362 found with slice thickness out of range : 1.25   Instance 1.2.840.113619.2.55.3.4094358250.93.     1395417628.479.361 found with slice thickness out of range : 1.25   Instance 1.2.840.113619.2.55.3.4094358250.93.1395417628.479.360 found with slice thicknes      Does anyone have any other suggestions?


title: How can I spy on X client messages?

text: In an evergoing battle against an ugly icon, I found that applications can communicate with the system tray by sending X client messages. Is there a utility for spying on these messages?


title: Routing internet on NAT server thru Squid proxy

text: I've configured a Squid proxy and a NAT instance and both are functioning fine. Now I want to configure a proxy server on the NAT instance so that the internet on NAT is routed through the Squid proxy server. This set up is configured on CentOS 6.3.


title: su not asking for password

text: My `su` does not ask for password. When I run `su` it simply logs me in to `root`. I tried `su - root` then it asks for password. Now, because of this `kdesu` runs applications with root rights without password. I tried replacing `su` with the following script               #!/bin/bash     /root/./su - root      exit      I moved my su into `/root`. Now `kdesu` asks for a password but hangs as soon as I hit `Enter` after typing the password. I'm using Arch Linux.


title: Why ssh does not turn terminal title back?

text: As you might know, when you ssh to a server from an X terminal (rxvt, gnome- terminal...), ssh changes the window title to reflect user@host, _but_ it does not change it back. There are many tips how to fix this around the Internets. I'm not asking for another one 1. What I am looking for is explanation why is it so. So I can learn to live with that. Why ssh does not set the title back? To put it more FITD way: if vim can do it, why ssh can't? 1 ...unless the explanation is that the problem is caused only by ssh misconfiguration in which case I welcome way to fix that.


title: How do I get a long listing for a single directory?

text: I want to see a long listing for a single directory. When I type `ls -lha`, I see this:               drwxrwxr-x  4 username groupname 4.0K 2010-08-05 09:55 files     drwxrwxr-x  7 username groupname 4.0K 2010-08-05 14:25 trunk     drwxrwxr-x  8 username groupname 4.0K 2010-08-05 16:02 phpincludes     drwxrwxr-x 11 username groupname 4.0K 2010-07-26 12:31 phpMyAdmin-3.3.5-english      However, when I type `ls -lha phpMyAdmin-3.3.5`, I get a listing of the contents of the directory. How do I type the command so that I see only               drwxrwxr-x 11 username groupname 4.0K 2010-07-26 12:31 phpMyAdmin-3.3.5-english      ? I want to do this with symlinked directories, so I can see where they're linked to, not their contents.


title: Download documents referenced by a web page with wget

text: I want to download all the documents pointed to by a web page with wget. When I run wget, it only downloads the webpage, not all the contents that the web page links to.               wget --content-disposition -v -S -r -nc -np -Kk -px --ignore-length \          --content-disposition --proxy-user "XYZ" --proxy-passwd "PASS" \          --no-check-certificate --load-cookies=cookies.txt --keep-session-cookies \          'https://www.website.com/link/live?func=lab&objId=174914395&objAction=browse&viewType=1'      Wget downloads only one page which is `https://www.website.com/link/live?func=lab&objId=174914395&objAction=browse&viewType=1`. That webpage contains:               DataStringToVariables( '( {"currentPageNum":1,"totalPages":1,"totalCount":21,"dbTimeTaken":0,"timeTaken":1,"haveBigImages":"fa lse1","myrows":[{"dataId":"177020845","type2":"184","typeName":"Document","name":"Action_Mar_JKill%2Exls", etc.      There are many xls,docs, pdf, etc but wget doesn't download them. How can I download them?


title: How to auto-start a service (apache2) with Linux Mint

text: (Strangley) My installed Apache2 does not start up when logging in to Linux Mint. Running this command gets it going:               sudo service apache2 start      How should I attempt to start up this service upon each login?


title: Mouse cursor wonky on Mint 16?

text: Mint 16, having an intermittent problem. sometimes mouse is normal, sometimes it goes into a period of time where it just doesn't move right. you go left, it goes sort of leftish. Sometimes moving the cursor is like pushing against a wall, you have to keep going left and the cursor jiggles but doesn't go the proper amount of left for the amount of physical movement. It feels like I'm fighting with it. You know what it's like when there are two mouses connected to a computer and someone is screwing with you by moving the other mouse? That. except it doesn't move on it's own, so I don't think there's another user. It goes away after a while, for a while, till it comes back. during the periods of wonkyness, the mouse is unusable. Mouse is wired. Any thoughts?


title: Apt/Aptitude: how to filter packages that are impossible to install?

text: Especially when running Sid, there are many packages that become non- installable as the dependencies change ABI versions, or the dependencies themselves may have been dropped. It'd be good to know how to filter these packages so that a potential maintainer can check what problematic packages are there on the repo. So far I came up with:               #!/bin/sh     apt-cache pkgnames|xargs apt-get -s install\     |sed "/ : /h;/installable/{x;/ .* :/{s/ \(.*\) :.*/\1/;b}};d" | sort      It does not recursively mark packages which depend on package "not going to be installed" X, where X is package that is marked because one of the dependecies is "not installable". E.g in the following:               foo : Depends on bar but not going to be installed     bar : Depends on baz but not installable      `bar` will be marked but `foo` will not. And I shouldn't just mark all packages that has the line "not going to be installed" because it could be bar is a package that exists but breaks another installed package.


title: How can I alias to `!!` (last command)?

text: `!!` in bash runs last command. I find it too difficult to type given how much I use it. `alias` to the rescue, I presumed. Or not. I tried:               $ alias dl='!!'               # Aliasing     $ echo Testing123             # Here's something to test on     Testing123     $ dl                          # Testing alias     bash: !!: command not found     $                             # I AM DISAPPOINT      Without quotes also fails. What's up?


title: Move files to specific directories

text: This question is the same as http://askubuntu.com/questions/47155/reorder- files-inside-folder: I have about 30K songs in mp3. I already organized/tagged them with Musicbrainz Picard. But Picard made an excess of folders and subfolders inside each other because of the tags. What I need now is a script to do the following inside the main music folder:   1. To read each subfolder and move all the mp3 files inside the subfolder's folders to the main subfolder. For example:               Music -          Offspring -           Album 1 - 20 songs           Album 2 - 30 songs           Album 3 - 5 Songs              Folder 1 - 2 Songs              Folder 2 - 3 Songs        Journey -           Song Pack 1 - 2 Songs                Packy 1 - 15 Songs                Packy 2 - 20 Songs                Packy 3 - 7 Songs           Album 2 - 20 songs           Whatever 3 - 10 Songs      After script they would be like this:                    Music -                Offspring - All Songs inside THIS folder. Not inside subfolders of Offspring.              Journey - All Songs inside THIS folder. Not inside subfolders of Journey.         And so on.. So all the music for each subfolder of each music group should not have any more subfolders and all songs inside their respective sub-subfolders should be moved to the main sub-folder of the music group. So when I check Music and I see the Bee Gees then I KNOW that all the songs are right there and not inside some subfolder of Bee Gees. NOTE - In some cases there are more than 20 recursive sub-folders. An example is: Music/Lady Gaga/1/Album/Lady Gaga/2/2/2/1/1/1/1/3/3Album 2/Lady Gaga/1/1/1/SONG.mp3. In this case i want the son inside Music/Lady Gaga and eliminate the rest of the folders. Please do not take into account that the files are mp3. Just think of them as normal text files or something since what I want can also be applied to group of files inside several folders.


title: parsing process ID/names from /proc, thread IDs

text: When I'm parsing process IDs from /proc, obviously each thread of a process gets its own ID. And I realize that all the threads in that same process can be gathered from `/proc/${pid}/task/`. But my question is, can I assume that the first ID in the list (the lowest numbered one?) is the main thread of the process? The goal I'm ultimately trying to do is write a quick `ps` script in python without using a subprocess or invoking the shell.


title: Disabling mirror option in preseed.cfg

text: I am installing Debain Weezy (netinstall) in VirtualBOX using `preseed.cfg`. I'm trying to create a `preseed.cfg` that would skip/not set Debian mirror in the `Configure the package manager` step. I am not installing any additonal packages (`tasksel tasksel/first multiselect none`) therefore "a very minimal base system" If I use `d-i mirror/country string manual` I get               Please enter the hostname of the mirror from which Debian will be downloaded      I then have to manually select `Go back` and select `Yes` when asked `Continue without a network mirror?`. Setting `d-i mirror/country string boolean false` gives the same dialogue. Additionally something like `d-i mirror/confirm boolean true` needs to be added too I think since it's a two-step dialogue.


title: cat combining not all file formats - but which ones?

text: In GNU⁄Linux, combining files with `cat` works in miraculous ways - at least for me: `cat part_* > /destination/file.xyz` with the same file format for BOTH source and target file(s) works like a charm for formats like `.ogg` and `mpg` and of course lain text files. But I get some quite interesting to weird results with other files.   * `.flac` -> Everything works fine, except that the combined file is displayed with the length of the initial file and then playing along all the other parts while still displaying the first file's length (just like the "hidden tracks" on CDs back then)   * `.pdf` -> exits without an error message and does nothing except displaying the first file (the one just after `cat` in the command) under the name given as destination, thus basically saving a copy under another name. **Question** : Is there a way other than Trial & Error to find out which file formats can be merged with `cat` and which can't? I've got that far that a lot depends on certain header formats inside the files - but then I wonder: "I thought every executable file has to start with a header?!".


title: Preseed.cfg ignoring host setting

text: I am installing Debian Wheezy (netinstall) in VirtualBox using `preseed.cfg`. I tried both `d-i netcfg/get_hostname string somehost` and `d-i netcfg/get_hostname string somehost`, but in both cases the host gets set as "debian". I tried both at the same time but still the host is set as "debian". Excerpt from Debian's guide about preconfiguration file: > If you want to force a hostname, regardless of what either the DHCP server > returns or what the reverse DNS entry for the IP is, uncommentand adjust the > following line > > d-i netcfg/hostname string somehost Is this a bug or am I just unlucky?


I recently upgraded my Ubuntu from 11.10 ( _Oneiric_ ) to 12.04 ( _Precise Pangolin_ ) on a **Dell Inspiron B130** Laptop. When I run `fdisk -l` it says that my HD doesn't contain a valid partition table. I have been reading a great deal about proper partitioning that leads me to believe that this is bad, but I have noticed no strange behavior or problems. What are the ramifications of not having a valid partition table?


title: nis and autofs manual restart after a reboot

text: I have a minor inconvenience involving NIS and `autofs`. I pull my home directory from an NFS server. It all works fine, except that I have to manually restart `nis` and `autofs` after each reboot. So after the system starts up, I need to switch to a console (or ssh into the machine) and do               sudo service nis restart     sudo service autofs restart      After this, everything works like a charm, with no problems. If I don't do that, I can't get past the login screen. To give an example, I have two users on the system, call them `localuser` (password and home directory on the machine) and `remoteuser` (password on the remote machine, home directory on NFS). Now, after a fresh reboot, I can log in as `localuser` with no problems. If I try to login as `remoteuser`, my password is accepted but no home directory is found, so if I try to log in using GNOME, I get an instant logout. I can still log in as `remoteuser` remotely or after switching to a text terminal (`ctrl`+`alt`+`f1`), but no home directory is found. After restarting NIS and `autofs` as mentioned above, I can log in as `remoteuser` with no further problems until a reboot. So my question is: how do I avoid manually restarting these services after each reboot? I have been using this computer as a standalone machine, and then moved it to a network, so I imagine some network settings were configured before I installed `autofs`.   I am using Ubuntu 12.04, but I had a similar problem on a different machine running older versions of Ubuntu.


title: Passing glob expressions to functions/scripts

text: The following script is supposed to concatenate multiple `csv` files in a path specified in the first argument into a single csv file specified in the second argument               #!/bin/zsh     set -x     set -v     args=("$@");     globbing_pattern=${args[1]}     output_file=${args[2]}          # First the headers:     head -n1 ${globbing_pattern}([1,1]) > $output_file          # Now concatenate everything:     find ${globbing_pattern} -print0 | xargs -0 cat >> $output_file      I would like to call this script with:               my_script '/some/path/*.csv' output.csv      but it doesn't work. I get:               find: /some/path/*.csv: No such file or directory      why?


title: Network connectivity issue between different hosts from a network namespace in one host

text: I have created two Ubuntu 12.04 VMs using VMWare Player with NAT network configuration. I am able to ping them from each other. After that, I created a network namespace in one of them and add a virtual interface. From the network namespace I can access the physical interface of the VM via the other end of the virtual interface which resides in the default namespace by adding a route in the namespace. I have enabled `ip_forward` for the VM which causes access to the Internet from the network namespace. However, I could not ping the other VM in the private network from the namespace. Can anyone explain the reason behind this. I am attaching my configuration:   1. Create a network namespace and make communication between virtual interfaces:              sudo ip netns add vnet       ip netns list     sudo ip link add veth0 type veth peer name veth1     ip link     sudo ip link set veth1 netns vnet     sudo ip netns exec vnet ip link list     sudo ip netns exec vnet ip link set dev lo up     ip netns exec vnet ping -c5 127.0.0.1     sudo ip addr add 10.0.0.1/24 dev veth0     sudo ip link set dev veth0 up     ip netns exec vnet ip addr add 10.0.0.2/24 dev veth1     ip netns exec vnet ip link set dev veth1 up     ip netns exec vnet ping -c5 10.0.0.1        2. Communication of virtual interfaces with the physical interfaces:              sudo ip netns exec vnet route add default gw 10.0.0.1 veth1        3. Communication of virtual interfaces with outside world:              echo 1 > /proc/sys/net/ipv4/ip_forward     echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp     echo 1 > /proc/sys/net/ipv4/conf/veth0/proxy_arp


title: pattern to install dependencies in linux

text: Different OSes have different standard way of installing package dependencies; in OS X, all library dependencies are copied in the `App` folder. Windows application developers have both options; they can install a library as a subpackage (for example, game installers would install directX library). But usually the user cannot choose if he wants the dependencies to be copied or be shared on the system In Linux, package managers (for example, `apt-get`) will resolve recursively the dependencies and install them system wide. This of course, doesn't necessarily solve the problem of dependency duplication, since applications might still use different versions or builds of the same source library For instance, some applications will require `libboost-filesystem1.42` but damn, I have libboost-filesystem-1.49 available, but that won't help because the package resolver can't figure out that I already have one. On the other hand, I don't want an old library being installed in system-wide paths, because I have already another version in there. **Question:** is there, or will there be a standard package manager option to allow dependencies for certain applications be installed in application- specific folders (like `App` folders in Mac OS X)?


title: bold text when using 256 colors

text: I am configuring colors in Mutt, but I think my problem is general to linux terminal. For the 16 predefined colors (such as `red`) I can make it bold, by specifying `brightred` However, when using 256 colors (such as `color208`), there is no such color as `brightcolor208`. I have following color theme in mutt:               color index color208 color236 ~T      How can I make the color208 bold (bright) ?


title: Why is "uname gcc" not working in Ubuntu

text: I know that `uname -a` shows the full machine name and details, etc. But I did `uname gcc` to see what the version of gcc I am running, and it returned `Linux` - **What does that mean?**               Ubuntu86: $ uname gcc     Linux      This is the machine I am on (I know it is old):               Ubuntu86: $ uname -a     Linux ubuntu86 2.6.8.1-3-386 #1 Tue Oct 12 12:41:57 BST 2004 i686 GNU/Linux      How can I check the version of gcc running on this machine? I installed it by typing:               Ubuntu86: $ sudo apt-get install gcc      So I know it has installed a version of gcc, but no idea what version.


title: Sorting with command ls in unix (ksh)

text: I'm wondering how does the sort works with `ls`.   For example:               ls - lrt tri par date     ls - lSr par size, ...      However I don't see how this pattern works.


title: Strange behavior in $(dirname `readlink -f $0`)

text: When I run the following as a normal user, everything is fine:               $(dirname `readlink -f $0`)      but after I switched to root, the following error occurred:               readlink: invalid option -- 'b'     Try `readlink --help' for more information.     dirname: missing operand     Try `dirname --help' for more information.      Any ideas? I tried on local Fedora 16 and Amazon EC2, both running bash shell. edit for illustration. apologze that I did not further illustrate the issue here. here is the scenario: using normal user account:               $ pwd      /home/myuser      $ export MY_DIR=$(dirname `readlink -f $0`)      $ echo MY_DIR      /home/myuser      using root:               # pwd     /root     # export ROOT_DIR=$(dirname `readlink -f $0`)     readlink: invalid option -- 'b'     Try `readlink --help' for more information.     dirname: missing operand     Try `dirname --help' for more information.          # export ROOT_DIR=echo $(dirname `readlink -f -- $0`)     # echo $ROOT_DIR     /root


title: libfaketime and Mac OS, LD_PRELOAD

text: Running Mac OS 10.7.2 and trying to run libfaketime and nothing happen. I installed and ran exactly as directed only the time and date stay exactly as are set in the system? Is anyone else able to successfully run this on OSX?               $ date     Mon Jan 30 21:05:09 CST 2012     $ LD_PRELOAD=./libfaketime.so.1 FAKETIME="-15d" date     Mon Jan 30 21:05:32 CST 2012


title: Sed not giving the first occurence of pattern

text: cat file contains                inet addr:192.168.154.102 Bcast:192.168.154.255 Mask:255.255.255.0      inet addr:127.0.0.1 Mask:255.0.0.0      i am extracting the ipaddress(`192.168.154.102` and `127.0.0.1`) using sed like this :               sed -ne 's/.*\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*/\1/p'      but it just gives :               5.255.255.0     5.0.0.0


title: Determining if GPU switching works?

text: I have a 8,3 MacBook Pro with an onboard Radeon 6700M GPU alongside the integrated Intel Sandy Bridge GPU. I recently upgraded to FGLRX 8.930/12.1, and Catalyst Control Center seemed to look the same, there weren't any different options as opposed to 8.920/11.12. However, here it mentions that someone tested things out and was able to determine that with FGLRX on the same card as me, they were able to determine that GPU switching was, in fact, working. Unfortunately, the blog doesn't allow comments, so I can't ask this question there. Is there a way for me to determine if GPU switching is working or not between ATI and Intel cards? How can I know if it's working or not? Again, there doesn't seem to be anything in CCC that tells me whether it's enabled or not. There's "PowerPlay," but that seems to be more of a setting for battery-saving in general and doesn't make any mention of GPU switching. How can I test if GPU-switching/hybrid graphics is enabled and working on my Ubuntu 11.10 machine?


title: Finding error log related to specific crash in Ubuntu

text: Every time I try to start a specific program (Mathematica), my Ubuntu session crashes and I get thrown back to login screen. I want to find out 1) what is it exactly that crashes (probably X) and 2) find the error log produced by this crash. I tried looking at .xsession-errors file, but the file is huge and I don't know how to find what I'm looking for from there. It would be ideal if I could somehow make X output its error log to another file temporarily or something. EDIT: The relevant error log was found from /var/log/syslog which says: "gnome-session[3679]: Gdk-WARNING: gnome-session: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.#012". This is possibly related to this bug: https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics- drivers/+bug/999191 .


title: Pcie 1.1 device is not detected on a pcie gen 3 slot

text: My PC is running in Ubuntu 12.04 LTS with kernel version 3.11.0-23. The link below is my PC model: http://www.villman.com/Product- Detail/HP_Pavilion_500_232d I inserted a x4 pcie 1.1 device on the x16 PCIE 3.0 slot. When I do lspci, my device is not shown in the list. I tested my device on other PC with Gen 2.0 slot and it is detected. Is there a way for my device to be detected?


title: Why don't I have read access to files with modified ACL?

text: My aim is to allow read access to folder `/var/www/mysite/` only for users in group www-data using a default **ACL**. **This works for a regular ACL, but not for a default ACL. Why?** This is how I did it: I am logged on as user _www-data_ who is in group _www-data_. I am in directory _`/var/www`_. I created a directory _mysite_ and gave it the permission 0. Then I added ACL permissions so that anyone in group _www-data_ has read-access to directory _mysite/_.               $ mkdir mysite     $ chmod 0 mysite     $ setfacl -m g:www-data:r-x mysite     $ ls -la     d---------+  2 root root 4096 Sep  6 11:16 mysite     $ getfacl mysite/     # file: mysite/     # owner: root     # group: root     user::---     group::---     group:www-data:r-x     mask::r-x     other::---      At this point user _www-data_ has access to the folder. However, if I instead add a default ACL, access is denied!               $ setfacl -m d:g:www-data:r-x mysite # <---- NOTE the default acl rule.     $ ls -la     d---------+  2 root root 4096 Sep  6 11:16 mysite     $ getfacl mysite/     # file: mysite/     # owner: root     # group: root     user::---     group::---     other::---     default:user::---     default:group::---     default:group:www-data:r-x     default:mask::r-x     default:other::---


title: How can I merge multiple lines with spaces (blank line) separating them?

text: I'd like to merge the following multiple lines of output so that they form a single line: _line 1:_ > > ,,,1,,,,,,,,18,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,42,1,121,1,17,10,21,1,,IU,8,0,,0, > ,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,1227,,,11,,0,,,,1,01,,,1,12769,,7707,0,,,,12769,,,12769,6,0,,,,10,,,1, > 901,10800,14/04/13,,,4,,,,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,A,,,,1001,,,,,,,,,,,01,,12769,0,,,,,,,,,,,,, > ,,,,,,,,,,,,,,,,14/04/13,10800,,,,,,,,,,,,,,,,,,,,,,1,,,,,,,,,964750001210,,1001,,1,,0,,,,,,,,,,,,17 > ,,,,,,,,,31685125704,,,,1,,1,0,,,,,,,,,,,,,,,,,,19,0,.901,19,0,.901,,,901,1,,,8767318,13790084045,1, > 1304150024556817,,,,33399399,,,,,,,,,,,,901,1,,,,,,0,,0,,,,,,GSMT11B* *** > _S_** ,,,4,,,,,,10800,14/04/1 > 3,10800,14/04/13,443867992,,,,,,,,1,0,,0,,,,,,,61409,51,,,9647507763683,,1001,1,0,,60,0,5,,N,,0,1,I, > 1,,,,,,47,,,,,54,1,4,19,,29,1,1,1,3,1112,2,,Usage,Usage,USG,,N,N,0,,1,,TRNT01I,90,,0GRI3,90,,,,,0,1, > 1,1,1,1,34111,437956,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,19,,,,,,,,,,,,,,,H,,1,0,1,0 _...blank line..._ _line 2:_ > > ,,,1,,,,,,,,18,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,42,1,121,1,17,10,21,1,,IU,8,0,,0, > ,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,399,,,11,,0,,,,1,01,,,1,61,,67,0,,,,61,,,61,6,0,,,,10,,,1,74,10800,14/ > 04/13,,,4,,,,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,A,,,,1001,,,,,,,,,,,01,,61,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,, > 14/04/13,10800,,,,,,,,,,,,,,,,,,,,,,1,,,,,,,,,964750001210,,1001,,1,,0,,,,,,,,,,,,17,,,,,,,,,9647703 > 026865,,,,1,,1,0,,,,,,,,,,,,,,,,,,19,0,.061667,19,0,.061667,,,74,1,,,8820807,13790084046,1,130415002 > 4556817,,,,33399399,,,,,,,,,,,,74,1,,,,,,0,,0,,,,,,GSMT11B* *** _S_** > ,,,4,,,,,,10800,14/04/13,10800,14 > /04/13,443867993,,,,,,,,1,0,,0,,,,,,,61409,51,,,9647503228592,,1001,1,0,,60,0,5,,N,,0,1,I,1,,,,,,20, > ,,,,25,1,4,19,,19,1,1,1,3,980,2,,Usage,Usage,USG,,N,N,0,,1,,ASIA03I,90,,0GRI3,90,,,,,0,1,1,1,1,1,341 > 12,437956,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,19,,,,,,,,,,,,,,,H,,1,0,1,0 _...blank line..._ _line 3:_ > > ,,,1,,,,,,,,18,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,42,1,121,1,17,10,21,1,,IU,8,0,,0, > ,0,0,0,,,,,,,,,,,,,,,,,,,,,,,,327,,,11,,0,,,,1,01,,,1,12769,,7707,0,,,,12769,,,12769,6,0,,,,10,,,1,2 > ,10800,14/04/13,,,4,,,,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,A,,,,1001,,,,,,,,,,,01,,12769,0,,,,,,,,,,,,,,,, > ,,,,,,,,,,,,,14/04/13,10800,,,,,,,,,,,,,,,,,,,,,,1,,,,,,,,,964750001210,,1001,,1,,0,,,,,,,,,,,,17,,, > ,,,,,,96171254836,,,,1,,1,0,,,,,,,,,,,,,,,,,,19,0,.002,19,0,.002,,,2,1,,,8825322,13790084047,1,13041 > 50024556817,,,,33399399,,,,,,,,,,,,2,1,,,,,,0,,0,,,,,,GSMT11B* *** _S_** > ,,,4,,,,,,10800,14/04/13,10800 > ,14/04/13,443867994,,,,,,,,1,0,,0,,,,,,,61409,51,,,9647501378572,,1001,1,0,,60,0,5,,N,,0,1,I,1,,,,,, > 47,,,,,54,1,4,19,,29,1,1,1,3,1112,2,,Usage,Usage,USG,,N,N,0,,1,,TRNT01I,90,,0GRI3,90,,,,,0,1,1,1,1,1 > ,34113,437956,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,19,,,,,,,,,,,,,,,H,,1,0,1,0 _...blank line..._


title: How to run awk for some number of lines.?

text: I want to extract some lines with `awk`. Is it possible to do the following task:               ls -l | awk 'BEGIN FOR(i=122;i<=129;i++) FNR==i'      How can I display the details from line numbers 122 to 129?


title: How to restore a DD image file in my primary disk on new debian server

text: I have a dedicated Debian server at Online.net and I want to change the server by a more powerful (always Debian OS). For that, I have made an image on my old hard disk with this command:               dd if=/dev/sda | gzip -c > /backup/sda1_image.gz       In my 2 machines, I don't have partitions and I have just one hard disk. My question : How I can to restore my image in my new Debian server, on his primary disk? It's possible to make it in ssh:               gzip -cd /backup/sda1_image.gz | dd of=/dev/sda      Question: I have to unmount my primary disk before the restoration ? Question: If I unmount the primary(boot) disk by ssh, it not freeze ? Because I just can access to my server in ssh (no phisical).


title: Mounting error while installing VM ware tools in Kali Linux

text: I'm new to Linux and I have installed Kali Linux on VM Workstation.I want to install the VM tools but when I click "install VMware tools" from the VM workstation menu I receive this error at the guest OS window "unable to mount VM ware tools error mounting:mount exited with with exit code 1:...." Does any on know what's the problem here and how I can proceed with the installation.


title: What is the .gitignore pattern equivalent of the regex (Big|Small)(State|City)-[0-9]*\.csv

text: I have a regex I stuck in my `.gitignore` similar to:               (Big|Small)(State|City)-[0-9]*\.csv      It didn't work so I tested it against RegexLab.NET. I then found the gitignore man page which led me to learn that gitignore doesn't use regexes, but rather fnmatch(3). However, fnmatch it doesn't seem to have an equivalent of the capture groups. Is this feasible or do I need to break this into three lines?


title: Does brand/hardware limit the distributions that are safe to run?

text: I recently tried running Fedora 16 on my laptop and had problems with the fan. In particular, the fan would start, run at full power, and never turn off. I spent a few hours online looking for solutions but didn't find any. I then reverted back to Ubuntu and had the problem disappear (after some minor configuration). I would really like to try different distributions, but I'm afraid that the hardware on my laptop would not be supported. Is there always a fix to these kinds of problems or should I just stick to what works? I have a Toshiba Satellite L305-S5945.


title: I can't login to Crunchbang Linux

text: I rebooted my VM and now I can't login. It gives me the following error:               Your session only lasted less than 10 seconds. If you have not logged out yourself, this could mean that there is some installation problem or that you may be out of diskspace. Try logging in with one of the failsafe sessions to see if you fix this problem.          View details (!/.xsession-errors file)          /etc/gdm/Xsession: Beginning session setup...     mkdtemp: private socket dir: Permission denied      When changing the session to failsafe gnome it gives me `Could not find the GNOME installation, will try running the "Failsafe xterm" session`. And when trying failsafe terminal I get `Cannot find "xterm" to start a failsafe session.` I had not rebooted my VM in a while; I can't think of something that would cause this. But how do I fix it? Edit: The output of `stat /tmp`:                 File: `/tmp`       Size: 4096        Blocks: 8        IO Block: 4096   directory     Device: 801h/2049d    Inode: 131238    Links: 13     Access: (0755/drwxr-xr-x) Uid: (    0/    root)  Gid: (    0/    root)     Access: 2012-02-15 06:18:42.360913478 -0700     Modify: 2012-02-16 19:17:01.514555114 -0700     Change: 2012-02-16 19:17:01.514555114 -0700


title: Set Variable Environment Variables in bash (or other)

text: I want my script to read a file containing key/value pairs of environment variables to set, and then to set them. So far, I have this:               #!/bin/bash          cat $1 | while read kv     do         key=${kv%=*}         val=`echo ${kv#*=} | sed 's/^"\|"$//g'`         export $key="$val"     done      And I want to read a file like this:               XAUTHLOCALHOSTNAME="localhost"     DISPLAY=":0"     XAUTHORITY="/tmp/some-XAuthority"      I only need these variables in scope for the duration of the script, so I don't need to solve the problem of setting a variable in script for the parent scope. From my testing, I think my problem lies with `export $key="$val"`, so I think I just need a replacement for that line.


title: dynamic display of a running process?

text: I am writing a script and acording to that when i run it certain info will be displayed on the output screen. for example say the **constant data** displayed is:               my name is mukesh.     i am 27 years old     unix version 7.2.3.0      but along with the above display something else is also need to be displayed( **varying data** ) i.e               Process A is starting     Process A is running     Process A is completed.      but i dont want the above display. I want `Process A is starting` to be cleared from screen and replaced by `Process A is running` and then by `Process A is completed.` i am not very keen to use `clear` as it will remove the whole screen containing the **constant data** also. and also because the constant data takes a lot of time to process and to be displayed on the screen.


title: Two way internet sharing configuration (swiching modem from one machine to another)

text: I have:   1. One Raspberry Pi with Raspbian (distribution based on Debian), with one enthernet interface   2. One laptop with windows, with one ethernet interface   3. One USB modem   4. Ethernet cable between Pi and laptop I want to:   1. Share internet on Raspberry Pi when modem is connected to Pi   2. Use internet which is shared on laptop when modem is connected to laptop. What I have done:   1. My modem is working on both machines, its ppp0 interface on Pi. ppp0 has dynamic IP.   2. Sharing internet from laptop to Raspberry works. Laptop IP: 192.168.137.1 Question: **How can I share internet on Raspberry Pi without ruining too much / reconfiguring network on both machines when I switch modem from one machine to another?** Extra question: I know that interfaces on both windows and linux can have multiple IP addresses. Can I have both configurations set and just plug my modem here and there and start connection to have internet on second machine?


title: If I connect a physical device, how can I ever know which device file belongs to it?

text: Say I plug in several USB drives which don't get automatically mounted. How can I find out which device file belongs to which physical device, so I can mount it for example? I'm running Mac OS X but I rather like an answer that works on all (or at least the most popular) Unix systems. I had this problem with Linux in the past.


title: counting the number of occurences in a file of data list

text: I have a data file, like               7     2     10     9     10     3     2     4     2     4     6      Each line has a single value. I want to count the occurence of each value. For instance, 10 occurs two times in this file. Is there a simple way to do that under linux without writing formal counting program?


title: Changing suspend order on OpenSUSE 12.2

text: This question seems more relevant here than SO. I've been trying to debug a library that X uses through a GDB session that I'm running through SSH, but it seems that on OpenSUSE, the SSH session is being "suspended" before GDB hits a breakpoint that occurs in the library on suspend. As a result, the system waits on the remote GDB to continue, but I can't continue because the SSH session is "suspended". I noticed on Ubuntu 12.04 and 12.10, the GDB session stops while the SSH connection is still active, so I can continue on the breakpoint and continue on the SIGUSR1 signal that GDB gets. Is it possible to mimic this behaviour on SUSE and "reverse" the order of suspends?


title: Remap keypad keys to modifiers

text: I did some research but I couldn't find a working solution: How can I make my keyboard buttons: `KP_1`, `KP_2`, `KP_3` to work exactly the same as `Shift_L`, `Alt_L` and `Control_L`? I use Linux Mint 17 Cinnamon. I want the new keys to work in game Dota 2 (but i don't mind if they will work globally). I tried different things but none of it worked as expected: ### `xmodmap` I run in terminal:               xmodmap -e "keycode 87 = Shift_L"     xmodmap -e "keycode 88 = Alt_L"     xmodmap -e "keycode 89 = Control_L"      Results:   * OS: `KP_1` and `KP_2` work as they should (as `Shift` and `Alt`), but somehow `kp_3` doesn't work as `Ctrl`     * Dota 2: none of the `kp_1`, `kp_2`, `kp_3` work as `Shift`/`Alt`/`Ctrl` (why?) ### `remap.inc` file I added the following lines to `/etc/console-setup/remap.inc`               keycode  79 = Shift     keycode  80 = Alt     keycode  81 = Control      and then run               sudo dpkg-reconfigure console-setup -phigh      Results: doesn't work anywhere. I don't know why these keycodes are different than what "xev" returns, but that's what I found using dumpkeys:               sudo dumpkeys | egrep "^keycode.*KP_[123]"     keycode  79 = KP_1                 keycode  80 = KP_2                 keycode  81 = KP_3       ### `xbindkeys` + `xte` I addedd these lines to `~/.xbindkeysrc`:               "xte 'key Shift_L'"         Mod2 + KP_End      and ran "xbindkeys" in terminal.   Results: doesn't work anywhere (probably because `Shift_L` is pressed only once - I would like it to be kept pressing when I keep pressing `KP_1`, just like the normal `Shift` button).


title: How can I know if the current kernel was compiled with a certain option enabled?

text: Is there a way to know if the kernel was compiled with a certain option activated (i.e. `CONFIG_PROC_EVENTS=y`) without having to pull out the kernel sources package and looking in the config file?


title: vagrant private network unstable

text: I have these 2 boxes, but I have a problem, when I start `disributed` and `ping 172.28.128.2` often the network isn't working, but if I then go into `oracle` and `ping 172.28.128.3` it'll find that and both networks will suddenly be able to talk to each other (once saw `ip neigh` in a `DELAY` state)               config.vm.box = "chef/centos-6.5"          config.vm.define "oracle", primary: true do |oracle|         config.vm.network "private_network", ip: "172.28.128.2"         config.vm.network "forwarded_port", guest: 1521, host: 1521          config.vm.define "distributed", autostart: false do |distributed|         config.vm.network "private_network", ip: "172.28.128.3"      what could be going wrong?               [root@localhost ~]# ip neigh     172.28.128.1 dev eth1 lladdr 0a:00:27:00:00:01 REACHABLE     10.0.2.2 dev eth0 lladdr 52:54:00:12:35:02 REACHABLE     172.28.128.2 dev eth1 lladdr 08:00:27:e3:d8:31 DELAY


title: iptables: refuse immediately when blocking particular domain from visiting by browser

text: I need to block particular domain "megafonpro.ru" and all subdomains from visiting by browser. Here's rule that I wrote:               sudo iptables -I OUTPUT -p tcp --dport 80 -m string --string "megafonpro.ru" --algo kmp --to 65535 -j REJECT      It works, but not perfect: when I try to enter matching URL (say, "wap.megafonpro.ru"), firefox tries to connect for very long time (about 30 seconds), and then reports "The connection was reset". How to make it refuse immediately? * * * **UPD:** I found out that I can just add non-wanted domains to the `/etc/hosts`, like that:               127.0.0.1   megafonpro.ru     127.0.0.1   m.megafonpro.ru     127.0.0.1   wap.megafonpro.ru      We can't wildcard sumdomains unfortunately ( related question: http://serverfault.com/questions/118378/in-my-etc-hosts-file-on-linux-osx-how- do-i-do-a-wildcard-subdomain ). Now, browser refuses immediately. But anyway, I'm interested how to make it with iptables.


title: How can I tell what woke my laptop from suspend?

text: On other operating systems, there are ways to see what process or event woke them from suspend. I leave my laptop often for multiple days in suspend, sometimes to find that it has woken itself up and is heating whatever surface it is resting on :) Is there a way to find out what woke it up so that I can prevent that thing from happening again? On Ubuntu 12.04 (elementary Luna).


title: How to redirect stdout to a file and read from the same file simultaneously with another task?

text: I want to run a task (which takes quite a long time) remotely in Ubuntu Linux Bash via `nohup` and redirect `stdout` to a file, e.g.: `nohup task > out.txt &` From time to time I would like to check the progress of the task by looking into the output file: `cat out.txt` I haven't yet figured out how to do that because the file's content is shown as empty as long as the file is opened for writing by Bash. So my question is: Is there any linux command that allows a 'shared' `stdout` redirection?


title: System calls in linux

text: Generally, systems provide a library or API that sits between normal programs and the operating system. On Unix-like systems, that API is usually part of an implementation of the C library (libc), such as glibc, that provides wrapper functions for the system calls.In C i can use these wrapper functions to make system calls. How do i make system calls in other languages?


title: squashfs reserve some free space

text: **Briefly: Is it possible to reserve some free space using mksquashfs?** I'm creating an image of simple livecd based on squashfs filesystem. Everything works fine except that I've got very little "free" space on a root partition. Can I assign more free space with mksquashfs? For now as I workaround I'm mounting ramfs after livecd boot. Another idea will be to create a large file on squashfs, pack it using mksquashfs and delete it after bootup. Is there any "clean" solution?


title: System calls source code

text: C library provides functions such as write(),read(),open()...that we can use in our C program to make system calls. where can I find source code for these functions?


title: How to clone linux installation onto an external harddisk?

text: I see a lot of `dd` related questions, but could not find answers to the following. If question/answers already exist, please point to them, then flag to close, delete or merge.   1. Can a working linux installation (say on `/dev/sda7`) be cloned to an external hard disk partition (say `/dev/sdb2`), while on it? (`/dev/sdb` is a 1TB USB hard disk, `/dev/sdb2` is of size 100GB)   2. If not, can I do it using a live cd? Will the cloned partition on external drive be bootable?    3. If it is not bootable, how to do that? **Why want to do that ?** : Need to carry the cloned external drive than the laptop itself, with all the installed (& customized) programs and data. Additional info (relevant parts only):               $ sudo fdisk -l     Disk /dev/sda: 160.0 GB, 160041885696 bytes     Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *           1        2550    20482843+   7  HPFS/NTFS     /dev/sda7            5660        6904    10000431   83  Linux          $ df -h     Filesystem            Size  Used Avail Use% Mounted on     /dev/sda7             9.4G  7.4G  1.6G  83% /


title: Additional keybinding combination to copy text to clipboard

text: I would like know, how to make _copy to clipboard_ work not only with the default `Ctrl`+`c` key-combination but also using `Ctrl`+`End` for instance. How do I do that?


title: Not able to deny selected local user to login ftp server

text: I added the below 2 lines in the end of the configuration file `/etc/vsftpd.conf` so as to deny a local user named 'tentenths' from loggin in the ftp server. I restarted the vsftpd service after the change. But still the user was permitted to login. Where am I mistaken!               userlist_deny=YES     userlist_file=/etc/vsftpd.denied_users      The content of the above file is:               ravbholua@ravi:~$ cat /etc/vsftpd.denied_users     tentenths     ravbholua@ravi:~$      I am referring this link for the same. Have a look at the whole conf. file:               # Example config file /etc/vsftpd.conf     #     # The default compiled in settings are fairly paranoid. This sample file     # loosens things up a bit, to make the ftp daemon more usable.     # Please see vsftpd.conf.5 for all compiled in defaults.     #     # READ THIS: This example file is NOT an exhaustive list of vsftpd options.     # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's     # capabilities.     #     #     # Run standalone?  vsftpd can run either from an inetd or as a standalone     # daemon started from an initscript.     listen=YES     #     # Run standalone with IPv6?     # Like the listen parameter, except vsftpd will listen on an IPv6 socket     # instead of an IPv4 one. This parameter and the listen parameter are mutually     # exclusive.     #listen_ipv6=YES     #     # Allow anonymous FTP? (Disabled by default)     anonymous_enable=YES     #     # Uncomment this to allow local users to log in.     local_enable=YES     #     # Uncomment this to enable any form of FTP write command.     write_enable=YES     #     # Default umask for local users is 077. You may wish to change this to 022,     # if your users expect that (022 is used by most other ftpd's)     #local_umask=022     #     # Uncomment this to allow the anonymous FTP user to upload files. This only     # has an effect if the above global write enable is activated. Also, you will     # obviously need to create a directory writable by the FTP user.     anon_upload_enable=YES     #     # Uncomment this if you want the anonymous FTP user to be able to create     # new directories.     #anon_mkdir_write_enable=YES     #     # Activate directory messages - messages given to remote users when they     # go into a certain directory.     dirmessage_enable=YES     #     # If enabled, vsftpd will display directory listings with the time     # in  your  local  time  zone.  The default is to display GMT. The     # times returned by the MDTM FTP command are also affected by this     # option.     use_localtime=YES     #     # Activate logging of uploads/downloads.     xferlog_enable=YES     #     # Make sure PORT transfer connections originate from port 20 (ftp-data).     connect_from_port_20=YES     #     # If you want, you can arrange for uploaded anonymous files to be owned by     # a different user. Note! Using "root" for uploaded files is not     # recommended!     #chown_uploads=YES     #chown_username=whoever     #     # You may override where the log file goes if you like. The default is shown     # below.     #xferlog_file=/var/log/vsftpd.log     #     # If you want, you can have your log file in standard ftpd xferlog format.     # Note that the default log file location is /var/log/xferlog in this case.     #xferlog_std_format=YES     #     # You may change the default value for timing out an idle session.     #idle_session_timeout=600     #     # You may change the default value for timing out a data connection.     #data_connection_timeout=120     #     # It is recommended that you define on your system a unique user which the     # ftp server can use as a totally isolated and unprivileged user.     #nopriv_user=ftpsecure     #     # Enable this and the server will recognise asynchronous ABOR requests. Not     # recommended for security (the code is non-trivial). Not enabling it,     # however, may confuse older FTP clients.     #async_abor_enable=YES     #     # By default the server will pretend to allow ASCII mode but in fact ignore     # the request. Turn on the below options to have the server actually do ASCII     # mangling on files when in ASCII mode.     # Beware that on some FTP servers, ASCII support allows a denial of service     # attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd     # predicted this attack and has always been safe, reporting the size of the     # raw file.     # ASCII mangling is a horrible feature of the protocol.     #ascii_upload_enable=YES     #ascii_download_enable=YES     #     # You may fully customise the login banner string:     #ftpd_banner=Welcome to blah FTP service.     #     # You may specify a file of disallowed anonymous e-mail addresses. Apparently     # useful for combatting certain DoS attacks.     #deny_email_enable=YES     # (default follows)     #banned_email_file=/etc/vsftpd.banned_emails     #     # You may restrict local users to their home directories.  See the FAQ for     # the possible risks in this before using chroot_local_user or     # chroot_list_enable below.     chroot_local_user=NO     #     # You may specify an explicit list of local users to chroot() to their home     # directory. If chroot_local_user is YES, then this list becomes a list of     # users to NOT chroot().     # (Warning! chroot'ing can be very dangerous. If using chroot, make sure that     # the user does not have write access to the top level directory within the     # chroot)     #chroot_local_user=YES     chroot_list_enable=YES     # (default follows)     chroot_list_file=/etc/vsftpd.chroot_list     #     # You may activate the "-R" option to the builtin ls. This is disabled by     # default to avoid remote users being able to cause excessive I/O on large     # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume     # the presence of the "-R" option, so there is a strong case for enabling it.     #ls_recurse_enable=YES     #     # Customization     #     # Some of vsftpd's settings don't fit the filesystem layout by     # default.     #     # This option should be the name of a directory which is empty.  Also, the     # directory should not be writable by the ftp user. This directory is used     # as a secure chroot() jail at times vsftpd does not require filesystem     # access.     secure_chroot_dir=/var/run/vsftpd/empty     #     # This string is the name of the PAM service vsftpd will use.     pam_service_name=vsftpd     #     # This option specifies the location of the RSA certificate to use for SSL     # encrypted connections.     rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem     # This option specifies the location of the RSA key to use for SSL     # encrypted connections.     rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key     userlist_deny=YES     userlist_file=/etc/vsftpd.denied_users


title: Mixing 4k/512 drives with ZFS (FreeNAS)

text: I have the following drives:   * Seagate Barracuda ST3200054AS   * WDC WD20EADS-00S2B0   * Samsung HD204UI As far as I understand, the first are ordinary 512 drives while the last is 4096 (Advanced format). Together with a new 2TB drive, I want to create a 6TB RAIDz1 with ZFS in FreeNAS. The new drive must most likely be also Advanced format because the old 512 are becoming rare/expensive. So I will effectively have two 512-byte-block and two 4096-byte-block drives. What special things must I take care in order to not **decrease** performance? When I chose "Force 4096 bytes sector size" in the volume manager, will I make sure that I will get the same performance if all block sizes were equal?


title: pam-auth-update does not display prompt screen or log any failure

text: ~# lsb_release -a     No LSB modules are available.     Distributor ID: Ubuntu     Description:    Ubuntu 12.04.4 LTS     Release:        12.04     Codename:       precise          ~# dpkg -l \*pam\* | grep ii     ii  libpam-krb5                          4.5-3                               PAM module for MIT Kerberos     ii  libpam-modules                       1.1.3-7ubuntu2                      Pluggable Authentication Modules for PAM     ii  libpam-modules-bin                   1.1.3-7ubuntu2                      Pluggable Authentication Modules for PAM - helper binaries     ii  libpam-runtime                       1.1.3-7ubuntu2                      Runtime support for the PAM library     ii  libpam0g                             1.1.3-7ubuntu2                      Pluggable Authentication Modules library      trying to run pam-auth-update on this particular box. Other boxes causea prompt screen to pop up. This particular box, however, does absolutely nothing with no feedback or logs as far as I can tell.


title: RAIDing with LVM vs MDRAID - pros and cons?

text: In his answer to the question "mixed raid types", HBruijn suggests using LVM to implement RAID vs the more standard MDRAID. After a little investigation, it seems LVM also supports RAID functionality. In the past, I have used LVM on top of MDRAID, and was not aware till now that LVM also supports RAID functionality. This seems to be a relatively recent development, but I have not found out exactly when this was implemented. So, these are alternative ways to implement software RAID on Linux. What are the pros and cons of these two different approaches? I'm looking for feature comparisons between the two approaches so people can decide which is better for them. Conclusions based on experimentation (as in, this feature doesn't work as well as this feature and here is why) are also Ok, provided you include your data in the answer. Some specific issues to address:   1. Suppose I want to do sw RAID + LVM (a common scenario). Should I use LVM's support for sw RAID and thus use one utility instead of two? Does this more integrated approach have any advantages?   2. Does LVMs support for sw RAID have significant deficiencies compared to the more mature MDADM? Specifically, how stable/bug-free is the LVM support for sw RAID? It seems this support only goes back to 2011 (see below), while MDADM is much older. Also, how does it compare in terms of feature set. Does it have significant feature deficiencies compared to MDADM? Conversely, does it have support for any sw RAID features that MDADM does not have? NOTEs:   1. There is a detailed discussion at http://www.olearycomputers.com/ll/linux_mirrors.html but I could not find what date it was written. Similar question on Serverfault: linux LVM mirror vs. MD mirror. However, this question was asked in 2010, and the answers may be out of date.   2. The changelog entry for version 2.02.87 - 12th August 2011 has > Add configure --with-raid for new segtype 'raid' for MD RAID 1/4/5/6 support So, it looks like RAID support in LVM is about 3 years old.


title: sed convert 4 spaces to 2

text: How does one convert 4 spaces into 2 spaces with `sed`? Is it possible? I found this but it converts tab to spaces: `sed -r ':f; s|^(\t*)\s{4}|\1\t|g; t f' file`


title: Can files be created with permissions set on the command line?

text: When creating directories, `mkdir -m <mode> <dir>` provides for creating one or more directories with the given mode/permissions set (atomically). Is there an equivalent for creating files, on the command line? Something akin to:               open("file", O_WRONLY | O_APPEND | O_CREAT, 0777);      Is using `touch` followed by a `chmod` my only option here? * * * **Edit:** After trying out teppic's suggestion to use `install`, I ran it through `strace` to see how close to atomic it was. The answer is, not very:               $ strace install -m 777 /dev/null newfile     ...     open("newfile", O_WRONLY|O_CREAT|O_EXCL, 0666) = 4     fstat(4, {st_mode=S_IFREG|0666, st_size=0, ...}) = 0     ...     fchmod(4, 0600)                         = 0     close(4)                                = 0     ...     chmod("newfile", 0777)                  = 0     ...      Still, it's a single shell command and one I didn't know before.


title: mount failed to process probably corrupted CD

text: I wanted to check a CD from my drawer. I inserted it into my drive and issued mount. I got               mount: block device /dev/sr0 is write-protected, mounting read-only      mount command did not exit. I checked its state in top:               4640 root      20   0 27088 1280 1060 R  99,8  0,0   1:36.90 mount      99,8% CPU usage what was not true because usage of all my cores is almost 0,0%. I tried to kill it - no success (both signals KILL and TERM fail to stop the mount programme). I tried reboot -f and reboot got into D state. fuser helped neither. /dev/sr0 is my cdrom and it was not present in mount output               umount  /media/cdrom           umount: /media/cdrom0 is not mounted (according to mtab)      fstab:               /dev/sr0       /media/cdrom0   udf,iso9660 user,noauto     0       0      Don't know what to do with that. All what works is to cut power and start again. System doesn't reboot or shutdown.


title: busybox initramfs loop mount

text: I'm trying to loop mount my root filesystem (a loop file) within a busybox initramfs. I try to run the command: mount /rootfs.raw /root ... which works on my Ubuntu laptop, however, I simply get `mount: mounting /dev/loop0 on /root failed: Invalid argument` No matter what combination of options I use, (including loading to /loop0 manually and trying to mount it), the system will not mount the loop device. Why can't I mount it?


title: How can I change the default gateway?

text: Currently I'm running a FreeBSD 9.1 and the default gateway is already configured in the `rc.conf`. `rc.conf`:               defaultrouter = "10.0.0.1"      But now I want to change the default gateway without rebooting the system, is this possible?


title: Make vim open files as nomodifiable, under certain conditions

text: How can I make open files as `readonly` and `nomodifiable`, if they're in a certain folder hierarchy, but do NOT contain a certain extension? For example, if I open files on /server/(production|uat)/* I want to be prompted whether to edit the file, or just view it. An exception might be needed as well--such as if the file contains the prefix `temp`.


title: Upgrade to squeeze and dpkg returned an error code(1)

text: I want to upgrade my server so I ran `apt-get dist upgrade` but I keep having this error:               Unpacking replacement aptitude ...     dpkg-deb: file `/var/cache/apt/archives/aptitude_0.6.8.2-1_armel.deb' contains ununderstood data member data.tar.xz     , giving up     dpkg: error processing /var/cache/apt/archives/aptitude_0.6.8.2-1_armel.deb (--unpack):      subprocess dpkg-deb --fsys-tarfile returned error exit status 2     dpkg: considering deconfiguration of aptitude, which would be broken by installation of aptitude-common ...     dpkg: yes, will deconfigure aptitude (broken by aptitude-common).     Unpacking aptitude-common (from .../aptitude-common_0.6.8.2-1_all.deb) ...     De-configuring aptitude ...     dpkg-deb: file `/var/cache/apt/archives/aptitude-common_0.6.8.2-1_all.deb' contains ununderstood data member data.tar.xz     , giving up     dpkg: error processing /var/cache/apt/archives/aptitude-common_0.6.8.2-1_all.deb (--unpack):      subprocess dpkg-deb --fsys-tarfile returned error exit status 2                    Errors were encountered while processing:                                             /var/cache/apt/archives/aptitude_0.6.8.2-1_armel.deb                                 /var/cache/apt/archives/aptitude-common_0.6.8.2-1_all.deb                           E: Sub-process /usr/bin/dpkg returned an error code (1)       Here's some of what I've tryied:               sudo apt-get dist-upgrade     sudo dpkg --configure -a     sudo ldconfig     sudo apt-get check     sudo apt-get -f install     sudo apt-get -f upgrade --fix-missing      Always ending with the same errors so I can't do anything else. What should I do?


title: What is loop0 and how do I e2fsck it?

text: EXT3-fs (sdd1): using internal journal     EXT3-fs (sdd1): mounted filesystem with ordered data mode     EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts:      EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts:      EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts:      Adding 4194296k swap on /dev/sdd2.  Priority:-1 extents:1 across:4194296k SSD     kjournald starting.  Commit interval 5 seconds     EXT3-fs (loop0): warning: maximal mount count reached, running e2fsck is recommended     EXT3-fs (loop0): using internal journal     EXT3-fs (loop0): mounted filesystem with ordered data mode      (loop0) is mounted too many times. What is it? Is it important? This is my fstab               #     # /etc/fstab     # Created by anaconda on Wed Nov  1 00:29:46 2000     #     # Accessible filesystems, by reference, are maintained under '/dev/disk'     # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info     #     UUID=9fac7ae7-9948-4612-88dc-e652fc4ceb73 /                       ext4    defaults        1 1     UUID=1daa52c7-a5da-464d-a4c7-2ee19ef017af /boot                   ext3    defaults        1 2     UUID=12649fb1-fd53-4558-8a2a-79692ada8b19 swap                    swap    defaults        0 0     tmpfs                   /dev/shm                tmpfs   defaults        0 0     devpts                  /dev/pts                devpts  gid=5,mode=620  0 0     sysfs                   /sys                    sysfs   defaults        0 0     proc                    /proc                   proc    defaults        0 0     /usr/tmpDSK             /tmp                    ext3    defaults,noauto        0 0     /dev/sda1               /home1                  auto    auto,noatime,defaults        0 2     /dev/sdb1               /home2                  auto    auto,noatime,defaults        0 2     /dev/sdc1               /home3                  auto    auto,noatime,defaults        0 2


title: no irq handler vector

text: I'm a Linux newbie and I've just installed CentOS 6.4 on my desktop machine. Everytime I start my terminal I get these error messages and I can't figure out why. How can I trace the problem and fix it?               Message from syslogd@dan-p4 at Jan 16 18:52:50 ...      kernel:do_IRQ: 0.115 No irq handler for vector (irq -1)


title: Count lines of non-terminating input

text: Is there any way to count the lines of a non-terminating input source? For example, I want to run the following for a period of time to count the number of requests:               ngrep -W byline port 80 and dst host 1.2.3.4 | grep ":80" | wc      Obviously, that doesn't work. When I `Ctrl`+`C` kill that, I'm not going to get any output from `wc`. I would rather avoid creating a file if I can.