Skip to content

Instantly share code, notes, and snippets.

@jimyang2008
jimyang2008 / rpi.md
Last active June 12, 2019 07:21
Raspberry Pi

Notes on Raspberry Pi

Initial default username password for Raspbian

username: pi
password: raspberry

Update Locale to support "US"

Need to add US support in addition to default GB, including language, keyboard, etc.

$ raspi-config

@jimyang2008
jimyang2008 / rpi_router.md
Last active November 5, 2017 06:37
Setup RPi as a wireless bridge

Setup RPi as a wireless bridge

Steps

To setup wireless bridge on a Raspberry Pi 3B, following steps need to followed strictly

STAIFNAME=wlan0
APIFNAME=wlan1
APIFMAC=b8:27:eb:1c:98:53
APIFIP=192.168.6.1
@jimyang2008
jimyang2008 / setup_bbr.sh
Last active December 7, 2017 10:56
Setup BBR for Linux
#!/bin/bash
err() {
msg="$@"
echo "ERROR: $msg" >&2
}
centos6() {
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm
@jimyang2008
jimyang2008 / tips.md
Last active September 5, 2024 07:09
Tips

hostapd.conf examples

802.11AX 5GHz 80MHz

interface=phy1-ap0
bridge=br0
hw_mode=a
channel=auto
# for fixed channel
#channel=36
@jimyang2008
jimyang2008 / fix_Xresources.sh
Last active December 29, 2017 07:18
Replace color names defined in .Xresources for older version of xrdb
#!/bin/bash
err() {
echo "ERROR: $@" >&2
}
: ${INFILE:="$HOME/.Xresources"}
if [[ $# -gt 0 ]]
then
@jimyang2008
jimyang2008 / owncloud_install.sh
Last active May 10, 2018 12:00
install ownCloud in Linux
#!/bin/bash
set -e
err() {
echo "$@" >&2
}
prepare_redhat() {
yum update -y
@jimyang2008
jimyang2008 / tcpdump.md
Last active April 15, 2019 03:12
TCPDUMP reference

Overview

tcpdump

  • Is a packet content inspection tool
  • Does packet filtering by boolean expression

For expression syntax, refere to pcap-filter(7)

Syntax

@jimyang2008
jimyang2008 / install-python27-centos67.md
Created February 25, 2019 04:13
Install Python 2.7 on CentOS 6/7
curl -LOk https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz
tar -zf Python-2.7.15.tgz
cd Python.2.7.15
./configure --enable-optimization
make altinstall
curl -LOk https://bootstrap.pypa.io/get-pip.py
python2.7 get-pip.py
@jimyang2008
jimyang2008 / install_tmux.sh
Created March 20, 2019 05:36
install tmux script
#!/bin/bash
set -e
FTP_BASE='ftp://ftp.yangjian.net/pub'
LIBEVENT=libevent-2.1.8-stable
NCURSES=ncurses
TMUX=tmux-2.6
OPT_DIR=$HOME/opt
@jimyang2008
jimyang2008 / install_python_pip_no_root.sh
Last active March 20, 2019 05:40
install Python 2.7 and Pip without root access
#!/bin/bash
INSTALL_DIR=~/opt/python
TMP_DIR=/tmp/install_python
mkdir -p $INSTALL_DIR
DIR_OPENSSL=openssl-1.0.2k
DIR_PYTHON=Python-2.7.13
FILE_OPENSSL=${DIR_OPENSSL}.tar.gz
FILE_PYTHON=${DIR_PYTHON}.tgz