Skip to content

Instantly share code, notes, and snippets.

View 1ycx's full-sized avatar
🎯
Focusing

1ycx

🎯
Focusing
View GitHub Profile
@1ycx
1ycx / crontab.sh
Last active May 30, 2022 08:06
Cronjob for Alarm
# flush your motor circuit on reboot to avoid unexpected spray
@reboot /usr/bin/python3 /home/pi/alarm.py "flush"
# Refer to https://crontab.guru
# change 0 6 * * * to an expression of your choice
0 6 * * * /usr/bin/python3 /home/pi/alarm.py
# Experimental - syslog gets flushed on reboot, have to try another way
# cron logs to `stdout` syslog
# we also want to log `stderr` output to syslog with a CRON_ALARM tag
@1ycx
1ycx / embed-gist-dark-theme.css
Last active February 22, 2022 01:54 — forked from just-jeb/embed-gist-dark-theme.css
Dark theme gist embed for blog
<style>
/* https://github.com/lonekorean/gist-syntax-themes */
@import url('https://cdn.rawgit.com/lonekorean/gist-syntax-themes/d49b91b3/stylesheets/idle-fingers.css');
@import url('https://fonts.googleapis.com/css?family=Open+Sans');
body {
font: 16px 'Open Sans', sans-serif;
}
body .gist .gist-file {
border-color: #555 #555 #444
@1ycx
1ycx / alarm.py
Last active May 31, 2022 06:54
Code for Water Alarm using Pi
#!/usr/bin/python3
import sys
import time
import RPi.GPIO as GPIO
# def gett():
# return time.strftime("%I:%M %p")
@1ycx
1ycx / clean_down.py
Created December 11, 2021 08:04
Download folder cleaner script
import getpass as gt
import os
from collections import Counter
WIN_BASE = "C:\\Users\\kogam\\Downloads"
EXCEL_XTS = ["xls", "xlsx", "xlsb", "xlsm", "xlam"]
SETUP_XTS = ["dmg", "deb", "dnf", "exe", "msix", "msixbundle", "cab", "cub", "ex_", "idt", "msi", "msp", "mst", "pcp", "rbf", "rra", "stf"]
ARCHIVE_XTS = ["zip", "tar", "xz", "7z", "bz2", "pkg", "lz", "lzh", "rar", "gz", "tgz", "war"]
@1ycx
1ycx / Windows
Created April 26, 2020 07:03 — forked from JerryLokjianming/Crack Sublime Text Windows and Linux.md
Crack Sublime Text 3.2.2 Build 3211
# Subscribe to my YouTube Channel -> https://lokjianming.page.link/CVLm #
How to Crack Sublime Text 3 with Hex Editor (without license) ↓
Note: -> is Change
1. Download & Install Sublime Text 3.2.2 Build 3211
2. Visit Hexed.it
3. Open file sublime_text.exe
4. Search address: 97 94 0D -> 00 00 00
5. Offset 0x8545: Original 84 -> 85
@1ycx
1ycx / whiteboardCleaner.md
Created October 15, 2019 18:41 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@1ycx
1ycx / ad
Created April 23, 2019 20:05
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Activate the plugin in ~/.zshrc:
plugins=( [plugins...] zsh-syntax-highlighting)
@1ycx
1ycx / README.md
Last active November 30, 2020 19:29
Python UDP Broadcast

Docs :

Run server and client in seperate terminals. Server first then client.

Server.py

import socket

host = ''
port = 51424