Skip to content

Instantly share code, notes, and snippets.

View oprypin's full-sized avatar

Oleh Prypin oprypin

View GitHub Profile
@wlib
wlib / LICENSE
Last active June 10, 2022 22:14
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@ivanistheone
ivanistheone / samizdat-shell-help.bash
Last active December 17, 2020 22:23 — forked from kovetskiy/samizdat-shell-help.bash
help text for bas script based on ### comment + awk command
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@fonic
fonic / nvidia-sensors.sh
Last active June 24, 2023 12:43
KDE KSysGuard NVIDIA GPU Sensors - see comments below for usage information
#!/usr/bin/env bash
# -------------------------------------------------------------------------
# -
# Created by Fonic (https://github.com/fonic) -
# Date: 12/29/19 - 02/12/20 -
# -
# Created for and tested on single-GPU system equipped with NVIDIA -
# GeForce RTX 2060 SUPER. For other systems, modifications might be -
# required. -

Recon and Attack Vectors from My Logs

This document contains excerpts from my web server logs collected over a period of 7 years that shows various kinds of recon and attack vectors.

There were a total of 37.2 million lines of logs out of which 1.1 million unique HTTP requests (Method + URI) were found.

$ sed 's/^.* - - \[.*\] "\(.*\) HTTP\/.*" .*/\1/' access.log &gt; requests.txt
@jwo
jwo / query.graphql
Last active May 31, 2021 20:53
GraphQL example: current user's 100 most current public repos
{
viewer {
repositories(privacy: PUBLIC, first: 3, orderBy: {field: PUSHED_AT, direction: DESC}) {
nodes {
nameWithOwner
url
}
}
}
}
@jhass
jhass / server.cr
Created July 22, 2016 12:05
Simple debug HTTP server in Crystal
require "option_parser"
require "http/server"
require "json"
class Settings
property port = 3000
property host = "127.0.0.1"
property? show_headers = false
property? show_raw_json = false
end
data = [{"Brian", 42}, {"Alan", 30}, {"Brian", 32}]
# unstable
data.sort_by &.[0] # => [{"Brian", 42}, {"Alan", 30}, {"Brian", 32}]
# stable
data.map_with_index { |d,i| {d,i} }.sort_by { |di| {di[0][0], di[1]} }.map { |di| di[0] } # => [{"Alan", 30}, {"Brian", 42}, {"Brian", 32}]
@keplersj
keplersj / logged.rs
Created July 25, 2015 21:00
Gist demonstrating the ability to run Crystal code from Rust.
#[link(name = "logger")]
extern {
fn CrystalLog(text: *const u8);
}
fn log(text: &'static str) {
unsafe{ CrystalLog(text.as_bytes().as_ptr()) };
}
fn main() {
@megawac
megawac / .travis.yml
Created May 5, 2015 19:48
NIM travis.yml file
language: C
compiler:
- gcc
before_install:
# Install nim
- git clone -b master git://github.com/Araq/Nim.git --depth 1
- cd Nim
- git clone -b master --depth 1 git://github.com/nim-lang/csources
- cd csources && sh build.sh
- cd ..
@flaviut
flaviut / libyaml.nim
Last active August 29, 2015 14:14
Nim libyaml wrapper. Here be dragons.
type
yaml_version_directive_t* = object
major*: cint
minor*: cint
type
yaml_tag_directive_t* = object
handle*: cstring
prefix*: cstring
type
yaml_encoding_t* {.size: sizeof(cint).} = enum