Skip to content

Instantly share code, notes, and snippets.

@petrofcikmatus
petrofcikmatus / Dockerfile
Last active June 16, 2023 08:08
Automated nginx proxy for Docker containers
FROM php:7.1-apache
RUN apt-get update \
&& apt-get install -y --no-install-recommends git zlib1g-dev libicu-dev \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl gettext zip pdo pdo_mysql \
&& a2enmod rewrite \
&& sed -i 's!/var/www/html!/var/www/web!g' /etc/apache2/sites-available/000-default.conf \
&& mv /var/www/html /var/www/web \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
@renejahn
renejahn / maplotlib_close.py
Created October 5, 2017 12:57
close matplotlib figures via escape button
import sys
import matplotlib.pyplot as plt
def connect_close(figure=None):
def press_key(event):
if event.key == 'escape':
plt.close('all')
sys.exit(0)
if not figure:
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active June 5, 2024 21:05
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@x3rAx
x3rAx / .gitignore
Created August 6, 2015 20:36
Gitignore with .gitkeep
# +----------------------------+
# | IDE files |
# +----------------------------+
/.idea
# +----------------------------+
# | Vagrant |
# +----------------------------+
/.vagrant
@Pysis868
Pysis868 / grub.cfg
Last active May 29, 2024 20:27
My own configuration file for GRUB2 to boot various live distributions of Linux-based operating systems, along with some system tools. I tried to include a lot of sample configuration entries, even if I don't currently use them, so it may help others. Exceedingly long blog post: http://tehfishyblog.logdown.com/chips/306146-a-homemade-ultimate-bo…
# Config for GNU GRand Unified Bootloader (GRUB) (2)
# /boot/grub2/grub.cfg
# or
# /boot/grub/grub.cfg
# Mostly only 'legacy' CSM/BIOS boot methods currently.
# Unable to boot loop entries with Secure Boot
# Notes:
# Description:
# This grub.cfg file was created by Lance http://www.pendrivelinux.com

This is a quick set-up guide on how to install Icecast for Mp3 and Ogg streaming, sort of online radio. Tested on Debian Wheezy. Probably works on Ubuntu, etc. Icecast is a "server-like". It offers the HTTP URL/port through which end-users can play the media. However, Icecast itself does not serve the files. It must get its input from other "client-like" software. For example, Ices0 sends mp3 input to Icecast and then Icecast delivers to the end user. Similarly, Ices2 sends ogg input to Icecast and then Icecast delivers to the end user.

Set up icecast

Start by installing:

sudo apt-get install icecast2
@letmaik
letmaik / voronoi_polygons.py
Last active June 9, 2022 22:16
Creates a Voronoi diagram with cell polygons using scipy's Delaunay triangulation (scipy >= 0.9)
from __future__ import division
import collections
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from scipy.spatial import Delaunay, KDTree
# an adaptation of https://stackoverflow.com/a/15783581/60982
# using ideas from https://stackoverflow.com/a/9471601/60982
@Tom32i
Tom32i / README.md
Last active June 23, 2020 21:04
Simple list hydrator for Symfony2

Simple list hydrator for #Syfmony2

Sample User repository method that return all user names in an array:

/**
 * Find user names
 *
 * @return array
 */

public function findAllNames()

@mkottman
mkottman / figfonts.sh
Created September 30, 2013 12:57
Show all ASCII art figlet fonts installed on your system using the font itself
#!/bin/sh
figlist | awk '/fonts/ {f=1;next} /control/ {f=0} f {print}' | while read font; do
echo "=== $font ==="
echo $font | figlet -f $font
done | less
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>