Skip to content

Instantly share code, notes, and snippets.

@nl5887
nl5887 / transfer.fish
Last active March 22, 2022 09:07
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file

Farewell

A few days ago I tweeted and profile-posted this message:

靜雞雞咁我走啦,好似我靜雞雞咁嚟,fing 一 fing 件衫,唔拎走一舊雲。 嗰棵榆樹下面潭水,唔係泉水而係彩虹,喺藻葉之間搓碎,將彩虹咁既夢整沉左

Yes, I am serious about this message. I am leaving (very soon).

# To use this, you need Python 3.5+ and pip.
#
# 1. Make a new Discord app with a bot. https://discordapp.com/developers/applications/
#
# 2. Set environment variable SIMPLEWORDS_TOKEN on your computer to the bot's Token.
# Unix/Mac: export SIMPLEWORDS_TOKEN=MzABCDefghIJKLmnopQRSTuv.EnZ3kg.b5bdD74CKCr3du679hkemGJ7R7N
# PowerShell: $env:SIMPLEWORDS_TOKEN='MzABCDefghIJKLmnopQRSTuv.EnZ3kg.b5bdD74CKCr3du679hkemGJ7R7N'
#
# 3. Invite the bot to your server: https://stackoverflow.com/a/37743722/257418
#
/*
This exports vtable entry symbols to a file.
Run this in the IDA Script Command window (File->Script Command...)
Each vtable segment in the output file is separated by an empty line.
*/
#include <idc.idc>
static getPointerAddress(loc)

You want to override the tell command, that has also the w and msg aliases by default. The class that will override these commands is MyTellCommand (extends PluginCommand).

To do this, you've to set the original command in a state that allows it to be overriden. Also, aliases will be registered directly, but since all the work was done for the first registration, it's pretty simple.

//We are in the context of a plugin
anonymous
anonymous / words
Created October 10, 2017 15:44
[a, auto] [p, play] [toggle]* 0 parameter(s)
[admin]* [cmds, commands] [reload] 0 parameter(s)
[admin]* [eval] 1 parameter(s)
[admin]* [gc] 0 parameter(s)
[admin]* [get, find] [servers, guilds] [mutual]* 1 parameter(s)
[admin]* [history] [get]* 2 parameter(s)
[admin]* [throw error, throwerror] 0 parameter(s)
[admin]* [usage] 0 parameter(s)
[b, previous, prev, back] [track]* 0 parameter(s)
[bot]* [set] [name] 1 parameter(s)
@SOF3
SOF3 / README.md
Last active August 26, 2017 16:23

This is a simple CLI tool for managing phar files easily.

This tool is intended for Windows users using Linux-like shells.

Required executables/commands in the %PATH%:

  • mintty for starting a window that hosts the vim editor
  • vi for editing a temp file from phar v

If php is in the %PATH%, you may put this file in a directory in the %PATH% with or without a file extension, then execute this directly from the shell. For example, I save this as phar in one of the directories in my path variable, so I just execute phar l path/to/file.phar directly on Git Bash.

I received the following comment from a web developer after I told him I wouldn't make his volatile files directory chmod 777 so Apache could write to it.
"777 tends to scare sys admins, so I understand."
Here's my response:
"Yes, it scares us and it should scare you.
"Think of your account like an apartment. If you set your permissions to 777, anyone who can get into the building (onto the server) can make changes: raid your fridge, steal your cat, replace your pillows, or plant evidence pointing to a crime you didn't commit. Even if they did none of those things, you can get skeeved out by the possiblility.
@falkirks
falkirks / .htaccess
Last active May 5, 2016 11:59
PocketMine-Banners router
RewriteEngine on
RewriteCond %{REQUEST_URI} !=/index.php
RewriteRule !^assets($|/) index.php [L,QSA]
from twisted.words.protocols import irc
from twisted.internet import reactor, protocol, defer
from twisted.python import log
class BetBot(irc.IRCClient):
nickname = "INSERT YOUR TWITCH USERNAME"
password = "oauth: GENERATE YOUR OAUTH TWITCH TOKEN SOMEWHERE"
def connectionMade(self):