Skip to content

Instantly share code, notes, and snippets.

View IceCruelStuff's full-sized avatar

IceCruelStuff

View GitHub Profile
@IceCruelStuff
IceCruelStuff / lockfile.py
Created May 11, 2021 01:31 — forked from ionrock/lockfile.py
A file locking example
"""
A file lock implementation that tries to avoid platform specific
issues. It is inspired by a whole bunch of different implementations
listed below.
- https://bitbucket.org/jaraco/yg.lockfile/src/6c448dcbf6e5/yg/lockfile/__init__.py
- http://svn.zope.org/zc.lockfile/trunk/src/zc/lockfile/__init__.py?rev=121133&view=markup
- http://stackoverflow.com/questions/489861/locking-a-file-in-python
- http://www.evanfosmark.com/2009/01/cross-platform-file-locking-support-in-python/
- http://packages.python.org/lockfile/lockfile.html
/*
0. Go to http://gabrielecirulli.github.io/2048/
1. Copy & Paste below 3 lines to the console.
2. Every time a move is done, a prompt will be opened.
3. Input two integers (separated by a slash), where
the first integer indicates the place where the tile will appear,
and the second integer indicates the type of the tile (2 or 4 only).
The place will be indicated by the index in the list of empty tiles (after the move),
where the first one is leftmost+upmost and the next one is below of the first one.
(For example, if every tiles are empty, then the tiles will have index 0 4 8 12 / 1 5 9 13 / 2 6 10 14 / 3 7 11 15.)
@IceCruelStuff
IceCruelStuff / lsof_funcs.py
Created March 29, 2021 06:02 — forked from lebedov/lsof_funcs.py
Python functions for finding open files and PIDs that have opened a file.
#!/usr/bin/env python
"""
Python functions for finding open files and PIDs that have opened a file.
"""
import numbers
import subprocess
try:
@IceCruelStuff
IceCruelStuff / fixperms.bat
Created March 26, 2021 04:15 — forked from SathyaBhat/fixperms.bat
fix permissions for "You need permissions from .. to perform this action" in Windows 7
takeown /r /d y /f *
icacls * /reset /t /c /q
@IceCruelStuff
IceCruelStuff / youtube-search.py
Created March 20, 2021 22:54 — forked from stvar/youtube-search.py
Find YouTube channel IDs by custom URLs or user names
#!/usr/bin/python3
# Copyright (C) 2020 Stefan Vargyas
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@IceCruelStuff
IceCruelStuff / ExtendedMessage.js
Created March 20, 2021 04:58 — forked from Allvaa/ExtendedMessage.js
Discord.js v12 Inline Replies (use discord.js's Message#reply instead because the PR has been merged)
const { APIMessage, Structures } = require("discord.js");
class Message extends Structures.get("Message") {
async inlineReply(content, options) {
const mentionRepliedUser = typeof ((options || content || {}).allowedMentions || {}).repliedUser === "undefined" ? true : ((options || content).allowedMentions).repliedUser;
delete ((options || content || {}).allowedMentions || {}).repliedUser;
const apiMessage = content instanceof APIMessage ? content.resolveData() : APIMessage.create(this.channel, content, options).resolveData();
Object.assign(apiMessage.data, { message_reference: { message_id: this.id } });
@IceCruelStuff
IceCruelStuff / HotbarShortcuts.ahk
Created March 19, 2021 21:08 — forked from TwistedAsylumMC/HotbarShortcuts.ahk
This script allows Windows 10 users to use the 1-9 keys in their inventories to act as shortcuts to easily move items in and out of their hotbar slots.
; Hotbar Shortcuts for Minecraft Bedrock Edition by TwistedAsylumMC
; This script allows Windows 10 users to use the 1-9 keys in their inventories
; to act as shortcuts to easily move items in and out of their hotbar slots.
; How to use this script:
; 1. Download AutoHotKey (If you haven't already) from https://www.autohotkey.com/download/
; 2. Save this file to your device and double click it to start the script
; 3. Load up your Minecraft client and go inside of a world
; 4. Inside your inventory, you can use the 1-9 keys to swap items around
@IceCruelStuff
IceCruelStuff / sock-client.py
Created March 14, 2021 03:52 — forked from skyrocknroll/sock-client.py
python socket server
__author__ = 'uva'
import socket
sock = socket.socket()
data = raw_input()
try:
sock.connect(('localhost', 9999), )
sock.sendall(data + '\n')
received = sock.recv(1024)
except Exception as e:
@IceCruelStuff
IceCruelStuff / Python PDF Password
Created February 27, 2021 20:13 — forked from mrpollo/Python PDF Password
Python PDF Password cracker
#!/usr/local/bin/python
from pyPdf import PdfFileWriter, PdfFileReader
import random
from pprint import pprint as pp
import sys
# sys.setrecursionlimit(10000000)
seed = 'BN9F'
pile = [1]
def getNumber():
@IceCruelStuff
IceCruelStuff / McpeProxy_README.md
Created January 29, 2021 03:00 — forked from svilex/McpeProxy_README.md
Useful informations about McpeProxy