Skip to content

Instantly share code, notes, and snippets.

View Jeffallan's full-sized avatar
🏠
Working from home

Jeffallan

🏠
Working from home
View GitHub Profile
@Jeffallan
Jeffallan / .bashrc
Created December 18, 2019 20:19 — forked from rickdaalhuizen90/.bashrc
Parrot Os bash theme for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@Jeffallan
Jeffallan / time_round.py
Created September 28, 2019 19:04
easy time rounding for python
"""
function rounded_time
param: dt a date time object
kwarg: rnd the number of minutes to round to
Since datetime attributes are integers round them like a normal integer
This function will roll over hours i.e 10:59 -> 11:00
This function will roll over days i.e 23:59 01/01 -> 00:00 01/02
"""
from datetime imort datetime, timedelta
@Jeffallan
Jeffallan / ParrotToUbuntu.md
Last active February 10, 2023 01:18
Add parrot repos to ubuntu
  1. Update /etc/apt/sources.list:

deb https://deb.parrotsec.org/parrot parrot main contrib non-free

  1. Then add public key:

wget -qO - https://archive.parrotsec.org/parrot/misc/parrotsec.gpg | apt-key add -

  1. Update apt
@Jeffallan
Jeffallan / sockping.py
Created February 14, 2019 15:36
Solutions to NULLIFY's 2019 CTF Script Challenges
import socket
import time
import sys
HOST = '18.216.82.207'
PORT = 2003
s = socket.create_connection((HOST,PORT))
@Jeffallan
Jeffallan / .gitignore
Created June 27, 2018 00:03
.gitignore For Python Projects
## Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*.pyc
# C extensions
*.so
# Distribution / packaging
@Jeffallan
Jeffallan / age.py
Created March 21, 2018 17:05
Birthday calculator
from datetime import date
class Birthday(object):
def __init__(self, year, month, day):
self.dob = date(year, month, day)
@property
@Jeffallan
Jeffallan / PyPi-resources.txt
Created November 16, 2017 18:16
Resources for adding o PyPi from GitHub
http://sherifsoliman.com/2016/09/30/Python-package-with-GitHub-PyPI/
@Jeffallan
Jeffallan / PythonFlower.py
Last active November 16, 2017 17:32
Give a flower, and the gift of Python, to that special someone in your life.
import turtle
def draw_square(some_turtle):
for i in range(1,5):
some_turtle.forward(100)
some_turtle.right(90)
def draw_art():
window=turtle.Screen()
@Jeffallan
Jeffallan / mautic-styling.css
Created November 16, 2017 15:57
Basic Styling For Mautic Contact Form
.mauticform_wrapper {
max-width: 600px;
margin: 10px auto;
}
.mauticform-innerform {}
.mauticform-post-success {}
.mauticform-name {
@Jeffallan
Jeffallan / pipelines.py
Created January 22, 2017 02:04 — forked from tzermias/pipelines.py
Scrapy MySQL pipeline. Just a mirror to the asynchronous MySQL pipeline. Copy-paste it directly to pipelines.py. Database credentials are stored in settings.py. Based on http://snipplr.com/view/66986/
import MySQLdb.cursors
from twisted.enterprise import adbapi
from scrapy.xlib.pydispatch import dispatcher
from scrapy import signals
from scrapy.utils.project import get_project_settings
from scrapy import log
SETTINGS = get_project_settings()