Skip to content

Instantly share code, notes, and snippets.

View hbasria's full-sized avatar

Basri hbasria

  • base9.tech
  • ///soak.massing.glory
View GitHub Profile
import hashlib as hasher
import datetime as date
# Define what a Snakecoin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash
@hbasria
hbasria / 0_reuse_code.js
Created January 17, 2017 07:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hbasria
hbasria / rename_git_branch.txt
Created October 21, 2016 08:05
rename git branch
1. switch to branch which needs to be renamed
2. git branch -m <new_name>
3. git push origin :<old_name>
4. git push origin <new_name>:refs/heads/<new_name>
0 = Success
1 = Operation not permitted
2 = No such file or directory
3 = No such process
4 = Interrupted system call
5 = Input/output error
6 = No such device or address
7 = Argument list too long
8 = Exec format error
# coding=utf-8
"""
LICENSE http://www.apache.org/licenses/LICENSE-2.0
"""
import datetime
import sys
import time
import threading
import traceback
import SocketServer
@hbasria
hbasria / keybase.md
Last active September 13, 2019 13:45

Keybase proof

I hereby claim:

  • I am hbasria on github.
  • I am hbasria (https://keybase.io/hbasria) on keybase.
  • I have a public key ASAzGNiQsLhlHqgmTff9X8Z1GvuBnZ1XXCNMZ-WtO0eOYgo

To claim this, I am signing this object:

@hbasria
hbasria / scanner.py
Created April 8, 2016 16:18 — forked from sh1nu11bi/scanner.py
Raw Sockets and sniffing
import socket
import os
import struct
import threading
from netaddr import IPNetwork,IPAddress
from ctypes import *
# host to listen on
host = "192.168.0.187"
import socket, struct, os, array
from scapy.all import ETH_P_ALL
from scapy.all import select
from scapy.all import MTU
#author: askldjd
#see: http://wp.me/pDfjR-rQ
class IPSniff:
def __init__(self, interface_name, on_ip_incoming, on_ip_outgoing):
@hbasria
hbasria / ping.py
Created April 5, 2016 17:52 — forked from pklaus/ping.py
A pure python ping implementation using raw socket.
#!/usr/bin/env python2
"""
Other Repositories of python-ping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* https://github.com/l4m3rx/python-ping supports Python2 and Python3
* https://bitbucket.org/delroth/python-ping
SELECT
pgClass.relname AS tableName,
pgClass.reltuples AS rowCount
FROM
pg_class pgClass
LEFT JOIN
pg_namespace pgNamespace ON (pgNamespace.oid = pgClass.relnamespace)
WHERE
pgNamespace.nspname NOT IN ('pg_catalog', 'information_schema') AND
pgClass.relkind='r'