Skip to content

Instantly share code, notes, and snippets.

View Exagone313's full-sized avatar
🌠
Working from the stars

Elouan Martinet Exagone313

🌠
Working from the stars
View GitHub Profile
package exa.gone;
import org.eclipse.jetty.client.HttpClient;
public class Main {
public static void main(String[] args) {
HttpClient httpClient = new HttpClient();
try {
httpClient.newRequest("http://127.0.0.1:81/")
#!/usr/bin/env php
/**
* @author Elouan Martinet <exa@elou.world>
* @copyright Copyright (c) 2017, Elouan Martinet
* @license AGPL-3.0+
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
@Exagone313
Exagone313 / cbr2cbz.zsh
Created October 11, 2017 23:50
Convert cbr to cbz (comic book archives)
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@Exagone313
Exagone313 / gist:bfb77c90854d26949dd9b2b99eda6b2a
Created June 15, 2017 12:10
systemctl start mastodon-streaming
Jun 15 14:05:59 archlinux.elou.world systemd[1]: Started mastodon-streaming.
Jun 15 14:06:00 archlinux.elou.world npm[18372]: > mastodon@ start /var/lib/mastodon/live
Jun 15 14:06:00 archlinux.elou.world npm[18372]: > rimraf ./tmp/streaming && babel ./streaming/index.js --out-dir ./tmp && node ./tmp/streaming/index.js
Jun 15 14:06:02 archlinux.elou.world npm[18372]: ./streaming/index.js -> tmp/streaming/index.js
Jun 15 14:06:03 archlinux.elou.world npm[18372]: /var/lib/mastodon/live/node_modules/uws/uws.js:38
Jun 15 14:06:03 archlinux.elou.world npm[18372]: throw new Error('Compilation of µWebSockets has failed and there is no pre-compiled binary ' +
Jun 15 14:06:03 archlinux.elou.world npm[18372]: ^
Jun 15 14:06:03 archlinux.elou.world npm[18372]: Error: Compilation of µWebSockets has failed and there is no pre-compiled binary available for your system. Please install a supported C++11 compiler and reinstall the module 'uws'.
Jun 15 14:06:03 archlinux.elou.world npm[18372]: at nat
(gdb) bt
#0 0x00007ffff6c96f22 in fwrite () at /usr/lib/libc.so.6
#1 0x0000000000455bbe in SPI_Firmware::Reset() () at /build/packages/melonds/src/melonds-git/src/SPI.cpp:138
#2 0x0000000000456a4c in SPI::Reset() () at /build/packages/melonds/src/melonds-git/src/SPI.cpp:607
#3 0x0000000000444ed8 in NDS::Reset() () at /build/packages/melonds/src/melonds-git/src/NDS.cpp:496
#4 0x00000000004457b4 in NDS::LoadBIOS() () at /build/packages/melonds/src/melonds-git/src/NDS.cpp:725
#5 0x0000000000410b74 in OnRun(uiMenuItem*, uiWindow*, void*) (item=0x12cdf60, window=0x125e080, blarg=0x0) at /build/packages/melonds/src/melonds-git/src/libui_sdl/main.cpp:1939
#6 0x000000000048fd4b in onClicked (menuitem=0x11ca3b0, data=0x12cdf60) at /build/packages/melonds/src/melonds-git/src/libui_sdl/libui/unix/menu.c:79
#7 0x00007ffff742be55 in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#8 0x00007ffff7418ec7 in () at /usr/lib/libgobject-2.0.so.0
<?php
/**
* @author Elouan Martinet <exa@elou.world>
* @copyright Copyright (c) 2016-2017, Elouan Martinet
* @license AGPL-3.0+
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
@Exagone313
Exagone313 / 2048.diff
Last active November 6, 2022 10:40
Mastodon 2048 character limit patch
diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js
index 4620d1c43..3028bb684 100644
--- a/app/javascript/mastodon/features/compose/components/compose_form.js
+++ b/app/javascript/mastodon/features/compose/components/compose_form.js
@@ -90,7 +90,7 @@ class ComposeForm extends ImmutablePureComponent {
const fulltext = this.getFulltextForCharacterCounting();
const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0;
- return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (isOnlyWhitespace && !anyMedia));
+ return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 2048 || (isOnlyWhitespace && !anyMedia));
@Exagone313
Exagone313 / README.md
Created July 31, 2023 14:48
AWS S3 deletion

AWS S3 deletion

Do not use in production

@Exagone313
Exagone313 / Dockerfile
Created November 19, 2023 11:19
Mastodon patched Docker image
FROM ghcr.io/mastodon/mastodon:v4.1.10
RUN sed -i 's/500/2048/g' app/javascript/mastodon/features/compose/components/compose_form.js && \
sed -i 's/500/2048/g' app/validators/status_length_validator.rb && \
sed -i 's/300/2048/g' app/models/rule.rb
# ---
# Code below is copied from the end of https://github.com/mastodon/mastodon/blob/v4.1.10/Dockerfile
# ---
# Set the run user