Mindblown: a blog about philosophy.
-
Autossh init.d script
In this init.d script for autossh in CentOS, I use puppet to replace the param “pAutoSSHParams”, which could be something like this: “-M 0 -f -N -L 3307:127.0.0.1:3306 -p 22 user@host” File: /etc/init.d/autossh Run: service autossh start/stop #!/bin/sh # # autossh – Startup script for autossh # chkconfig: 2345 20 80 # description: Maintain a…
-
SSH Tunneling with restricted/limited shell
If you want to connect to rsync/mysql or other service via localhost through SSH tunneling, you need the tunnel to stay open. There are rssh and other limited shells. But you can write your own. In this case, it opens for 10 seconds then closes. It does not close if there are activities (rsync takes…
-
Steadfast Cloud
These are some benchmarks run with UnixBench 5.1.3 on Steadfast Cloud powered by OnApp. The ability for scaling up/down RAM and CPU without reboot is neat and very useful. Disk resizing need reboot but this can be avoided by the app. The OnApp API is very simple and easy to use as well. I tried…
-
RackSpace cloud resizing (Scaling) steps
Step 1: Resize request is queued The resize request will be processed as resources permit. The queued period is usually quick, but can vary depending on other host machine activities. Step 2: Initial preparation of new server This is the longest part of the upgrade, during this step the original server remains up and running.…
-
Benchmark xtrabackup streaming option tar.gz vs. tar
time innobackupex –databases=”mydb” –stream=tar ./ –slave-info > /var/lib/mysql/snapshot_mydb.tar time innobackupex –databases=”mydb” –stream=tar ./ –slave-info | gzip – > /var/lib/mysql/snapshot_mydb.tar.gz Results: TAR: filesize 5.4Gb real 0m52.633s user 0m0.900s sys 0m29.860s TAR.GZ: filesize 350Mb real 2m26.606s user 3m40.261s sys 0m28.829s And during the dump, tar.gz locks tables. Thus, for a big database, a better solution would be…
-
OSSEC vs. SVN
If you found the server suddenly blocks access when you try to “svn commit”, it might be because of OSSEC active response, which is good but a false alarm in this case (too many 404). Solution: many, but mine is just simply turn OSSEC off while committing and back on later. I don’t rename files…
-
Puppet, bittorrent, aria2
Bittorrent package for Linux is getting old (4.4 from RPMForge and 5.x from the source). Therefore, I made the switch to aria2 (command line is “aria2c”), which is much much better and offer a lot more features. Here is what I have for aria2.conf daemon enable-dht=true allow-overwrite=true seed-ratio=2 max-upload-limit=600K bt-min-crypto-level=arc4 bt-require-crypto=true Here is how to…
-
Autobench, httperf – Web Server Benchmarking
Automate the benchmarking process for new/existing server: # need to install autobench and httperf autobench –single_host –host1 localhost –uri1 /stresstest/simple.php –low_rate 1000 –high_rate 10000 –rate_step 100 –const_test_time 20 –timeout 5 –quiet –file results.tsv # graph the results in PostScript file (Mac Mail can preview this automatically) rm -f results.ps && bench2graph results.tsv results.ps 4 5…
-
Door-to-door is hard
Our neighborhood is organizing a petition to fight the city against the plan to convert a golf course, open space to more housing. Knocking door-to-door to get signature is hard. Some people don’t know about the issue (even with many reminders, letters sent to them). Likely just threw away, don’t care, don’t read, or don’t…
-
Good garden deals
These are some of the deals that are seasonal and the timing is very important. It’s a reminder for myself to wait until these times to get great deals Playsand 50lbs for $2 (Lowes, around June/July) 75% off plastic planter/pot/container (16″ for $3.24) at RiteAid (July 20, ad run from about July 15 – Aug…
Got any book recommendations?