This file contains hidden or 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
with Ada.Text_IO; | |
with Ada.Command_Line; | |
with Ada.Streams.Stream_IO; | |
use Ada.Streams; | |
procedure Verify_UTF is | |
First_Word : constant Stream_Element_Array (1 .. 2) := (16#fe#, 16#ff#); -- http://en.wikipedia.org/wiki/Byte_order_mark | |
Second_Word : constant Stream_Element_Array (1 .. 2) := (16#00#, 16#22#); |
This file contains hidden or 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
--- | |
# Execute using ansible-playbook -i hosts example.yml | |
- hosts: web | |
gather_facts: yes | |
- hosts: db | |
gather_facts: no # optional; speed optimization | |
tasks: | |
- name: Display addresses of all web hosts | |
- debug: msg={{ hostvars[item].ansible_eth0.ipv4.address }} |
This file contains hidden or 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
git fetch --prune && git branch -r --merged origin/HEAD | sed "s/origin\///" | grep -v 'master\|HEAD' | xargs -n 1 git push --delete origin && git fetch --prune |
This file contains hidden or 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/sh | |
# Script to migrate git repos from one instance of Altassian Stash/BitBucket to another. | |
# Author: Jesse Lang | http://jesselang.com/ | |
REPO=/tmp/migrate-repo-mirror-${USER} | |
if [ $# -lt 2 ]; then | |
echo "usage: migrate-repo.sh <current-url> <new-url>" | |
exit 1 | |
fi |
This file contains hidden or 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
#!/usr/bin/env python | |
# Script to assist in cleaning up one type of injection from PHP malware. | |
# Author: Jesse Lang | http://jesselang.com/ | |
# Use it with "find" like this: | |
# $ for FILE in $(find -iname *.php); do python malware_cleanup.py $FILE; done | |
# This script takes one argument, a file path. | |
# The file is opened and scanned for a match. | |
# The user is given the option of cleaning or deleting the file, or doing nothing. | |
# If repairing the file would result in an empty file, the file is deleted instead. |
NewerOlder