Skip to content

Instantly share code, notes, and snippets.

View KIVagant's full-sized avatar
⛏️
Not enough wood, my lord!

Eugene Glotov KIVagant

⛏️
Not enough wood, my lord!
View GitHub Profile
@KIVagant
KIVagant / linkerd-debug-bad.txt
Last active August 3, 2020 18:45
tls results (linkerd2)
349309 1858.306418996 172.20.0.10 → 10.56.43.237 DNS 108 Standard query response 0x6f78 A www.example.com A 93.184.216.34
349310 1858.306576019 10.56.43.237 → 127.0.0.1 TCP 76 [TCP Port numbers reused] 51046 → 4140 [SYN] Seq=0 Win=26883 Len=0 MSS=8961 SACK_PERM=1 TSval=1099592030 TSecr=0 WS=512
349311 1858.306588068 93.184.216.34 → 10.56.43.237 TCP 76 443 → 51046 [SYN, ACK] Seq=0 Ack=1 Win=43690 Len=0 MSS=65495 SACK_PERM=1 TSval=3444165818 TSecr=1099592030 WS=512
349312 1858.306598463 10.56.43.237 → 127.0.0.1 TCP 68 51046 → 4140 [ACK] Seq=1 Ack=1 Win=27136 Len=0 TSval=1099592030 TSecr=3444165818
349313 1858.306755035 10.56.43.237 → 127.0.0.1 TLSv1 170 Client Hello
349314 1858.306764426 93.184.216.34 → 10.56.43.237 TCP 68 443 → 51046 [ACK] Seq=1 Ack=103 Win=44032 Len=0 TSval=3444165818 TSecr=1099592030
349315 1858.306848506 10.56.43.237 → 93.184.216.34 TCP 76 51048 → 443 [SYN] Seq=0 Win=26883 Len=0 MSS=8961 SACK_PERM=1 TSval=1099592030 TSecr=0 WS=512
349316 1858.308819576 93.184.216.34 → 10.56.43.237
@KIVagant
KIVagant / yes-no-input.bf
Created May 6, 2020 17:55
Brainfuck example: yes-no dialogue (if-else condition)
//
// Use the following resources to play with your code:
//
// - http://bf.doleczek.pl One of the best interpreter.
// - https://fatiherikli.github.io/brainfuck-visualizer/ Amazing visualizer to understand the logic (but too slow for big examples)
// - https://copy.sh/brainfuck/text.html Text-to-brainfuck transformer to generate strings
//
// Put here a question text generated in https://copy.sh/brainfuck/text.html.
// The question MUST expect "y" (yes, yeah, y**whatever) as the proper answer.
// And anything else means "no".
@KIVagant
KIVagant / Jenkins_next_build_number.groovy
Last active March 29, 2017 13:29
Jenkins multi-branch pipeline: set the next build number
// 1. Open https://your-jenkins-url/script
def job = Jenkins.instance.getItemByFullName("GitAccount/repository/features%2Fbranch")
// println(job.nextBuildNumber)
job.nextBuildNumber = 301 // set what you want
job.saveNextBuildNumber()
@KIVagant
KIVagant / Mysql subquery variable missing.sql
Created November 2, 2016 20:57
Mysql variable in subselect problem
SELECT @a := test,
(SELECT @a) AS first_level_subquery,
(SELECT * FROM (SELECT @a) as tmp ) AS second_level_subquery
FROM (
SELECT 1 as test UNION ALL SELECT 2 UNION ALL SELECT 3
) AS some_data\G
+------------+----------------------+-----------------------+
| @a := test | first_level_subquery | second_level_subquery |
+------------+----------------------+-----------------------+
@KIVagant
KIVagant / laravel_subsplit_measure.txt
Last active October 12, 2016 15:39
Subsplit Laravel in parallel processes (example)
# for my symfony-based test project (not for Laravel!) with 7 splitted packages in OSX:
time split-slower # without parallel execution
split-slower 66.71s user 127.59s system 71% cpu 4:30.62 total
time split-faster # with parallel execution
split-faster 99.21s user 148.89s system 236% cpu 1:44.83 total
@KIVagant
KIVagant / instruction.sh
Created August 23, 2016 09:14
Copy files from one git repository to another with all history
# https://blogs.s-osg.org/retain-history-moving-files-git-repositories/
# http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/
### 1
vim /tmp/git_script.sh
#>>>>>>
#!/bin/bash
mkdir -p newroot/
@KIVagant
KIVagant / bash commands
Created January 22, 2016 08:22
Ansible 2 variables priority
#
# ansible 1.9.4
#
ansible-playbook -i localhost.ini playbook.yml
...
TASK: [debug var=hello] *******************************************************
ok: [localhost] => {
"var": {
"hello": "world"
}
@KIVagant
KIVagant / localhost.ini
Last active January 21, 2016 10:37
Ansible 1.9 bug explanation (fixed in >2.0)
localhost ansible_connection=local