Skip to content

Instantly share code, notes, and snippets.

View jangeador's full-sized avatar
🐵

Delio Castillo jangeador

🐵
View GitHub Profile
@jangeador
jangeador / find_anagrams.py
Created October 5, 2016 12:48
rmotr.com assignment 3
import unittest
def find_anagrams(list_of_strings, word):
anagrams = []
for test_word in list_of_strings:
if ''.join(sorted(test_word)) == ''.join(sorted(word)):
anagrams.append(test_word)
return anagrams
@jangeador
jangeador / debug.py
Created November 8, 2016 00:20
python debugger
a = [1, 2, 3, 4]
# call the trace debugger
import ipdb
ipdb.set_trace()
@jangeador
jangeador / copy_files.bat
Created November 16, 2016 14:51
Robust copy of files in Windows
@echo off
SET SORC="\\server\share"
SET DEST="Z:\WHERE YOU WANT FILES TO GO"
SET LOG="Z:\THE LOG FILE.log"
ROBOCOPY %SORC% %DEST% /MIR /SEC /R:1 /W:1 /NP /LOG:%LOG%
@if errorlevel 16 echo ***ERROR *** & goto END
@if errorlevel 8 echo **FAILED COPY ** & goto END
@if errorlevel 4 echo *MISMATCHES * & goto END
@jangeador
jangeador / rename_documents.ps1
Created December 1, 2016 01:16
Rename the "My Documents" folder to "Documents"
Get-ChildItem -Directory -Recurse | where-object { $_.Name -like "My Documents" } | Rename-Item -newname { $_.name -replace "My Documents", "Documents" } -force
@jangeador
jangeador / docker-compose.yml
Created December 14, 2016 22:20
docker-compose for ZoneMinder 1.29
version: '2'
volumes:
config-data:
driver: nimble
driver_opts:
sizeInGiB: 500
description: "ZoneMinder Data and Config"
services:
@jangeador
jangeador / 02-mydns.conf
Created February 20, 2017 17:41
Pihole DHCP / DNS / TFTP Config
domain-needed
bogus-priv
domain=lan.delianna.net
expand-hosts
local=/lan.delianna.net/
# do not use /etc/resolv.conf or /etc/hosts
no-hosts
no-resolv
no-poll
@jangeador
jangeador / config.conf
Created March 17, 2017 00:19
Youtube-DL Config
# MP3 CONFIG
#--extract-audio
#--audio-format "mp3"
#--ignore-errors
#-o '~/youtube/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s'
# VIDEO CONFIG
--ignore-errors
-f best[height<=?720,ext=mp4]
@jangeador
jangeador / useful_commands.ps1
Last active May 25, 2017 21:55
Exchange 2010 Useful Commands
# Mailboxes size:
Get-MailboxDatabase | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Export-Csv "Z:\Mailboxes.csv"
# Databases size:
Get-MailboxDatabase -Status | Select-Object Name,@{N="DatabaseSize GB";E={$_.DatabaseSize.ToGB()}},AvailableNewMailboxSpace | Sort-Object Name | fl
# Move database to another drive or path:
move-DatabasePath -Identity '$DB' -EdbFilePath 'New_File_Path.edb' -LogFolderPath 'New_Log_Path'
# Get count per server
@jangeador
jangeador / rancheros_services.sh
Last active July 26, 2017 18:05
rancher os stuff
sudo ros service enable rancher-server
sudo ros service up rancher-server
# If you want to see what services are available (not many), just run:
sudo ros service list
@jangeador
jangeador / scan.txt
Created December 1, 2017 17:47
Port scan using nmap
sudo nmap -p 80,443 192.168.1.10