Skip to content

Instantly share code, notes, and snippets.

View gnh1201's full-sized avatar
๐Ÿ‰
Your Watermelon OPEN UP!

Namhyeon, Go gnh1201

๐Ÿ‰
Your Watermelon OPEN UP!
View GitHub Profile
@gnh1201
gnh1201 / deobfusate_ps.py
Last active October 4, 2023 11:16
Powershell format string deobfusation
# Namhyeon Go <abuse@catswords.net>
# 2023-10-04
import re
# Text to search (Example text using PowerShell format strings)
text = """
&("{0}{1}{2}" -f 'Set','-Var','iable')
&("{0} {1} {2}" -f 'Set','-Var','iable')
&("This is a test {0}" -f 'arg1')
@gnh1201
gnh1201 / error.log
Last active September 9, 2023 21:12
IBM Cloud Language Translator in Mastodon (Not working yet)
Sep 9 20:44:08 gosomi bundle[782892]: [26a0d58f-e22c-4219-9dcd-6a04f953ced0] method=POST path=/api/v1/statuses/111036983556043247/translate format=html controller=Api::V1::Statuses::TranslationsController action=create status=500 error='NoMethodError: undefined method `model_name' for Request:Class
Sep 9 20:44:08 gosomi bundle[782892]: [26a0d58f-e22c-4219-9dcd-6a04f953ced0]
Sep 9 20:44:08 gosomi bundle[782892]: [26a0d58f-e22c-4219-9dcd-6a04f953ced0] NoMethodError (undefined method `model_name' for Request:Class
Sep 9 20:44:08 gosomi bundle[782892]: [26a0d58f-e22c-4219-9dcd-6a04f953ced0]
Sep 9 20:44:08 gosomi bundle[782892]: [26a0d58f-e22c-4219-9dcd-6a04f953ced0] app/controllers/api/v1/statuses/translations_controller.rb:14:in `create'
Sep 9 20:44:08 gosomi bundle[782892]: [26a0d58f-e22c-4219-9dcd-6a04f953ced0] app/controllers/concerns/localized.rb:11:in `set_locale'
Sep 9 20:44:08 gosomi bundle[782892]: [26a0d58f-e22c-4219-9dcd-6a04f953ced0] lib/mastodon/rack_middleware.rb:9:in `call'
@gnh1201
gnh1201 / ipfs_nat.md
Created August 19, 2023 10:37
IPFS configuration with NAT

IPFS configuration with NAT

IPFS (here, referring to go-ipfs or kubo) already supports NAT environments, but there is a lack of documentation explaining this, leading to difficulties in configuration for many users.

Below is an configuration example for supporting NAT environments in IPFS.

{
	"Addresses": {
 "API": "/ip4/0.0.0.0/tcp/5001",
@gnh1201
gnh1201 / video-trancoding-mastodon.md
Last active July 20, 2024 09:51
How to accelerate video trancoding (FFmpeg) in Mastodon

How to accelerate video trancoding (FFmpeg) in Mastodon

Let's build a remote video transcoder (FFmpeg) for Mastodon!

This post may be outdated. Please check https://github.com/gnh1201/topic-activitypub/blob/main/ffmpeg.md

Why?

Whenever there were incidents or similar events on X (formerly, Twitter), such as on July 1st, the Sidekiq queue in Mastodon would expand, resulting in latency exceeding 10 hours. However, no matter how many photos or videos were being exchanged, it seemed unreasonable in a network where text communication was the primary focus. Eventually, when I disabled all multimedia processing-related features, the latency dropped to zero.

Before following this tutorial

@gnh1201
gnh1201 / rqlite.env
Created June 12, 2023 07:44
rqlite with systemd
INTERFACE=venet0
NODE_ID=1
HTTP_PORT=2001
RAFT_PORT=2002
JOIN=
@gnh1201
gnh1201 / index.php
Created March 24, 2023 08:39
Extract all environment data from PHP runtime
<?php
// Extract all environment data from PHP runtime
// Go Namhyeon <abuse@catswords.net>
echo "Extracting...<br/><br/>";
$extracted_data = array();
// Extracting all defined functions
echo "Extracting all defined functions...<br/><br/>";
@gnh1201
gnh1201 / vault.repo
Last active March 16, 2023 20:20
CentOS vault (6.10) repo file example
# wget [this file URL]
# mv /etc/yum.repos.d /etc/yum.repos.d.old
# mkdir /etc/yum.repos.d
# cp vault.repo /etc/yum.repos.d/
# yum clean all
# yum update
[Catswords-C6.10-base]
name=Catswords-CentOS-6.10 - Base
baseurl=http://repo.catswords.com/centos-vault/6.10/os/$basearch/
@gnh1201
gnh1201 / _badbots.conf
Last active September 13, 2022 09:25
nginx _badbots.conf
map $http_user_agent $badbots {
~*(Slurp) 1;
~*([wW]get) 1;
~*(LinkedInBot) 1;
~*(Python-urllib) 1;
~*(python-requests) 1;
~*(aiohttp) 1;
~*(httpx) 1;
~*(libwww-perl) 1;
~*(httpunit) 1;
@gnh1201
gnh1201 / set-up-chromium-keys.md
Last active August 30, 2022 11:17 — forked from cvan/set-up-chromium-keys.md
Launch Chromium with API Keys on Mac OS X and Windows

Sometimes you need to use API Keys to use things like the Speech API. And then you Google a bit and follow all the instructions. But the Chromium Project's API Keys page does a not-so-great of explaining how to do this, so I will.

  1. Download Chromium.
  2. You'll notice a yellow disclaimer message appear as a doorhanger: Google API Keys are missing. Some functionality of Chromium will be disabled. Learn More.
  3. Clicking on that link takes you to the confusing API Keys docs page.
  4. If you aren't already, subscribe to the chromium-dev@chromium.org mailing list. (You can just subscribe to the list and choose to not receive any mail. FYI: the Chromium project restricts the APIs to those subscribed to that group - that is, Chromium devs.)
  5. Make sur
@gnh1201
gnh1201 / api.tistory.us.txt
Created August 25, 2022 03:35
api.tistory.us honeypot
172.70.222.28 - - [25/Aug/2022:00:18:24 +0900] "GET /entry.php HTTP/1.1" 200 9 "http://www.yega.co.kr/index.php" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
143.92.32.36 - - [25/Aug/2022:00:45:51 +0900] "GET /v82991.html HTTP/1.1" 404 199 "https://m.sm.cn/s?q=www.zkhyy.com&from=smor&safe=1&snum=0" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 YisouSpider/5.0 Safari/537.36"
172.70.233.44 - - [25/Aug/2022:00:56:21 +0900] "GET /entry.php HTTP/1.1" 200 9 "http://kdy.raonweb.com/m/bbs/board.php?bo_table=music&wr_id=2" "mozilla/5.0 (linux; android 7.0;) applewebkit/537.36 (khtml, like gecko) mobile safari/537.36 (compatible; petalbot;+https://webmaster.petalsearch.com/site/petalbot)"
172.68.118.130 - - [25/Aug/2022:01:36:48 +0900] "GET /entry.php HTTP/1.1" 200 9 "http://www.dongha.net/index.php" "Mozilla/5.0 (compatible; SEOkicks; +https://www.seokicks.de/robot.html)"
172.68.118.130 - - [25/Aug/2022:01:44:59 +0900] "GET /entry.php