Skip to content

Instantly share code, notes, and snippets.

@sunary
sunary / aes256.go
Last active August 4, 2023 09:04
aes256 CBC & CFB
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"errors"
@sunary
sunary / devops_best_practices.md
Created July 18, 2023 06:25 — forked from jpswade/devops_best_practices.md
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, at the Agile Conference in Toronto, Andrew Shafer posted an offer to moderate an ad hoc "Birds of a Feather" meeting to discuss the topic of "Agile Infrastructure". Only one person showed up to discuss the topic: Patrick Debois. Their discussions and sharing of ideas with others advanced the concept of "agile systems administration". Debois and Shafer formed an Agile Systems Administrator group on Google, with limited success. Patrick Debois did a presentation called "Infrastructure and Operations" addressing

@sunary
sunary / principles.md
Last active October 6, 2021 00:44
Design Principles

Design principles applicable to many areas of computer systems:

Adopt sweeping simplifications

So you can see what you are doing.

Avoid excessive generality

If it is good for everything, it is good for nothing.

Avoid rarely used components

Deterioration and corruption accumulate unnoticed—until the next use.

@sunary
sunary / script.js
Created January 10, 2021 08:59
prevent redirect web
window.onbeforeunload = function(){ return 'Leave page?'; };
@sunary
sunary / readme.md
Last active February 21, 2020 09:55
bypass ssl pinning

Decompile android

  • Download apktool from https://ibotpeaches.github.io/Apktool/
  • Unpack apk file: java -jar d apktool.jar app.apk
  • Modify AndroidManifest.xml by adding android:networkSecurityConfig="@xml/network_security_config" attribute to application element.
  • Create file /res/xml/network_security_config.xml with following content:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
// same https://play.golang.org/p/3vGkbJ8OiNC
package main
const C = 12345678
func power(x, y int64) int64 {
a := int64(1)
for ; ; {
if (y & 1) != 0 {
@sunary
sunary / lispy.py
Created October 30, 2018 00:41
lisp parser
def read_from_tokens(tokens):
token = tokens.pop(0)
if token == '(':
L = []
while tokens[0] != ')':
L.append(read_from_tokens(tokens))
tokens.pop(0)
return L
elif token == ')':
raise SyntaxError('unexpected )')
@sunary
sunary / fanout.go
Last active April 1, 2019 16:02
Play with go channel
# source https://play.golang.org/p/jwdtDXVHJk
package main
import (
"fmt"
"time"
)
func producer(iters int) <-chan int {
@sunary
sunary / pusher_client.md
Last active July 28, 2018 06:00
pusher websocket