This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DAOBase | |
{ | |
private readonly string _connectionString; | |
public DAOBase(string database) | |
{ | |
try | |
{ | |
_connectionString = ConfigurationManager.ConnectionStrings[database].ConnectionString; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install gcc-avr gdb-avr binutils-avr avr-libc avrdude libusb-1.0-0-dev dfu-util | |
#git your flavor of tmk, for example | |
#git clone https://github.com/jackhumbert/tmk_keyboard | |
cd ~/code/others | |
git clone https://github.com/dfu-programmer/dfu-programmer.git | |
cd dfu-programmer | |
./bootstrap.sh | |
./configure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import eyeD3 | |
trackNo = 1 | |
listing = os.listdir(".") | |
for infile in listing: | |
maxt = listing.count | |
title = " ".join(" ".join(str(infile).split(' ')[1:]).split('.')[:-1]) | |
print title | |
tag = eyeD3.Tag() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear | |
$files = get-childitem "F:\Work_Area\Music\Raw" *.flac -rec | |
foreach ($file in $files) | |
{ | |
$artist = metaflac $file.fullname --show-tag=ALBUMARTIST | |
if(!$artist -or !$artist.split("=")[1]) {$artist = metaflac $file.fullname --show-tag=ARTIST} | |
$artist = $artist.split("=") | |
$artist = $artist[1..($artist.length-1)] -join "=" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$limit = (Get-Date).AddDays(-8) | |
sqlcmd -S pmssql -E -Q "EXEC sp_BackupDatabases @backupLocation='D:\backups\', @backupType='F', @databaseName='dashboard'" | |
if ($LASTEXITCODE -eq 0) { | |
$path = "D:\backups" | |
# Delete files older than the $limit. | |
Get-ChildItem -Path $path -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt $limit } | Remove-Item -Force | |
# Delete any empty directories left behind after deleting the old files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#CouchDB replication sync script. | |
#Run on target CouchDB server and supply IP or DNS name of source. | |
#For example running 'bash couch_replicator.sh tcdb01' on tcdb02 | |
#will keep tcdb02 in sync with all databases on tcdb01. | |
if [ "$#" -ne 1 ]; then | |
echo "Wrong number of arguments!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pry' | |
require 'couchrest' | |
require 'net/http' | |
require 'uri' | |
require 'json/ext' | |
require 'rest-client' | |
if ARGV.length == 1 | |
puts 'Run on all database (y/n)?' | |
if STDIN.gets.chomp != 'y' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#disable password access /etc/ssh/sshd_config | |
#set to no password 'ALL=NOPASSWD: ALL' | |
#change /etc/network/interfaces | |
#reboot | |
#update sources | |
sudo apt-get update | |
sudo apt-get upgrade | |
#reboot | |
#needed packages | |
sudo apt-get install git nfs-common python-lxml python-pip libffi-dev libssl-dev mono-devel open-vm-tools atop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IS_LOCKED=$(sudo lsof /var/lib/dpkg/lock | wc -l) | |
echo "Is Locked? $IS_LOCKED" | |
until [[ $IS_LOCKED -eq 0 ]]; do | |
echo "Is Locked? $IS_LOCKED" | |
echo "sleeping for 5" | |
sleep 5 | |
IS_LOCKED=$(sudo lsof /var/lib/dpkg/lock | wc -l) | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum repolist | grep -Po "^[\w|-]+(?=\/)" | xargs yumdb search from_repo | grep -Po "=\K .+" | sort - | uniq - | sed -e 's/^[[:space:]]*//' | awk '{system("repoquery --repoid="$1" -a --location")}' | grep -oP "^.+\://\K[^/]+(?=/.+)" | sort - | uniq - | awk '{system( "echo && host "$1)}' |
OlderNewer