Skip to content

Instantly share code, notes, and snippets.

@rivernate
rivernate / bash_cheat.sh
Created May 5, 2021 16:54
Bash Script cheat sheet
#!/usr/bin/env bash
## Font weight
bold=$(tput bold)
normal=$(tput sgr0)
## Font colors
red=$'\e[1;31m'
grn=$'\e[1;32m'
end=$'\e[0m'
### Keybase proof
I hereby claim:
* I am rivernate on github.
* I am rivernate (https://keybase.io/rivernate) on keybase.
* I have a public key ASCPj-FwlRUQz0-rONm_X0MdxzfHaui2e2ybMekNIr02Vwo
To claim this, I am signing this object:
<?xml version="1.0" encoding="UTF-8"?><cartridge_basiclti_link xmlns="http://www.imsglobal.org/xsd/imslticc_v1p0" xmlns:blti="http://www.imsglobal.org/xsd/imsbasiclti_v1p0" xmlns:lticm="http://www.imsglobal.org/xsd/imslticm_v1p0" xmlns:lticp="http://www.imsglobal.org/xsd/imslticp_v1p0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imslticc_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticc_v1p0.xsd http://www.imsglobal.org/xsd/imsbasiclti_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imsbasiclti_v1p0p1.xsd http://www.imsglobal.org/xsd/imslticm_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticm_v1p0.xsd http://www.imsglobal.org/xsd/imslticp_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticp_v1p0.xsd">
<blti:title>IMS Certification Suite</blti:title>
<blti:launch_url>https://apps.imsglobal.org/lti/cert/tc/tc_tool.php?x=With%20Space&amp;y=yes</blti:launch_url>
<blti:extensions platform="canvas.instructure.com">
<lticm:option
@rivernate
rivernate / reboot_to_linux.bat
Last active March 19, 2017 17:39
reboot to other linux
@echo off
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit)
bcdedit /set {fwbootmgr} bootsequence {uuid}
shutdown /r /t 0

Keybase proof

I hereby claim:

  • I am rivernate on github.
  • I am rivernate (https://keybase.io/rivernate) on keybase.
  • I have a public key ASD8cYT3yNwGh8X6K7KYjdhCSP9zxktUMXVUdX2ynilAUwo

To claim this, I am signing this object:

Canvas File Upload Example
require 'simple_oauth'
SimpleOAuth::Header::ATTRIBUTE_KEYS << :body_hash unless SimpleOAuth::Header::ATTRIBUTE_KEYS.include? :body_hash
def self.validate(header, url, secret)
o = SimpleOAuth::Header.new(:post, url, {}, SimpleOAuth::Header.parse(header).merge({consumer_secret: secret}))
puts o.send(:signature)
puts o.send(:signature_base)
#puts o.send(:secret)
puts o.valid?()
o
require 'httparty'
require 'httmultiparty'
access_token = ""
domain = ""
course_id = ""
assignment_id = ""
file_path = ''
api_endpoint = "#{domain}/api/v1/courses/#{course_id}/assignments/#{assignment_id}/submissions/self/files"
file = File.new(file_path)
@rivernate
rivernate / gist:e4fe1e70ad88af658de3
Created April 20, 2015 22:54
.gitignore_global
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
### Keybase proof
I hereby claim:
* I am rivernate on github.
* I am rivernate (https://keybase.io/rivernate) on keybase.
* I have a public key whose fingerprint is 1C9E AE5E 2013 298C 42C8 0E18 FCF4 6130 1D92 4674
To claim this, I am signing this object: