Skip to content

Instantly share code, notes, and snippets.

View mmajis's full-sized avatar

Mika Majakorpi mmajis

  • Nitor Creations
  • Helsinki, Finland
View GitHub Profile
@mmajis
mmajis / get_logs.sh
Last active May 25, 2018 11:35 — forked from vertti/get_logs.sh
Search and combine json logs from multiple Log Groups from CloudWatch
#!/bin/bash
if [[ $# -lt 2 ]] ; then
echo "Usage: ./get_logs.sh <search term> <log group filter> [-s <start time ref>, default '24h ago'] [-e <end time ref>, default ''] [-c]"
echo "Use -c to wrap the search term in a correlationId filter pattern: {$.correlationId = "search term"}"
echo "Example: ./get_logs.sh ERROR appName -s '10m ago' -e '5m ago' -c"
exit 1
fi
POSITIONAL=()
@mmajis
mmajis / gist:b9a177a7164d684aa55ffb2f90392c0a
Created April 28, 2018 19:17
Building graphviz dot statically for PlantUML on AWS Lambda
docker run -d --name dotbuild -v /path/to/graphviz-src:/dot amazonlinux:2017.03 tail -f /dev/null
docker exec -it dotbuild bash
yum install expat-devel
cd /dot
./configure --enable-static=yes --with-expat=yes

Keybase proof

I hereby claim:

  • I am mmajis on github.
  • I am mmajis (https://keybase.io/mmajis) on keybase.
  • I have a public key whose fingerprint is CFC0 B0A2 A16D ACE4 7677 E159 89E8 96D8 303E DE35

To claim this, I am signing this object:

@mmajis
mmajis / enable-adb-wifi.sh
Created April 16, 2016 17:42
Dragonboard 410C Android setup: enable ADB wifi access and GPIO pin access for apps
#!/bin/bash
adb root
adb remount
adb shell "echo service.adb.tcp.port=5555 >> /data/local.prop"
adb shell "chmod 0644 /data/local.prop"
@mmajis
mmajis / gist:6d4538f56882b5f34e71
Created July 9, 2015 13:46
Speed up apt-get in Ubuntu on AWS by changing to clouds.archive.ubuntu.com repository URLs
#!/bin/bash
#run as root
EC2_REGION="eu-west-1"
sed -i.bak -e "s/${EC2_REGION}.ec2.archive.ubuntu.com/${EC2_REGION}.clouds.archive.ubuntu.com/g" /etc/apt/sources.list
apt-get update
@mmajis
mmajis / gist:10201432
Created April 8, 2014 22:16
Chef knife command to create an EC2 VM in a VPC subnet
knife ec2 server create -I ami-51e91b26 -x ubuntu --identity-file ~/.ssh/identity.pem -g sg-cce70ba9 -s subnet-8cac99f8 -r "role[wordpress-test]"
@mmajis
mmajis / gist:10201305
Created April 8, 2014 22:15
Bootstrap Chef on a AWS Ubuntu VM
knife bootstrap 192.168.200.40 -N nodename -i ~/.ssh/identity.pem -x ubuntu -r "role[wordpress-test]" --sudo
@mmajis
mmajis / gist:3988313
Created October 31, 2012 17:02
rabbitmq settings for chef after hostname change
sudo rabbitmqctl add_vhost /chef
sudo rabbitmqctl add_user chef <password here (amqp_pass from /etc/chef/server.rb)>
sudo rabbitmqctl set_permissions -p /chef chef “.*” “.*” “.*”