Skip to content

Instantly share code, notes, and snippets.

View jahentao's full-sized avatar

Jiaheng Tao jahentao

  • HangZhou, Zhejiang
View GitHub Profile
@jahentao
jahentao / do_login.sh
Last active April 10, 2019 09:06
浙江大学(宁波校区)软件学院_上网验证 #Util
# 采用curl命令行方式
# 我的用户名 21851075,密码 123456ABC
username=21851075
password=123456ABC
pass1=$(echo -n $password | md5sum |cut -d ' ' -f1)
pass2=$(echo ${pass1:8:16})
curl -H "Content-Type: application/x-www-form-urlencoded" \
-b srun_login=$username%7C$password \
-A "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36" \
-d "username=$username&password=$pass2&drop=0&type=1&n=100" \
@orenyomtov
orenyomtov / update-gcc-clang-8-ubuntu-16.04-xenial.sh
Created March 31, 2019 12:42
Update clang to 8.0 and gcc to 8.0 on Ubuntu xenial 16.04
if [ ! -f /usr/bin/gcc-8 ]; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-8 g++-8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 1000
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 1000
fi
if [ ! -f /usr/bin/gcc-8 ]; then
@dentechy
dentechy / WSL-ssh-server.md
Last active October 8, 2024 10:48
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@zhanghai
zhanghai / 0-zju-network-configuration.md
Last active November 24, 2019 10:34
浙江大学 VPN 及 ZJUWLAN 网络配置
  1. 检查是否已有 ~/bin 目录(~ 即是家目录)。如果没有:   0. 创建目录:mkdir ~/bin。   1. 编辑 ~/.bashrc,加入 export PATH="$HOME/bin:$PATH"。   2. 退出终端并重新打开以使新的 ~/.bashrc 生效(或者执行 source ~/.bashrc)。

ZJUVPN

  1. 下载 https://github.com/DreaminginCodeZH/zju-net-utils/raw/master/src/zjuvpn.sh~/bin/zjuvpn(不带扩展名,用起来方便),并使用 chmod +x ~/bin/zjuvpn 添加可执行权限。
  2. 安装 xl2tpd:sudo pacman -S xl2tpd
  3. 配置 ppp
@hygull
hygull / LICENSE KEY FOR SUBLIME TEXT 3 BUILD 3143.md
Last active December 16, 2023 19:30
LICENSE KEY FOR SUBLIME TEXT 3 BUILD 3143

STEPS

  • Click on Help menu

  • Select Enter License

  • Then paste given KEY given at bottom

  • Finally click on Use License

@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active November 2, 2024 12:39
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@ryerh
ryerh / tmux-cheatsheet.markdown
Last active October 30, 2024 08:09 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@wfaler
wfaler / bind-consul.sh
Created September 9, 2015 19:01
use consul as DNS for local services, fronted by Bind for the rest
sudo apt-get install bind9 bind9utils bind9-doc
wget https://dl.bintray.com/mitchellh/consul/0.5.2_linux_amd64.zip
/etc/bind/named.conf.options:
options {
directory "/var/cache/bind";
recursion yes;
allow-query { localhost; };
forwarders {
@lisovy
lisovy / qemu_pci_pass_through.txt
Created April 11, 2015 20:21
Qemu PCI pass-through
How to use 'pci pass-through' to run Linux in Qemu accessing real Ath9k adapter
===============================================================================
# Boot kernel with 'intel_iommu=on'
# Unbind driver from the device and bind 'pci-stub' to it
echo "168c 0030" > /sys/bus/pci/drivers/pci-stub/new_id
echo 0000:0b:00.0 > /sys/bus/pci/devices/0000:0b:00.0/driver/unbind
echo 0000:0b:00.0 > /sys/bus/pci/drivers/pci-stub/bind
@dynamicguy
dynamicguy / install-opencv-2.4.11-in-ubuntu.sh
Last active April 3, 2024 20:20
install opencv-2.4.11 in ubuntu
# install dependencies
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y cmake
sudo apt-get install -y libgtk2.0-dev
sudo apt-get install -y pkg-config
sudo apt-get install -y python-numpy python-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libjasper-dev