Skip to content

Instantly share code, notes, and snippets.

View nelsestu's full-sized avatar

Erik Nelsestuen nelsestu

View GitHub Profile
@nelsestu
nelsestu / create_restore_dmg_macosx.md
Created February 18, 2024 21:56 — forked from disulfidebond/create_restore_dmg_macosx.md
Create or Restore Disk Image in Mac OSX

Overview

This gist details how to create or restore a disk image in Mac OSX. There are three methods that are described: Carbon Copy Cloner, Disk Utility, and CommandLine.

  • Disclaimer:
    • I have no financial incentives to https://bombich.com or Apple.
    • Always make a backup of your data, and make 2 separate backups before trying something new.
    • The following steps have been tested and are a summary of my personal recommendations, but should be used at your own risk.
    • If there is a chance of imminent data loss, contact a professional for assistance, and do not rely on a random person from the Internet for help.

Method 1: Carbon Copy Cloner (CCC)

@nelsestu
nelsestu / submit.md
Created February 15, 2024 06:10 — forked from tanaikech/submit.md
Creating Quizzes in Google Form using Google Forms Service with Google Apps Script

Creating Quizzes in Google Form using Google Forms Service with Google Apps Script

This is a sample script for creating quizzes in Google Form using Google Forms Service with Google Apps Script.

Usage

1. Prepare questions and answers.

@nelsestu
nelsestu / docker-remove-images-by-name.md
Created November 7, 2023 09:02 — forked from zulhfreelancer/docker-remove-images-by-name.md
How to delete Docker images that contains a sub-string inside the name?

docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep 'imagename')

For example, to delete all images that contains zulh inside the name, run:

docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep 'zulh')

@nelsestu
nelsestu / JavaTwoWaySSLClient.md
Created November 7, 2023 05:52 — forked from gvisoc/JavaTwoWaySSLClient.md
2-Way SSL: HTTPs Client

What is this

This Gist is about using Client Certificates in Java when making HTTPs calls with plain Java code (java(x).net, no other frameworks) in a 2-way SSL context, that is: the Server trusts and uses a Client Public Key to establish the secure connection. The example is a Java runnable class for a Client that uses a Certificate to establish a Two Way SSL communication with a Server.

Disclaimer: this gist reflects my understanding, and is not necessarily 100% accurate. Feedback is appreciated.

Context

For this to work, the Client certificate has to be issued by a CA (Certification Authority) trusted by the Server, the same way that the Client has to trust the CA of the Server. In Java, "trust a CA" means having that CA stored in an encrypted file called "trust store" accessible from our code by the use of a password and the appropriate security SDK provided by the JDK.

How to store that trust stores' passwords securely in our enviroments is another story.

@nelsestu
nelsestu / quick-actions-finder-macos-big-sur.md
Created October 23, 2023 17:39 — forked from aamnah/quick-actions-finder-macos-big-sur.md
Add Quick Actions to Finde in macOS Big Sur to open a folder in VS Code
  • Open Automator
  • Choose Quick Action as the document type
  • Change Workflow receives current to files or folders in Finder.app
  • For Action, choose Open Finder items from the left hand sidebar
  • Change Open with to Visual Studio Code.app (find it in Other... )
  • For the Icon, change Image to "Choose..." and select the Visual Stuido Code app. It'll automatically pick the icon
  • Save it (Cmd+S) as something like "Open in VS Code"
@nelsestu
nelsestu / win10-starter.ps1
Last active August 21, 2023 07:15
Boxstarter script that installs a bunch of things that are fundamental to the windows machine i am creating
# https://boxstarter.org/creatingpackages
# install boxstarter and then run the following to invoke this package:
# Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/nelsestu/8d70e16f57c555a8fc225f1135442561/raw/b068720e9a3a17776ce513a6ffcb6acbe9a1c425/win10-starter.ps1
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-TaskbarSmall
Enable-RemoteDeskto
choco install 7zip.portable
choco install anki
choco install arduino
@nelsestu
nelsestu / linux startup sounds.md
Created August 18, 2023 04:53 — forked from forksofpower/linux startup sounds.md
startup sounds in linux

How to add startup sound to linux

I use this implementation on my RuneAudio player to play a sound when the raspberry pi is powered on.

  1. Place your audio file in /var/local/

    cp startupsound.mp3 /var/local/
  2. Create /usr/bin/startupsound.sh with these contents:

@nelsestu
nelsestu / nextcloud.conf
Created August 6, 2023 06:04 — forked from xxblx/nextcloud.conf
nextcloud nginx config
upstream php-handler {
server unix:/run/php-fpm/www.sock;
}
server {
#listen 443 ssl;
listen 80;
server_name 192.168.1.8;
#ssl_certificate /etc/ssl/nginx/cloud.example.com.crt;
@nelsestu
nelsestu / resume.json
Last active June 2, 2023 13:10
JSON Resume offers a hosting service that renders your resume.json to any theme you would like. e.g. https://registry.jsonresume.org/nelsestu. All you have to do is create a Gist on GitHub named resume.json.
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Erik Nelsestuen",
"label": "Senior/Staff Software Engineer",
"image": "",
"email": "erik.nelsestuen@gmail.com",
"phone": "",
"url": "https://www.linkedin.com/in/eriknelsestuen/",
"summary": "Creativity, accountability, and personal ownership drive my relationship with software design and architecture. The balance between the elegantly written, and the financially responsible, represents the crux of the day-to-day, even the year over year challenges of software engineering. I hope to make a significant contribution to a creative company, where I can bring expertise in object-oriented design, scalability, and test-driven development practices to a passionate work environment. My reputation as a results-oriented team player and a confident communicator, compliments my experience in technical and managerial leadership roles.<br><section class=\"card\"><h3>Skills and
@nelsestu
nelsestu / host.json
Created May 3, 2023 17:19 — forked from TotallyNotChase/host.json
Native Messaging - Rust
{
"name": "pingpong",
"description": "Native messaging host example",
"path": "path/to/release_executable",
"type": "stdio",
"allowed_origins": [
"chrome-extension://extension_id/"
]
}