Skip to content

Instantly share code, notes, and snippets.

View 5kr1p7's full-sized avatar
😎

Alexander Shangin 5kr1p7

😎
View GitHub Profile
@5kr1p7
5kr1p7 / keybase.md
Created August 21, 2016 20:27
Keybase

Keybase proof

I hereby claim:

  • I am 5kr1p7 on github.
  • I am 5kr1p7 (https://keybase.io/5kr1p7) on keybase.
  • I have a public key whose fingerprint is 9023 FA47 B1AF 5BB1 BA99 F4D0 F7EB 6451 E9CA 613F

To claim this, I am signing this object:

@5kr1p7
5kr1p7 / subresource.md
Last active August 19, 2022 23:16
Subresource Integrity

Subresource Integrity

<!-- Load jQuery 2.1.4 from their CDN -->
<script src="https://code.jquery.com/jquery-2.1.4.min.js"
  integrity="sha384-R4/ztc4ZlRqWjqIuvf6RX5yb/v90qNGx6fS48N0tRxiGkqveZETq72KgDVJCp2TC"
  crossorigin="anonymous"></script>

Notes (Bash, Shell)

Network

Get own IP address

curl -ks "https://ipv4.myip.info/"
curl -ks "https://ifconfig.me/"
@5kr1p7
5kr1p7 / Notes_WIN.md
Last active August 19, 2022 23:15
Notes_WIN

Коммандная строка

Настройка сети

Отображение текущих параметров

netsh interface ipv4 show ipaddresses "LAN" normal
netsh interface ipv4 show dnsservers "LAN"
var proxyurl = "https://cors-anywhere.herokuapp.com/";
var url = "https://api.coindesk.com/v1/bpi/currentprice.json"; // site that doesn’t send Access-Control-*
fetch(proxyurl + url) // https://cors-anywhere.herokuapp.com/https://example.com
.then(response => response.text())
.then(contents => console.log(contents))
.catch(() => console.log("Can’t access " + url + " response. Blocked by browser?"))
@5kr1p7
5kr1p7 / ipv6board_sender.py
Last active August 19, 2022 23:14
Send messages to device from https://ipv6board.best-practice.se
#!/usr/bin/python3
import sys
import os
def ascii_to_code(message):
"""Convert chars to ASCII HEX codes"""
ascii = ''
for char in message.center(8, ' '): # Center align string
<?php
/**
* Converter from cyrillic string to HEX for MikroTik
*
* @param string $str String with cyrillic characters
* @return string Converted to HEX codes string
*/
function CyrToHex($str) {
$str = mb_convert_encoding($str, 'windows-1251');
$out = '';
@5kr1p7
5kr1p7 / group_by_hour.sh
Created June 16, 2020 07:42
Group files in directory by hour
#!/bin/bash
ls -lcp | grep -v / | sed -e 's/\s\{1,\}/\t/g' | cut -f 6,7,8 | sed -e 's/:.*//g' | grep -v "^$" | sort | uniq -c
@5kr1p7
5kr1p7 / inodes_finder.sh
Created June 16, 2020 07:44
Find which dir has many inodes
#!/bin/bash
find . -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -nr | head -30