Skip to content

Instantly share code, notes, and snippets.

View tgunr's full-sized avatar

Dave Carlton tgunr

View GitHub Profile
The C compiler identification is AppleClang 11.0.3.11030032
The CXX compiler identification is AppleClang 11.0.3.11030032
The Fortran compiler identification is unknown
Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
Function key behaviour is set in: /sys/module/hid_apple/parameters/fnmode
The following are valid tokens:
Quote:
0 = disabled : Disable the 'fn' key. Pressing 'fn'+'F8' will behave like you only press 'F8'
1 = fkeyslast : Function keys are used as last key. Pressing 'F8' key will act as a special key. Pressing 'fn'+'F8' will behave like a F8.
2 = fkeysfirst : Function keys are used as first key. Pressing 'F8' key will behave like a F8. Pressing 'fn'+'F8' will act as special key (play/pause).
You require 2 to use the function keys as desired. First try this from the command line (as root):
Code:
echo 2 > /sys/module/hid_apple/parameters/fnmode
#How to mount a qcow2 disk image
#This is a quick guide to mounting a qcow2 disk images on your host server.
#This is useful to reset passwords, edit
#files, or recover something without the virtual machine running.
function mount-qcow2 () {
modprobe nbd max_part=8
qemu-nbd --connect=/dev/nbd0 "$1"
fdisk /dev/nbd0 -l
if [[ ! -d "$2"/nbd0p1 ]]; then
@tgunr
tgunr / drop-caches.sh
Created November 15, 2019 14:07
and wait (your prompt won't return immediately, but other processes will continue to run). It will slowly unload the caches (2.5 min for my 24GB cache on 2 pair of raid 1'd 2TB WD blacks on a 2Ghz 4 year old cpu on a box w/64GB) - beware, you will su
echo 3 > /proc/sys/vm/drop_caches
@tgunr
tgunr / Detail.swift
Created October 7, 2019 15:41
Initialize Subview
...
@State var medication: Medication
...
TakeView(hour: $medication.interval)
//
// DosageDetail.swift
// myTracking
//
// Created by Dave Carlton on 10/1/19.
// Copyright © 2019 Dave Carlton. All rights reserved.
//
import SwiftUI
Error: Got Net::HTTPUnauthorized from gist: {"message":"Requires authentication","documentation_url":"https://developer.github.com/v3/gists/#create-a-gist"}
@tgunr
tgunr / syslog
Created June 22, 2019 14:39
syslog smaple
Jun 22 07:07:42 pve plank.desktop[1248]: [3290:3297:0622/070742.163052:ERROR:ssl_client_socket_impl.cc(947)] handshake failed; returned -1, SSL error code 1, net_error -202
Jun 22 07:07:49 pve plank.desktop[1248]: [3290:3297:0622/070749.588213:ERROR:ssl_client_socket_impl.cc(947)] handshake failed; returned -1, SSL error code 1, net_error -202
Jun 22 07:07:54 pve plank.desktop[1248]: [3290:3297:0622/070754.647800:ERROR:ssl_client_socket_impl.cc(947)] handshake failed; returned -1, SSL error code 1, net_error -202
Jun 22 07:07:55 pve plank.desktop[1248]: [3290:3297:0622/070755.687284:ERROR:ssl_client_socket_impl.cc(947)] handshake failed; returned -1, SSL error code 1, net_error -202
Jun 22 07:08:00 pve systemd[1]: Starting Proxmox VE replication runner...
Jun 22 07:08:02 pve systemd[1]: Started Proxmox VE replication runner.
Jun 22 07:08:19 pve plank.desktop[1248]: [3290:3297:0622/070819.565609:ERROR:ssl_client_socket_impl.cc(947)] handshake failed; returned -1, SSL error code 1, net_error -202
# /etc/rsyslog.conf Configuration file for rsyslog.
#
# For more information see
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
#################
#### MODULES ####
#################
# /etc/rsyslog.conf Configuration file for rsyslog.
#
# For more information see
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
#################
#### MODULES ####
#################