Skip to content

Instantly share code, notes, and snippets.

@uraimo
uraimo / dnsovertls.md
Last active March 22, 2024 20:55
Configure your Mac to use DNS over TLS
@uraimo
uraimo / disable_show_menubar_fullscreen.md
Last active October 9, 2023 07:29
Force disable the menubar or dock appearing when in full screen in MacOS... need this for Sonoma on some applications

This needs to be done on a per-application basis.

Select the application, show package content, edit the plist.info and add:

  ...
  <dict>
  ...
  ...
  <key>LSUIPresentationMode</key>

3

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "Test": "rest"
      },
 "geometry": {
@uraimo
uraimo / graph.md
Last active November 9, 2022 17:37
Create graphs with markdown on github
@uraimo
uraimo / new_homebrew_formula.md
Last active November 9, 2022 17:12
Create a new homebrew formula and submit it/private tap

Creating a new Homebrew formula

Simplified procedure extracted from the contribution guidelines and the guide.

Example for a new go application, the install step and the dependencies will be different if you are building something else.

  1. Update brew:

    brew update

@uraimo
uraimo / TaxMan.java
Last active November 7, 2022 14:38
Interview question [entry-level,java,finance]: solve and comment on what's wrong with this sample
// Calculate the tax from the amount as you would do in a real world scenario.
class TaxMan{
//Return the tax as percentage of the amount plus penalty
private static double calcTaxes(long amount, int perc, double penalty){
//fill here
}
public static void main(String args...){
@uraimo
uraimo / bad_code_review.md
Created May 26, 2022 17:43
Interview question[entry-level, java]: Review the following samples and spot issues (5+ each)

Sample 1

public OSGiCommand getCmd() {
   if (path.equals("/bundle") ||
       path.equals("/bundles") ||
       path.equals("/bundle/json") ||
       path.equals("/list.html"))
       return new OSGiListCommand(context, new PrintWriter(out));
   else {
@uraimo
uraimo / masto_this.go
Created November 7, 2022 10:51
Post a new toot to a Mastodon instance in Go
package main
import (
"os"
"strings"
"context"
"log"
"github.com/mattn/go-mastodon" //Thanks Mattn!
)
@uraimo
uraimo / pimoroni_unicornhat_nulsom_rainbow_matrix.markdown
Created March 5, 2016 20:46
Using the Pimoroni Unicorn Hat python library with a Nulsom 8x8 Led matrix

The Nulsom rainbow matrix is compatible with the Pimoroni unicorn hat Raspberry Pi library but needs a few modifications. Tested on a Raspberry 2.

Connections

Connect the matrix 5V and GND to the Raspberry, connect the DI pin to P18.

Modifications

Install the unicorn hat library with \curl -sS get.pimoroni.com/unicornhat | bash.

@uraimo
uraimo / snmp_guide.md
Last active June 3, 2022 09:16
The bare minimum you need to query an SNMP service

To traverse the tree of public data (i.e. "public" community), starting from the "iso" root:

  snmpwalk -v 2c -Cc -c public -m ALL 10.0.0.1 iso

To print out private data ("private" community, enterprises leaf(1.3.6.1.4)):

snmpwalk -v 2c -c private -l authPriv -u "user" -a MD5 -A "pass" -x DES -X "pass" -m ALL 10.0.0.1 1.3.6.1.4