Skip to content

Instantly share code, notes, and snippets.

View tomer's full-sized avatar

Tomer Cohen tomer

View GitHub Profile
@tomer
tomer / _README.md
Last active June 3, 2021 15:16
VLC UDP Multicast

Usage

./server.sh &
./client.sh &
./client.sh &
./client.sh &
@tomer
tomer / tee.py
Created April 28, 2021 19:37
Simple `tee` alternative for operating systems without native tee command
import argparse
import sys
from contextlib import ExitStack
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('filename', nargs='*')
parser.add_argument('--append', '-a', action='store_true')
args = parser.parse_args()
@tomer
tomer / index.html
Last active January 21, 2020 08:39
sync-multiple-vimeo-videos.html
<!doctype html>
<html>
<head>
<script type="text/javascript">
function playButton() {
const players = [];
for (const p of ['video1', 'video2', 'video3']) players.push(document.getElementById(p));
const paused = players[0].paused;
for (const p of players) paused? p.play(): p.pause();
@tomer
tomer / !Scan file using VirusTotal API.md
Last active December 23, 2019 16:44
Upload file to Virus Total servers and reterive scan report

Installation

  • Use pipenv or make sure to have the python requests library available.
  • Make sure to have valid API key by creating a developer account on virustotal website and then accessing your profile for API keys.

Usage

usage: virustotal_api_check_file.py [-h] --key KEY filename

positional arguments:
  filename    File to scan
@tomer
tomer / .gitconfig
Created March 19, 2019 13:23
GIT dotfile
[user]
name = Full Name
email = email@address
[alias]
tree = log --oneline --decorate --all --graph
[branch]
autosetuprebase = always
[core]
editor = vim
autocrlf = input
@tomer
tomer / get-certificate.sh
Created February 11, 2017 13:38
Manually obtain Let's Encrypt certificate over SSH using sshfs
#!/bin/bash
mkdir example.net
fusermount -u example.net
sshfs ssh-user@example.net:/var/www/example.net example.net
certbot -w example.net/ -d example.net -m webmaster@example.net --agree-tos --config-dir .config --work-dir .work --logs-dir .logs certonly --webroot
fusermount -u example.net
rmdir example.net
echo
echo Certificate has been created. Now please install the certificate on your website.
echo
@tomer
tomer / dabblet.html
Last active December 9, 2016 13:56
Untitled
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<style>
.bad {direction: ltr; text-align: right; background-color: red;}
.good {direction: rtl; background-color: green;}
input {display:block; width: 80%; padding: 1em; margin: auto;}
.expected {unicode-bidi: plaintext;}
.expected2 {unicode-bidi: plaintext; text-align: right;}
@tomer
tomer / dabblet.css
Created December 9, 2016 13:05
Untitled
body {
margin: 25px auto;
width: 200px;
text-align: center;
border: 1px gray solid;
border-radius: 25px;
box-shadow: 5px 5px 5px 5px silver;
animation: rotate 1s infinite alternate; }
@keyframes rotate {
0% { transform: translate(100px) rotate(-20deg);}