Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Juanjo Salvador JuanjoSalvador

🏠
Working from home
View GitHub Profile
@JuanjoSalvador
JuanjoSalvador / python_malware.md
Last active Apr 8, 2021
Python code injection: a really, REALLY SIMPLE example of how we can inject malicius code into a Python script.
View python_malware.md

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 Jan 27, 2021
Yet Another Docker Example. Now with Python!
View Dockerfile
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 Mar 29, 2020 — forked from vickyqian/twitter crawler.txt
Script that downloads and counts tweets
View twitter_crawler.py
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 Jan 3, 2020
Script that checks your Mastodon instance's process memory usage
View mastodon-memchecker.sh
#!/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 Oct 13, 2019
Telegram's channel admin bot
View settings.ini
[DEFAULT]
API_KEY = SET YOUR BOT API KEY HERE
CHANNEL_NAME = SET YOUR @channelname HERE
@JuanjoSalvador
JuanjoSalvador / README.md
Last active Oct 9, 2019
Place it on ~/.config/nvim/init.vim
View README.md

Requirements

Install

  • Copy init.vim into your vim/neovim config (~/.vimrc or ~/.config/nvim/init.vim).
  • Run :PlugInstall command.
  • Reload.
View iron.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=""
View keybase.md

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 Jan 30, 2022
Script to install Wine Staging from WineHQ repositories (Debian)
View wine-installer.sh
#!/bin/bash
VERSIONS="buster|bullseye|bookworm"
BRANCHES="stable|devel|staging"
if [ "${UID}" -eq 0 ] ; then
ARCH=$(dpkg --print-architecture)
if [ "${ARCH}" == "amd64" ] ; then
View copyright.js