Skip to content

Instantly share code, notes, and snippets.

View Fonger's full-sized avatar

Fonger Fonger

  • Taipei, Taiwan
  • 10:54 (UTC +08:00)
View GitHub Profile
{
"_id": "5b41b1224f963f29008b8407",
"name": "Fonger",
"username": "fonger",
"password": "$2b$10$aDVxKb.nWwyW/V1kbIfypOP83yltwmkeuO7DvIadJZ60fxGsDHogO",
"labs": [
{
"id": "testdb",
"description": "測試用",
"apiKey": "8f65263ad306bc0e0d765e3dff69fb43",
@Fonger
Fonger / mongo.sh
Last active April 4, 2024 21:13
create an isolated mongo shell with chroot
#check dependencies
for i in `ldd /usr/bin/mongo`;do echo $i;done |grep -v = |grep -v 0x |grep /|xargs ls -l
# manually copy the lib dependencies shown above to choot path
cp xxxxx yyyyy... /path/to/root/of/chroot
# create an user without home directory & login permission
sudo useradd -M -s /bin/false mongoshell
# chroot to the shell and disable critical native method
@Fonger
Fonger / lirc_raw_signal.js
Last active July 3, 2019 11:36
Sending IR Pulse with LIRC in node.js without d.conf file
/*
Copyright (c) 2019 Fonger https://github.com/Fonger
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@Fonger
Fonger / esp-open-rtos-servo-control.c
Last active August 15, 2024 20:03
Servo Control for SG90 (0 to 180 degree) Example using esp-open-rtos
// Servo Control for SG90 (0 to 180 degree)
// MIT License Fonger
// Connect signal pin to NodeMCU D7 (GPIO13)
// add EXTRA_COMPONENTS = extras/pwm to makefile
#include <stdio.h>
#include <FreeRTOS.h>
#include <esp/uart.h>
#include <esp8266.h>
#include <task.h>
@Fonger
Fonger / test.json
Last active May 26, 2020 09:43
test.json
[{"result":true}]
@Fonger
Fonger / is-crawler-regex.js
Created February 1, 2024 08:14
Crawler User-Agent Regex
let i=RegExp("Googlebot\\/|Googlebot-Mobile|Googlebot-Image|Googlebot-News|Googlebot-Video|AdsBot-Google([^-]|$)|AdsBot-Google-Mobile|Feedfetcher-Google|Mediapartners-Google|Mediapartners \\(Googlebot\\)|APIs-Google|bingbot|Slurp|[wW]get|LinkedInBot|Python-urllib|python-requests|aiohttp|httpx|libwww-perl|httpunit|nutch|Go-http-client|phpcrawl|msnbot|jyxobot|FAST-WebCrawler|FAST Enterprise Crawler|BIGLOTRON|Teoma|convera|seekbot|Gigabot|Gigablast|exabot|ia_archiver|GingerCrawler|webmon |HTTrack|grub.org|UsineNouvelleCrawler|antibot|netresearchserver|speedy|fluffy|findlink|msrbot|panscient|yacybot|AISearchBot|ips-agent|tagoobot|MJ12bot|woriobot|yanga|buzzbot|mlbot|YandexBot|YandexImages|YandexAccessibilityBot|YandexMobileBot|YandexMetrika|YandexTurbo|YandexImageResizer|YandexVideo|YandexAdNet|YandexBlogs|YandexCalendar|YandexDirect|YandexFavicons|YaDirectFetcher|YandexForDomain|YandexMarket|YandexMedia|YandexMobileScreenShotBot|YandexNews|YandexOntoDB|YandexPagechecker|YandexPartner|YandexRCA|YandexSearchShop|Y