Skip to content

Instantly share code, notes, and snippets.

View zhanglongqi's full-sized avatar

Zhang LongQi zhanglongqi

View GitHub Profile

disable autostarted services

sudo systemctl disable bonescript-autorun.service bonescript.socket node-red.socket nginx.service cloud9.socket

share internet from host by USB

on BBB

@zhanglongqi
zhanglongqi / bbb_eeprom.c
Last active January 31, 2020 07:15
Beaglebone Black operation
/*
* bbb_eeprom.c Read Model & SerialNo from BeagleBone Black's EEPROM via i2c
*
* Compile with:
* cc bbb_eeprom.c -o bbb_eeprom
*
* Winston Smith <[email protected]>
*
* History:
* 2014-05-01 Initial Implementation for FreeBSD

Target machine is raspberry pi zero, running raspbian 10 buster and zsh.

--color=on can fix the color in terminal.

-R UTF8 can fix the character display problem, like lines in tree.

minicom --color=on -8 -b 115200 -R UTF8 -D /dev/ttyUSB0
@zhanglongqi
zhanglongqi / osx_wifi_strenght_command_line.sh
Created March 11, 2019 09:26 — forked from miglen/osx_wifi_strenght_command_line.sh
Mac OS X Wifi Signal strength meter command line
#!/bin/bash
# Simple command to display the wireless strenght signal
#
clear
while x=1
do /System/Library/PrivateFrameworks/Apple*.framework/Versions/Current/Resources/airport -I \
| grep CtlRSSI \
| sed -e 's/^.*://g' \
| xargs -I SIGNAL printf "\rWifi dBm: SIGNAL"
sleep 0.5
@zhanglongqi
zhanglongqi / Beaglebone_Black_Boot_explained.svg
Last active April 5, 2018 13:56
Beaglebone Black Boot explained
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zhanglongqi
zhanglongqi / bulk_ping.sh
Created April 5, 2018 13:45
ping the ip in a network segment
#!/bin/sh
ip=1
while [ $ip != "254]; do
ping 192.168.0.$ip -c 2 | grep -q "ttl=" && echo "192.168.0.$ip yes" || echo "192.168.0.$ip no"
ip=`expr "$ip" "+" "1"`
done
@zhanglongqi
zhanglongqi / setup_WPA2_with_hidden_SSID.md
Last active June 12, 2023 10:44
Connect to WPA2 Personal with hidden SSID using command line on Linux

This command will add your network parameters to the configuration file of wpa_supplicant

sudo -s
wpa_passphrase YOUR_SSID YOUR_PASSWORD >> /etc/wpa_supplicant/wpa_supplicant.conf

If the SSID of the network is hidden additional step need to be done:

sudo vim /etc/wpa_supplicant/wpa_supplicant.conf

Update what you just added scan_ssid=1 in your network parameters, such as from

@zhanglongqi
zhanglongqi / capture_filter.md
Last active October 20, 2017 07:11
Capture Filter of Wireshark for capturing all packages from/to a particular RF station
@zhanglongqi
zhanglongqi / 99_ssh_keep_awake.sh
Last active December 23, 2024 03:31
Prevent Linux from going to suspend/sleep when ssh connections are on.
#!/bin/sh
#
# Put this file to /etc/pm/sleep.d/
# chmod +x /etc/pm/sleep.d/99_ssh_keep_awake.sh
#
#
# Thanks to https://askubuntu.com/questions/521620/prevent-machine-from-sleeping-when-ssh-connections-are-on
#
ip=`w -h | awk '{print $1,$2,$3}' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'`
@zhanglongqi
zhanglongqi / beep.sh
Created September 15, 2017 05:30
beep in mac, show dialog in mac
#!/bin/bash
i="0"
while [ $i -lt 10000 ]
do
# osascript -e 'tell app "System Events" to display dialog "Dear Researchs: This is the first warning. Please stop playing games in the lab. \n IGS"'
# afplay /System/Library/Sounds/Basso.aiff
# say "b"
# echo -e "\a"