Skip to content

Instantly share code, notes, and snippets.

View normic's full-sized avatar
🎯
Focusing

Michael Heumann normic

🎯
Focusing
View GitHub Profile
@anjomro
anjomro / WIFIonICE-Automatic-Login.md
Last active April 4, 2024 23:05 — forked from hacker-bastl/bahn.sh
WIFIonICE Automatic Login

WIFIonICE Automatic Login

This connector intends to automate the process of logging in into the public wifi inside of an IC /ICE of the German railways. The adapter enables does enable you to choose and keep a custom DNS server.

Usage on Linux

The script should be usable on most Linux systems, at least if the following requirements are met:

  • bash
  • ip
  • dig
@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.

@gonvaled
gonvaled / forms.py
Last active June 26, 2021 14:48
Django widget to replace the file selection standard button by an image preview. Tested with Django 1.8.5
from django.forms import ModelForm, FileField
from .models import Campaign
from .widgets import ImagePreviewWidget
class DesignCampaignForm(ModelForm):
brand_logo = FileField(widget=ImagePreviewWidget)
@ralavay
ralavay / vim-nginx-conf-highlight.sh
Last active April 21, 2024 03:58
Enable syntax highlight for Nginx conf file in Vim
#!/bin/bash
#
# Highligh Nginx config file in Vim
# Download syntax highlight
mkdir -p ~/.vim/syntax/
wget http://www.vim.org/scripts/download_script.php?src_id=19394 -O ~/.vim/syntax/nginx.vim
# Set location of Nginx config file
cat > ~/.vim/filetype.vim <<EOF
@gingerlime
gingerlime / change_db_owner.sh
Created April 24, 2012 19:32
Postgresql - Changing ownership on all tables
#!/bin/bash
usage()
{
cat << EOF
usage: $0 options
This script set ownership for all table, sequence and views for a given database
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto
Copyright (c) 2012, Miguel Araujo
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,