Skip to content

Instantly share code, notes, and snippets.


Bruno Oliveira da Silva abstractj

View GitHub Profile
coolaj86 /
Last active Jun 19, 2022
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm config set "Your Name"
npm config set ""
npm config set "https:/"

npm config set init.version "1.0.0"
subudeepak /
Last active Jun 4, 2022
The problems and some security implications of websockets - Cross-site WebSockets Scripting (XSWS)

WebSockets - An Introduction

WebSockets is a modern HTML5 standard which makes communication between client and server a lot more simpler than ever. We are all familiar with the technology of sockets. Sockets have been fundamental to network communication for a long time but usually the communication over the browser has been restricted. The general restrictions

  • The server used to have a permanent listener while the client (aka browser) was not designated any fixed listener for a more long term connection. Hence, every communication was restricted to the client demanding and the server responding.
  • This meant that unless the client requested for a particular resource, the server was unable to push such a resource to the client.
  • This was detrimental since the client is then forced to check with the server at regular intervals. This meant a lot of libraries focused on optimizing asynchronous calls and identifying the response of asynchronous calls. Notably t
granella /
Created Jun 27, 2016
Create self-signed certificate with root and ca for development
rm *.jks 2> /dev/null
rm *.pem 2> /dev/null
echo "===================================================="
echo "Creating fake third-party chain root -> ca"
echo "===================================================="
# generate private keys (for root and ca)
View Dealing with

Dealing with issues

Try to reproduce issues

Go through the new issues and try to reproduce them. It’s important to get additional info, logs, and test if an issue occurs on different platforms. That helps us identify the source of the problem.

Triage issues

  • if there’s more info needed, ask the reporter to use the issue template
  • assign relevant labels
letmaik / .travis.yml
Last active Dec 15, 2021
Deploy snapshots to Sonatype after Travis CI build
View .travis.yml
language: java
- SONATYPE_USERNAME=yourusername
- secure: "your encrypted SONATYPE_PASSWORD=pass"
- python
- mvn clean deploy --settings ~/.m2/mySettings.xml
fernandoaleman / gist:5083680
Last active Oct 1, 2021
How to update VirtualBox Guest Additions with vagrant
View gist:5083680
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
mweisel /
Last active Aug 25, 2021
A basic script to create bridge network interfaces for VMware Fusion and GNS3 integration for Mac OS X.
#!/usr/bin/env bash
# AUTHOR: Marc Weisel
# DATE: 03/04/2014
# NOTES: Tested with Mac OS X 10.9 (Mavericks); Bash v3.2.51(1)-release
## Is the TAP network interface available?
tap_exist() {
TomTasche / AndroidManifest.xml
Last active Aug 17, 2021
OAuth flow using the AccountManager on Android
View AndroidManifest.xml
<!-- ... -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<!-- ... -->
goldmann / .zshrc
Last active Jun 24, 2019
Docker aliases / helper function
View .zshrc
alias dip="docker inspect -f '{{ .NetworkSettings.IPAddress }}'"
dssh() {
PID=$(docker inspect --format {{.State.Pid}} $1)
sudo /usr/bin/nsenter --target $PID --mount --uts --ipc --net --pid env -i - $(sudo cat /proc/$PID/environ | xargs -0) bash
drmiall() {
docker rmi `docker images -q -f dangling=true`
emboss / pbkdf2.rb
Created Oct 20, 2011
Using PBKDF2 with HMAC-SHA256 for storing passwords
View pbkdf2.rb
p ="password"
#according to PKCS#5, should be at least 8 bytes. Public information, can be stored along with the pwd.
s = OpenSSL::Random.random_bytes(16)
c = 20000 # varies depending on how fast the system is, tweak until it takes "long enough"
digest =
#should be >= the output size of the underlying hash function, but ">" doesn't improve security (says PKCS#5)
dk_len = digest.digest_length
#store the result for new passwords
value = OpenSSL::PKCS5.pbkdf2_hmac(p, s, c, dk_len, digest)