Skip to content

Instantly share code, notes, and snippets.

View ponsfrilus's full-sized avatar
🤖
Ideas are easy. Execution is everything.

Nicolas Borboën ponsfrilus

🤖
Ideas are easy. Execution is everything.
View GitHub Profile
@ponsfrilus
ponsfrilus / README.md
Last active January 20, 2024 20:26
Replacement between markers

Replacement between markers

I'm looking for a sed command that replace a part of the [target.md] file identified by the <!-- start:block --> and <!-- end:block --> markers.

This part of the file has to be replaced either with [replaceA.md] or [replaceB.md], but the marker have to be there at the end, so we can start the process again.

You can clone this gist to get the files:

@ponsfrilus
ponsfrilus / mal_token.sh
Last active November 12, 2021 23:13
Bash script to retreive a MyAnimeList (MAL) API access Token
#!/usr/bin/env bash
#
# Simplify the TOKEN generation for the My Anime List API (MAL API).
#
# Link to this file: https://gist.github.com/ponsfrilus/5fa501752595c972f568b61fb192e8b5
#
# Usage:
# export MAL_CLIENT_ID='phiequ3nah4phohqu7aephae5va8eePu' MAL_CLIENT_SECRET='oof1EilohLaimeigi5eithei0Johlai4hud2EiTee8Ien3iRieTouSeiv1phaiti';
# ./mal_token.sh [--refresh]
# Note: these are pwgen generated, they won't work.
@ponsfrilus
ponsfrilus / puppeteer timeline
Last active January 28, 2019 09:59
puppeteer timeline
This file has been truncated, but you can view the full file.
{"traceEvents":[{"pid":305,"tid":305,"ts":493945222891,"ph":"X","cat":"toplevel","name":"ThreadControllerImpl::DoWork","args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"},"dur":52,"tdur":52,"tts":31828},
{"pid":305,"tid":305,"ts":493945222971,"ph":"X","cat":"toplevel","name":"ThreadControllerImpl::DoWork","args":{"src_file":"../../base/trace_event/trace_log.cc","src_func":"SetEnabled"},"dur":510,"tdur":142,"tts":31908},
{"pid":305,"tid":305,"ts":493945222986,"ph":"S","cat":"toplevel","name":"RendererAudioState","args":{},"tts":31926,"id":"0xaf62a16724f057fc"},
{"pid":305,"tid":305,"ts":493945222986,"ph":"T","cat":"toplevel","name":"RendererAudioState","args":{"step":"silent"},"tts":31938,"id":"0xaf62a16724f057fc"},
{"pid":305,"tid":305,"ts":493945223014,"ph":"S","cat":"toplevel","name":"RendererVisibility","args":{},"tts":31954,"id":"0xaf62a16724f057fc"},
{"pid":305,"tid":305,"ts":493945223014,"ph":"T","cat":"toplevel","name":"RendererVisibility","args":{"step":"renderer_visible"
// ANSI Terminal stlye \u001B[1municorn\u001B[22m
// ZWJ https://en.wikipedia.org/wiki/Zero-width_joiner 👶
// UNICODE ☆ 🤓 え 术
const testStrings = [
'2189☆ 404⑂ nodejs-learning-guide (@chyingp/Ruby)',
'Nodejs学习笔记以及经验总结,公众号"程序猿小卡"',
'🤓 Build your own (insert technology here)',
'后端架构师技术图谱',
'☆🤓端',
'☆ 🤓 端',

Keybase proof

I hereby claim:

  • I am ponsfrilus on github.
  • I am ponsfrilus (https://keybase.io/ponsfrilus) on keybase.
  • I have a public key ASCzdwhckqxbeRLBlopkjO0axj0uZBZ3ZDihPYNHmWytLwo

To claim this, I am signing this object:

@ponsfrilus
ponsfrilus / generate_config_files.sh
Created June 22, 2017 13:23
./opt/piratebox/bin/generate_config_files.sh
/media/nbo/fd472eba-571d-4583-8873-97f09353655c # cat ./opt/piratebox/bin/generate_config_files.sh root@X1
#!/bin/sh
# Matthias Strubel (c) 2013-2014
# licenced with GPL-3
#
# Generate severall configuration files out of piratebox.conf
# conf/hosts_generated
# conf/dnsmasq_generated.conf
# conf/radvd_generated.conf
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<OOBE>
<HideEULAPage>true</HideEULAPage>
<NetworkLocation>Work</NetworkLocation>
<ProtectYourPC>1</ProtectYourPC>
<SkipMachineOOBE>true</SkipMachineOOBE>
<SkipUserOOBE>true</SkipUserOOBE>
@ponsfrilus
ponsfrilus / setup-osf.sh
Last active July 28, 2016 14:51
Setting up the Open Semantic Framework
#!/bin/bash
# Setting up the Open Semantic Framework
# https://github.com/structureddynamics/Open-Semantic-Framework-Installer#installing-the-open-semantic-framework
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# 1. Change localhost to osf
@ponsfrilus
ponsfrilus / install-osh.sh
Created July 28, 2016 14:40
Installing the Open Semantic Framework
#!/bin/bash
# Installing the Open Semantic Framework
# https://github.com/structureddynamics/Open-Semantic-Framework-Installer#installing-the-open-semantic-framework
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
hostname osf
@ponsfrilus
ponsfrilus / dmesg.txt
Created February 17, 2016 15:59
Lenovo ThinkPad W451 dmesg (installed)
lis@W541:~$ dmesg
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.2.0-16-generic (buildd@lcy01-07) (gcc version 5.2.1 20151003 (Ubuntu 5.2.1-21ubuntu2) ) #19-Ubuntu SMP Thu Oct 8 15:35:06 UTC 2015 (Ubuntu 4.2.0-16.19-generic 4.2.3)
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.2.0-16-generic root=UUID=4b9dde04-c133-455f-8aee-7af149375f71 ro priority=low nouveau.modeset=0 quiet splash vt.handoff=7
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Centaur CentaurHauls