Skip to content

Instantly share code, notes, and snippets.

View nonkr's full-sized avatar
🎯
Focusing

Nonkr nonkr

🎯
Focusing
  • Hangzhou, China
View GitHub Profile
#!/bin/sh
IMAGES=$(docker images | awk '{print $1":"$2}')
echo "Saving images to tar files."
for image in ${IMAGES}; do
if [ ${image} != "REPOSITORY:TAG" ];then
echo "==> Saving ${image}......\c"
tar=$(echo -n ${image} | base64)
@echo off
adb devices
set "destdir=%date:~,4%-%date:~5,2%-%date:~8,2%"
if not exist %destdir% (
md %destdir%
)
echo pull /tmp/phase.bin
adb pull -p /tmp/phase.bin %destdir%/phase_%1.bin
@nonkr
nonkr / hshy_checkin.py
Created April 13, 2018 17:35 — forked from ficapy/hshy_checkin.py
练手python脚本,登陆Discuz论坛打卡签到
# -*- coding: utf-8 -*-
import requests
import hashlib
import re
username = '' ###账号###
password = ''###密码###
UA = "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) \
Chrome/27.0.1453.116 Safari/537.36"
headers = {
@nonkr
nonkr / Darcula copy.icls
Created November 21, 2017 05:43
CLion C/C++ Color Scheme
<scheme name="Darcula copy" version="142" parent_scheme="Darcula">
<option name="FONT_SCALE" value="1.0" />
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="EDITOR_FONT_NAME" value="Menlo" />
<option name="EDITOR_LIGATURES" value="true" />
<attributes>
<option name="OC.DIRECTIVE">
<value>
<option name="FOREGROUND" value="80b000" />
</value>
@nonkr
nonkr / gdbinit
Last active November 6, 2016 05:27
gdbinit
set print pretty on
define phs
if $argc != 2
help phs
else
set $_i = 0
if $arg1 > 0
echo \033[34m
while ($_i < $arg1)
Rtp_pt_map arr_pt_maps[] = {
{ 0, "ITU-T G.711 PCMU" },
{ 1, "USA Federal Standard FS-1016" },
{ 2, "ITU-T G.721" },
{ 3, "GSM 06.10" },
{ 4, "ITU-T G.723" },
{ 5, "DVI4 8000 samples/s" },
{ 6, "DVI4 16000 samples/s" },
{ 7, "Experimental linear predictive encoding from Xerox PARC" },
{ 8, "ITU-T G.711 PCMA" },
@echo off&cls
for %%* in (.) do set PROJECT=%%~nx*
set DISTFILE=cmakelist.tmp.txt
if exist %DISTFILE% del %DISTFILE%
echo cmake_minimum_required(VERSION 3.3.2)>>%DISTFILE%
echo project(%PROJECT%)>>%DISTFILE%
echo set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")>>%DISTFILE%
echo.>>%DISTFILE%
<?php
/**
* UUID class
*
* The following class generates VALID RFC 4122 COMPLIANT
* Universally Unique IDentifiers (UUID) version 3, 4 and 5.
*
* UUIDs generated validates using OSSP UUID Tool, and output
* for named-based UUIDs are exactly the same. This is a pure
* PHP implementation.
<key>GDI Commands</key>
<dict>
<key>GDI Duplicate Selected Line</key>
<string>selectLine:, copy:, moveToEndOfLine:, insertNewline:, paste:, deleteBackward:</string>
<key>GDI Delete Selected Line</key>
<string>moveToEndOfLine:, deleteToBeginningOfLine:, deleteBackward:, moveDown:, moveToEndOfLine:</string>
<key>GDI Move Selected Line Up</key>
<string>selectLine:, cut:, moveUp:, moveToBeginningOfLine:, insertNewLine:, paste:, moveBackward:</string>
<key>GDI Move Selected Line Down</key>
<string>selectLine:, cut:, moveDown:, moveToBeginningOfLine:, insertNewLine:, paste:, moveBackward:</string>
@nonkr
nonkr / sha.pl
Created January 14, 2014 17:12
SHA in 8 lines of perl5
#!/usr/bin/perl -iD9T4C`>_-JXF8NMS^$#)4=L/2X?!:@GF9;MGKH8\;O-S*8L'6
@A=unpack"N*",unpack u,$^I;@K=splice@A,5,4;sub M{($x=pop)-($m=1+~0)*int$x/$m};
sub L{$n=pop;($x=pop)<<$n|2**$n-1&$x>>32-$n}@F=(sub{$b&($c^$d)^$d},$S=sub{$b^$c
^$d},sub{($b|$c)&$d|$b&$c},$S);do{$l+=$r=read STDIN,$_,64;$r++,$_.="\x80"if$r<
64&&!$p++;@W=unpack N16,$_."\0"x7;$W[15]=$l*8 if$r<57;for(16..79){push@W,L$W[$_
-3]^$W[$_-8]^$W[$_-14]^$W[$_-16],1}($a,$b,$c,$d,$e)=@A;for(0..79){$t=M&{$F[$_/
20]}+$e+$W[$_]+$K[$_/20]+L$a,5;$e=$d;$d=$c;$c=L$b,30;$b=$a;$a=$t}$v='a';@A=map{
M$_+${$v++}}@A}while$r>56;printf'%.8x'x5 ."\n",@A