Skip to content

Instantly share code, notes, and snippets.

View gslin's full-sized avatar

Gea-Suan Lin gslin

View GitHub Profile
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
</head>
<body>
<script>
<!--
let el = 'foo';
@gslin
gslin / cleanfeed.local
Last active October 23, 2023 08:43
Cleanfeed + SpamAssassin
# vim: set syntax=perl
use Mail::SpamAssassin;
my $sa_agent = Mail::SpamAssassin->new();
sub local_filter_last {
return unless $hdr{Path} =~ /google-groups\.googlegroups\.com/;
my %myhdr = %hdr;
#
server {
listen 80;
listen [::]:80;
server_name test3.gslin.com;
root /srv/test3.gslin.com/public;
index index.html;
access_log /var/log/nginx/test3.gslin.com-access.log combined;
return 301 https://$server_name$request_uri;
/**
* Event handler for clicking on an image thumbnail
*
* @param {jQuery.Event} ev
* @ignore
*/
function onClickImage(ev) {
ev.preventDefault();
routeThumbnail($(this).data("thumb"));
}
function _enable( $container, prefix, page, isClosed ) {
...
// Restricted to links created by editors and thus outside our control
// T166544 - don't do this for reference links - they will be handled elsewhere
var $link = $container.find("a:not(.reference a)");
$link.on("click", function () {
// the link might be an internal link with a hash.
// if it is check if we need to reveal any sections.
if (
$link.attr("href") !== undefined &&
File "/home/service-trac/.pyenv/versions/2.7.18/lib/python2.7/site-packages/trac/web/_fcgi.py", line 659, in run
self.process_input()
File "/home/service-trac/.pyenv/versions/2.7.18/lib/python2.7/site-packages/trac/web/_fcgi.py", line 695, in process_input
self._do_params(rec)
File "/home/service-trac/.pyenv/versions/2.7.18/lib/python2.7/site-packages/trac/web/_fcgi.py", line 794, in _do_params
self._start_request(req)
File "/home/service-trac/.pyenv/versions/2.7.18/lib/python2.7/site-packages/trac/web/_fcgi.py", line 778, in _start_request
req.run()
File "/home/service-trac/.pyenv/versions/2.7.18/lib/python2.7/site-packages/trac/web/_fcgi.py", line 571, in run
protocolStatus, appStatus = self.server.handler(self)
from six.moves.urllib.parse import parse_qs, quote
from trac.core import Component, implements
from trac.util import hex_entropy
from trac.util.datefmt import time_now
from trac.util.html import tag
from trac.util.translation import _, tag_
from trac.web import IAuthenticator, IRequestHandler
from trac.web.chrome import Chrome, INavigationContributor
import re
import requests
#!/usr/bin/perl
use v5.14;
use strict;
use warnings;
use IO::File;
use JSON::PP;
use WWW::Mechanize;
#!/bin/sh
set -o allexport
. /dev/stdin <<__GSM2ENV20230330EOF__
$(gcloud secrets versions access latest --secret="$1" || kill $$)
__GSM2ENV20230330EOF__
shift
exec "$@"
@gslin
gslin / gist:12c13db0379693d8932dfcfde1f45e36
Created March 6, 2023 05:57
新買的 TP-Link 的 Wireless USB 網卡抓不到... (Ubuntu 22.04)
[一 三 6 13:52:25 2023] usb 1-4: new high-speed USB device number 7 using xhci_hcd
[一 三 6 13:52:26 2023] usb 1-4: New USB device found, idVendor=2357, idProduct=011f, bcdDevice= 2.00
[一 三 6 13:52:26 2023] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[一 三 6 13:52:26 2023] usb 1-4: Product: 802.11ac WLAN Adapter
[一 三 6 13:52:26 2023] usb 1-4: Manufacturer: Realtek
[一 三 6 13:52:26 2023] usb 1-4: SerialNumber: 00e04c000001