Skip to content

Instantly share code, notes, and snippets.

View SavSanta's full-sized avatar
😉
No Use Being Food in Mouth of The Beast

Ru Uba SavSanta

😉
No Use Being Food in Mouth of The Beast
  • DCMDVA ;'(
  • 05:27 (UTC -04:00)
View GitHub Profile
@addyosmani
addyosmani / headless.md
Last active May 17, 2024 03:38
So, you want to run Chrome headless.

Update May 2017

Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.

#!/usr/bin/env python
"""Demo: use a socket as subprocesses stdin/stdout.
http://stackoverflow.com/a/19961290
"""
import socket
from contextlib import closing
from subprocess import Popen, PIPE
host = "stackoverflow.com"
@trendels
trendels / rsync_daemon_over_ssh.md
Last active November 13, 2023 03:26
Rsync daemon mode over ssh

rsync daemon mode over ssh

There are several common ways to do rsync backups of hosts over ssh:

  1. As a non-root user. Upsides: very secure. Downside: cannot back up sensitive files.
  2. As root, with a public key. Downsides: Whoever has the private key has full root access to the host being backed up.
  3. As root, with a public key and a "forced command". Upsides: Restricts access to the server. Downsides: Requires either careful matching of rsync options (which might change over time), or "validator" scripts. Neither idea sounds very appealing to me.
  4. Running rsync in daemon mode on the host being backed up. Upsides: Lots of useful options, like read-only mode, running as a different user if required, server-side excludes/includes, etc. Downsides: Opens up a TCP port that has full filesystem read access and is hard to secure (Ideally you could make the rsync daemon use a unix socket instead, that could be secured by filesystem permissions, but I haven't found a way to do that).

Here is another option t

0</*! ::
@echo off
echo:Hello, batch!
cscript //nologo //e:jscript "%~f0" %*
echo:Hello, batch again!
goto :EOF
@HarmJ0y
HarmJ0y / keepass2john.py
Created June 30, 2016 06:02
Python port of John the Ripper's keepass2john - extracts a HashCat/john crackable hash from KeePass 1.x/2.X databases
#!/usr/bin/python
# Python port of keepass2john from the John the Ripper suite (http://www.openwall.com/john/)
# ./keepass2john.c was written by Dhiru Kholia <dhiru.kholia at gmail.com> in March of 2012
# ./keepass2john.c was released under the GNU General Public License
# source keepass2john.c source code from: http://fossies.org/linux/john/src/keepass2john.c
#
# Python port by @harmj0y, GNU General Public License
#
@mattifestation
mattifestation / CIPolicyParser.ps1
Last active July 20, 2024 18:08
Functions to recover information from binary Windows Defender Application Control (WDAC) Code Integrity policies.
# Ensure System.Security assembly is loaded.
Add-Type -AssemblyName System.Security
function ConvertTo-CIPolicy {
<#
.SYNOPSIS
Converts a binary file that contains a Code Integrity policy into XML format.
Author: Matthew Graeber (@mattifestation)
@Framartin
Framartin / esprima_node_generator.py
Last active June 10, 2022 13:52
Generator to browse all the nodes of an Esprima Tree
def node_generator(node):
"""
Generator that takes an Esprima object (or a Esprima node) from the esprima
module converted as a dict, and outputs all child nodes at any level of the
tree. It's useful to browse the entire tree.
Subnodes are generated by browsing all the keys. It's not the most
optimized way to browse the tree, because some keys will never contains
child nodes. But it's very simple, and you're sure to not miss any subnodes.
"""
if node: # not empty dict or list
@curi0usJack
curi0usJack / .htaccess
Last active July 9, 2024 18:38
FYI THIS IS NO LONGER AN .HTACCESS FILE. SEE COMMENTS BELOW. DON'T WORRY, IT'S STILL EASY.
#
# TO-DO: set |DESTINATIONURL| below to be whatever you want e.g. www.google.com. Do not include "http(s)://" as a prefix. All matching requests will be sent to that url. Thanks @Meatballs__!
#
# Note this version requires Apache 2.4+
#
# Save this file into something like /etc/apache2/redirect.rules.
# Then in your site's apache conf file (in /etc/apache2/sites-avaiable/), put this statement somewhere near the bottom
#
# Include /etc/apache2/redirect.rules
#
@dmitriiweb
dmitriiweb / bs_vs_lxml.py
Last active March 13, 2024 02:22
BeautifulSoup vs lxml
from datetime import datetime
from datetime import datetime
import requests
from bs4 import BeautifulSoup as BSoup
from lxml import html
def get_html():
url = 'https://en.wikipedia.org/wiki/List_of_states_and_territories_of_the_United_States'
@ceramicskate0
ceramicskate0 / rsrcDecryptAssembly.nim
Created January 7, 2022 03:36 — forked from ChoiSG/rsrcDecryptAssembly.nim
embed .net, decrypt, load and execute in nim poc
import nimcrypto
import winim/clr except `[]` # https://s3cur3th1ssh1t.github.io/Playing-with-OffensiveNim/ <-- thank you so much, 2 hours googling I almost went crazy
#[
All credit goes to @byt3bl33d3r (OffensiveNim) and @s3cur3th1ssh1t
nimble install winim nimcrypto zippy
nim c -d:danger -d:strip --opt:size rsrcDecryptAssembly.nim
slurp = "staticRead" will read the file and store it in the variable (.rdata) on compile time.