Skip to content

Instantly share code, notes, and snippets.

View wwmoraes's full-sized avatar
🎯
Focusing

William Artero wwmoraes

🎯
Focusing
View GitHub Profile
@bassx
bassx / BWAND.applescript
Created March 28, 2012 15:16
AppleScript Handler: bitwise AND operator
(* __int1 : integer
* __int2 : integer
* Integers are from 0 till 2 ^ 31 - 1. When integers become greater than 2 ^ 31 then they will become a real and the handler wont't work.
*)
on BWAND(__int1, __int2)
set theResult to 0
repeat with bitOffset from 30 to 0 by -1
if __int1 div (2 ^ bitOffset) = 1 and __int2 div (2 ^ bitOffset) = 1 then
set theResult to theResult + 2 ^ bitOffset
@Uberi
Uberi / Decompiler.ahk
Last active April 21, 2024 17:54
AHK script decompiler with GUI. Based on IsNull's [decompiler](http://www.autohotkey.com/board/topic/82986-ahk-l-decompiler-payload-method/).
#NoEnv
SetBatchLines, -1
Gui, Font, s16, Arial
Gui, Add, Edit, x10 y10 w450 h30 vPath gUpdate
Gui, Add, Button, x460 y10 w30 h30 gSelectFile, ...
Gui, Font, s12, Courier New
Gui, Add, Edit, x10 y50 w480 h340 vCode ReadOnly -Wrap, <Output>
Gui, Show, w496 h398, AutoHotkey Decompiler
@rxaviers
rxaviers / gist:7360908
Last active June 11, 2024 21:17
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@d11wtq
d11wtq / docker-ssh-forward.bash
Created January 29, 2014 23:32
How to SSH agent forward into a docker container
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash
@dotcypress
dotcypress / wit-telegram-bot.js
Last active February 2, 2022 07:14
How to build Telegram bot with Wit.ai Bot Engine
// npm install telegraf telegraf-wit
var Telegraf = require('telegraf')
var TelegrafWit = require('telegraf-wit')
var app = new Telegraf(process.env.BOT_TOKEN)
var wit = new TelegrafWit(process.env.WIT_TOKEN)
app.use(Telegraf.memorySession())
@andrewlkho
andrewlkho / debian-strongswan.md
Last active January 3, 2024 03:39
Setting up a secure VPN with strongSwan on debian

With heightening concern regarding the state of internet privacy (fuelled in part by the passing of the Investigatory Powers Act in the UK), I have set up a VPN server on the virtual server I have hosted with Mythic Beasts. This uses strongSwan and certificate-based IKEv2 authentication.

Assumptions:

  • Debian Jessie server already set up and accessible via debian.example.com, a public IPv4 of 203.0.113.1 and a public IPv6 of 2001:db8::1
  • Client username of me
  • Clients are running the latest versions of macOS and iOS (Sierra and 10 respectively at the time of writing)
  • No need to support any other operating systems (although the setup is easily translated)

For automated deployment of a similar setup, albeit Ubuntu-based and using ansible for deployment, I recommend you take a look at Algo VPN. I used that project as a basis for my configuration.

@rkitover
rkitover / parallels-tools-4.9.x.patch
Created January 18, 2017 12:22
patch for parallels tools for kernel 4.9.x
diff -ruN orig/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c new/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c
--- orig/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c 2016-11-15 02:37:25.000000000 -0800
+++ new/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c 2017-01-18 02:18:08.000000000 -0800
@@ -383,7 +383,7 @@
}
static int prlfs_rename(struct inode *old_dir, struct dentry *old_de,
- struct inode *new_dir, struct dentry *new_de)
+ struct inode *new_dir, struct dentry *new_de, unsigned int dummy)
{
@ageis
ageis / systemd_service_hardening.md
Last active June 9, 2024 13:57
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 11, 2024 14:01
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@andrewmunro
andrewmunro / .babelrc
Created July 17, 2017 11:30
Sequelize cli with ES6
{
"presets": ["es2015"],
"plugins": [
"add-module-exports"
],
}