# 64k
dd if=/dev/zero of=test bs=64k count=1638 && rm -f test
dd if=/dev/zero of=test bs=64k count=1638 conv=fdatasync && rm -f test
dd if=/dev/zero of=test bs=64k count=1638 conv=fsync && rm -f test
dd if=/dev/zero of=test bs=64k count=1638 oflag=dsync && rm -f test
# 1024k
dd if=/dev/zero of=test bs=1024k count=100 && rm -f test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Patch a recovery image to enable RTC writing | |
Unfortunately it has not the intended effect (tested from recovery): | |
~ # /system/xbin/hwclock -w | |
hwclock: RTC_SET_TIME: Operation not permitted | |
<3>[ 25.821247] spmi_pmic_arb fc4cf000.qcom,spmi: pmic_arb_wait_for_done: transaction denied (0x5) | |
<3>[ 25.821338] qcom,qpnp-rtc qpnp-rtc-ee162000: SPMI write failed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -xe | |
# Replace ******** with your token | |
export SIGN_IN_URL=http://m.client.10010.com/SigninApp/signin/querySigninActivity.htm?token=******** | |
export DAY_SIGN_URL=http://m.client.10010.com/SigninApp/signin/daySign.do | |
export SCRIPT_PATH=$(dirname $0) | |
echo "$(date +'%Y-%m-%d %T')" >> $SCRIPT_PATH/log.txt | |
curl $SIGN_IN_URL \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem Batch file that extracts java from installer | |
rem Original topic on stackoverflow: | |
rem http://stackoverflow.com/questions/1619662/how-can-i-get-the-latest-jre-jdk-as-a-zip-file-rather-than-exe-or-msi-installe | |
setlocal | |
if [%1]==[] goto usage | |
set fn=%~n1 | |
7z.exe e %1 .rsrc\1033\JAVA_CAB10\111 | |
if errorlevel 1 goto err |
https://www.google.com/android/uncertified
# disable root at first.
# backup
adb shell sqlite3 /data/data/com.google.android.gsf/databases/gservices.db \"select * from main where name='android_id'\"
# update
adb shell sqlite3 /data/data/com.google.android.gsf/databases/gservices.db \"update main set value='<my_certified_android_id>' where name='android_id'\"
# check
# unpack
bsdcpio -id < ../extra.lzma
# repack
find . | cpio -o --format='newc' --owner root:root | lzma > ../extra.lzma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
# | |
# Hurricane Electric DDNS script for OpenWrt | |
# | |
# crontab: */5 * * * * INTERFACE=pppoe-wan USE_PEERDNS=1 DOMAIN=example.com KEY=password /usr/bin/he-ddns.sh | |
# | |
set -o pipefail | |
INTERFACE="${INTERFACE:-pppoe-wan}" | |
DOMAIN="${DOMAIN:-example.com}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
METHOD="$1" | |
# prepare | |
docker stop iperf-client ss-client ss-server iperf-server &>/dev/null || true | |
docker rm iperf-client ss-client ss-server iperf-server &>/dev/null || true | |
# iperf server | |
docker run -d --rm --name iperf-server --network host pexcn/docker-images:iperf -s -B 127.0.0.1 -p 10000 >/dev/null |
标签(空格分隔): 密码学
本文介绍目前现代密码学的最先进技术, 前半部分主要翻译自 《Cryptographic Right Answers》,附上收集的资料,和byron个人的理解。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Solarized Darcula] | |
text=d2d8d9 | |
cyan(bold)=15968d | |
text(bold)=d2d8d9 | |
magenta=797fd4 | |
green=629655 | |
green(bold)=629655 | |
background=3d3f41 | |
cyan=15968d | |
red(bold)=f24840 |
OlderNewer