Thursday, 4 February 2016

SSH config: command for bastion server proxying


Host 51.21.21.11
  IdentityFile ~/.ssh/mykey.pem
  User ec2-user
  ForwardAgent yes

Host 10.*
  ProxyCommand ssh ec2-user@51.21.21.11 nc %h 22
  User ec2-user
  IdentityFile ~/.ssh/mykey.pem
  ForwardAgent yes

Put your ssh public key in ~/.ssh/authorized_keys along the path.

Tuesday, 26 January 2016

Ruby: multi-level hash keys trick

Ruby freakshow to allow multi-level hash keys to be set even if they have not been defined before. Feature!

m_entities = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }

Wednesday, 22 July 2015

htop: save configuration

To exit htop and save config in file:

  F10

To find the config file just after you exit:

  find -name '*htoprc*' -mmin -10

Friday, 17 July 2015

Slow loading mysql dump into RDS

It's the PIOPS, stupid. Try cranking them up, e.g. 300GB volume at 3000 IOPS on your RDS instance when you create it.

See if that helps.

I just went from load taking days to load taking only hours.

This is an official AWS collection point for data, so please leave a comment on your experience. jk.

Thursday, 25 June 2015

create simple mysql table for testing

CREATE TABLE suppliers (
    SupplierID SMALLINT UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT,
    SupplierName VARCHAR(40) NOT NULL,
    Phone VARCHAR(14) NOT NULL,
    Email VARCHAR(60) NULL,
    PRIMARY KEY (SupplierID)
 );

INSERT INTO suppliers (SupplierName, Phone, Email) VALUES ('ABCSupplier','1122334455','abc@dicforum.com');

Monday, 22 June 2015

VirtualBox: port forwarding to guest from host

Something weird in the new (2015-06) version.


  • Network
    • Set "NAT"
    • Click "Port Forwarding"
    • "Insert new rule" (right-hand nav button)
      • Rule 1
        • Host IP: 127.0.0.1
        • Host port: 2222
        • Guest IP: [leave blank]
        • Guest Port: 22
To get to guest:

ssh -p 2222 myuser@localhost

where myuser is user you created when you installed Linux OS on to VM.

Monday, 1 June 2015

Connect to remote JMX over ssh and jconsole

ssh -N -f -D 7777 dev-cass-10.mydomain.internal

jconsole -J-DsocksProxyHost=localhost -J-DsocksProxyPort=7777 service:jmx:rmi:///jndi/rmi://localhost:7199/jmxrmi

Interview questions: 2020-12

Terraform provider vs provisioner Load balancing Network Load Balancer vs Application Load Balancer  Networking Layer 1 vs Layer 4 haproxy u...