Skip to content

Instantly share code, notes, and snippets.

@tacofumi
tacofumi / cloud-config.yml
Created May 23, 2019 16:26
cloud-config.yml modified with NOPASSWD
run_cmd:
- "sudo adduser --disabled-password --gecos \"\" vagrant"
- "echo vagrant:vagrant | chpasswd"
- "mkdir -p /home/vagrant/.ssh"
- "chmod 0700 /home/vagrant/.ssh"
- "wget --no-check-certificate https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -O /home/vagrant/.ssh/authorized_keys"
- "chmod 0600 /home/vagrant/.ssh/authorized_keys"
- "chown -R vagrant /home/vagrant/.ssh"
- "echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers"
k3os:
@tacofumi
tacofumi / youtube2audio.sh
Last active August 29, 2015 14:14
Using youtube-dl to download audio and convert it to m4a with ffmpeg. (the file downloaded as it is won't play on iTunes for some reason. So I decided to convert it with ffmpeg with -acodec copy)
#!/bin/bash
# Setting default quality to 256kb
quality=141
# See if url is provided
url=$1
if [ -z $url ]; then
echo "Need a URL"
exit
@tacofumi
tacofumi / diskripper.sh
Last active December 15, 2023 16:18
This script rips DVD/Blu-ray using makemkvcon. Use udev to invoke this script to auto-rip when disk is inserted. Some variables such as length of string to trim in order to get the title of movie may vary depending on your environment.
#!/bin/bash
{
echo $(date)
echo ">>>Disk found"
echo ">>>Setting the title..."
title=$(makemkvcon -r info)
title=`echo "$title" | grep "DRV:0\+"`
title=${title:53}