Skip to content

Instantly share code, notes, and snippets.

View ch3ll0v3k's full-sized avatar

Timoschenko Viacheslau ch3ll0v3k

View GitHub Profile
@ch3ll0v3k
ch3ll0v3k / Makefile
Created August 30, 2016 10:31 — forked from nzjrs/Makefile
Python ctypes example
all: test libtest.so testmodule
libtest.so: libtest.c
$(CC) -Wall -g -fPIC -shared -o $@ $? -lc
test: test_main.c libtest.o
$(CC) -o $@ $?
testmodule: testmodule.c
python setup.py build
@ch3ll0v3k
ch3ll0v3k / gist:b01ec0c96ee0896ba7cb74f453eb59df
Created September 30, 2016 21:25
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
echo-server-epoll
echo-server-poll
talk
talk.dSYM
@ch3ll0v3k
ch3ll0v3k / aes.java
Created August 20, 2017 20:28 — forked from ulymarins/aes.java
Java Encryption with AES
import java.math.BigInteger;
import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.util.Random;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Base64;
@ch3ll0v3k
ch3ll0v3k / sendRawTransaction.js
Created March 25, 2018 15:33 — forked from raineorshine/sendRawTransaction.js
Sends a raw transaction with web3 v1.0 and Infura
const Web3 = require('web3')
const Tx = require('ethereumjs-tx')
// connect to Infura node
const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/INFURA_KEY'))
// the address that will send the test transaction
const addressFrom = '0x1889EF49cDBaad420EB4D6f04066CA4093088Bbd'
const privKey = 'PRIVATE_KEY'
@ch3ll0v3k
ch3ll0v3k / gist:0bb51f8f085255e35b8021831b43ab61
Created March 27, 2018 19:30 — forked from matthieu/gist:b07c5ba27bc99188a15f
Create and send a Bitcoin transaction using the BlockCypher Transaction API
# In this example we're sending some test bitcoins from an address we control to a brand new test
# address. We'll be sending the coins using the following address, public and private keys (please
# don't abuse).
# address : mtWg6ccLiZWw2Et7E5UqmHsYgrAi5wqiov
# public : 03bb318b00de944086fad67ab78a832eb1bf26916053ecd3b14a3f48f9fbe0821f
# private : 1af97b1f428ac89b7d35323ea7a68aba8cad178a04eddbbf591f65671bae48a2
# 1. generate a one-shot dummy address we're going to send money to
$ curl -X POST http://api.blockcypher.com/v1/btc/test3/addrs
{
@ch3ll0v3k
ch3ll0v3k / README.md
Created July 21, 2020 09:37 — forked from mrbar42/README.md
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster
@ch3ll0v3k
ch3ll0v3k / .env
Created May 19, 2022 08:43 — forked from BlockmanCodes/.env
Get spot prices on Uniswap
INFURA_URL=<your_url>
ETHERSCAN_API_KEY=<your_api_key>
@ch3ll0v3k
ch3ll0v3k / 14ACN6-tlp1.4.md
Created October 23, 2022 01:03 — forked from stavros-k/14ACN6-tlp1.4.md
TLP 1.4 Test: Battery Care for Lenovo IdeaPad 5 Pro (AMD) 14'' Gen 6

SYSTEM

LENOVO IdeaPad 5 Pro 14ACN6 82L7

Enable conservation

Edit /etc/tlp.conf

~$ cat /etc/tlp.conf | grep STOP_CHARGE_THRESH_BAT0
STOP_CHARGE_THRESH_BAT0="1"