Skip to content

Instantly share code, notes, and snippets.

View JuanjoSalvador's full-sized avatar
🏠
Working from home

Juanjo Salvador JuanjoSalvador

🏠
Working from home
View GitHub Profile
#panel {
background-gradient-direction: none;
background-color: #1d2128;
border-radius: 7px;
margin-top: 3px;
margin-bottom: 3px;
margin-left: 10px;
margin-right: 10px;
height: 35px;
@JuanjoSalvador
JuanjoSalvador / wine-installer.sh
Last active January 30, 2022 21:25
Script to install Wine Staging from WineHQ repositories (Debian)
#!/bin/bash
VERSIONS="buster|bullseye|bookworm"
BRANCHES="stable|devel|staging"
if [ "${UID}" -eq 0 ] ; then
ARCH=$(dpkg --print-architecture)
if [ "${ARCH}" == "amd64" ] ; then
@JuanjoSalvador
JuanjoSalvador / cronometer.html
Created October 26, 2015 09:42
Cronometro en JavaScript
<html>
<head>
<title>Cronómetro</title>
<meta charset="utf-8">
<script>
var cronos;
var tiempo;
@JuanjoSalvador
JuanjoSalvador / python_malware.md
Last active April 8, 2021 21:28
Python code injection: a really, REALLY SIMPLE example of how we can inject malicius code into a Python script.

HOW-TO: Python code injection

A really, REALLY SIMPLE example of how we can inject malicius code into a Python script. For learning and documentation purposes.

Base script.

This is an unoffuscated version of our malicious code (actually dummy and completely safe).

import datetime 
print(int(datetime.datetime.now().timestamp() * 100000))
@JuanjoSalvador
JuanjoSalvador / Trackma Desktop.md
Last active February 15, 2021 14:27
Trackma's Desktop Entry. Open up Trackma as another desktop app.

GNOME Shell

Tested on 3.18.1

  1. Copy trackma.desktop into ~/.local/share/applications/ folder. For all users, put it into /usr/share/applicacions/.
  2. Download icon (available here) and copy it into ~/.local/share/icons/hicolor/128x128/apps/ folder. For all users, change ~/.local/ by /usr/.
  3. Reload gnome-shell by restarting your system.

Trackma Desktop

@JuanjoSalvador
JuanjoSalvador / Dockerfile
Last active January 27, 2021 15:09
Yet Another Docker Example. Now with Python!
FROM alpine:latest
MAINTAINER Juanjo Salvador "juanjosalvador@netc.eu"
RUN apk add python3
COPY ./app.py /app/app.py
ENTRYPOINT ["python3", "/app/app.py"]
@JuanjoSalvador
JuanjoSalvador / .conkyrc
Last active July 28, 2020 18:02
My conky configuration
# Utils conky config
# By Juanjo Salvador (http://juanjosalvador.es)
background no
use_xft yes
xftfont Sans:size=8
xftalpha 1
update_interval 1
total_run_times 0
own_window yes
@JuanjoSalvador
JuanjoSalvador / twitter_crawler.py
Last active March 29, 2020 12:37 — forked from vickyqian/twitter crawler.txt
Script that downloads and counts tweets
import tweepy
import csv
from datetime import date, timedelta, datetime
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''
ACCESS_TOKEN_SECRET = ''
@JuanjoSalvador
JuanjoSalvador / downloader.py
Last active February 17, 2020 16:55
Extracts and decrypt a list of adf.ly links from a forum's post
# -*- coding: utf-8 -*-
import base64, requests, os, re, sys
from bs4 import BeautifulSoup
def _crack(code):
zeros = ''
ones = ''
for n,letter in enumerate(code):
@JuanjoSalvador
JuanjoSalvador / mastodon-memchecker.sh
Created January 3, 2020 20:25
Script that checks your Mastodon instance's process memory usage
#!/bin/bash
systemd-cgtop | grep mastodon* | awk 'BEGIN { printf "%-28s %s", "SERVICE", "MEMORY USAGE\n";
printf "%-28s %s", "-------", "------------\n" }
{ printf "%-30s %10s\n", substr($1, 15), $4 }'