Skip to content

Instantly share code, notes, and snippets.

View matheusfillipe's full-sized avatar

Matheus Fillipe matheusfillipe

  • https://gitlab.com/matheusfillipeag
  • Germany
View GitHub Profile
@matheusfillipe
matheusfillipe / quickIrcBot.py
Last active March 10, 2021 18:26
A Quick and simple Irc Bot
import socket, time, re
# Not supposed to look pretty, supposed to look short and ugly
send_ = lambda client, channel, m: client.send(f"PRIVMSG {channel} :{m}\r\n".encode()) #sends a private message to the channel or user PM if you pass a nickname
raw_send_ = lambda client, m: client.send(f"{m}\r\n".encode()) #Use this to implrement more methods: https://tools.ietf.org/html/rfc1459
#This is a work in progress... pass in a number like 3 or 4 and send some messages
recv_ = lambda client, n: list(map(lambda g: [g.group(1), g.group(2)], filter(lambda m: m, map(lambda m: re.match(r'^.*PRIVMSG (.*) :(.*)\r$', m), filter(lambda m: "PRIVMSG" in m, [client.recv(1024).decode('utf-8') for i in range(n)])))))
# Why not create a class? Because it's not funny!
def Bot(host, port=6667, name="botty", channel="#lobby"):
import socket, time, re, trio
from IrcBot.bot import IrcBot, utils
import logging
import threading
import urllib.request
from random import randint, choice
from cleverbot_free.cbapi import CleverBot
url = "http://www.storage.dot.org.es/trivia/questions.txt"
res = urllib.request.urlopen(url)
hello im testing wgetpaste now
rofi usage:
rofi [-options ...]
Command line only options:
-no-config Do not load configuration, use default values.
-v,-version Print the version number and exit.
-dmenu Start in dmenu mode.
-display [string] X server to contact.
${DISPLAY}
-h,-help This help message.
@matheusfillipe
matheusfillipe / homematheus.configroficonfig.rasi
Created June 15, 2021 20:28
/home/matheus/.config/rofi/config.rasi
configuration {
theme: "~/.config/rofi/themes/dt-center.rasi";
modi: "window,run,drun,ssh,file-browser,windowcd,combi,calc";
terminal: "/usr/bin/alacritty";
ssh-client: "/usr/bin/mosh";
ssh-command: "{terminal} -t {host} --class ssh_client -e {ssh-client} mattf -- mosh {host} -- tmux a";
sorting-method: "fzf";
matching: "fuzzy";
sort: true;
drun-use-desktop-cache: true;
@matheusfillipe
matheusfillipe / homematheus.configroficonfig.rasi
Created June 15, 2021 20:29
/home/matheus/.config/rofi/config.rasi
configuration {
theme: "~/.config/rofi/themes/dt-center.rasi";
modi: "window,run,drun,ssh,file-browser,windowcd,combi,calc";
terminal: "/usr/bin/alacritty";
ssh-client: "/usr/bin/mosh";
ssh-command: "{terminal} -t {host} --class ssh_client -e {ssh-client} mattf -- mosh {host} -- tmux a";
sorting-method: "fzf";
matching: "fuzzy";
sort: true;
drun-use-desktop-cache: true;
@matheusfillipe
matheusfillipe / homematheus.configroficonfig.rasi
Created June 15, 2021 20:29
/home/matheus/.config/rofi/config.rasi
configuration {
theme: "~/.config/rofi/themes/dt-center.rasi";
modi: "window,run,drun,ssh,file-browser,windowcd,combi,calc";
terminal: "/usr/bin/alacritty";
ssh-client: "/usr/bin/mosh";
ssh-command: "{terminal} -t {host} --class ssh_client -e {ssh-client} mattf -- mosh {host} -- tmux a";
sorting-method: "fzf";
matching: "fuzzy";
sort: true;
drun-use-desktop-cache: true;
$ -X
bash: -X: invalid option
Usage: bash [GNU long option] [option] ...
bash [GNU long option] [option] script-file ...
GNU long options:
--debug
--debugger
--dump-po-strings
--dump-strings
--help
$ -X
bash: -X: invalid option
Usage: bash [GNU long option] [option] ...
bash [GNU long option] [option] script-file ...
GNU long options:
--debug
--debugger
--dump-po-strings
--dump-strings
--help
#!/bin/bash
service=$(wgetpaste -S | awk 'NR > 3{print $1}' | sed 's/\*//g' | rofi -dmenu -p service)
lang=$(wgetpaste -s "$service" -L | awk '{print $1}')
wgetpaste -s "$service" -l "$lang" -x -X -C