Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexander Dahl LeSpocky

View GitHub Profile
@likema
likema / glibc.cmake
Last active Aug 31, 2021
CMake macro to detect glibc version by filename.
View glibc.cmake
# - Check glibc version
# CHECK_GLIBC_VERSION()
#
# Once done this will define
#
# GLIBC_VERSION - glibc version
#
MACRO (CHECK_GLIBC_VERSION)
EXECUTE_PROCESS (
COMMAND ${CMAKE_C_COMPILER} -print-file-name=libc.so.6
@oseiskar
oseiskar / swagger-yaml-to-html.py
Last active Jan 19, 2022
Converts Swagger YAML to a static HTML document (needs: pip install PyYAML)
View swagger-yaml-to-html.py
#!/usr/bin/python
#
# Copyright 2017 Otto Seiskari
# Licensed under the Apache License, Version 2.0.
# See http://www.apache.org/licenses/LICENSE-2.0 for the full text.
#
# This file is based on
# https://github.com/swagger-api/swagger-ui/blob/4f1772f6544699bc748299bd65f7ae2112777abc/dist/index.html
# (Copyright 2017 SmartBear Software, Licensed under Apache 2.0)
#
@tahiro86j
tahiro86j / nginx config for icecast2
Last active Jan 6, 2022
nginx configuration for reverse-proxying icecast2 streaming server.
View nginx config for icecast2
server {
listen 80;
listen [::]:80;
server_name radio.example.com;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
location / {
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active Jan 16, 2022
Hyperlinks in Terminal Emulators
View Hyperlinks_in_Terminal_Emulators.md
@JonathonReinhart
JonathonReinhart / sample_output
Created Jul 29, 2016
Show Ethernet drivers on Linux
View sample_output
$ ~/what_eth_drivers.sh
eth0 [52:54:00:aa:bb:cc]: virtio_net (up)
eth1 [52:54:00:dd:ee:ff]: virtio_net (up)
eth2 [52:54:00:99:88:77]: virtio_net (up)
lo [00:00:00:00:00:00]: (unknown)
@topheman
topheman / git-notes.md
Created Jun 29, 2015
Git notes cheat sheet
View git-notes.md
@dideler
dideler / upgrade-postgres-9.3-to-9.4.md
Last active Jun 8, 2020
Upgrading PostgreSQL from 9.3 to 9.4 when upgrading Ubuntu 14.04 to 14.10
View upgrade-postgres-9.3-to-9.4.md

TL;DR

Create a backup:

pg_dumpall > mybackup.sql

Perform the upgrade:

sudo pg_dropcluster 9.4 main --stop
View Remove all git tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d