Skip to content

Instantly share code, notes, and snippets.

View fgsoap's full-sized avatar
🏠
Working from home

Scott fgsoap

🏠
Working from home
  • Suzhou, Jiangsu, China
View GitHub Profile
@fgsoap
fgsoap / gist:2089ddb45e132ff39dafac03c49cdb4c
Created November 28, 2023 12:22 — forked from levelsio/gist:5bc87fd1b1ffbf4a705047bebd9b4790
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
# 2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same!
Send me your ChatGPT text adventure game on X, I'd love to try it!
@fgsoap
fgsoap / ss-docker-apply.sh
Created November 27, 2021 11:41 — forked from jizusun/ss-docker-apply.sh
Shadowsocks On Docker/Kubernetes
export password=foobar
export method=chacha20-ietf-poly1305
export port=9301
docker run -e PASSWORD=${password} -e METHOD=${method} -p${port}:8388 -p${port}:8388/udp -d shadowsocks/shadowsocks-libev
export host=$(curl -s ipinfo.io/json | grep \"ip\" | awk -F'"' '{ print $4 }')
echo $host:$port
@fgsoap
fgsoap / facebook.js
Created November 5, 2020 16:33 — forked from speeddragon/facebook.js
Facebook Image Crawler for Puppeteer
/**
* Facebook Image Crawler
*/
const puppeteer = require("puppeteer");
var https = require("https");
/**
* Get the biggest image possivel from FBID.
* @param {string} fbid
@fgsoap
fgsoap / postgres-brew.md
Created November 23, 2019 03:06 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@fgsoap
fgsoap / subtitle_downloader.py
Created November 17, 2016 08:54 — forked from ihciah/subtitle_downloader.py
Xunlei subtitle downloader
#!/usr/bin/python
# -*- coding: utf-8 -*-
# __author__ = 'ihciah'
# cid_hash_file function from https://github.com/binux/lixian.xunlei/blob/master/libs/tools.py
import hashlib
import inotify.adapters
import os
import requests
import re
@fgsoap
fgsoap / cal_abs.py
Last active October 1, 2016 16:34
Calculate the absences of different staffs from a excel sheet exported from Peoplesoft
# coding: utf-8
# This programme is used to make a monthly and yearly report of all the staff absences.
# What you need to do is to input the roles and the date by instuctions.
# By Scott @2016-9-18
#######################################################################################
#Empl ID Name Department Leave Begin Date End Date Hours #
@fgsoap
fgsoap / p0f_iptables.py
Created May 22, 2014 05:42
use p0f to detect the OS of the client from server and change the iptables
import subprocess, time
from p0f import P0f
def get_os(ip):
data = None
p0f = P0f("/tmp/smb.sock") # point this to socket defined with "-s" argument.
try:
data = p0f.get_info(ip)
except:
return None
@fgsoap
fgsoap / auto_reply_mail.py
Last active November 5, 2024 14:09
Auto Reply Emails By Python
#-*- coding:UTF-8 -*-
__author__ = nodejx
import imaplib, email, smtplib, time
server = "mail.test.com"
fadd = "admin@test.com"
mbody = ["""This is an example!"""]
while True:
@fgsoap
fgsoap / vms_snapshots.py
Last active August 29, 2015 14:01
Use pysphere to manage snapshots in VMware ESXi
#!/usr/bin/env python
__author__ = nodejx
from pysphere import *
vms_snapshots_names = []
vms_names = []
host = ''
user = ''
password = ''
#!/usr/bin/env python
# List, create, delete vmware vsphere snapshots with unix-like user interface.
# This assumes that the vm name are equal to the hostname or the fqdn
# Requirements: pysphere >= 0.1.6 If Python < 2.7: argparse
#
# Peter Froehlich (tarwin@tarwin.de) @ 03/2013
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by