Last updated: 12/31/2013
- Edit
/etc/default/localeas sudo. - Append
LC_ALL="en_US.UTF-8"at the end of the file, save and quit. sudo locale-gen en_US en_US.UTF-8sudo dpkg-reconfigure locales
| #!/usr/bin/ruby | |
| # Create display override file to force Mac OS X to use RGB mode for Display | |
| # see http://embdev.net/topic/284710 | |
| require 'base64' | |
| data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
| edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
| vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
| #!/usr/bin/perl | |
| # | |
| # Script to download/clone all of your Github repos | |
| # | |
| # Copyright Nicholas Humfrey, 22nd August 2017 | |
| # | |
| # License: http://unlicense.org | |
| # | |
| use JSON; |
| # 1) Create your private key (any password will do, we remove it below) | |
| $ cd ~/.ssh | |
| $ openssl genrsa -des3 -out server.orig.key 2048 | |
| # 2) Remove the password | |
| $ openssl rsa -in server.orig.key -out server.key |
| def queue_time(queue, cashier) | |
| # 每個位置一起減去當中最小的值 | |
| def subtract_the_min(arr) | |
| arr.map do |ele| | |
| ele - arr.min | |
| end | |
| end | |
| # 如果 at_a_certain_moment 裡面有0 -> 找到這個位置,塞入下一個顧客 ->直到每個位置都不是0 |
| = form_for(@tank_configuration) do |f| | |
| - if @tank_configuration.errors.any? | |
| #error_explanation | |
| h2 | |
| = pluralize(@tank_configuration.errors.count, "error") | |
| | prohibited this tank_configuration from being saved: | |
| ul | |
| - @tank_configuration.errors.full_messages.each do |msg| | |
| li | |
| = msg |
| class Fail2banNotifier | |
| def initialize(options) | |
| @default_options = options | |
| @default_options[:logfile] ||= Rails.root.join('log', 'fail2ban.log') | |
| # Roll over every 30M, keep 10 files | |
| @logger ||= Logger.new(@default_options[:logfile], 10, 30*1024*1024) | |
| end | |
| def call(exception, options={}) |
Last updated: 12/31/2013
/etc/default/locale as sudo.LC_ALL="en_US.UTF-8" at the end of the file, save and quit.sudo locale-gen en_US en_US.UTF-8sudo dpkg-reconfigure locales| #Signing AWS Requests By Using Signature Version 4 | |
| #http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html | |
| require 'uri' | |
| require 'openssl' | |
| require 'net/http' | |
| require 'cgi' | |
| method = 'GET' | |
| service = 'iam' |