Skip to content

Instantly share code, notes, and snippets.

@xlphs
xlphs / MyIOContext.cpp
Last active June 24, 2022 18:12
MyIOContext
#include <cstdio>
#include <string>
class MyIOContext {
public:
std::string datafile;
AVIOContext *ioCtx;
uint8_t *buffer; // internal buffer for ffmpeg
int bufferSize;
FILE *fh;
#!/bin/sh
trap "exit 0" INT
if [ $# = 0 ]; then
echo
echo "Usage: $0 <interface> [start ip addr] [end ip addr]"
echo " Sorry, it's not more configurable than that, edit the source."
echo
exit 1
<html>
<head>
<title>SDP Rewrite Test</title>
</head>
<body>
<textarea rows="20" cols="80" id="sdp">
v=0
o=- 9085987410276364131 2 IN IP4 127.0.0.1
<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/">
<ClientInitialization>
<WindowsLogonEnforcement>SingleLocalLogon</WindowsLogonEnforcement>
<WindowsVPNEstablishment>AllowRemoteUsers</WindowsVPNEstablishment>
<LocalLanAccess>true</LocalLanAccess>
<AutoUpdate>false</AutoUpdate>
<CertificateMatch>
<DistinguishedName>
<DistinguishedNameDefinition Operator="Equal">
<Name>CN</Name>
#include <time.h>
#include <sys/time.h>
#ifdef __MACH__
#include <mach/clock.h>
#include <mach/mach.h>
#define CLOCK_REALTIME 0
#define CLOCK_MONOTONIC 0
static int
clock_gettime(int clk_id, struct timespec *ts) {
defmodule Sudoku do
def solve do
sudoku = [
[5, 3, :_, :_, 7, :_, :_, :_, :_],
[6, :_, :_, 1, 9, 5, :_, :_, :_],
[:_, 9, 8, :_, :_, :_, :_, 6, :_],
[8, :_, :_, :_, 6, :_, :_, :_, 3],
[4, :_, :_, 8, :_, 3, :_, :_, 1],
[7, :_, :_, :_, 2, :_, :_, :_, 6],
[:_, 6, :_, :_, :_, :_, 2, 8, :_],
@xlphs
xlphs / public_key_verify.exs
Created April 5, 2017 17:22
public_key_verify.exs
defmodule PublicKey do
def verify_fun(_, {:extension, _}, state) do
IO.puts "verify_fun -- extension"
{:unknown, state}
end
def verify_fun(_, {:revoked, _}, state) do
IO.puts "verify_fun -- revoked"
{:fail, state}
end
wget http://pkgrepo.linuxtech.net/el6/release/linuxtech.repo -O /etc/yum.repos.d/linuxtech.repo
yum -y install vlc
sed -i 's/geteuid/getppid/' $(which vlc)
import os
import shutil
import argparse
import numpy as np
from PIL import Image
#os.remove(path) #Delete file
#os.removedirs(path) #Delete empty folder
yum -y install https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm
yum -y install vlc
sed -i 's/geteuid/getppid/' $(which vlc)