Skip to content

Instantly share code, notes, and snippets.

View V4nish's full-sized avatar

Lyndon V4nish

View GitHub Profile
@V4nish
V4nish / coinFlip.py
Created December 1, 2023 15:44
Flip a coin, count the number of concurrent results....
import random
def flip_coin():
return random.choice(["Heads", "Tails"])
def record_occurrences(flips):
occurrences = {}
current_result = flips[0]
import os
import requests
from bs4 import BeautifulSoup
from contextlib import closing
import csv
vog_url = "https://www.valeofglamorgan.gov.uk/en/our_council/Council-Finance.aspx"
vog_hostname = "https://www.valeofglamorgan.gov.uk"
def get_csv_urls():
#Import the ad module
import-module activedirectory
#define the new password
$newpwd = ConvertTo-SecureString -String "P@ssword123!" -AsPlainText –Force
#get the users in ad. we can filter by OU
$users = get-aduser -filter * -searchbase "OU=test,OU=testnb users,DC=testnb,DC=local" | select Surname
#Logic to reset password
@V4nish
V4nish / findHiddenTrafficInIcmp.py
Created October 3, 2018 09:34
Script to extract traffic (from a WireShark capture) where it is suspected that an ICMP tunnel is being used to hide/bypass firewall/filters
from scapy.all import *
packets = rdpcap("suspectCap.cap")
def write(pkt):
wrpcap('icmpOutput.pcap', pkt, append=True)
for packet in packets:
if (packet.haslayer(ICMP)):
a=packet.getlayer(IP).load
@V4nish
V4nish / keybase.md
Created May 12, 2017 13:55
keybase.md

Keybase proof

I hereby claim:

  • I am lyndonwatkins on github.
  • I am lyndonwatkins (https://keybase.io/lyndonwatkins) on keybase.
  • I have a public key whose fingerprint is 45B2 2887 D6DB 86A0 8F28 CC3C 5B7B C2B5 CD16 7169

To claim this, I am signing this object:

@V4nish
V4nish / Microbit - Dice
Last active May 12, 2017 13:37
A simple program to create a dice using a BBC micro:bit. Shake the micro:bit and a random dice face should be shown! (For year 7 pupils)
from microbit import *
import random
numbers = [
"00000:00000:00900:00000:00000",
"00000:00900:00000:00900:00000",
"90000:00000:00900:00000:00009",
"00000:09090:00000:09090:00000",
"00000:09090:00900:09090:00000",
"90009:00000:90009:00000:90009",
@V4nish
V4nish / web.php
Created December 13, 2016 17:00
UK Regions - Laravel formatted DB insert
// TESTING ROUTES BELOW
Route::get('/pop', function()
{
DB::table('regions')->insert([
['regionName' => 'England'],
['regionName' => 'Ireland'],
['regionName' => 'Northern Ireland'],
['regionName' => 'Scotland'],
@V4nish
V4nish / .htaccess - return 503 maintenance mode
Last active August 26, 2016 21:12
Quick htaccess method of closing an entire site, returning one page and a 503 HTTP code
ErrorDocument 503 /index.html
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /index.html [R=503,L]