Skip to content

Instantly share code, notes, and snippets.

View syneart's full-sized avatar

Jed Hong syneart

View GitHub Profile
@syneart
syneart / LinkItSmart7688_wifi-multi-role.md
Created September 20, 2016 09:02
This is the the doc for wifi multi-role on LinkIt Smart 7688 temporary solution.

LinkIt Smart 7688 wifi multi-role

This is the the doc for wifi multi-role on LinkIt Smart 7688 temporary solution.

Usage

  1. Factory reset or configure 7688(or 7688 Duo)'s Wi-Fi to AP mode.

  2. SSH login to 7688(or 7688 Duo)'s shell.

@syneart
syneart / OpenCV3.2withContrib.sh
Last active January 22, 2025 11:06
OpenCV 3.2 with Contrib install script [CUDA supported]
######################################
# INSTALL OPENCV ON UBUNTU OR DEBIAN #
######################################
# Use below command to install OpenCV 3.2 with Contrib at Ubuntu or Debian on your own operating system.
# wget -O - https://gist.githubusercontent.com/syneart/3e6bb68de8b6390d2eb18bff67767dcb/raw/OpenCV3.2withContrib.sh | bash
# | THIS SCRIPT IS TESTED CORRECTLY ON |
# |-----------------------------------------------------------|
# | OS | OpenCV | CUDA | Test | Last test |
@syneart
syneart / imageFileTypeIdentify.c
Created March 22, 2018 14:14
Identifying Image Format from the First Few "Magic" Bytes in C
#include <stdio.h>
int main(int argc, char *argv[]) {
FILE *fileptr;
char *buffer;
long filelen;
fileptr = fopen(argv[1], "rb"); // Open the file in binary mode
fseek(fileptr, 0, SEEK_END); // Jump to the end of the file
filelen = ftell(fileptr); // Get the current byte offset in the file
@syneart
syneart / wedding_remind.ics
Created July 14, 2018 22:55
Congratulations!
BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
CALSCALE:GREGORIAN
PRODID:Jed
BEGIN:VTIMEZONE
TZID:Taipei
END:VTIMEZONE
BEGIN:VEVENT
DESCRIPTION:我們決定要結婚了 (還籌備了好陣子)\n小小婚禮希望大家來參與\n讓我們與你/妳分享喜悅 ☺
@syneart
syneart / build_wireshark.sh
Last active July 6, 2025 17:55
BUILD WIRESHARK ON UBUNTU OR DEBIAN
#!/bin/sh
# This shell script is made by SyneArt <[email protected]>
#######################################
# BUILD WIRESHARK ON UBUNTU OR DEBIAN #
#######################################
# | THIS SCRIPT IS TESTED CORRECTLY ON |
# |----------------------------------------------------------|
# | OS | Wireshark | Test | Last test |
# |--------------------|----------------|------|-------------|
@syneart
syneart / caffeine-indicator.patch
Last active September 27, 2023 01:48
Default start caffeine in active mode (patch for caffeine-indicator 2.9.4 [https://launchpad.net/caffeine])
27a28
> import subprocess
64,68d64
< # Handle command line arguments
< parser = argparse.ArgumentParser(prog=PROGRAM_NAME, description='Toggle desktop idleness inhibition')
< parser.add_argument('-V', '--version', action='version', version=PROGRAM_NAME + ' ' + VERSION)
< parser.parse_args()
<
179d174
<
@syneart
syneart / netgear_firmware_crawler.py
Last active March 2, 2024 02:37
To download all Netgear's firmwares
#!/usr/bin/env python2
# -*- coding:utf-8 -*-
# pip2 install requests BeautifulSoup4 wget --user
import os, requests, json, re, wget
from bs4 import BeautifulSoup
root_save_dir_path = r'./netgear/'
if not os.path.isdir(root_save_dir_path):
os.mkdir(root_save_dir_path)
@syneart
syneart / mysql_native_password.sh
Last active May 29, 2019 11:53
Set default root password for MySQL 5.7 with Ubuntu when MySQL doesn't ask for root password at installing
#!/bin/sh
# | THIS SCRIPT IS TESTED CORRECTLY ON |
# |--------------------------------------------------------|
# | OS | MySQL | Test | Last test |
# |--------|--------------------------|------|-------------|
# | Ubuntu | Ver 14.14 Distrib 5.7.26 | OK | 16 May 2019 |
MYSQL_ROOT_PASSWORD=`head /dev/urandom | tr -dc A-Za-z0-9 | head -c10`
sudo mysql -uroot<<EOF
use mysql;
@syneart
syneart / uhd_installer.sh
Last active June 27, 2025 13:03
Get latest USRP Hardware Driver from apt with install or upgrade
#!/bin/bash
# This shell script is made by SyneArt <[email protected]>
#######################################
# INSTALL UHD ON UBUNTU OR DEBIAN #
#######################################
# | THIS SCRIPT IS TESTED CORRECTLY ON |
# |--------------------------------------------------------|
# | OS | UHD | Test | Last test |
# |----------------|------------------|------|-------------|
@syneart
syneart / deviceConnect2Wifi.sh
Created January 12, 2021 07:43
Android debugging over WiFi (use adb)
#!/bin/bash
# This shell script is made by SyneArt <[email protected]>
# Android Studio default path on Mac
adb=~/Library/Android/sdk/platform-tools/adb
function connect() {
device_id=$1
device_ip=`${adb} -s ${device_id} shell ip -f inet addr show wlan0 | grep -e "[0-9].*\/[0-9]*" | awk '{ print $2 }' | sed 's/\/[0-9]*//'`
echo "Android device id: ${device_id}"