Skip to content

Instantly share code, notes, and snippets.

View Hoto-Cocoa's full-sized avatar
🚙
Driving

Cocoa Hoto Hoto-Cocoa

🚙
Driving
View GitHub Profile
@hakasenyang
hakasenyang / index.php
Last active July 22, 2021 09:45
ssl.hakase.io source
<?php
// Tor Check : https://gist.github.com/TheRealBastiaan/889b4ec5fafd928e0de2
function IsTorExitPoint($ip=null){
$ip = ($ip) ? $ip : $_SERVER['REMOTE_ADDR'];
if (gethostbyname(ReverseIPOctets($ip).".".$_SERVER['SERVER_PORT'].".".ReverseIPOctets($_SERVER['SERVER_ADDR']).".ip-port.exitlist.torproject.org")=="127.0.0.2") {
return true;
} else {
return false;
}
}
@mahirrudin
mahirrudin / ubuntu-bionic-openldap-mysql.sh
Created June 17, 2018 15:12
OpenLDAP with MySQL Backend - Ubuntu 18.04
## installation openldap with backend mysql
sudo apt update && sudo apt upgrade -y && sudo reboot
sudo apt install mysql-server unixodbc make gcc libmysqlclient-dev unixodbc-dev groff ldap-utils
## mysql login as root
sudo mysql -u root
CREATE DATABASE ldap
CREATE USER 'ldap'@'%' IDENTIFIED BY 'S3cureP4ssw0rd$';
GRANT ALL PRIVILEGES ON ldap.* TO 'ldap'@'%';
@jovimon
jovimon / gist:524e116471f249626fd2ccd141f3fe05
Last active April 26, 2024 17:59
compile realtek network driver for pfsense 2.4.x

How to compile and install latest realtek network driver in pfSense 2.4.x (FreeBSD 11.1)

  1. Download FreeBSD 11.1 VMDK and create a VM with it as HDD.

  2. Get FreeBSD source tree for your exact FreeBSD version and uncompress it to /usr/src:

    fetch -o /tmp ftp://ftp.freebsd.org/pub/`uname -s`/releases/`uname -m`/`uname -r | cut -d'-' -f1,2`/src.txz
    tar -C / -xvf /tmp/src.txz
    
  3. Download latest Realtek network driver (you need to input an email address).

@stecman
stecman / _readme.md
Last active April 25, 2024 00:10
Brother P-Touch PT-P300BT bluetooth driver python

Controlling the Brother P-Touch Cube label maker from a computer

The Brother PTP300BT label maker is intended to be controlled using the official Brother P-Touch Design & Print iOS/Android app. The app has arbitrary limits on what you can print (1 text object and up to 3 preset icons), so I thought it would be a fun challenge to reverse engineer the protocol to print whatever I wanted.

Python code at the bottom if you want to skip the fine details.

Process

Intitially I had a quick peek at the Android APK to see if there was any useful information inside. The code that handles the communication with the printer in Print&Design turned out to be a native library, but the app clearly prepares a bitmap image and passes it to this native library for printing. Bitmaps are definitely something we can work with.

@dentechy
dentechy / WSL-ssh-server.md
Last active March 30, 2024 16:16
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@hinaloe
hinaloe / Twitter Cramming.user.js
Last active September 28, 2017 05:35 — forked from if1live/Twitter Cramming.user.js
Force enable cramming (280 character tweets) on Twitter. NOTE: Stops working when you switch pages, refresh to fix. https://twitter.com/Prof9/status/912859110776950784
// ==UserScript==
// @name Twitter Cramming
// @description Force enable cramming (280 character tweets) on Twitter
// @author Prof. 9
// @version 0.1
// @match https://twitter.com/*
// @run-at document-idle
// @namespace prof9.twittercramming
// ==/UserScript==
@fawkesley
fawkesley / readonly_pi.markdown
Last active March 28, 2020 06:47
Mount raspberry pi filesystems as readonly
@foriequal0
foriequal0 / yaminjeongeum.user.js
Last active September 4, 2023 06:58
브라우저의 모든 텍스트를 야민정음으로 바꿔줍니다
// 브라우저에 GreaseMonkey(Firefox) TamperMonkey(Chrome) 을 설치하고,
// https://gist.github.com/foriequal0/154e73d3289d808e8ce94603f5eff6a4/raw/yaminjeongeum.user.js
// 위 링크를 브라우저에 입력하면 자동으로 스크립트를 설치하겠느냐는 창이 뜹니다.
// ==UserScript==
// @name yaminjeongeum
// @namespace yaminjeongeum.kr
// @description 야민정음
// @include *
// @exclude file://*
// Dirty overload the native function
var parseInt = function(arg1) {
if (arg1 === "Infinity") {
return NaN;
}
if (arg1 === "Infinity+1") {
return "Infinity1";
}
if (arg1 === "1+1+1") {
return "3?";
@perillamint
perillamint / node.service
Created February 17, 2017 03:12
systemd unit for node app
[Unit]
Description=Your awesome nodejs app
After=network.target
[Service]
User=awesome_user_account_name_here
Environment=NODE_ENV=production
ExecStart=/opt/awesomenode/launcher_script.sh
Restart=on-failure