Skip to content

Instantly share code, notes, and snippets.

View made-by-love's full-sized avatar
🎯
Focusing

Goblin made-by-love

🎯
Focusing
  • San Jose
View GitHub Profile
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@made-by-love
made-by-love / calender.md
Created August 2, 2021 09:08 — forked from yulanggong/calender.md
日历标准格式研究

日历标准格式研究

日历的导入导出

格式

现在通用的日历格式是 iCalendar,通常扩展名是 .ics

BEGIN:VCALENDAR #日历开始
@made-by-love
made-by-love / sysctl.conf
Created November 18, 2019 14:29 — forked from voluntas/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@made-by-love
made-by-love / environment_variables_for_php_applications.md
Created February 17, 2019 09:56 — forked from CMCDragonkai/environment_variables_for_php_applications.md
Environment Variables for PHP Applications #php #configuration

Environment variables for PHP Applications

According to 12 factor app, the best way to configure things for deployment is through environment variables, not necessarily environment variable files, but just any environment variables. The problem is how to get environment variables into PHP. It is quite complicated depending on what you're doing.

The first step is to make sure you're using getenv in PHP for environment variables as the $_ENV array may not be set unless you set variables_order=EGPCS in the INI settings. This is enough for command line PHP applications including the command line PHP server.

If you're running PHP through Apache either via mod_php or CGI, the only way is to use an .htaccess file along the path from the index.php to the document root and to use SetEnv NAME Value directives. Or you put them into the Virtual Host block inside Apache configuration.

If you're using NGINX + PHP-FPM. You have 3 options:

Set up L2TP/IPsec VPN on Debian

Set up IPsec

Set up networking

@made-by-love
made-by-love / config.json
Created May 16, 2018 07:50 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",

如何在路由器中实现透明代理?

0 互联网现状

目前整个互联网环境,被破坏最严重地部分,是 Web 服务体验。当直接破坏难以实现时,就会从流程链的上下游着手,如:DNS 污染。

其它地互联网服务类型,例如:邮件,可能小部分会受到 Web 服务上下游破坏地余震,但整体上基本不受影响。

@made-by-love
made-by-love / dns.py
Created February 3, 2017 05:44 — forked from infra-0-0/dns.py
python3.5 asyncio dns resolver, based on code from who knows where
"""
The most simple DNS client written for Python with asyncio:
* Only A record is support (no CNAME, no AAAA, no MX, etc.)
* Almost no error handling
* Doesn't support fragmented UDP packets (is it possible?)
"""
import asyncio
import logging