Skip to content

Instantly share code, notes, and snippets.

View matti's full-sized avatar
🎯
Focusing

Matti Paksula matti

🎯
Focusing
View GitHub Profile
@matti
matti / array-reduce-include.rb
Last active August 5, 2016 08:05
if array of string include substring with reduce
irb(main):040:0> ["abba", "bebbe", "cebbe"].reduce(false) {|a,c| (a || c.include?("xx")) }
=> false
irb(main):041:0> ["abba", "bebbe", "cebbe"].reduce(false) {|a,c| (a || c.include?("bbe")) }
=> true

Keybase proof

I hereby claim:

  • I am matti on github.
  • I am mattipaksula (https://keybase.io/mattipaksula) on keybase.
  • I have a public key whose fingerprint is 6996 7112 D611 8AD3 6CB5 23A9 B8BE B1F9 DCDD 42A8

To claim this, I am signing this object:

events {
}
http {
autoindex on;
server {
listen 80;
root /data;
}
@matti
matti / xcode-nuke-uninstall.rb
Created November 1, 2014 16:57
completely remove all xcode files
#!/usr/bin/env ruby
cancer_in_home = [
"Library/Developer",
"Library/Preferences/com.apple.dt.*",
"Library/Caches/com.apple.dt.*",
'Library/Application\ Support/Xcode'
]
cancer_in_root = [
bean program_firmware -n neljaes
2017-06-24T11:14:02.971Z INFO Setting scan timeout: 15 seconds
2017-06-24T11:14:03.218Z INFO Starting to scan...
Found device with name/address: neljaes/e2398a18d12648f499c4f61c49eda786
2017-06-24T11:14:09.134Z INFO No longer scanning...
2017-06-24T11:14:09.135Z INFO Connecting to device: neljaes
2017-06-24T11:14:09.145Z INFO Checking if device is in progress...
2017-06-24T11:14:09.145Z INFO No device is in progress!
@matti
matti / bluetooth_scan.m
Created June 25, 2017 19:16
ios objective-c scan all devices
//
// AppDelegate.m
// watlol
//
// Created by mpa on 25/06/2017.
// Copyright © 2017 mpa. All rights reserved.
//
#import "AppDelegate.h"
@import CoreBluetooth;
@matti
matti / google_mx_records_aws_route53.txt
Created July 28, 2017 07:16
google mx records aws route53
1 ASPMX.L.GOOGLE.COM.
5 ALT1.ASPMX.L.GOOGLE.COM.
5 ALT2.ASPMX.L.GOOGLE.COM.
10 ASPMX2.GOOGLEMAIL.COM.
10 ASPMX3.GOOGLEMAIL.COM.
ENTRYPOINT ["/bin/sh", "-c", "echo sleeping forever; while true; do sleep 99999; done"]
ENTRYPOINT ["/app/entrypoint.sh"]
trap 'exit 0' TERM
sleep inf &
wait $!

sudo tcpdump -i en0 icmp ping -c2 224.0.0.251

20:47:43.072218 IP 192.168.146.61 > 224.0.0.251: ICMP echo request, id 32551, seq 0, length 64
20:47:43.074505 IP 192.168.146.83 > 192.168.146.61: ICMP echo reply, id 32551, seq 0, length 64
20:47:43.183397 IP 192.168.146.63 > 192.168.146.61: ICMP echo reply, id 32551, seq 0, length 64
2017-09-12T07:16:52.000Z [2]: Initializing data volume.
2017-09-12T07:16:52.000Z [2]: [01/04] http://web-1:9000/data/1 - 60 GiB online
2017-09-12T07:16:52.000Z [2]: [02/04] http://web-2:9000/data/2 - 60 GiB online
2017-09-12T07:16:52.000Z [2]: [03/04] http://web-3:9000/data/3 - 60 GiB online
2017-09-12T07:16:52.000Z [2]: [04/04] http://web-4:9000/data/4 - 13 GiB online
2017-09-12T07:16:53.000Z [2]: Endpoint: http://10.81.128.100:9000 http://172.17.0.8:9000 http://127.0.0.1:9000
2017-09-12T07:16:53.000Z [2]: AccessKey: ACCESSKEY
2017-09-12T07:16:53.000Z [2]: SecretKey: SECRETKEY
2017-09-12T07:16:53.000Z [2]:
2017-09-12T07:16:53.000Z [2]: Browser Access: