Skip to content

Instantly share code, notes, and snippets.

View pzxbc's full-sized avatar
🎯
Focusing

pzxbc

🎯
Focusing
View GitHub Profile
@pzxbc
pzxbc / gist:bf0b9ffb66e5774b09fd7ff39d6a3b1e
Created September 10, 2019 03:06 — forked from adamgit/gist:3705459
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
##########################################
#
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.82
#
# Latest Change:
# - MORE tweaks to get the iOS 10+ and 9- working
# - Support iOS 10+
# - Corrected typo for iOS 1-10+ (thanks @stuikomma)
@pzxbc
pzxbc / cd_script_path.sh
Created August 14, 2019 05:54
shell进入脚本目录
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")";pwd)
cd ${SCRIPT_DIR}
@pzxbc
pzxbc / windows_file_time.md
Created April 8, 2019 06:51
[Windows文件时间戳操作] Windows上查看修改文件创建、最后修改、最后访问时间 #timestamp

先创建文件new-item gh.txt

powershell显示文件的创建、最后修改、最后访问时间 属性

PS D:\godhat> (ls gh.txt).CreationTimeUtc
PS D:\godhat> (ls gh.txt).LastWriteTimeUtc
PS D:\godhat> (ls gh.txt).LastAccessTimeUtc
@pzxbc
pzxbc / dbg.h
Created March 25, 2019 11:30
C debug macros
#ifndef __dbg_h__
#define __dbg_h__
#include <stdio.h>
#include <errno.h>
#include <string.h>
#ifdef NDEBUG
#define debug(M, ...)
@pzxbc
pzxbc / autossh_connect.service
Last active March 4, 2019 05:43
autossh systemd service unit file
[Unit]
Description=autossh connect
After=network-online.target ssh.service
[Service]
ExecStart=/usr/bin/autossh -M 40000 -N -q pi3
ExecStop=killall -s KILL autossh
RestartSec=5
Restart=always
@pzxbc
pzxbc / Netfilter-IPTables-Diagrams.md
Created January 21, 2019 01:56 — forked from nerdalert/Netfilter-IPTables-Diagrams.md
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

@pzxbc
pzxbc / gitlab-runner.md
Created November 2, 2018 03:42
gitlab问题

Windows上一般是GBK编码的,但是gitlab-runner默认是utf-8的编码。

在Windows上的runner的输出如果包含中文就会出现乱码,解决方法:在script执行前添加codepage转化的命令

chcp 65001

但是Windows上的有些命令时不支持utf8编码的,比如xcopy...,所以即使切换的编码,也会有部分命令出现乱码

@pzxbc
pzxbc / Tmux.md
Last active October 8, 2018 12:15
[Tmux使用] #Tmux

Tmux

Tmux是一个终端复用软件,它可以让你在单一屏幕上创建和使用多个终端。它最大的作用是可以让你的终端会话永不掉线!

原理

通过伪终端技术来实现,类似相关的应用有SSHTelnet

相关介绍:
伪终端原理

@pzxbc
pzxbc / itchat.md
Last active September 27, 2018 09:39
[itchat使用] 记录使用itchat过程遇到的问题 #itchat #wxbot #微信机器人

itchat是基于微信网页端接口实现的一个处理微信消息的库

入门例子

给文件助手发送消息

import itchat
itchat.auto_login()
itchat.send('Hell, filehelper', toUserName='filehelper')
@pzxbc
pzxbc / 0_reuse_code.js
Created August 25, 2014 04:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console