Skip to content

Instantly share code, notes, and snippets.

View iffa's full-sized avatar
☀️
Sun is shining and so are you

Santeri Elo iffa

☀️
Sun is shining and so are you
View GitHub Profile
@klittlepage
klittlepage / ddclient.conf
Last active May 24, 2024 00:17
A ddclient config file for use with Cloudflare. See https://gist.github.com/klittlepage/7243505 for a Cloudflare patch to the 3.8.1 version of ddclient.
daemon=1800 # check every 300 seconds
syslog=yes # log update msgs to syslog
mail=root # mail all msgs to root
mail-failure=root # mail failed update msgs to root
pid=/var/run/ddclient.pid # record PID in file.
ssl=yes # use ssl-support. Works with
# ssl-library
use=web, web=checkip.dyndns.com/, web-skip='IP Address'
cache=/tmp/ddclient.cache
@JamesChevalier
JamesChevalier / mac_utf8_insanity.md
Last active March 25, 2025 09:29
Unicode on Mac is insane. Mac OS X uses NFD while everything else uses NFC. This fixes that.

convmv manpage

Install convmv if you don't have it

sudo apt-get install convmv

Convert all files in a directory from NFD to NFC:

convmv -r -f utf8 -t utf8 --nfc --notest .

@gavinhungry
gavinhungry / nginx-tls.conf
Last active June 13, 2025 19:54
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <[email protected]>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
#
# Additional tips:
#
@AlexKorovyansky
AlexKorovyansky / CheckableImageButton.java
Created March 9, 2015 12:52
Implementation of checkable ImageButton, with behaviour similar to Checkbox and support of state_checked selectors. Based on http://kmansoft.com/2011/01/11/checkable-image-button/
public class CheckableImageButton extends ImageButton implements Checkable {
private boolean checked;
private boolean broadcasting;
private OnCheckedChangeListener onCheckedChangeListener;
private static final int[] CHECKED_STATE_SET = { android.R.attr.state_checked };
public CheckableImageButton(Context context) {
@parmentf
parmentf / GitCommitEmoji.md
Last active July 2, 2025 15:04
Git Commit message Emoji
@lokhman
lokhman / ubuntu-hardening.md
Last active June 4, 2025 23:15
List of things for hardening Ubuntu

WARNING

May contain out of date information. Check the comments below!

The list of actions listed below was taken mostly from Book Of Zeus with minor modifications and did the job well for Ubuntu version, which was available at that moment (May 2016). This gist was created for internal use and was never meant to be discovered by the web, although Google managed to find and index this page, which was a great surprise for me. Please check the original source for the updated information (links are provided in most of the sections), and read the comments below: they provide more details about the usage experience.

System Updates

http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

@antic183
antic183 / remove-utf8-bom.js
Last active June 2, 2025 13:52
remove utf-8 bom with javascript
// remove utf-8 BOM from ressource "res"
// res.charCodeAt(0) === 0xFEFF | res.charCodeAt(0) === 65279
if (res.charCodeAt(0) === 0xFEFF) {
res = res.substr(1);
}
@thomasdarimont
thomasdarimont / App.java
Last active April 18, 2025 07:57
Secure REST API Example with Spring Security, Spring Session, Spring Boot
package demo;
import java.io.Serializable;
import java.security.Principal;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@meetkabeershah
meetkabeershah / default nginx configuration file
Last active January 11, 2025 12:19
The default nginx configuration file inside /etc/nginx/sites-available/default
# Author: Zameer Ansari
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@Uninen
Uninen / packages.md
Created April 25, 2018 13:19
Python Packages

Python Packages

Here's a curated list of interesting and useful Python packages. You can install any package with pip by saying pip install <package-name>. All of the packages on the list are open source.

This list has been collected spesifically for Anders Python Workshop evening. For more comprehensive list of interesting Python packages, take a look at https://github.com/vinta/awesome-python and for all 130k+ packages, search PyPI at https://pypi.org/

Development Tools

  • faker - A package for generating fake data (for example testing purposes)