Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

# Generated by chatgpt 3.5
# Prompt
# help me create a dataset with random values and use it to create a benchmark for statsmodels.api.Logit.fit().
# use timeit to measure how long it takes to run
# create 40 X's and make it 1000000 observations (on the second prompt)
import numpy as np
import pandas as pd
@ispanos
ispanos / dynare_install_notes.txt
Created December 30, 2023 22:23
Some notes on installing dynare on fedora
## See
## - https://forum.dynare.org/t/compiling-and-running-dynare-on-a-linux-cluster-running-centos-or-rhel/18039
## - https://mutschler.dev/linux/fedora-post-install/#coding
## - https://mutschler.eu/dynare/
## - https://mutschler.eu/dynare/intro-dsge-dynare/
## - https://forum.dynare.org/t/building-best-version-for-fedora-centos/10552/5
## - https://forum.dynare.org/t/linux-centos-preprocessor-command-not-found/17444/3
MATLAB_DIR=/home/$USER/.local/MATLAB/R2018a
@ispanos
ispanos / package_history.py
Created October 10, 2023 19:23
dnf 'exclusively' installed packages
import subprocess
import re
import sys
def get_pks_repoquery():
# Use repoquery to create a list of userinstalled packages
return set(subprocess.check_output(
'dnf repoquery --userinstalled --qf "%{name}"', shell=True, text=True
).splitlines())
@ispanos
ispanos / fedora_hybernate.sh
Last active April 3, 2024 20:49
A script to enable hybernation on Fedora workstation.
#!/bin/bash
# Credits:
# Hibernation in Fedora Workstation
# Fedora Magazine
# Posted by Alexander Wellbrock on August 10, 2022
# https://fedoramagazine.org/hibernation-in-fedora-36-workstation/
# Which was based on: https://gist.github.com/eloylp/b0d64d3c947dbfb23d13864e0c051c67
# WARNING: This script has not been properly tested.
@ispanos
ispanos / btrfsonkuks.md
Last active October 22, 2023 11:50
Notes on how I set up Btrfs on Luks for storing data.

BTRFS on LUKS for drives containing data

Reading material

[Frequently Asked Questions on Cryptsetup/LUKS]

[Getting started with btrfs]

Wipe the drive

import random
import string
import re
import datetime
from typing import List, Set, Dict, Tuple, Optional
#### Warning
#### Υπάρχουν Hardcoded range()'s, γιατί έχω μόνο 5 γεωραφικές περιοχές και κατηγορίες.
#### Δεν έχω χρόνο να τα φτιάξω όλα εντός της προθεσμίας για το 2ο παραδοτέο.
#### Επίσης, φτιάξετε πρώτα μικα datasets, να δείτε ότι είναι σωστά
@ispanos
ispanos / pre_anergos.old.sh
Last active July 10, 2020 19:37
Some functions I was using on one of my scripts, but no longer use.
#!/usr/bin/env bash
# License: GNU GPLv3
# setfont sun12x22 #HDPI
# dd bs=4M if=path/to/archlinux.iso of=/dev/sdx status=progress oflag=sync
get_drive() {
# Sata and NVME drives array
drives=( $(/usr/bin/ls -1 /dev | grep -P "sd.$|nvme.*$" | grep -v "p.$") )
@ispanos
ispanos / anergos.old.sh
Last active April 13, 2020 15:25
Some functions I was using on one of my scripts, but no longer use.
#!/usr/bin/env bash
# License: GNU GPLv3
status_msg() { printf "%-25s %2s" $(tput setaf 4)"${FUNCNAME[1]}"$(tput sgr0) "- "; }
# Prints "done" and any given arguments with a new line.
ready() { echo $(tput setaf 2)"done"$@$(tput sgr0); }
Install_nvim_plugged_plugins() {
# Not tested. Run as user