Skip to content

Instantly share code, notes, and snippets.

View kiproping's full-sized avatar

AfricanEsque kiproping

  • Kenya
View GitHub Profile
@kiproping
kiproping / update.md
Last active July 31, 2018 17:02
Updates to tabbs-secrets doc
  • cut shoud be -c
  • Add python certbot
  • editing /etc/sudoers is by visudo
  • dd if=/dev/urandom bs=1k count=1024 | base64 | cut -c1-40 | head -n 1
#List all users
SELECT User FROM mysql.user;
# Create new user
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
# Graniting priviledges (databs.table)
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
#!/bin/python
import csv
firstline = True
def savetofile(file, content):
with open(file, 'w') as file:
file.write(content)
def checkfirst():
@kiproping
kiproping / FB.txt
Created October 4, 2017 12:34
FB user info returned
object(Laravel\Socialite\Two\User)#459 (8) {
["token" ]=> string(209) "{token}"
["id"] => string(17) "{socialID}"
["nickname"] => NULL
["name"] => string(14) "{Full Name}"
["email"] => string(19) "{Email address}"
["avatar"] => string(69) "https://graph.facebook.com/v2.4/{socialID}/picture?type=normal"
["user"] => array(6) {
["first_name"] => string(6) "{First name}"
["last_name"] => string(7) "{Last mame}"
@kiproping
kiproping / BasicEnum.php
Created July 21, 2017 14:17
Enumerator
<?php
/**
* SageOne Library
*
* @category Library
* @package SageOne
* @author Brian Cline https://stackoverflow.com/a/254543/536434 / Brian Maiyo kiproping@github.com
* @license MIT <https://github.com/darrynten/sage-one-php/blob/master/LICENSE>
* @link https://github.com/darrynten/sage-one-php
*/
@kiproping
kiproping / dbconnect.py
Created June 22, 2017 10:27
Update to dl.py with db connect and status updates
#!/usr/bin/python
#Returns mysql cursor
import MySQLdb
class DBconnect():
def __init__(self, name="cc", host="localhost", user="cc", passwd="cc"):
self.name = name
self.host = host
@kiproping
kiproping / dl.py
Last active June 21, 2017 20:04
Downloading content from a list of files, handles 404 and 500 errors in CalledProcessorError
from subprocess import *
import time
from random import randint
path = "songs.lst"
sleepaftersong = 10 #seconds sleep after each song
sleepaftermax = 600 #seconds sleep after max consecutive songs
maxdownload = 40 #Downloads before long wait
def main():