Skip to content

Instantly share code, notes, and snippets.

View phaseOne's full-sized avatar

Evan Bovie phaseOne

View GitHub Profile
@countingpine
countingpine / tvsread.c
Created November 3, 2018 23:47
tvsread.c - dump contents of KEY chunks in TeamViewer ".tvs" videos
/* tvsread.c: lists KEY chunks in video and uncompresses them to ./key1.data, ./key2.data, ... */
/* See also http://www.jerrysguide.com/tips/demystify-tvs-file-format.html, https://stackoverflow.com/a/53135938/446106 */
/* Fairly quick and dirty. Tested with a Version 5 video from TeamViewer 13. */
/* compile with gcc -lz tvsread.c */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <zlib.h>
@lukeplausin
lukeplausin / bash_aws_jq_cheatsheet.sh
Last active January 29, 2024 10:00
AWS, JQ and bash command cheat sheet. How to query, cut and munge things in JSON generally.
# Count total EBS based storage in AWS
aws ec2 describe-volumes | jq "[.Volumes[].Size] | add"
# Count total EBS storage with a tag filter
aws ec2 describe-volumes --filters "Name=tag:Name,Values=CloudEndure Volume qjenc" | jq "[.Volumes[].Size] | add"
# Describe instances concisely
aws ec2 describe-instances | jq '[.Reservations | .[] | .Instances | .[] | {InstanceId: .InstanceId, State: .State, SubnetId: .SubnetId, VpcId: .VpcId, Name: (.Tags[]|select(.Key=="Name")|.Value)}]'
# Wait until $instance_id is running and then immediately stop it again
aws ec2 wait instance-running --instance-id $instance_id && aws ec2 stop-instances --instance-id $instance_id
# Get 10th instance in the account
@leommoore
leommoore / mongodb_3.2.x_replica_sets_on_aws_ec2.md
Last active March 15, 2022 22:28
MongoDB 3.2.x Replica Sets on AWS EC2

#MongoDB 3.2.x Replica Sets on AWS EC2 A MongoDB replica set provides a mechanism to allow for a reliable database services. The basic replica set consists of three servers, a primary, a secondary and an arbitrator. The primary and secondary both hold a copy of the data. The arbitrator is normally a low spec server which just monitors the other servers and help with the failover process. In production, there can be more than three servers.

To setup mongo as a replica set on Amazon Web Services EC2 you need to first setup a security group with ssh on port 22 and mongodb on port 27017. You then need to create three servers. Select Ubuntu 14.04 LTS x64 and a micro (or bigger depending on your database size, ideally you should have enough memory to match your database size) instance for the primary and secondary and a nano instance for the arbitrator.

##Adjust the File System on each Server The operating system by default will update the last access time on a file. In a high data throughput database application

@joaocampinhos
joaocampinhos / tech.js
Last active February 22, 2019 08:54
Disable MIT Technology Review (https://www.technologyreview.com/) paywall
var h=document.head,s=document.createElement('style');s.type='text/css',s.appendChild(document.createTextNode('.entry-login,.meter{display:none}article,.article-body__content{height:auto!important}.article-body__content:before{content:none!important}')),h.appendChild(s);
@ikonst
ikonst / NSData+GStreamer.h
Created July 1, 2015 13:12
NSData+GStreamer
@import Foundation;
#include <gst/gst.h>
@interface NSData (GStreamer)
- (GstBuffer *)gstBuffer;
@end
@interface NSMutableData (GStreamer)
@suakig
suakig / PostBuildProcess.cs
Last active August 23, 2021 15:20
PostBuildProcess.cs
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using System.IO;
using System.Collections.Generic;
public class PostBuildProcess : MonoBehaviour
{
internal static void CopyAndReplaceDirectory(string srcPath, string dstPath)
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname