You can display a spinning clock while performing network tasks.
puts "Starting nmap scan..."
scan_results = ""
spin_during {
scan_results = %x(nmap -Pn dillonhafer.com)
}
puts scan_results
SET @oldsite = 'http://www.oldsite.com'; | |
SET @newsite = 'http://www.newsite.com'; | |
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = REPLACE (guid, @oldsite, @newsite); | |
UPDATE wp_posts SET post_content = REPLACE (post_content, @oldsite, @newsite); | |
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, @oldsite, @newsite); |
require 'nokogiri' | |
require 'open-uri' | |
class Grc | |
attr_accessor :hex, :ascii, :alpha | |
PAGE_URL = "https://www.grc.com/passwords.htm" | |
def initialize | |
chars = fetch | |
@hex = chars[0].text |
#!/bin/bash | |
function space { | |
SEARCH_PATH='.' | |
if (( $# == 1 )) | |
then | |
SEARCH_PATH=$1 | |
fi | |
du -ch $SEARCH_PATH | grep total | |
} |
function rails_version { | |
if (( $# == 1 )); then | |
VERSION="$1-stable" | |
else | |
VERSION='master' | |
echo -e "\033[1;33mUsage: rails_version [BRANCH]\033[0m" | |
echo -e "\033[1;33mExample: rails_version 4-1\033[0m" | |
fi | |
URL="https://raw.githubusercontent.com/rails/rails/$VERSION/RAILS_VERSION" | |
VERSION_NUMBER=$(curl -s $URL) |
You can display a spinning clock while performing network tasks.
puts "Starting nmap scan..."
scan_results = ""
spin_during {
scan_results = %x(nmap -Pn dillonhafer.com)
}
puts scan_results
function dumper { | |
if (( $# != 1 )); then | |
echo "Usage: dumper [DATABASE]" | |
echo "Creates pg_dump: pg_dump -Fc --no-acl --no-owner DATABASE > DATABASE.dump" | |
else | |
pg_dump -Fc --no-acl --no-owner $1 > $1.dump | |
fi | |
} | |
function push_dev_db { |
on run {input, parameters} | |
tell application "Google Chrome" | |
set newTab to make new tab at end of tabs of window 1 | |
set translateURL to "https://translate.google.com/#auto/es/" | |
set URL of newTab to translateURL & input | |
end tell | |
return input | |
end run |
namespace :spec do | |
task :clone_structure do | |
environments = YAML.load(File.read('config/database.yml')) | |
test = environments["test"] | |
dev = environments["development"] | |
puts "Deleting #{test["database"]}..." | |
`echo 'DROP DATABASE #{test["database"]};' | mysql -u #{test["username"]} -p'#{test["password"]}'` | |
puts "Creating #{test["database"]}..." | |
`echo 'CREATE DATABASE #{test["database"]};' | mysql -u #{test["username"]} -p'#{test["password"]}'` | |
puts "Importing schema into #{test["database"]} from #{dev["database"]}..." |
; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a | |
; semicolon, such as this one, are comments. They are not executed. | |
; This script has a special filename and path because it is automatically | |
; launched when you run the program directly. Also, any text file whose | |
; name ends in .ahk is associated with the program, which means that it | |
; can be launched simply by double-clicking it. You can have as many .ahk | |
; files as you want, located in any folder. You can also run more than | |
; one ahk file simultaneously and each will get its own tray icon. |
ping 8.8.8.8 | while read pong; do echo "$(date): $pong"; done | tee > ~/Desktop/ping.log |