Skip to content

Instantly share code, notes, and snippets.

@TheCloudScout
TheCloudScout / dockerfile
Created November 4, 2019 19:34
adsha-windowsservercore-ltsc2019-dotnet-4.8
# escape=`
FROM mcr.microsoft.com/windows/servercore:ltsc2019
# Install .NET 4.8
RUN curl -fSLo dotnet-framework-installer.exe https://download.visualstudio.microsoft.com/download/pr/7afca223-55d2-470a-8edc-6a1739ae3252/abd170b4b0ec15ad0222a809b761a036/ndp48-x86-x64-allos-enu.exe `
&& .\dotnet-framework-installer.exe /q `
&& del .\dotnet-framework-installer.exe `
&& powershell Remove-Item -Force -Recurse ${Env:TEMP}\*
@nestukh
nestukh / installheadlessfirefoxonpi.sh
Last active February 24, 2024 02:38
Install firefox-esr + geckodriver + selenium + python3 on raspberry pi 3 and above
#!/bin/bash
pypcks="python3-pip python3 python3-all-dev python3-dev libffi-dev libssl-dev librtmp-dev python-dev python3 python3-doc python3-tk python3-setuptools tix xvfb python-bluez python-gobject python-dbus python cython python-doc python-tk python-numpy python-scipy python-qt4 python3-pyqt5 python3-pyqt5.q* python3-qtpy python-pyqt5.q* python-lxml fontconfig python-demjson qt5-default libqt5webkit5-dev build-essential libudev-dev python-lxml libxml2-dev libxslt-dev libpq-dev python-pyside python-distlib python-pip python-setuptools" # python-examples python3-examples python-vte
allgoodpcks="ca-certificates virtualenv autotools-dev cdbs git expect libnss3-tools util-linux xvfb curl bridge-utils chromium-browser chromium-chromedriver firefox-esr"
sudo apt-get install --reinstall -y $pypcks $allgoodpcks
if [[ ! -f /usr/lib/chromium-browser/chromedriver ]]; then
sudo ln -s /usr/bin/chromedriver /usr/lib/chromium-browser/chromedriver
fi
@jftuga
jftuga / bufWrite.go
Created September 9, 2019 09:18
demonstrates how to either write to STDOUT or to a buffer in golang
// demonstrates how to either write to STDOUT or to a buffer
package main
import (
"bufio"
"fmt"
"os"
)
@jamesinc
jamesinc / aws-notification-timer.user.js
Last active February 7, 2024 22:20
AWS console notification dismisserator 9000 - dismiss AWS flash notifications after (about) 5 seconds
// ==UserScript==
// @name AWS console notification dismisserator 9000
// @namespace https://github.com/jamesinc
// @version 1.1
// @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 November 29, 2021 02:10
Terraform Server Resource Creation and Provisioning with Ansible
# 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 January 3, 2024 19:29
golang convert UTF16 to UTF8 or UTF8 to UTF16
// 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 March 1, 2024 03:24
How to increase the root partition size on Fedora

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 
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 23, 2024 11:47
set -e, -u, -o, -x pipefail explanation
@ShayMe21
ShayMe21 / MyViewController.cs
Created July 31, 2018 07:27
Xamarin with Auth0 and TouchID Authentication
// 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 April 23, 2024 13:50
How to implement a simple set data structure in golang
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
}