Skip to content

Instantly share code, notes, and snippets.

View syneart's full-sized avatar

Jed Hong syneart

  • SentraSmart Inc.
  • Taipei, Taiwan
View GitHub Profile
@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 / 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 / OpenCV3.2withContrib.sh
Last active April 27, 2024 01:30
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 / 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 / LinkItSmart7688_Isolate_Issue_reslove.md
Last active September 5, 2016 08:27
Disable LinkIt Smart 7688 LAN client isolation with AP mode

Disable LinkIt Smart 7688 LAN client isolation with AP mode

This is the the doc for LAN client isolation issue with AP mode 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 / cm.bat
Created July 22, 2016 17:32
Lazy FullScreen
@ECHO OFF&mode con cols=15 lines=1
SET TMP_FILE=%tmp%\cm.bat
SET FILE=%1
SET FILE_EXT=%~x1
IF NOT "%~s0"=="%TMP_FILE%" (
COPY %0 %TMP_FILE% 1>nul 2>&1
start/min %TMP_FILE% %FILE%
EXIT
)
@syneart
syneart / FixChromeShortcut.sh
Created May 17, 2016 13:12
修正 Google Chrome 在 Ubuntu Unity (user interface) 所產生的捷徑錯誤
#!/bin/bash
clear
echo "Info: 修改檔案需要權限, 請先輸入密碼 .."
sudo -v
if [ $? -eq 1 ]; then
clear
echo "Error: 未輸入正確密碼, 無法繼續執行"
sleep 3
exit 0
fi
@syneart
syneart / UpdateUbuntuKernel.sh
Created May 17, 2016 13:10
Remove all Ubuntu older linux kernels and Update to the latest kernel.
#!/bin/bash
clear
echo "Info: 移除和更新核心檔案需要權限, 請先輸入密碼 .."
sudo -v
if [ $? -eq 1 ]; then
clear
echo "Error: 未輸入正確密碼, 無法繼續執行"
sleep 3
exit 0
fi
@syneart
syneart / mountISO.sh
Created May 17, 2016 13:08
This is a mount iso files bash for Ubuntu.
#!/bin/bash
clear
echo "Please input the iso file in here [Nothing input will unmount]"
read -p ">> " srcinputfile
clear
mntPath=/media/isofileceh
if ["$srcinputfile" == ""] 2>/dev/null ; then
sudo umount "$mntPath" 1>/dev/null 2>/dev/null
sudo rmdir "$mntPath" 1>/dev/null 2>/dev/null
echo The iso file is unmounted !
@syneart
syneart / PHPDeBugOnOff.sh
Created May 17, 2016 13:04
Turn On or Off php display_errors parameter on Ubuntu (to quick turn on display PHP error messages or not).
#!/bin/bash
DISPLAY_ERRORS_VAL=`grep display_errors.*=.* '/etc/php5/apache2/php.ini'`
clear
echo "Info: 目前 ${DISPLAY_ERRORS_VAL}";
echo "Info: 修改檔案需要權限, 請先輸入密碼 .."
sudo -v
if [ $? -eq 1 ]; then
clear
echo "Error: 未輸入正確密碼, 無法繼續執行"
sleep 3