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
| # Upload | |
| rsync -av -e "ssh -A JUMP_HOST ssh" FILE_TO_SEND DEST_HOST:/home/gareth/ | |
| # Download | |
| rsync -av -e "ssh -A JUMP_HOST ssh" DEST_HOST:~/FILE_TO_DOWNLOAD ~/Downloads/ |
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 | |
| sed ' | |
| /ONE/ { | |
| # append a line | |
| N | |
| # if TWO found, delete the first line | |
| /\n.*TWO/ D | |
| }' file |
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
| diskutil list | |
| diskutil unmountDisk /dev/disk2 | |
| diskutil eraseDisk FAT32 SANDISK /dev/disk2 |
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
| require 'rspec/rails' | |
| require 'factory_bot' | |
| require Rails.root.join('spec', 'support', 'load_file_fixtures') | |
| require Rails.root.join('spec', 'support', 'email_helpers') | |
| RSpec.configure do |config| | |
| config.fixture_paths = "#{::Rails.root}/spec/fixtures" | |
| end | |
| factory_users = User.pluck(:id) - [1,2,3,4,5,6,7] |
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 ruby | |
| class PrintEnvVars | |
| def initialize(a, b) | |
| @arg1 = a | |
| @arg2 = b | |
| @env1 = ENV['API_KEY'] ||= 'API_KEY not found' | |
| @env2 = ENV['PASSWORD'] ||= 'PASSWORD not found' | |
| end |
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
| # Find the USB drive | |
| $ diskutil list | |
| # Unmount it | |
| $ diskutil unmountDisk /dev/diskN | |
| # Copy the ISO to the USB drive | |
| $ sudo dd if=/Users/gareth/debian-7.7.0-amd64-CD-1.iso of=/dev/diskN bs=8M status=progress |
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
| # Output to a jpeg file | |
| set terminal jpeg size 1280,720 | |
| # Set the aspect ratio of the graph | |
| set size 1, 1 | |
| # The file to write to | |
| set output "timeseries.jpg" | |
| # The graph title |
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
| // Go to the Inbox | |
| // Unfold label menus (only labels visible to you will be collected) | |
| // Open a console | |
| var elementsWithDataLabel = document.querySelectorAll('[data-label-name]'); | |
| var dataLabelValues = Array.from(elementsWithDataLabel).map(el => el.getAttribute('data-label-name')); | |
| dataLabelValues.forEach(value => { | |
| console.log(value); |
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
| # Generate Private Key | |
| $ openssl genrsa -out server.key 2048 | |
| # Generate CSR | |
| $ openssl req -new -out server.csr -key server.key -config openssl.cnf | |
| # => Fill in info | |
| # Check CSR | |
| $ openssl req -text -noout -in server.csr | |
| # Sign Cert | |
| $ openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt -extensions v3_req -extfile openssl.cnf |
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 ruby | |
| require 'octokit' | |
| require 'pp' | |
| require 'csv' | |
| GITHUB_TOKEN = ENV['GITHUB_TOKEN'].freeze | |
| SINCE=ARGV[0].freeze | |
| client = Octokit::Client.new(access_token: GITHUB_TOKEN) |
NewerOlder