Thursday, August 14, 2014

resizing a linux partition with ubuntu

source: http://askubuntu.com/questions/116351/increase-partition-size-on-which-ubuntu-is-installed

As a matter of fact, you CAN enlarge the root filesystem while Ubuntu is running (I learned this recently myself here) - this sounds incredible but it's true :)
Here's the list of steps for a simple scenario where you have two partitions, /dev/sda1 is an ext4 partition the OS is booted from and /dev/sdb2 is swap. For this exercise we want to remove the swap partition an extend /dev/sda1 to the whole disk.
  1. As always, make sure you have a backup of your data - since we're going to modify the partition table there's a chance to lose all your data if you make a typo, for example.
  2. Run sudo fdisk /dev/sda
    • use p to list the partitions. Make note of the start cylinder of /dev/sda1
    • use d to delete first the swap partition (2) and then the /dev/sda1 partition. This is very scary but is actually harmless as the data is not written to the disk until you write the changes to the disk.
    • use n to create a new primary partition. Make sure its start cylinder is exactly the same as the old /dev/sda1 used to have. For the end cylinder agree with the default choice, which is to make the partition to span the whole disk.
    • use a to toggle the bootable flag on the new /dev/sda1
    • review your changes, make a deep breath and use w to write the new partition table to disk. You'll get a message telling that the kernel couldn't re-read the partition table because the device is busy, but that's ok.
  3. Reboot with sudo reboot. When the system boots, you'll have a smaller filesystem living inside a larger partition.
  4. The next magic command is resize2fs. Run sudo resize2fs /dev/sda1 - this form will default to making the filesystem to take all available space on the partition.

Friday, August 8, 2014

dns ip wildcard resolver

This took me a long time to find. Figured that I should post it before I lost it AGAIN!

This basically gives you the ability to host multiple hostnames on a single computer by using a 4 level domain name with the third level being your local internal ip address.
i.e.
http://something.10.0.0.100.xip.io/ and http://somethingelse.10.0.0.100.xip.io


http://xip.io/

Saturday, June 21, 2014

Tuesday, June 10, 2014

Varmeer

http://boingboing.net/2014/06/10/vermeers-paintings-might-be.html

Tuesday, May 27, 2014

Thursday, May 22, 2014

LOAD DATA LOCAL INFILE does not work correctly on RDS replicated mysql

You'll get stuck in a with an error similar to:
Error 'Access denied for user ''@'' (using password: NO)' on query. Default database: 'asdf'. Query: 'LOAD DATA INFILE '/rdsdbdata/tmp/SQL_LOAD-2065609985-756826296-2.data'
The reason this breaks is essentially because the read replica is replaying the binary logs and when it gets to your LOAD DATA LOCAL INFILE statement, it doesn't have that file.

RDS Creates a brand new read replica from an existing database by using a snapshot, not by replaying the bin logs.
CALL mysql.rds_skip_repl_error; will correct the error but not the problem.

Sunday, April 27, 2014

delayed_ack mac file transfer super slow


sudo sysctl -a net.inet.tcp.delayed_ack
out of the box will return:
net.inet.tcp.delayed_ack: 3

recommended from article:
sudo sysctl -w net.inet.tcp.delayed_ack=2

I have not ran any test, but if the computer is strictly being used in an office environment. Disabling delayed ack all together may not be a bad idea.
sudo sysctl - w net.inet.tcp.delayed_ack=0

for changes to persist after reboot save to /etc/sysctl.conf

reference:
http://www.shabangs.net/osx/speed-up-macos-x-file-transferring-over-network/
http://www.stuartcheshire.org/papers/NagleDelayedAck/
http://en.wikipedia.org/wiki/TCP_delayed_acknowledgment