Skip to content

Instantly share code, notes, and snippets.

View antonlogvinenko's full-sized avatar
☠️
kept you waiting huh

antonlogvinenko

☠️
kept you waiting huh
View GitHub Profile
pip3 install fitz
pip3 install PyMuPDF
# Contents of the tool crack.py
import fitz
import time
import sys
if len(sys.argv) != 2:
print("Pass file encrypted with SSN as a single argument")
@antonlogvinenko
antonlogvinenko / ffmpeg.sh
Created December 25, 2022 18:45
dancing deer
#https://media.tenor.com/qAnrl6goV44AAAAC/dancing-christmas.gif
ffmpeg -i dancing-christmas.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video1.mp4
ffmpeg -stream_loop 15 -i video1.mp4 -c copy video2.mp4
ffmpeg -i video2 -filter:v "setpts=0.628*PTS" video3.mp4
@antonlogvinenko
antonlogvinenko / gist:0f22353d71b0f70606f02b115c4b0ec6
Last active March 21, 2020 15:39
Cisco Anyconnect VPN automation script under Mac OS without exposing your password
-- Open "Keychain Access" program
-- Click File > New Password Item. Set "Keychain Item Name" to "WHATEVER_AnyConnect_VPN", "Account Name" to the account the script will be run under, and enter the password to the "Password" field, then click "Add"
-- Run "Script Editor" program
-- Paste all tihs text to the editor
-- Save the file somewhere, specify "File Format"="Application" upon saving, e.g. save as "myvpn" Application
-- Open console
-- Run "osascript myvpn" to start vpn
-- Run "osascript myvpn" to stop vpn
-- Upon the first start, application might ask for your password. After entering the password, click "Always Allow" instead of "Allow"
-- Original gist with comments that maybe helpful: https://gist.github.com/halocaridina/99466e4b1d08e57fb9dd
(setq inhibit-splash-screen t) ;; Don't show initial Emacs-logo and info
(defun myfun ()
(setq top-left (selected-window))
(setq bottom-left (split-window top-left nil 'below))
(setq bottom-right (split-window bottom-left nil 'right))
(setq top-right (split-window top-left nil 'right))
(setq ghcid (generate-new-buffer "ghcid"))
(with-selected-window bottom-left
@antonlogvinenko
antonlogvinenko / merge_bst.java
Last active December 10, 2018 21:19
merging trees: iterative using stack, immutable trees
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
class Solution {
@antonlogvinenko
antonlogvinenko / honest-profiler-centos7.sh
Created August 10, 2017 22:19
honest-profiler setup for centos7
# https://github.com/jvm-profiling-tools/honest-profiler
JAVA_HOME=/usr/java/default
export JAVA_HOME
git clone https://github.com/unittest-cpp/unittest-cpp.git
cd unittest-cpp/
cmake .
sudo make install
cd ..
@antonlogvinenko
antonlogvinenko / async-profiler-centos7.sh
Last active August 10, 2017 19:57
async profiler usage
# https://github.com/jvm-profiling-tools/async-profiler
JAVA_HOME=/usr/java/default
export JAVA_HOME
git clone https://github.com/jvm-profiling-tools/async-profiler.git
cd async-profiler
make
git clone https://github.com/brendangregg/FlameGraph.git
/*
* Just some X class
*/
public static class X implements Comparable<X> {
public int getX() {
return 42;
}
@Override
@antonlogvinenko
antonlogvinenko / TreeMultimapNaturalTest-bytecode.txt
Created January 13, 2017 20:13
TreeMultimapNaturalTest.class bytecode tree with detailed constant pool
Bytecode
Minor version: 0
Major version: 50
Flags: "AccSuper, AccPublic"
This
Class -> com/google/common/collect/TreeMultimapNaturalTest
Superclass
Class -> com/google/common/collect/AbstractSetMultimapTest
Interfaces
Constant pool
@antonlogvinenko
antonlogvinenko / TreeMultimapNaturalTest-bytecode.txt
Created January 13, 2017 20:10
TreeMultimapNaturalTest.class bytecode tree
Bytecode
Minor version: 0
Major version: 50
Flags: "AccSuper, AccPublic"
This
Class -> com/google/common/collect/TreeMultimapNaturalTest
Superclass
Class -> com/google/common/collect/AbstractSetMultimapTest
Interfaces
Constant pool