Skip to content

Instantly share code, notes, and snippets.

View koy1619's full-sized avatar
🎯
Focusing

Chris koy1619

🎯
Focusing
View GitHub Profile
@1a57danc3
1a57danc3 / FBI WARNING SSH NOTIFICATION.SH
Last active January 5, 2021 01:31
FBI WARNING SSH NOTIFICATION
#!/bin/bash
# Find out current screen width and hight
_COLUMNS=$(tput cols)
# Set default message if ( input not provided
_MESSAGE=" FBI Warining "
# Calculate x and y coordinates so that we can display $MESSAGE
# centered in the screen
y=$(( ( $_COLUMNS - ${#_MESSAGE} ) / 2 ))
spaces=$(printf "%-${y}s" " ")
# Alright display message stored in $_MESSAGE
@tdoly
tdoly / v2ex_auto_login.py
Last active May 24, 2019 13:28
v2ex 自动登录,领取金币脚本
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
import logging
import datetime
import requests
import BeautifulSoup
from requests.adapters import HTTPAdapter
@hugozhu
hugozhu / douban.php
Created January 3, 2013 05:10
Raspberry Pi上听豆瓣电台的简易方法:sudo apt-get install mpg123 php5-cli,然后执行本程序即可
#!/usr/bin/env php
<?php
function fetch_page($url, $timeout = 5) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
@phpdude
phpdude / nginx.conf
Last active February 28, 2024 04:36
Nginx image filter + caching of results.
location /resize {
alias /tmp/nginx/resize;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;