Skip to content

Instantly share code, notes, and snippets.

View tranch's full-sized avatar
🎯
Focusing

Tranch tranch

🎯
Focusing
View GitHub Profile
@tranch
tranch / v2ray_install.sh
Last active December 3, 2022 11:24
V2ray binary install script
#!/bin/sh
set -ex
V2RAY_BINARY_PATH=/usr/local/bin
V2RAY_LOCATION_ASSET_PATH=/usr/local/share/v2ray
V2RAY_CONFIG_PATH=/usr/local/etc/v2ray
apt update
apt install -y zip
@tranch
tranch / re-sign iOS IPA
Created September 27, 2022 14:31 — forked from lodalo/re-sign iOS IPA
Steps to re-sign an IPA file with a new provisioning profile
#Unzip the IPA
unzip Application.ipa
#Remove old CodeSignature
rm -R "Payload/Application.app/_CodeSignature"
#Replace embedded mobile provisioning profile
cp "path-to-provisioning-profile/MyEnterprise.mobileprovision" "Payload/Application.app/embedded.mobileprovision"
#If you are resigning to submit to the AppStore you need to extract the entitlements to use later
@tranch
tranch / .bash_prompt.sh
Last active January 19, 2021 15:10
bash prompt
if infocmp xterm-256color >/dev/null 2>&1; then
export TERM=xterm-256color
fi
if tput setaf 1 &> /dev/null; then
tput sgr0
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
MAGENTA=$(tput setaf 9)
ORANGE=$(tput setaf 172)
GREEN=$(tput setaf 190)
@tranch
tranch / INSTALL.sh
Last active November 4, 2020 15:06
V2ray config
#!/bin/bash
mkdir /usr/local/{etc,share}/v2ray
cp ./*.json /usr/local/etc/v2ray
cp ./v2{ctl,ray} /usr/local/bin
cp ./*.dat /usr/local/share/v2ray
package com.honey;
import java.util.concurrent.*;
/**
* Hello world!
*/
public class App {
public static void main(String[] args) {
@tranch
tranch / ideolog-monolog.md
Last active July 30, 2019 05:53 — forked from mysiar/ideolog-monolog.md
Monolog template for Ideolog
  • Message pattern: ^\[(.*)\] (.+?)\.([A-Z]+): (.*)
  • Message start pattern: ^\[
  • Time format: yyyy-MM-dd HH:mm:ss
  • Time capture group: 1
  • Severity capture group: 3
  • Category capture group: 2
@tranch
tranch / ntp.py
Last active November 28, 2018 12:43
NTP time update for micropython
import socket
import ustruct
import time
from machine import RTC
# datetime.date(2000, 1, 1) - datetime.date(1900, 1, 1)
NTP_DELTA = 3155673600
NTP_SERVER = '0.cn.pool.ntp.org'
def get_ntp_time():
import socket
import struct
import time
# datetime.date(1970, 1, 1) - datetime.date(1900, 1, 1)
NTP_DELTA = 2208988800
NTP_SERVER = '0.cn.pool.ntp.org'
def get_ntp_time():
data = bytearray(48)
https://press.one/p/address/v?s=4c8d6cec6dc360ad73cc18d9f893cf2a1816f3ab527be0f98fe6f8338087075a14a252d2f99089a3107df842673123bbd99aaca8a30db94357a2105aeed4df7d0&h=bf59b4c015605a9e8a08952d52c0fca3e78e67463d74e13887c3eac6ebc3ea4a&a=96303b762d3860e21afc7cefd7e1ff79176f5cb2&f=P1&v=2
@tranch
tranch / vimrc.vim
Last active March 26, 2018 15:51
My VIM Profile
set t_Co=256
set laststatus=2
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 wmw=0 smarttab smartindent nu
set listchars=tab:▸\ ,eol:¬ list
if has('gui_running')
colorscheme molokai
set background=dark
set guifont=Inconsolata-g\ for\ Powerline:h12
set guioptions-=r