Skip to content

Instantly share code, notes, and snippets.

View Mart-Bogdan's full-sized avatar
🤘
|m/

Bohdan Mart Mart-Bogdan

🤘
|m/
View GitHub Profile
javascript: (function () {
function c() {
var e = document.createElement("link");
e.setAttribute("type", "text/css");
e.setAttribute("rel", "stylesheet");
e.setAttribute("href", f);
e.setAttribute("class", l);
document.body.appendChild(e)
}
function h() {
@spacejam
spacejam / rr-with-rust.md
Last active March 13, 2024 18:51
using rr with rust

using rust with rr

rr is a great debugging tool. it records a trace of a program's execution, as well as the results of any syscalls it executes, so that you can "rewind" while you debug, and get deterministic forward and reverse instrumented playback. it works with rust, but by default if you try it out, it could be pretty ugly when you inspect variables. if this bothers you, configure gdb to use a rust pretty-printer

rr is probably in your system's package manager.

usage

@tzmartin
tzmartin / m3u8-to-mp4.md
Last active April 26, 2024 01:50
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@avitsidis
avitsidis / script
Created February 10, 2017 15:24
SSH into mobylinux (docker for windows)
#based on po75558Manuel Patrone comment on https://forums.docker.com/t/how-can-i-ssh-into-the-betas-mobylinuxvm/10991/8
#get a privileged container with access to Docker daemon
docker run --privileged -it --rm -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker alpine sh
#run a container with full root access to MobyLinuxVM and no seccomp profile (so you can mount stuff)
docker run --net=host --ipc=host --uts=host --pid=host -it --security-opt=seccomp=unconfined --privileged --rm -v /:/host alpine /bin/sh
#switch to host FS
chroot /host
@formix
formix / SUID.java
Last active February 26, 2018 18:09
64 bits Sufficiently Unique Id Generator
/****************************************************************************
* Copyright 2009-2015 Jean-Philippe Gravel, P. Eng. CSDP
*
* Modified 4/7/16 - Jean-Philippe Gravel (@formix) - Moved random number
* generator into the method "if" statement.
*
* Modified 6/8/15 - Osric Wilkinson (@Moosemorals) - No point messing with
* random seeds. Just use SecureRandom.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@cescoffier
cescoffier / AsyncInputStream.java
Last active March 11, 2024 10:20
Async Input Stream VertX Read Stream
/*
* #%L
* Wisdom-Framework
* %%
* Copyright (C) 2013 - 2014 Wisdom Framework
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@vladholubiev
vladholubiev / getActiveWindow.java
Created June 30, 2014 22:00
Get current active windows title and process using JNA
import static enumeration.EnumerateWindows.Kernel32.*;
import static enumeration.EnumerateWindows.Psapi.*;
import static enumeration.EnumerateWindows.User32DLL.*;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.WinDef.HWND;
import com.sun.jna.ptr.PointerByReference;
public class EnumerateWindows {
private static final int MAX_TITLE_LENGTH = 1024;
@bitshifter
bitshifter / PurgeStandbyList.cpp
Last active October 3, 2023 08:26
Command line utility for purging Window's standby list. Requires /MANIFESTUAC:"level='highestAvailable'.
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
#define STATUS_PRIVILEGE_NOT_HELD ((NTSTATUS)0xC0000061L)
typedef enum _SYSTEM_INFORMATION_CLASS {
SystemMemoryListInformation = 80, // 80, q: SYSTEM_MEMORY_LIST_INFORMATION; s: SYSTEM_MEMORY_LIST_COMMAND (requires SeProfileSingleProcessPrivilege)
} SYSTEM_INFORMATION_CLASS;
@bitwalker
bitwalker / convert.sql
Created April 16, 2014 20:43
Convert a hex-encoded string to varbinary - MSSQL
declare @hexstring varchar(max)
declare @bin varbinary(max)
set @hexstring = '0x10.....'
set @bin = (
select cast('' as xml).value('xs:hexBinary(substring(sql:variable("@hexstring"), sql:column("t.pos")))', 'varbinary(max)')
from (select case substring(@hexstring, 1, 2) when '0x' then 3 else 0 end) as t(pos)
)
select @bin
@Stanback
Stanback / nginx.conf
Last active February 4, 2022 18:05
Example Nginx configuration for serving pre-rendered HTML from Javascript pages/apps using the Prerender Service (https://github.com/collectiveip/prerender).Instead of using try_files (which can cause unnecessary overhead on busy servers), you could check $uri for specific file extensions and set $prerender appropriately.
# Note (November 2016):
# This config is rather outdated and left here for historical reasons, please refer to prerender.io for the latest setup information
# Serving static html to Googlebot is now considered bad practice as you should be using the escaped fragment crawling protocol
server {
listen 80;
listen [::]:80;
server_name yourserver.com;
root /path/to/your/htdocs;