Skip to content

Instantly share code, notes, and snippets.

@jamesinc
jamesinc / aws-notification-timer.user.js
Last active Jun 5, 2022
AWS console notification dismisserator 9000 - dismiss AWS flash notifications after (about) 5 seconds
View aws-notification-timer.user.js
// ==UserScript==
// @name AWS console notification dismisserator 9000
// @namespace https://github.com/jamesinc
// @version 1.0
// @description Dismiss AWS flash notifications after about 5 seconds
// @author James Ducker
// @match https://*.console.aws.amazon.com/*
// @grant none
// @run-at document-end
// ==/UserScript==
@HauptJ
HauptJ / server.tf
Last active Nov 29, 2021
Terraform Server Resource Creation and Provisioning with Ansible
View server.tf
# Creates and provisions DO cloud server for WordPress
resource "digitalocean_droplet" "wordpress" {
image = "centos-7-x64"
name = "${var.do_wordpress_name}"
region = "${var.do_region}"
size = "${var.do_wordpress_size}"
ipv6 = true
monitoring = true
ssh_keys = [
@sail1972
sail1972 / main.go
Last active Aug 31, 2022
golang convert UTF16 to UTF8 or UTF8 to UTF16
View main.go
// from blog of http://angelonotes.blogspot.com/2015/09/golang-utf16-utf8.html
package main
import (
"golang.org/x/text/encoding/unicode"
"golang.org/x/text/transform"
"fmt"
)
func main() {
@181192
181192 / increase_root_fedora.md
Last active Aug 24, 2022
How to increase the root partition size on Fedora
View increase_root_fedora.md

How to increase the root partition size on Fedora

Boot up with an Fedora Live USB stick.

  1. Run vgs to check if there's any space:
$ sudo vgs
  VG     #PV #LV #SN Attr   VSize    VFree
  fedora   1   3   0 wz--n- <237.28g    0 
@ShayMe21
ShayMe21 / MyViewController.cs
Created Jul 31, 2018
Xamarin with Auth0 and TouchID Authentication
View MyViewController.cs
// https://github.com/auth0-community/auth0-xamarin-oidc-samples/tree/master/Quickstart/01-Login/iOS
using System;
using UIKit;
using Auth0.OidcClient;
using System.Text;
using LocalAuthentication;
using Foundation;
using Xamarin.Auth;
@bgadrian
bgadrian / set.go
Last active Sep 16, 2022
How to implement a simple set data structure in golang
View set.go
type Set struct {
list map[int]struct{} //empty structs occupy 0 memory
}
func (s *Set) Has(v int) bool {
_, ok := s.list[v]
return ok
}
@nqbao
nqbao / ssm_parameter_store.py
Last active Jul 8, 2022
Python class to provide a dictionary-like interface to access AWS SSM Parameter Store easily
View ssm_parameter_store.py
# Copyright (c) 2018 Bao Nguyen <b@nqbao.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
@markekraus
markekraus / GetInboxRuleReport.ps1
Last active Jan 31, 2019
Generates Multi-Threaded Office 365 Inbox Rule Report That Scales with the Number of Service Accounts Provided
View GetInboxRuleReport.ps1
using namespace System.Collections.Concurrent
$StartDate = [datetime]::UtcNow
# can be generated with something like
# 1..10 | %{ Get-Credential} | Export-CliXml -path 'C:\reports\InboxRules\Creds.xml'
# Which will prompt for credentials 10 times and store them in the xml file
$CredentialFile = 'C:\reports\InboxRules\Creds.xml'
$RunDate = $StartDate.ToString('o') -replace ':'
# This is the path of the CSV file. It is imperative that this file not be
# access while the script is running
@rszeto
rszeto / *pycharm-setup-2020.3.2.md
Last active Aug 12, 2021
Setting up PyCharm project with remote interpreter
View *pycharm-setup-2020.3.2.md

Setting up PyCharm project with remote interpreter

Setting up a remote interpreter on PyCharm is awfully unintuitive. I've pared it down to what I think is the minimal number of steps, and leaves the fewest number of deployment configurations and Python interpreters lying around. This is designed for my specific configuration (specifically PyTorch); adapt as needed.

Configuring default project (only do after installing PyCharm for the first time):

  1. (Optional) Add virtual environment path to excluded files
    1. From Welcome Page, go to Configure > Settings > Build, Execution, Deployment > Deployment > Options
    2. Add virtualenv path. For example, if you always have the project's virtualenv in .env, add ";.env" to the "Exclude items by name" field
@rivo
rivo / postgres.go
Last active Sep 7, 2022
A demo Go application (a PostgreSQL database browser) highlighting the use of the rivo/tview package. See https://github.com/rivo/tview/wiki/Postgres
View postgres.go
package main
import (
"database/sql"
"fmt"
"net/url"
"os"
"reflect"
"regexp"
"strconv"