Skip to content

Instantly share code, notes, and snippets.

View bonelifer's full-sized avatar

William Jacoby bonelifer

View GitHub Profile

I wanted to do an automatic sync of a directory in my hard drive with 1 directory in my mp3 player (MSU Enabled) To launch an action on detecting it

I used the udev system by creating a rule under /etc/udev/rules.d/10-local.rules

SUBSYSTEMS=="scsi", ATTRS{model}=="MK3006GAL       ", SYMLINK+="DAP", MODE="0666"
SUBSYSTEMS=="scsi", ATTRS{model}=="MK3006GAL       ", ACTION=="add", RUN+="/usr/local/bin/music-sync %k"

The first line creates a symbolic link called DAP under /dev/ \ The second line runs a script I wrote to sync (and mount if required) the device

#IMPORTANT
sudo apt update &&
sudo apt install -y software-properties-common curl wget pavucontrol #pavucontrol is for audio configs
#Themes and Tweak (Ubuntu)
sudo add-apt-repository ppa:numix/ppa
sudo apt update
sudo apt install -y numix-gtk-theme numix-icon-theme-circle
sudo apt install -y unity-tweak-tool gnome-tweak-tool
@bfg100k
bfg100k / lan_monitor.sh
Last active December 20, 2023 04:35
This is a script to check for new devices on the network (regardless of connectivity type. i.e. wired, wireless, vpn). New devices (either new MAC or old MAC with new hostname) joining the network will trigger an email alert to be sent. A simple intrusion detection system for Asus routers running custom firmware by Padavan (https://code.google.c…
#!/bin/bash
# Script to monitor devices on network (regardless of connectivity type.
# i.e. wired, wireless, vpn). New devices (either new MAC or old MAC with
# new hostname) joining the network will trigger an email alert to be sent.
#
# REQUIRED ENTWARE PACKAGES :
# * msmtp - SMTP client to send mail to external email addresses
#
# Author: SidneyC <sidneyc_at_outlook_dot_com>
#
@tierra
tierra / convert-avatars.php
Last active April 2, 2019 22:13
phpBB 3.1 script that fetches all remote avatars, and converts them to uploaded avatars hosted locally.
<?php
/**
* Converts all phpBB 3.1 remote avatars to uploaded avatars.
*
* To use this script:
*
* 1. Copy this file into the root of your phpBB installation.
* 2. Run the script from the command line: php convert-avatars.php
*
* Any avatar will be skipped if any errors come up, like these:
#!/bin/bash
# MPD recent songs playlist creator
# Usage: mpd_recent_playlist.sh [days]
# Config starts here
MPC_CONF=/etc/mpd.conf
PLAYLIST_TITLE="Recently Added"
FILETYPES="mp3|m4a|flac|ogg"
@rdenadai
rdenadai / installer.sh
Last active November 22, 2023 09:24
Super complex set of script and text files to build a full feature computer with a lots of python libs, java and other stuff like ffmpeg, opencv, llvm inside a vagrant script or linux install!!!
# The commands must be executed in the order bellow! Not doing this may break the installation!
# Install python-software-properties if you get a 'command not found'
# sudo apt-get install python-software-properties
# In case you need to install setuptools
# Keep in mind that doing this may destroy pip installation of setuptools
# Instead you can pip install setuptools ... :)
# wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python
@dsprenkels
dsprenkels / mpd-alarm
Last active November 21, 2023 06:30
MDP alarm
#!/bin/bash
# Copyright 2015 Daan Sprenkels <dsprenkels@gmail.com>
export MPD_HOST="$MPD_PASSWD@localhost"
export MPD_PORT=6600
PLAYLISTS_DIR="/var/lib/mpd/playlists"
# Don't activate if we are already playing music
@matiaskorhonen
matiaskorhonen / toggle-tv-power off.sh
Created January 28, 2016 16:04
A quick script to control the power state of a TV attached to a Raspberry Pi over HDMI. Requires `cec-utils` to be installed.
#!/usr/bin/env bash
iso8601_date () {
date +%Y-%m-%dT%H:%M:%S%z
}
turn_on () {
echo 'on 0' | cec-client -s -d 1 RPI
}
@oleq
oleq / _README.md
Last active January 7, 2024 10:38
A2DP audio streaming using Raspberry PI (Raspbian Jessie)

What is this all about?

This tutorial will turn your Raspberry PI into a simple Bluetooth audio receiver, which plays music through connected speakers. It's like a regular car audio system, but it can be used anywhere and it's a good value.

   Audio source (i.e. smartphone) 
                |
                v
 (((  Wireless Bluetooth Channel  )))
 |
@jaredh
jaredh / pam-pushover.sh
Created February 21, 2016 22:24
Script for notifying Pushover of successful SSH logins
#!/bin/sh
PUSHOVER_API_URL="https://api.pushover.net/1/messages.json"
PUSHOVER_APPTOKEN="<YOUR_APP_TOKEN>"
PUSHOVER_USERKEY="<YOUR_USER_KEY>"
if [ "$PAM_TYPE" != "close_session" ]; then
MESSAGE="User '$PAM_USER' logged into '`hostname`' from IP address '$PAM_RHOST'"
curl -s -F "user=$PUSHOVER_USERKEY" -F "token=$PUSHOVER_APPTOKEN" -F "message=$MESSAGE" $PUSHOVER_API_URL