Skip to content

Instantly share code, notes, and snippets.

@duvrai
duvrai / nosleep.sh
Last active August 29, 2015 14:12
Writes a random byte every minute to a .nosleep file
#!/bin/bash
if [ "$1" ]
then
while true
do
date
for param in "$@"
do
echo Writing "$param/.nosleep"
head -c1 /dev/random >"$param/.nosleep"
@duvrai
duvrai / nosleep.sh
Created January 27, 2015 13:09
Finds Volumes of some external drives and writes a random byte to a /.nosleep file
#!/bin/bash
while true
do
re="/dev/disk[2-9][0-9]?s[0-9][0-9]? on ([^\(]+)" # Matches volumes on disk2sX or higher
mounts=`mount`
mounts2=$mounts
date
while [[ ${mounts} =~ (${re}) ]]
do
@duvrai
duvrai / Lens data.md
Last active August 29, 2015 14:21
Lens Data

#Lens Data

Manufaturer Data

Canon Lenses — EF & EF-S Mounts

Nikon Lenses — F Mount

Rokinon & Samyang Lenses — Multiple Mounts

@duvrai
duvrai / errors.php
Created July 2, 2015 14:58
Mailjet errors
$internalErrors = array(
'MJ01' => 'Could not determine APIKey', // SERRCouldNotDetermineAPIKey
'MJ02' => 'No persister object found for class: "%s"', // SErrNoPersister
'MJ03' => 'A non-empty value is required', // SErrValueRequired
'MJ04' => 'Value must have at least length %d', // SErrMinLength
'MJ05' => 'Value may have at most length %d', // SErrMaxLength
'MJ06' => 'Value must be larger than or equal to %s', // SErrMinValue
'MJ07' => 'Value must be less than or equal to %s', // SErrMaxValue
'MJ08' => 'Property %s is invalid: %s', // SErrInProperty
'MJ09' => 'Value is not in list of allowed values: (%s)', // SErrValueNotInList
@duvrai
duvrai / ipfs.md
Last active August 29, 2015 14:28
get ifs working on mac

Installing ipfs on mac

brew install ipfs go
brew cask install osxfuse
ipfs init

Make sure that your go installation works by setting environment vars etc...

go get github.com/jbenet/go-fuse-version/fuse-version
#!/bin/bash
# Automatically restarting server from stackoverflow.com/a/697064
until /usr/local/bin/ffmpeg -loglevel warning \
-use_wallclock_as_timestamps 1 -ss 0.2 -input_format h264 -framerate 25 -video_size 1920x1080 -thread_queue_size 512 -i /dev/video0 \
-f alsa -thread_queue_size 5120 -i hw:1 \
-f mpegts -c:v copy -c:a aac udp://239.3.4.5:50000
do
echo `basename "$0"` "server crashed with exit code $?. Respawning.." >&2
sleep 1
@duvrai
duvrai / # podofo - 2018-10-03_20-38-20.txt
Created October 4, 2018 08:58
podofo on macOS 10.14 - Homebrew build logs
Homebrew build logs for podofo on macOS 10.14
Build date: 2018-10-03 20:38:20
@duvrai
duvrai / DaVinciResolve.desktop
Created March 14, 2019 21:03
/opt/resolve/share/DaVinciResolve.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=DaVinci Resolve
GenericName=DaVinci Resolve
Comment=Revolutionary new tools for editing, visual effects, color correction and professional audio post production, all i$
Path=RESOLVE_INSTALL_LOCATION/
Exec=env QT_DEVICE_PIXEL_RATIO=2 RESOLVE_INSTALL_LOCATION/bin/resolve
Terminal=false
MimeType=application/x-resolveproj;