Open Xcode. Click the "Xcode" button in the top left of the screen near the Apple logo, then click "Preferences", then click "Downloads".
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
--- | |
gemhome: /home/USERNAME/.gems | |
gempath: | |
- /home/USERNAME/.gems | |
- /usr/lib/ruby/gems/1.8 |
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
def self.parse_config(file) | |
config = {} | |
File.open(file).each_line do |line| | |
line.strip! | |
# skip lines with comments or blank lines | |
next if /^\#/.match(line) | |
next if /^\s*$/.match(line) | |
# store which group in the config the line belongs to (e.g. [mysqld]) |
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 'base64' | |
require 'time' | |
require 'digest/sha1' | |
require 'openssl' | |
require 'net/https' | |
require 'json' | |
class ChefAPI | |
# Public: Gets/Sets the http object. |
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
on appIsRunning(appName) | |
tell application "System Events" to (name of processes) contains appName | |
end appIsRunning | |
on shortenUrl(str) | |
set curl_cmd to "curl -s https://www.googleapis.com/urlshortener/v1/url" | |
set json to " -H 'Content-Type: application/json' -d '{\"longUrl\": \"" & str & "\"}'" | |
set grep_cmd to "grep -Eo 'http:\\/\\/goo\\.gl\\/[0-9A-Za-z]*'" | |
set command to curl_cmd & json & " | " & grep_cmd | |
do shell script command |
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
irb(main):002:0> "AaAAaAA".match('\A[a-zA-Z]') | |
=> #<MatchData "A"> |
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
root@cvm01 [/var/cpanel]# /usr/local/cpanel/bin/fetch_cpconf_value access_log | |
/usr/local/cpanel/logs/access_log |
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
class Config | |
# The path to the config file as a String. | |
attr_reader :file | |
# Attributes used while config is parsed. | |
# | |
# Example: | |
# [mysqld] # group | |
# param = val # param, val |
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
#!/usr/bin/env ruby | |
cookbook_list = `knife cookbook list -a`.split("\n") | |
cookbook_list.each do |line| | |
line.strip! | |
line.match(/^([a-z0-9]+\-[a-z0-9-]+|\w+)\s+(\d\.\d\.\d|.+)$/) | |
name = $1 | |
versions = $2 |
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
FileBench Version 1.4.4 | |
filebench> load webserver | |
98008: 3.236: Webserver Version 2.1 personality successfully loaded | |
98008: 3.236: Usage: set $dir=<dir> | |
98008: 3.236: set $filesize=<size> defaults to 16384 | |
98008: 3.236: set $nfiles=<value> defaults to 1000 | |
98008: 3.236: set $dirwidth=<value> defaults to 20 | |
98008: 3.236: set $nthreads=<value> defaults to 100 | |
98008: 3.236: set $iosize=<size> defaults to 1048576 | |
98008: 3.236: run runtime (e.g. run 60) |
OlderNewer