Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
for filename in Memoranda\\*; do
base=$(echo -En "${filename}" | sed 's:\\:/:g' | sed "s:'::g" | xargs dirname)
fname=$(echo -En "${filename}" | sed 's:\\:/:g' | sed "s:'::g" | xargs basename)
mkdir -p ${base}
mv $filename ${base}/${fname}
done
@jtsagata
jtsagata / cTree.cpp
Last active December 25, 2018 17:22
Print a christmas tree
#include <algorithm>
#include <cassert>
#include <iostream>
#include <string>
#include <vector>
// Not C++20 yet
// https://github.com/HowardHinnant/date
#include "date.h"
@jtsagata
jtsagata / python_print.cpp
Created December 23, 2018 10:02
a C++ implementation of a Python-style print statement that doesn't need parentheses:
/* http://madebyevan.com/obscure-cpp-features/ */
#include <iostream>
namespace __hidden__ {
struct print {
bool space;
print() : space(false) {}
~print() { std::cout << std::endl; }
template <typename T>
1. https://xrysoi.online
2. xrysoi.se
3. xrysoi.eu
4. http://gamatotv.me
5. thegmtv.org,
6. gamatotv.to
7. httρs://onlinemoviestar.xyz
8. onlinemoviestar.com
9. tainies.online
10. tenies.online
@jtsagata
jtsagata / dirty_flax.lua
Created March 5, 2018 18:01
A qucick hack on flax macro
-- flax_stable.lua v1.2 -- by Jimbly, tweaked by Cegaiel and
-- KasumiGhia, revised by Tallow.
--
-- Plant flax and harvest either flax or seeds.
--
-- Works Reliably: 2x2, 3x3, 4x4, 5x5
-- May Work (depends on your computer): 6x6, 7x7
--
dofile("common.inc");
@jtsagata
jtsagata / logger-app.py
Created September 28, 2017 16:14
A Simple GUI to show syslog
#!/usr/bin/python3
import signal, os, gi
# You may need to adjust the versions, or just comment
gi.require_version('Gtk', '3.0')
gi.require_version('Vte', '2.91')
from gi.repository import GLib, Gtk, Vte, Gdk, Pango
signal.signal(signal.SIGINT, signal.SIG_DFL)
@jtsagata
jtsagata / lesson2.md
Last active March 8, 2022 14:02
Μαθήματα Bash: Προσδοκίες και expect

Μαθήματα Bash: Προσδοκίες και expect

Στην συνέχεια της σειράς μαθημάτων για το Bash Scripting σήμερα θα δούμε για την εντολή expect. Το πρώτο μέρος της σειράς πήρε καλές κριτικές. Μένει να δούμε αν το παρόν πόνημα θα δικαιώσει τις προσδοκίες του δύσκολου κοινού. Εφοδιαζόμαστε και καφέ καθαρό κεφάλι και είμαστε έτοιμοι

Προετοιμασία

Επειδή το πάν είναι η καλή οργάνωση, ας οργανωθούμε πρώτα λίγο. Επειδή στην πορεία θα φτιάξουμε πολλές εντολές, καλό είναι αυτές να τις έχουμε σε ένα φάκελο. Εμένα που αρέσει να τις έχω στον φάκελο ~/.local/bin.

Και γιατί βρε αδελφάκι, δεν τις βάζεις σε ένα φάκελο που να έχει το όνομα "εντολές"; Ελληνικά δεν ξέρεις; Και τέλος πάντων τι είναι αυτές οι καλικατσούνες "." και "~";

@jtsagata
jtsagata / jupiter_launcher.sh
Last active September 23, 2017 11:23
Launcher for jupyter notebook
#!/bin/bash
# Remember to first run
# aptapt install jq xdotool
jupyter=${HOME}/anaconda3/bin/jupyter
notebooks=${HOME}/MasterAdventures
terminal_name="Anaconda Kernel"
#!/bin/bash
#Heith Seewald 2012
#Feel free to extend/modify to meet your needs.
#Maya on Ubuntu v.1
#This is the base installer... I’ll add more features in later versions.
#if you have any issues, feel free email me at heiths@gmail.com
#### Lets run a few checks to make sure things work as expected.
#Make sure we’re running with root permissions.
if [ `whoami` != root ]; then
@jtsagata
jtsagata / check_sudo.sh
Last active March 7, 2017 07:58
Checking how sudo works
#!//usr/bin/env bash
set -e
function iColor() {
echo -n "'$(tput setaf $1)"; shift; echo -n "${@}$(tput sgr0)'"
}
function print_info() {
function iColor() {
printf "'$(tput setaf $1)"; shift; printf "${@}$(tput sgr0)'"