Skip to content

Instantly share code, notes, and snippets.

@lancelakey
lancelakey / playing_with_bash.txt
Last active August 29, 2015 13:57
Playing with bash in the Mac OS X Terminal
This is not a script
Simply type the stuff next to the ~ > into your Terminal like I did
Basically, we're playing around with doing a thing, and then with doing a thing several times
Play around with this for a few minutes, have fun with it, see if you can come up with your own variations
Homework, things to think about:
What does echo do?
What does for do?
What is {1..5}?
What does for i in {1..5} ; do SOMETHING ; done do?
T 10.118.139.238:40645 -> 10.218.136.203:81 [AP]
GET /api/v4/search HTTP/1.1.
User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.1.2; LG-P659 Build/JZO54K).
Host: api.example.com.
Accept-Encoding: gzip.
X-Forwarded-Proto: https.
X-Forwarded-Port: 443.
X-Forwarded-For: 172.26.13.18.
Connection: close.
X-Forwarded-Proto: http.
@lancelakey
lancelakey / gist:39f19cf1da3a867db1be
Created May 7, 2014 07:24
#dtrace how do I got sucj privileges?
[00:59:32] nanxiao: Hi, everyone. A guy has posted a issue about DTrace:http://www.listbox.com/member/archive/184261/2014/05/sort/time/page/1/entry/0:2/20140504234521:8955DE22-D407-11E3-ABB7-E7A856EF6811/.
[00:59:33] nanxiao: Could anyone help and give some advices on it?
[00:29:06] seanmcg: nanxiao, reduce the number of probes, this one you have; "fbt:::" can match over 90,000 probes.. (94415 on my desktop for example)
[00:47:32] nanxiao: seanmcg: Yes. But the root cause seems the dynamic variables leaks. Dave has answered the question:http://www.listbox.com/member/archive/184261/2014/05/sort/time/page/1/entry/2:3/20140505141710:5BA4F4A2-D481-11E3-ADF7-F8194C58CA13/
[00:47:51] Welastevil: hi everyone!
[00:47:54] Welastevil: someone here???
[00:49:12] nanxiao: seanmcg: Because I am the owner of the question, only help to forward this issue, I don't know whether the issue has been resolved. I can ask the owner of the new progress.:) Thanks for your kindly notice!
[00:50:53] nanxiao: seanmcg: B
#!/usr/bin/perl -w
use strict;
use Socket;
use IO::Handle;
if($#ARGV+1 != 2){
print "$#ARGV $0 Remote_IP Remote_Port \n";
exit 1;
}

This was a bit of a trick to get set up, so here it is for anyone who comes across it in search results.

ZNC User Account

  • Set up the account as usual (note the username and password)
  • Set the defualt buffer size to 0. Every time the bot reconnects after a crash, it would try to respond to the commands it hear or respond in the buffer, and might crash it again.
  • Go ahead and define a network and channel for your bot. Note the network name.
  • You should now see a "ghost" for your hubot connected.
  • Look at the ZNC user list. The hubot user will show 1 network, but 0 clients.
[root@ip-172-31-4-113 ~]# cat /etc/resolv.conf
# This file is managed by systemd-resolved(8). Do not edit.
#
# Third party programs must not access this file directly, but
# only through the symlink at /etc/resolv.conf. To manage
# resolv.conf(5) in a different way, replace the symlink by a
# static file or a different symlink.
nameserver 172.31.0.2
nameserver 8.8.8.8
[root@ip-172-31-4-113 ~]# lsmod
Module Size Used by
isofs 31387 0
crct10dif_pclmul 3607 0
crct10dif_common 1527 1 crct10dif_pclmul
crc32_pclmul 2459 0
ghash_clmulni_intel 3843 0
aesni_intel 128359 0
aes_x86_64 7510 1 aesni_intel
lrw 3545 1 aesni_intel
[root@ip-10-229-28-201 ~]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 20
file size (blocks, -f) unlimited
pending signals (-i) 12987
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 999999
pipe size (512 bytes, -p) 8
@lancelakey
lancelakey / gist:5ef70e5fa01a862d1c31
Created September 27, 2014 02:48
public ssh key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuq/3NdgLezywdsumgrQR8aBleZ6Qti/mDJm0yLvJ2kPx1lzmsojgV8EfV8Lu5MBh6gc7pUSF4S+i6HY+vetM4EOY3nYv9+hmDbW48oTpsBue49cgZrsWvZzn4h4a61rU+zWQRq4lX8E79Y2KoT+enB1uthP1033seVxtiTjIw3aFrI6dC7+vE+vEXtHINGEBfKuUsRKbH5QmJylrhi5WR28415zEYy0vXWCCzIlgfcrJ9OLKfLUJl2BwbCFO4FWL8rLozN5BM9b7D3W4jclCG1LCQqARkG5Z9bRId9+HlZW19grslE296wzaT8LRVvqFzWD+hrwEtLW5FIFIqT8irw== lance@pandastrike.com
@lancelakey
lancelakey / logging.yml
Created December 17, 2014 18:11
/etc/elasticsearch/logging.yml
# you can override this using by setting a system property, for example -Des.logger.level=DEBUG
es.logger.level: INFO
rootLogger: ${es.logger.level}, console, file
logger:
# log action execution errors for easier debugging
action: DEBUG
# reduce the logging for aws, too much is logged under the default INFO
com.amazonaws: WARN
# gateway