Skip to content

Instantly share code, notes, and snippets.

View marios88's full-sized avatar

marios88

  • Greece
View GitHub Profile
@marios88
marios88 / gist:add0545e025d66ff8a014ae4df89d525
Created December 19, 2023 10:51
linux Limit speed to 8mb/s
sudo tc qdisc del dev enp4s0 root;sudo tc qdisc add dev enp4s0 root tbf rate 2000kbit limit 800kbit burst 800kbit
@marios88
marios88 / #wg-peer.md
Created September 29, 2023 09:18 — forked from colemar/#wg-peer.md
Manage Wireguard peers (IPv4 only)

Manage Wireguard peers (IPv4 only)

List, add or delete Wireguard peers. Also show client configuration for already added peers.

wg-peer [add|show <peer>|del <peer>|list]

where:

  • a[dd] add a new peer
@marios88
marios88 / gist:83581194edbc9b8c9698d0f28ee28e03
Created February 3, 2023 14:12
Gracefully restart apache2 in docker container under supervisord
# to gracefully restart apache2 in docker container
supervisorctl signal USR1 apache2
@marios88
marios88 / gist:2a7d5c211e8f09b89abfad1e5bce7b6c
Created January 9, 2023 10:25
Scan docker logs and ban ip v4 based on resolved RDNS
docker logs --tail 1000 docker-ahttpd-1 | grep 'sitemap-pt' | awk '{print $1}' | uniq | xargs -i sh -c 'echo -n "{} _ " && dig -x {} +short' | grep -i 'banRDNSHERE\|server\|seznam' | awk '{print $1}' | xargs -i iptables -I INPUT -s {} -j DROP
@marios88
marios88 / gist:4a94a9b4643f7c6a19946bcc69a3db3f
Created July 22, 2022 10:16
Lexmark E460dn slow printer in linux cups
Lexmark E460dn prints are very slow with the defuault PPD provided by Lexmark
Using the Generic PCL 5e Printer Foomatic/ljet4 solves the problem
Connection: socket://192.168.0.0:9100
@marios88
marios88 / index.js
Created June 19, 2022 12:25
Puppeteer Opera open newPage
operaNewPage = async function(browser) {
const browserPages = await browser.pages();
//count pages
console.log((await browser.pages()).length);
const pageCount = (await browser.pages()).length;
const mainPage = (await browser.pages())[0];
await mainPage.evaluate( function (){
window.open('about:blank');
});
@marios88
marios88 / gist:f1c92347cc781f8bc9939e10c5460320
Last active April 25, 2022 19:53
ffmpeg change audio codec to ac3
./mountRPI.sh
// Make audio AC3
ffmpeg -i input.mkv -acodec ac3 -vcodec copy -c:s copy -map 0 -analyzeduration 999999999 -probesize 999999999 ~/RPI/EXTERNAL/Tainies/output.mkv
// Make audio AC3 and remove Subs
ffmpeg -i input.mkv -acodec ac3 -vcodec copy -map 0 -map -0:s -analyzeduration 999999999 -probesize 999999999 ~/RPI/EXTERNAL/Tainies/output.mkv
@marios88
marios88 / gist:031939dd47609a9b3083a1988fc1fd22
Last active September 17, 2021 11:36
Online resize with hpacucli to expand array's logical disk size when new larger disk are added
Replace slot=x
Replace ld ( LD not id ) with target logical disk
> hpacucli
> ctrl slot=2 show config detail
> ctrl slot=2 ld 1 modify size=max
> Warning: Extension may not be supported on certain operating systems.
Performing extension on these operating systems can cause data to
become inaccessible. See ACU documentation for details. Continue?
@marios88
marios88 / danted.conf
Created June 27, 2021 15:52
Dante 1.4 socks5 proxy simple configuration
#logging
logoutput: stdout
#debug: 1
#server address specification
internal: 192.168.1.51 port = 1080
external: eth0
#server identities (not needed on solaris)
#user.privileged: root
@marios88
marios88 / gist:050ad50528edcb7e0a9d98d527f252a9
Created December 22, 2020 14:45
Find PDFs in current folder and subfolders, run ps2pdf with parallel execution and replace on the fly
nohup find . -name '*.pdf' | xargs -n 1 -P 8 -I % sh -c 'ps2pdf "%" - | sponge "%";echo "%"' &