Skip to content

Instantly share code, notes, and snippets.

View HerrSpace's full-sized avatar
💭
🧠🔥

Space Meyer HerrSpace

💭
🧠🔥
View GitHub Profile
import get from 'lodash.get';
/**
* Subscribe partially to redux store changes
*
* @example
* subscribe(store, "backup.url", (state, prevState) => console.log("change!", state, prevState));
*
* @param {Redux.Store} store - Redux store
* @param {String} path - Path within the store object that should be watched for change. See https://lodash.com/docs/4.17.15#get
<plist version="1.0">
<dict>
<key>ConsentText</key>
<dict>
<key>default</key>
<string>Installs APN web.vodafone.de IPv4v6</string>
</dict>
<key>PayloadContent</key>
<array>
<dict>
@linuxsimba
linuxsimba / netbox-ansible.py
Created December 10, 2016 06:12
Ansible Netbox Integration Example
#!/usr/bin/python
""" Ansible Inventory Generated From Netbox
Author: Stanley Karunditu <stanley@linuxsimba.com>
License: MIT
Requirements:
* use netbox device roles that result in hyphenated role names. E.g
@dmitrykustov
dmitrykustov / upgrade-postgres-9.4-to-9.6.md
Last active August 8, 2022 17:52 — forked from dideler/upgrade-postgres-9.3-to-9.4.md
Upgrading PostgreSQL from 9.4 to 9.6 on Debian Jessie

To use the most modern version of Postgres software we need to add postgresql repository. Edit /etc/apt/sources.list or create /etc/apt/sources.list.d/pgdg.list and add there a line: deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main Then import the repository signing key, and update the package lists:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update

Install a new version of PostgreSQL server.

Once the Debian upgrade finished, I used dpkg-query -l postgresql* to check which versions of postgres I have installed.

@yrp604
yrp604 / xnu-syscall-life-amd64.md
Last active October 2, 2023 15:59
The life of an XNU unix syscall on amd64

XNU syscall path

Chart

             +------------------+
             |These push their  |                                  +-----------------------+
             |respective syscall|                                  |This overwrites the    |
             |dispatch functions|                                  |saved dispatch function|
             |onto the stack    |                                  |with hndl_alltraps     |
@plushvoxel
plushvoxel / spi_to_bin.py
Created February 12, 2016 21:35
write shit to binary
#!/usr/bin/env python2
import time
import serial
import struct
import binascii
mem_addr = 0x80000000
ser= serial.Serial('/dev/ttyUSB0', 115200, timeout=1)
#!/usr/bin/env python
# coding: utf-8
"""Automate managing an Archlinux repository of AUR-Only packages
Automatically checks the AUR for version changes, rebuilds packages and adds
them to a proper Archlinux repository so you can have your computers use the
latest version without the hassle of manually checking for updates, rebuilding,
package distribution etc pp
#!/usr/bin/bash
# Copyright (c) Joakim Reinert. All rights reserved.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
API_URL='https://api.domrobot.com/xmlrpc/'
TMPDIR='/tmp/inwx-acme'
@julianlam
julianlam / expose-directory-on-host-to-lxc-container.md
Last active April 7, 2024 04:01
Exposing a directory on the host machine to an LXC container #blog

Exposing a directory on the host machine to an LXC container

  1. Log into the container and create an empty directory, this will be the mount point
  2. Log out and stop the container.
  3. Open to your container's config file
    • For regular LXC containers: /var/lib/lxc/mycontainer/config
    • For unprivileged LXC containers: $HOME/.local/share/lxc/mycontainer/config
  4. Add a new line above the lxc.mount directive, that follows the format below. Substitute proper paths as necessary:
    • lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0
  • Both of these paths are relative to the host machine.
package main
import (
"log"
)
func a() []*int {
foo := make([]*int, 10)
for i, v := range foo {