Skip to content

Instantly share code, notes, and snippets.

@jouyouyun
jouyouyun / lsm_hookmanager_ifc.org
Created September 17, 2020 02:32
hookmanager 接口说明

UOS LSM Hook Manager

Kernel LSM 中提供了大量常用操作的 hook ,可以让开发者在这些操作执行前进行检查,便于对程序进行管控。 但由于 LSM Module 必须编译进内核,因此需要公开源码,这通常不符合很多开发者的要求。 基于这种情况, uos 基于 LSM 开发了一个 hook manager 的模块,可提供接口给开发者使用,达到了动态注册/移除 LSM Hook 的目的。

接口描述

@gen2brain
gen2brain / gist:2f35a965f55066954e7d
Created September 10, 2015 20:46
gomobile bind
thinkpad tmp # go version
go version devel +d862753 Wed Sep 9 05:29:20 2015 +0000 linux/amd64
thinkpad tmp # gomobile bind -a -v -x -o bukanir.aar -target android bukanir
GOMOBILE=/home/milann/golang/pkg/gomobile
WORK=/tmp/gomobile-work-763706777
write /tmp/gomobile-work-763706777/go_bukanir/go_bukanirmain.go
mkdir -p $WORK/go_bukanir
gobind -lang=go -outdir=$WORK/go_bukanir bukanir
write /tmp/gomobile-work-763706777/androidlib/main.go
mkdir -p $WORK/androidlib
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@85636682
85636682 / gist:a5ca5facf8cb4012a4ad
Last active May 20, 2019 15:02
ios7 隐藏虚拟键盘 解决键盘挡住UITextField问题
一、键盘风格
UIKit框架支持8种风格键盘
```
typedef enum {
UIKeyboardTypeDefault, // 默认键盘:支持所有字符
UIKeyboardTypeASCIICapable, // 支持ASCII的默认键盘
UIKeyboardTypeNumbersAndPunctuation, // 标准电话键盘,支持+*#等符号
UIKeyboardTypeURL, // URL键盘,有.com按钮;只支持URL字符
UIKeyboardTypeNumberPad, //数字键盘
@stefansundin
stefansundin / install-pre-push.sh
Last active June 9, 2024 13:02
Git pre-push hook to prevent force pushing the master/main branch.
#!/bin/bash
# This script will install a Git pre-push hook that prevents force pushing the master/main branch.
# There are three variants that I have built:
# - pre-push: prevents force-pushing to master/main.
# - pre-push-2: prevents force-pushing to master/main depending on the remote (you need to edit the file!).
# - pre-push-3: prevents any type of pushing to master/main.
# Set the desired version like this before proceeding:
# FILE=pre-push
# Single repo installation:
@nscoding
nscoding / NSCSearchBar.h
Last active July 6, 2018 04:07
On iOS 7 UISearchBar the placeholder text is centred and I want to disable that and make it always stick to the left like it was before. There is a private method setCenterPlaceholder and calling this with a BOOL work will make the trick. I am wondering if there is any other, not "Hacked" that does the same thing.
@interface NSCodingSearchBar : UISearchBar
// Default by the system is YES.
// https://github.com/nst/iOS-Runtime-Headers/blob/master/Frameworks/UIKit.framework/UISearchBar.h
@property (nonatomic, assign, setter = setHasCentredPlaceholder:) BOOL hasCentredPlaceholder;
@end
@kenshinx
kenshinx / client.go
Last active February 3, 2024 18:49
golang socket server & client ping-pong demo
package main
import (
"os"
"log"
"net"
"strconv"
"strings"
)
@mitchallen
mitchallen / .gitignore_global
Created April 21, 2012 15:27
Example global .gitignore file
####################################################
# Global .gitignore Flle
# Reference: http://help.github.com/ignore-files/
# Save this in a file: ~/.gitignore_global
# Then at the command line (you will see more info if a repo is in the current folder):
# git config --global core.excludesfile ~/.gitignore_global
# git config --list
#####################
# Maven #