Skip to content

Instantly share code, notes, and snippets.

@Rio517
Rio517 / install.log
Last active Mar 1, 2021
Linux Min 19 Install log - fails with Calling 'apt-install grub-efi-amd64-signed' failed
View install.log
# posting for reference in https://forums.linuxmint.com/viewtopic.php?f=46&t=272966
Jul 11 20:33:42 mint ubiquity[1988]: Device /dev/nvme0n1p3 not found in os-prober output
Jul 11 20:33:42 mint ubiquity[1988]: Device free not found in os-prober output
Jul 11 20:33:42 mint ubiquity[1988]: Device /dev/nvme0n1p6 not found in os-prober output
Jul 11 20:33:42 mint ubiquity[1988]: Device /dev/nvme0n1p7 not found in os-prober output
Jul 11 20:33:42 mint ubiquity[1988]: Device free not found in os-prober output
Jul 11 20:33:42 mint ubiquity[1988]: Device /dev/nvme0n1p8 not found in os-prober output
Jul 11 20:33:42 mint ubiquity[1988]: Device /dev/nvme0n1p4 not found in os-prober output
Jul 11 20:33:42 mint ubiquity[1988]: Device free not found in os-prober output
@Rio517
Rio517 / request.log
Created May 22, 2018
Slack API Issue
View request.log
curl -X GET \
'https://slack.com/api/files.list?token=REMOVED&page=1&types=&channel=' \
-H 'Cache-Control: no-cache' \
-H 'accept: application/json, text/plain, */*' \
-H 'accept-encoding: gzip, deflate, br' \
-H 'accept-language: en-US,en;q=0.9,de;q=0.8' \
-H 'authority: slack.com' \
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36'
@Rio517
Rio517 / request.log
Last active Mar 29, 2018
WOW Booking Error
View request.log
POST /api/midgardur/v4/reservations HTTP/1.1
Host: booking.prod.wowair.net
Origin: https://booking.wowair.com
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,de;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
Content-Type: application/json
Accept: application/json
Referer: https://booking.wowair.com/passengers
Connection: keep-alive
@Rio517
Rio517 / action_dispatch_override.rb
Created Mar 5, 2018
Allow passing body to in rails test suites
View action_dispatch_override.rb
# Overriding ActionDispatch::Integration::Session.any_instance.process
# Adding a body and passing to rack-test as an :input param.
module ActionDispatch
module Integration
class Session
#add body param here
def process(method, path, params: nil, body: nil, headers: nil, env: nil, xhr: false, as: nil)
request_encoder = RequestEncoder.encoder(as)
headers ||= {}
@Rio517
Rio517 / application.controller.js
Last active Aug 25, 2017 — forked from spieker/application.controller.js
nested JSON-API attributes ember example
View application.controller.js
import Ember from 'ember';
import Serializer from '../serializers/author';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
serialized: Ember.computed(function() {
return JSON.stringify(this.get('model').serialize(), null, 2);
})
});
@Rio517
Rio517 / humaize.rb
Created Feb 3, 2017
Humanize.rb - a Copy and Paste version of https://github.com/radar/humanize. So I can quickly paste into console when useful. English bits only.
View humaize.rb
module Humanize
SUB_ONE_THOUSAND = {
:en => ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', 'twenty', 'twenty-one', 'twenty-two', 'twenty-three', 'twenty-four', 'twenty-five', 'twenty-six', 'twenty-seven', 'twenty-eight', 'twenty-nine', 'thirty', 'thirty-one', 'thirty-two', 'thirty-three', 'thirty-four', 'thirty-five', 'thirty-six', 'thirty-seven', 'thirty-eight', 'thirty-nine', 'forty', 'forty-one', 'forty-two', 'forty-three', 'forty-four', 'forty-five', 'forty-six', 'forty-seven', 'forty-eight', 'forty-nine', 'fifty', 'fifty-one', 'fifty-two', 'fifty-three', 'fifty-four', 'fifty-five', 'fifty-six', 'fifty-seven', 'fifty-eight', 'fifty-nine', 'sixty', 'sixty-one', 'sixty-two', 'sixty-three', 'sixty-four', 'sixty-five', 'sixty-six', 'sixty-seven', 'sixty-eight', 'sixty-nine', 'seventy', 'seventy-one', 'seventy-two', 'seventy-three', 'seventy-four', 'seventy-five
@Rio517
Rio517 / 1password_lastpass_migrator.rb
Last active Feb 1, 2017
First pseudo code of how I might do this. Obviously, this is only 5 minutes of work, so my parser class is not well thought out or might not be neccessary.
View 1password_lastpass_migrator.rb
# psudeo code for how I might build a 1password => lastpass converter
# this is done becuase lastpasse's importer seems to ingore many fields.
# Usage:
# OnePasswordCsv.new(
# input_csv_path: 'exported_admin_folder_from_1password.csv',
# output_csv_path: 'lastpass_admin_import.csv'
# )
class OnePasswordCsv
@Rio517
Rio517 / json_api_mocking.rb
Last active Aug 23, 2016
JSON-API mocking library/script - in Ruby
View json_api_mocking.rb
# JSON-API mocking library - a very, very simple script to help mock JSON-API
# JSON. This is more designed to return scaffolding that can then be manually
# edited. It supports only single resource objects, with included or linked
# children, but only one child per relationship. This might be useful for
# specing out what your API could look like for frontend and backend developers.
# Example usage is at the bottom. If I were to take this further, I'd make it
# more recursive.
class JsonApiMock
@Rio517
Rio517 / install_chrome_flash.sh
Last active Jul 31, 2016
raspbery pi install chrome and flash
View install_chrome_flash.sh
# Original Source: https://drive.google.com/file/d/0B2X5T2P-KI8mUVNGSlVhYjVnNGc/view
#Install Chromium Browser
wget https://www.dropbox.com/s/emv1akq9lm4gi3c/chromium-browser-l10n_50.0.2661.102-0ubuntu0.14.04.1.1118_all.deb?dl=0
wget https://www.dropbox.com/s/12ht1lgpossgq0q/chromium-browser_50.0.2661.102-0ubuntu0.14.04.1.1118_armhf.deb?dl=0
wget https://www.dropbox.com/s/041d46qhi9yhla7/chromium-codecs-ffmpeg-extra_50.0.2661.102-0ubuntu0.14.04.1.1117_armhf.deb?dl=0
sudo dpkg -i chromium-browser_50.0.2661.102-0ubuntu0.14.04.1.1118_armhf.deb?dl=0
sudo dpkg -i chromium-codecs-ffmpeg-extra_50.0.2661.102-0ubuntu0.14.04.1.1117_armhf.deb?dl=0
sudo dpkg -i chromium-browser-l10n_50.0.2661.102-0ubuntu0.14.04.1.1118_all.deb?dl=0
@Rio517
Rio517 / google_calendar_merge.js
Created Jul 26, 2016
This script will merge multiple calendars into a separate, isolated calendar.
View google_calendar_merge.js
// Google Calendar Merge Script
// This script will merge multiple calendars into a single calendar. Slightly updated from an
// earlier version: http://techingthetech.blogspot.co.uk/2015/04/merging-google-calendars.html
//
// Usage:
// 1. Grab the calendar name and IDs for your target calendar and the ones you want to merge
// 2. Go to Google Drive and create a new Google Apps Script (it will be under New > More).
// 3. Search for the "App Script" add it and allow it to work.
// 4. Create a new script and copy and past this code in there.
// 5. Add your IDs below for the target calender to import to and to import from.