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 / 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 / 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 / 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 / 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 }'
@JuanjoSalvador
JuanjoSalvador / settings.ini
Created October 13, 2019 01:02
Telegram's channel admin bot
[DEFAULT]
API_KEY = SET YOUR BOT API KEY HERE
CHANNEL_NAME = SET YOUR @channelname HERE
@JuanjoSalvador
JuanjoSalvador / README.md
Last active October 9, 2019 19:39
Place it on ~/.config/nvim/init.vim

Requirements

Install

  • Copy init.vim into your vim/neovim config (~/.vimrc or ~/.config/nvim/init.vim).
  • Run :PlugInstall command.
  • Reload.
@JuanjoSalvador
JuanjoSalvador / iron.zsh-theme
Created October 8, 2019 19:59
My current zsh theme
#%{$fg_bold[green]%}%n@%m %{$reset_color%}
PROMPT=$'%{$fg[blue]%}[%~]%{$reset_color%} $(git_prompt_info) %{$fg_bold[red]%}→%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""

Keybase proof

I hereby claim:

  • I am JuanjoSalvador on github.
  • I am jsalvador (https://keybase.io/jsalvador) on keybase.
  • I have a public key whose fingerprint is 8650 335F 9B32 25FC 2E18 5395 71EC 2F5C B6EB CF5A

To claim this, I am signing this object:

@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