Skip to content

Instantly share code, notes, and snippets.

// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@Averroes
Averroes / example.py
Created April 10, 2015 18:30
parsing simple xml data
from urllib.request import urlopen
from xml.etree.ElementTree import parse
# Download the RSS feed and parse it
u = urlopen('http://planet.python.org/rss20.xml')
doc = parse(u)
# Extract and output tags of interest
for item in doc.iterfind('channel/item'):
title = item.findtext('title')
@Averroes
Averroes / binascii-example-1.py
Created April 11, 2015 18:41
binascii example 1
import binascii
text = "hello, mrs teal"
data = binascii.b2a_base64(text)
text = binascii.a2b_base64(data)
print text, "<=>", repr(data)
data = binascii.b2a_uu(text)
text = binascii.a2b_uu(data)
@Averroes
Averroes / disable_windows_defender.bat
Last active December 25, 2023 10:48 — forked from pe3zx/disable_windows_defender.bat
Disable Windows Defender on Windows 10 1903
rem USE AT OWN RISK AS IS WITHOUT WARRANTY OF ANY KIND !!!!!
rem https://technet.microsoft.com/en-us/itpro/powershell/windows/defender/set-mppreference
rem To also disable Windows Defender Security Center include this
rem reg add "HKLM\System\CurrentControlSet\Services\SecurityHealthService" /v "Start" /t REG_DWORD /d "4" /f
rem 1 - Disable Real-time protection
reg delete "HKLM\Software\Policies\Microsoft\Windows Defender" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender" /v "DisableAntiSpyware" /t REG_DWORD /d "1" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender" /v "DisableAntiVirus" /t REG_DWORD /d "1" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\MpEngine" /v "MpEnablePus" /t REG_DWORD /d "0" /f
reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection" /v "DisableBehaviorMonitoring" /t REG_DWORD /d "1" /f
@Averroes
Averroes / Brave_Search_Gogggles.goggle
Last active June 7, 2023 17:24
Brave Search Gogggles
! name: Brave Averroes
! description: Boost My Gist.
! public: false
! author: Averroes
$boost=1,site=github.com
$boost=1,site=hackerone.com
$boost=1,site=bugreader.com
$boost=1,site=portswigger.net
$boost=1,site=vk9-sec.com
@Averroes
Averroes / argparse_subparsers.py
Created April 11, 2015 11:45
argparse subparsers
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""
"""
#end_pymotw_header
import argparse
@Averroes
Averroes / ElementTree_pretty.py
Created April 11, 2015 15:17
ElementTree pretty
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""Pretty-print function for ElementTree
"""
#end_pymotw_header
from xml.etree import ElementTree
@Averroes
Averroes / random_random.py
Created April 11, 2015 13:54
random random
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""Generate random numbers
"""
#end_pymotw_header
import random
@Averroes
Averroes / shlex_split.py
Created April 11, 2015 14:11
shlex split
#!/usr/bin/env python
#
# Copyright 2007 Doug Hellmann.
#
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
@Averroes
Averroes / youtube.list
Created September 8, 2022 04:21
YT list
o-o.preferred.ams03t04.v7.cache3.googlevideo.com
r10.sn-25ge7n76.googlevideo.com
r10---sn-25ge7n76.googlevideo.com
r10.sn-25ge7n7d.googlevideo.com
r10---sn-25ge7n7d.googlevideo.com
r10.sn-25ge7n7e.googlevideo.com
r10---sn-25ge7n7e.googlevideo.com
r10.sn-25ge7n7k.googlevideo.com
r10---sn-25ge7n7k.googlevideo.com
r10.sn-25ge7n7l.googlevideo.com