Open wupanhao opened 7 years ago
sudo iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE sudo iptables -A FORWARD -i wlan1 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT sudo iptables -A FORWARD -i wlan0 -o wlan1 -j ACCEPT
ip -6 route add default via fe80::eda:41ff:feac:3ba0 dev eth0.2
参考GitHub官网: https://help.github.com/articles/removing-sensitive-data-from-a-repository
# 查看对象文件记录
git rev-list --objects --all
例如, 我的jekyll博客代码库提交了大量mp3文件, 使用下面命令清除后代码库由233M缩小为1.3M, 提交到GitHub部署博客轻快飞速
# 清除垃圾文件(大量无用的mp3文件)
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch *.mp3' --prune-empty --tag-name-filter cat -- --all
# 提交到远程仓库(如GitHub, 我再次从git clone GitHub代码库会变小为1.3M)
git push origin --force --all
# 必须回收垃圾,本地仓库才变小
git for-each-ref --format='delete %(refname)' refs/original | git update-ref --stdin
git reflog expire --expire=now --all
git gc --prune=now
rm -rf .git/refs/original
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now
转自:https://blog.csdn.net/weixin_33762321/article/details/87208418
更改nodejs global包安装路径,解决EACESS ERROR
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
sudo apt-get update sudo apt-get install -y lrzsz sudo apt-get install -y zsh
sudo apt-get install -y vim
sudo apt-get install -y ttf-wqy-zenhei sudo apt-get install -y fcitx fcitx-pinyin
sudo apt-get install -y samba sudo apt-get install -y samba-common-bin
sudo apt-get install -y tightvncserver sudo apt-get install -y xtightvncviewer
sudo pip install shadowsocks
sudo apt-get install -y espeak
sudo apt-get install -y festival
sudo apt-get install -y nginx sudo apt-get install -y php5-fpm
树莓派关闭屏保 http://ju.outofmemory.cn/entry/103897
https://my.oschina.net/yangyanxing/blog/159215 http://jayveehe.github.io/2015/01/26/nginx-flask/
树莓派aria2 远程下载配置 http://mkitby.com/2016/01/15/raspberry-pi-nas-remote-download-aria2/
挂载samba sudo mount -t cifs -o username=xxxx,password=xxxx //192.168.31.189/kugou /mnt/kugou
虚拟键盘 http://bbs.ickey.cn/community/forum.php?mod=viewthread&tid=44694
openssl req -new -newkey rsa:2048 -sha256 -nodes -out wupanhao_top.csr -keyout wupanhao_top.key -subj "/C=CN/ST=BeiJing/L=BeiJing/O=Ekinghao Inc./OU=Web Security/CN=wupanhao.top"
openssl x509 -req -days 1024 -in wupanhao_top.csr -signkey wupanhao_top.key -out wupanhao_top.crt
server {
listen 443 ssl;
server_name lc.wupanhao.top;
#证书文件
ssl_certificate /home/cist/wupanhao_top.crt;
#私钥文件
ssl_certificate_key /home/cist/wupanhao_top.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
#...
root /home/cist/samples;
index index.html;
}
远程访问授权
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH GRANT OPTION;
树莓派旋转270度
sudo nano /boot/config.txt
display_rotate=1 # 1 90 ,2 180 , 3 270
avoid_warnings=1
hdmi_force_hotplug=1 #允许HDMI热插拔
香橙派
sudo nano /etc/X11/xorg.conf.d/01-armbian-defaults.conf
Section "Device"
Identifier "default"
Driver "fbdev"
Option "Rotate" "CCW" #The supported values are "CW" (clockwise,
90 degrees), "UD" (upside down, 180 degrees) and "CCW" (counter clockwise,
270 degrees)
EndSection
sudo apt-get purge libappstream3
cp -r /lib/modules/2.6.27.59-lynloong-2f-9003 /lib/modules/2.6.27.59-loongson-2f
权限需要改为755
anonymous_enable=YES
anon_root=/home/hao/Public
xgettext -d test header.php --from-code=utf-8
pip install opencv-python
网上很多人都是用源码编译的方式。也可通过pip方式安装。
pip3 install opencv-python
sudo apt install libatlas3-base libjasper1 libgst7 python3-gst-1.0 libqtgui4 libqt4-test
其实使用python3后,再import cv2从错误信息中就能知道缺少什么库,再使用sudo apt-cache search相关包就能查询到名称,最后使用apt安装即可。
conda install nb_conda_kernels conda install -n tensorflow ipykernel
/etc/wpa_supplicant/wpa_supplicant.conf
country=CN
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={ priority=3 ssid="zhanting" psk="xxxx" } network={ ssid="Xiaomi_R3G" scan_ssid=1 psk="xxxxxx" priority=2 } network={ ssid="hao" psk="xxxxx" priority=5 }
#include<stdio.h>
#include<sys/time.h>
int main()
{
/* 定义两个结构体 */
struct timeval start;
struct timeval end;
unsigned long timer;
/* 程序开始之前计时start */
gettimeofday(&start, NULL);
printf("hello world!\n");
/* 程序块结束后计时end */
gettimeofday(&end, NULL);
/* 统计程序段运行时间(unit is usec)*/
timer = 1000000 * (end.tv_sec - start.tv_sec) + end.tv_usec - start.tv_usec;
printf("timer = %ld us\n", timer);
return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
clock_t begin, end;
double cost;
//开始记录
begin = clock();
/*待测试程序段*/
printf("hello world!\n");
//结束记录
end = clock();
cost = (double)(end - begin)/CLOCKS_PER_SEC;
printf("constant CLOCKS_PER_SEC is: %ld, time cost is: %lf secs", CLOCKS_PER_SEC, cost);
}
转自https://blog.csdn.net/AdmireLinux/article/details/62237834
sudo vim /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=CN
network={
ssid="BNU"
key_mgmt=NONE
}
network={
ssid="Xiaomi_R3G"
psk="1234567890"
key_mgmt=WPA-PSK
}
network={
ssid="Xiaomi_HAO"
psk="wph123789"
key_mgmt=WPA-PSK
}
sudo apt-get install pulseaudio
vim /etc/systemd/system/pulseaudio.service
[Unit]
Description=PulseAudio Sound System
Before=sound.target
[Service] BusName=org.pulseaudio.Server ExecStart=/usr/bin/pulseaudio Restart=always
[Install] WantedBy=session.target
- 然后重启应该就能正常运行了
powershell 禁止运行脚本
set-executionpolicy remotesigned
https://gist.github.com/Lewiscowles1986/fecd4de0b45b2029c390#file-rpi3-ap-setup-sh
https://github.com/doraemonext/wechat-python-sdk
前端书籍整理
https://www.gitbook.com/book/mnichangxin/fe-book/details
我的新浪博客
http://weibo.com/u/3478765953?refer_flag=1005055010_&is_all=1
python打印
pip install python-escpos pip install pyusb 树莓派只需要者两项就可以了 香橙派貌似还需要 apt-get install python-dev && pip install Pillow 或 apt-get install python-imaging
挂载网络文件夹
nfs server
samba server
lubuntu远程桌面
docker删除所有容器(慎用)
docker ps -a | awk '{print $1}' | xargs docker rm
docker启动特殊容器
docker run -idt --name="xiaobai2" --privileged --net=host -v /root/rapiro:/root/rapiro wupanhao/xiaobai-assistant:v0.1 /bin/bash
ffmpeg下载532视频
fmpeg -i http://aisylive.oss/xxxxxxx/xxxx/180209c001_3.m3u8 -c copy -bsf:a aac_adtstoasc output.mp4
pip