Skip to content

Instantly share code, notes, and snippets.

View sames's full-sized avatar

Stefan Ames sames

  • Leopoldshöhe, Germany
View GitHub Profile
@dragonfire1119
dragonfire1119 / adguard-home-docker-compose.yml
Last active May 17, 2024 17:58
adguard-home-docker-compose.yml
version: '3' # Specify the Docker Compose version
services:
adguardhome: # Define the service named 'adguardhome'
image: adguard/adguardhome # Use the 'adguard/adguardhome' Docker image
container_name: adguardhome # Set the container name to 'adguardhome'
restart: unless-stopped # Restart the container automatically unless stopped manually
ports: # Map container ports to host ports
# Expose port 53 on TCP and UDP for DNS queries
- "53:53/tcp"

Check and see if port 53 is taken:

lsof -i :53

OR

netstat -tulpn | grep ":53 "
@ethanpil
ethanpil / wp-secure.conf
Created May 12, 2017 16:16
Wordpress Security for NginX
# wp-secure.conf
#
#
# This file includes common security considerations for wordpress using nginx.
#
# The goal is to block actions which are usually dangerous to wordpress.
# Additionally, we block direct access to PHP files and folders which should not
# be accessed directly from a browser.
#
# Also have included exceptions for plugins that are known to require this access.
@sergejmueller
sergejmueller / fastcgi_cache
Last active August 29, 2015 14:05
Nginx-Caching für PHP-generierte Inhalte. Weitere Details: http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html
## DEFAULT
set $no_cache 0;
## RULES
if ( $request_uri ~ "/wp-" ) {
set $no_cache 1;
}
if ( $http_cookie ~ (wp-postpass|wordpress_logged_in|comment_author)_ ) {
set $no_cache 1;
namespace Alphabet
{
public class AlphabetTest
{
public static readonly string Alphabet = "abcdefghijklmnopqrstuvwxyz0123456789";
public static readonly int Base = Alphabet.Length;
public static string Encode(int i)
{
if (i == 0) return Alphabet[0].ToString();
@brainsatwork
brainsatwork / GWT calendar week
Created April 13, 2011 21:10
Calculating calendar weeks in GWT
public static Long calendarWeekIso (Date inputDate) {
Date thisThursday = new Date(inputDate.getYear(), inputDate.getMonth(), inputDate.getDate() - weekday(inputDate) + 4);
Date firstOfJan = new Date(thisThursday.getYear(), 0, 1);
Date firstThursdayOfYear = new Date(thisThursday.getYear(), 0, 1);
while(weekday(firstThursdayOfYear) != 4){
firstThursdayOfYear.setDate(firstThursdayOfYear.getDate() + 1);
}
Date firstMondayOfYear = new Date(firstThursdayOfYear.getYear(), 0, firstThursdayOfYear.getDate() - 3);
Long cw = (thisThursday.getTime() - firstMondayOfYear.getTime())/1000/60/60/24/7 + 1;
return cw;
@darktable
darktable / app.yaml
Created March 16, 2011 19:10
GAE: App.yaml designed for serving a static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May not be neces
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest