Skip to content

Instantly share code, notes, and snippets.

View X4's full-sized avatar
:shipit:
❯ Building Some Capital

X4 X4

:shipit:
❯ Building Some Capital
  • (𝙰𝙸, 𝙲𝙼𝙿𝚁𝚂𝚂𝙽, 𝙲𝚛𝚢𝚙𝚝𝚘)
  • Dubai, UAW
  • 11:27 (UTC +04:00)
  • X @X4AES
  • X @SomeCapitalX
View GitHub Profile
@X4
X4 / entropy_sabayonlinux.org.txt
Last active August 29, 2015 13:57
equo repo mirrorsort sabayonlinux.org
# Repository configuration file automatically generated
# by Entropy on your behalf.
[sabayonlinux.org]
enabled = true
desc = Sabayon Linux Official Repository
repo = http://pkg.sabayon.org#bz2
repo = http://pkg.repo.sabayon.org#bz2
# Main sabayonlinux.org Repository
@X4
X4 / autorotate.sh
Created July 14, 2014 20:52
Autorotate Touchscreen
#!/bin/bash
ERASER=$(xinput --list | grep 'eraser' | grep -o [0-9][0-9])
STYLUS=$(($ERASER+1))
TOUCH=$(xinput --list | grep 'Wacom' | grep -o [0-9][0-9] | grep -v $ERASER | grep -v $STYLUS)
#xsetwacom set $STYLUS TopX -100
#xsetwacom set $STYLUS TopY 12
#xsetwacom set $STYLUS BottomX 26170
@X4
X4 / hidlib_enqueue_overflow.c
Last active July 14, 2016 20:04
hidlib_enqueue_overflow.c (OS X IOKit kernel code execution due to integer overflow in IODataQueue::enqueue)
/* The class IODataQueue is used in various places in the kernel. There are a couple of exploitable integer overflow issues in the ::enqueue method: */
Boolean IODataQueue::enqueue(void * data, UInt32 dataSize)
{
const UInt32 head = dataQueue->head; // volatile
const UInt32 tail = dataQueue->tail;
const UInt32 entrySize = dataSize + DATA_QUEUE_ENTRY_HEADER_SIZE; <-- (a)
IODataQueueEntry * entry;
if ( tail >= head )
@X4
X4 / nodejs-pi-setup.sh
Created March 23, 2015 20:22
Setup NodeJS on Raspberry Pi 2 in < 5 Minutes
Prerequisites:
==============
1. Raspbian
2. Raspberry Pi (2)
sudo apt-get update
sudo apt-get upgrade
cd
## Source: http://node-arm.herokuapp.com/
@X4
X4 / kMer.hs
Last active August 29, 2015 14:23
k-mer algorithm
{-# LANGUAGE UnicodeSyntax #-}
{-
Reads: AGATCGAGTG
Prints: sorted 3-mers: AGA AGT ATC CGA GAG GAT GTG TCG
unsorted 3-mers: AGA GAT ATC TCG CGA GAG AGT GTG
-}
import Data.Function
import Data.List
@X4
X4 / try_catch.c
Last active December 4, 2015 12:44
/* C-Standard-Libraries */
#ifndef LIBRARIES
#define LIBRARIES
#include <stdio.h> /* stdio.h — standard buffered input/output */
#include <stdlib.h> /* stdlib.h — standard library definitions */
#include <string.h> /* string.h — string operations */
#include <stdarg.h> /* stdarg.h — handle variable argument list */
#include <stdbool.h> /* stdbool.h — boolean type and values */
#include <stddef.h> /* stddef.h — standard type definitions */
# Performs a beam search, to be run in the "Decoder"
def Beamsearch(self,
predict_fun, # RNN() with: new_states as a list, outputs of shape (batch_size, n_symbols)
states0, # RNN()'s initial layer states are equal to states0
batch_size, # Size derived from initial layer states0
start_symbol # Tagging the encoded target sequence with <S> as a start symbol for example
stop_symbol # ' ' </S> as a stop symbol for example
max_length, # Maximum length of a given sequence
beam_size=4 # See [simple beam search](https://github.com/SeitaroShinagawa/simple_beamsearch) for an example of probabilities
):
@X4
X4 / sklearn-pipeline.py
Last active October 30, 2017 00:28
Building a SciKit-Learn Pipeline
# Make ML-Pipeline Runs Reproducible
random_state=7
# Testing our Pipeline with an ML-Ready Dataset
from sklearn.datasets import load_iris
iris = load_iris()
# Assign ML-Input and Ml-Target
Xi = iris.data # Input
yi = iris.target # Output
@X4
X4 / check_ssl.py
Created August 8, 2021 23:22 — forked from fffonion/check_ssl.py
hosts - A mix of working google, twitter, wikipedia ips and no-ads
from socket import socket, error, setdefaulttimeout
import ssl
import re
import time
import sys
import os
from hashlib import md5
import json
os.chdir(os.path.split(sys.argv[0])[0])