Skip to content

Instantly share code, notes, and snippets.

@justin-schroeder
justin-schroeder / gist:d3ef404e80a7ae658a8d
Last active August 10, 2018 19:54
Installing X-Sendfile on Mac OS X Yosemitee

Installing mod_xsendfile on Mac OS X (Yosemite) [Update: El Capitan]

Update: El Capitan follows the same procedures, but you may have some difficulty with the compile/install, see the secation at the bottom for specific help with El Capitan

Installing mod_xsendfile for apache is atually quite simple, however I could find very little documentation out there. Here's my attempt to help out. In order to proceeed you'll need:

@salex89
salex89 / key_and_certificate_conversions.sh
Last active July 10, 2025 11:00
Different private/public key conversions GnuPG, OpenSSH and OpenSSL
# Source: http://www.sysmic.org/dotclear/index.php?post/2010/03/24/Convert-keys-betweens-GnuPG%2C-OpenSsh-and-OpenSSL
# OpenSSH private keys are directly understable by OpenSSL. You can test for example:
openssl rsa -in ~/.ssh/id_rsa -text
openssl dsa -in ~/.ssh/id_dsa -text
# So, you can directly use it to create a certification request:
openssl req -new -key ~/.ssh/id_dsa -out myid.csr
# You can also use your ssh key to create a sef-signed certificate:
user=root
# disable dns server
port=0
# enable tftp server
enable-tftp
@EiNSTeiN-
EiNSTeiN- / Ubuntu 16.04 on a Surface Book.md
Last active April 20, 2017 02:08
My notes to get decent hardware support with Ubuntu 16.04 for my Surface Book
@atifazad
atifazad / sysquit_commands.md
Last active May 31, 2025 06:48
osascript commands to shutdown, restart, sleep and logout mac

Shut down without showing a confirmation dialog:

osascript -e 'tell app "System Events" to shut down'

Shut down after showing a confirmation dialog:

osascript -e 'tell app "loginwindow" to «event aevtrsdn»'
@loa
loa / README.md
Last active June 29, 2025 07:21
Dual GPG Yubikey Setup

Dual GPG Yubikey Setup

Migrated

These instructions has been migrated to a proper repository loa/dual-gpg-yubikey-setup.

Instructions

If you follow this guide you will end up with an offline and online Yubikey. Use your online Yubikey for everyday life, signing/encryption etc. Offline key for signing keys for web-of-trust and replace lost online keys.

@Jyosua
Jyosua / ImageEx.cs
Last active November 27, 2019 01:44 — forked from andreinitescu/gist:c907c2951a719ed3ac34
Xamarin.Forms Image subclass that finds the aspect needed to fill the view in one axis, and then dynamically expands the view in the other axis to fit the image without scaling.
public class ImageEx : Image
{
public static readonly BindableProperty TrueAspectProperty =
BindableProperty.Create(
propertyName: nameof(TrueAspect),
returnType: typeof(AspectEx),
declaringType: typeof(AspectEx),
defaultValue: AspectEx.AspectFit,
defaultBindingMode: BindingMode.OneWay,
propertyChanged: OnAspectExPropertyChanged);
@yidas
yidas / csr.conf.md
Last active May 19, 2025 18:46
Certificate(CSR) configuration file

Openssl commands:

openssl genrsa -out self-ssl.key
openssl req -new -key self-ssl.key -out self-ssl.csr -config csr.conf
openssl x509 -req -days 365 -in self-ssl.csr -signkey self-ssl.key -out self-ssl.crt -extensions req_ext -extfile csr.conf

Sign from Root CA: openssl x509 -req -days 365 -extensions req_ext -extfile csr.conf -CA RootCA.crt -CAkey RootCA.key -in self-ssl.csr -out self-ssl.crt

#include <string_view>
#include <exception>
#include <assert.h>
using namespace std::literals;
struct guid
{
uint32_t Data1;
uint16_t Data2;
@fecf
fecf / server.cc
Created August 28, 2018 11:37
bare minimum websocket server with c++/winrt
...
using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::Networking::Sockets;
using namespace winrt::Windows::Storage::Streams;
using namespace winrt::Windows::Security::Cryptography;
using namespace winrt::Windows::Security::Cryptography::Core;
StreamSocketListener websocket_;