Skip to content

Instantly share code, notes, and snippets.

View moonstruck's full-sized avatar
🏠
Working from home

Abdullah Al Mamun moonstruck

🏠
Working from home
View GitHub Profile
@ryan-blunden
ryan-blunden / .env
Last active February 28, 2025 02:57
Python Application Config and Secrets Class
API_KEY="357A70FF-BFAA-4C6A-8289-9831DDFB2D3D"
HOSTNAME="0.0.0.0"
PORT="8080"
# Optional
# DEBUG="True"
# ENV="development"
@linuxkathirvel
linuxkathirvel / fix-domain-name-provided-is-not-valid-according-to-RFC-1034_1035.md
Last active November 8, 2024 07:22
How to fix "DisallowedHost at / Invalid HTTP_HOST header:. The domain name provided is not valid according to RFC 1034/1035." error in Django?

How to fix "DisallowedHost at / Invalid HTTP_HOST header:. The domain name provided is not valid according to RFC 1034/1035." error in Django?

Solution

  • Don't add include proxy_params; in Django application's NGINX configuration file.
  • Cross-check the Django application's NGINX configuration. If include proxy_params; line added, remove it.
  • proxy_params(/etc/nginx/proxy_params) file have proxy_set_header Host $http_host; line already. It will override proxy_set_header Host $host;

Related notes

  1. Security configurations in Django while deploying on production
  2. How to fix ERR_TOO_MANY_REDIRECTS issue in Django+Gunicorn+NGINX?

References

Phoenix 1.4.x to 1.5.0 upgrade instructions

Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v on the command line.

Install the new phx.new project generator

$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 8, 2025 14:18
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@AlexBrasileiro
AlexBrasileiro / index.js
Last active November 17, 2024 01:09
ShareYourFeedback
// inspiration: https://dribbble.com/shots/4370657-Share-Your-Feedback
import React, { Component, Fragment } from "react";
import { Animated, StyleSheet, Text, View, TouchableOpacity, Dimensions, Platform, Easing, TextInput, KeyboardAvoidingView, Image } from "react-native";
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
const { width: windowWidth } = Dimensions.get('window');
const Icon = (props) => <FontAwesome5 {...props} />
@duhaime
duhaime / headless.py
Last active February 16, 2023 23:19
Python Selenium Headless Chrome OSX
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--headless")
chrome_options.binary_location = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
driver = webdriver.Chrome(executable_path='/usr/local/bin/chromedriver', chrome_options=chrome_options)
driver.get("http://www.duo.com")
@mrbar42
mrbar42 / README.md
Last active March 14, 2025 21:14
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster
@sidferreira
sidferreira / RootNavigator.js
Last active February 8, 2022 13:42
React Navigation + MobX Integration (React Native Based)
// App/RootNavigator.js
import { StackNavigator } from 'react-navigation'
import AScreen from '../Containers/AScreen'
import BScreen from '../Containers/BScreen'
const RootNavigator = StackNavigator(
{
A: { screen: AScreen },
@nguyenkims
nguyenkims / log.py
Last active February 13, 2024 07:59
Basic example on how setup a Python logger
import logging
import sys
from logging.handlers import TimedRotatingFileHandler
FORMATTER = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
LOG_FILE = "my_app.log"
def get_console_handler():
console_handler = logging.StreamHandler(sys.stdout)
console_handler.setFormatter(FORMATTER)
@ibraheem4
ibraheem4 / postgres-brew.md
Last active February 11, 2025 10:40 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update