Skip to content

Instantly share code, notes, and snippets.

@ZiTAL
ZiTAL / mosquitto.md
Created January 15, 2024 09:45
podman: Create a mosquitto server and connect from container's python script

MOSQUITTO SERVER

  1. install mosquitto
apt-get install mosquitto mosquitto-clients
  1. add config to create server
echo "allow_anonymous true"  >  /etc/mosquitto/conf.d/nework.conf
@ZiTAL
ZiTAL / pdm-n.md
Last active January 12, 2024 11:12
podman: create a pod with a node simple application through nginx web server

dependencies

su
apt-get install podman golang-github-containernetworking-plugin-dnsname
cd /usr/lib/podman
wget https://github.com/containers/gvisor-tap-vsock/releases/download/v0.7.1/gvproxy-linux-amd64
mv gvproxy-linux-amd64 gvproxy
chmod +x gvproxy
exit
@ZiTAL
ZiTAL / podman.md
Last active January 12, 2024 08:14
podman: zerotik heroiera

podman

  1. add container sources to download from
echo "unqualified-search-registries = ['docker.io', 'ghrc.io', 'quay.io']" > .config/containers/registries.conf
  1. search container
podman search busybox
@ZiTAL
ZiTAL / elhuyar.py
Last active January 11, 2024 07:55
python: elhuyar-i hitzak itzultzeko eskatzeko script-a
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import requests
import re
from lxml import html
def printError(search):
print("Errorea gertatu da, ziur aski sartu duzun hitza ez da hiztegian agertzen")
@ZiTAL
ZiTAL / MediaWiki.py
Last active May 9, 2024 07:19
Mediawiki: How to parse all pages from the Main page and convert it to a pdf
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import requests
import re
class MediaWiki:
def getList(self, aplimit):
@ZiTAL
ZiTAL / fmod.py
Last active November 9, 2023 14:34
python: change modification date to folders/files from lower to higher date alphabetically
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# usage: python3 fmod.py "/home/zital/Music"
import os, sys, datetime
def getResources(path):
resources = []
@ZiTAL
ZiTAL / fstab
Last active November 9, 2023 06:47
gnu/linux: set tmpfs size
# /etc/fstab
#...
tmpfs /tmp tmpfs defaults,rw,nodev,nofail,noatime,nosuid,size=8G 0 0
#...
@ZiTAL
ZiTAL / help.md
Created November 3, 2023 08:30
linux mint: Enable WIFI Broadcom BCM43142

BIOS

ENABLE UEFI and DISABLE Secure Boot

@ZiTAL
ZiTAL / youtube2yewtube.js
Last active October 22, 2023 07:55
violentmonkey: convert youtube links to yewtu.be
// ==UserScript==
// @name YouTube Link Replacer
// @namespace Violentmonkey Scripts
// @match https://www.youtube.com/*
// @match https://m.youtube.com/*
// @grant none
// @run-at document-end
// ==/UserScript==
(function()
@ZiTAL
ZiTAL / LocalSettings.php
Last active November 8, 2023 08:51
mediawiki: nginx + pretty urls + sql backup + crontab
<?php
//...
$wgScriptPath = "";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;
//...