Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
MAX=20 # maximum numbe of loops
LOGFILE=~/tmp/start-and-move.log
rm -f $LOGFILE
log() {
@comhad
comhad / mybot.service
Last active May 17, 2025 20:41
How to setup a systemctl service for running your bot on a linux system
[Unit]
Description=My discord bot service
After=network.target
[Service]
ExecStart=/usr/bin/python3 mybot.py
WorkingDirectory=/home/user/bots/mybot
StandardOutput=inherit
StandardError=inherit
Restart=always
@nilesh-tawari
nilesh-tawari / LUA.lua
Created January 25, 2018 04:11
LUA cheatSheet
-- [[ Cheatsheet for LUA from http://www.newthinktank.com/2015/06/learn-lua-one-video/]]
-- Prints to the screen (Can end with semicolon)
print("Hello World")
--[[
Multiline comment
]]
-- Variable names can't start with a number, but can contain letters, numbers
@paulmach
paulmach / serve.go
Last active January 26, 2025 18:27
Simple Static File Server in Go
/*
Serve is a very simple static file server in go
Usage:
-p="8100": port to serve on
-d=".": the directory of static files to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.
*/
package main
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 4, 2025 14:40
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname