Skip to content

Instantly share code, notes, and snippets.

@macieksk
macieksk / bootstrap_box_ssh.sh
Last active April 25, 2021 18:07
bootstrap_box_ssh.sh
#!/bin/bash
set -eux
sudo echo Test sudo 123...
sudo apt update -y
sudo apt install openssh-{server,client} -y
ssh-keygen -b 4096
sudo addgroup --gid 1003 sshremote
sudo addgroup "$USER" sshremote
@macieksk
macieksk / test.html
Created January 23, 2020 21:04
test.html
<html>
<body>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAu8AAAHKCAYAAACzCqVJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAPYQAAD2EBqD%2BnaQAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nOzdd1wUx98H8M/dAaIgoKIQscSohyII2NCIJfafJVijMRFFBRFEQzT2GDEaNRYUVBAx9t5LxFgSWwyaWBJjYqyxF1SKgNwBt88fPLdhuQPuAMvp553wEnbn5ubmdme/Ozs7KxMEQQAREREREb325K%2B6AEREREREZBgG70REREREJoLBOxERERGRiWDwTkRERERkIhi8ExERERGZCAbvREREREQmgsE7EREREZGJYPBORERERGQiGLwTEREREZkIo4L3X375BRMmTECnTp3g4eGBFi1aYPjw4fjzzz910l68eBGDBg2Cp6cnGjVqhBEjRuD27duSNDdu3MDs2bPRs2dPNGrUCE2aNEG/fv2wf/9%2Bve//5MkTjB8/Hl5eXnB3d0ffvn3xyy%2B/6E178uRJ9O3bF%2B7u7vDy8sL48ePx5MkTnXTh4eEYNmwYWrRoAWdnZ4wfP15vflu2bEFQUBDatGmD%2BvXro3379vjqq6/w6NEjSbpHjx4hPDwcffv2hZeXFxo0aICePXti06ZNyM7O1pt3QXbu3InQ0FB07NgRderUQZs2bfJNm5aWhhkzZsDb2xtubm7w8fHB999/X2D%2BgiDgk08%2BgbOzM6ZNmyZZl56eLr63p6cnPDw80KVLFyxZsgTp6elGfxZTEBkZCWdn51ddjEIZu50Zs20Ysu9qrVmzBp06dYKrqyvatGmDRYsWITMzU5Lm5MmT8PPzg7e3N1xdXdGsWTP4%2Bvri6NGjevNMT09HTEwMunfvDk9
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@macieksk
macieksk / Przygotowanie do egzaminu 2WL 2016_2017.ipynb
Last active November 30, 2016 08:17
ZIMT, Przygotowanie do egzaminu 2WL 2016/2017
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@macieksk
macieksk / R_pubmed_download_authors_affiliations.ipynb
Last active January 11, 2021 22:41
Download authors and their affiliations from Pubmed articles using R packages: RISmed, rentrez
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@macieksk
macieksk / owocwordcloud.R
Last active March 15, 2017 13:06
Draw a word cloud in R
################################################################################
#Owoc
#words <- c('Workshops', 'Workshops', 'Standardized curriculum', 'Review of studies', 'Review of studies', 'Free access to journals', 'Workshops', 'Meeting others')
#v <- sort(table(words),decreasing=TRUE)
nwords <- c(
'financial support',
'free access to journals',
'meeting others',
'observerships',
'review of studies',
@macieksk
macieksk / springer-free-maths-books.md
Created December 29, 2015 14:13 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
@macieksk
macieksk / google_drive_util.py
Created July 2, 2014 12:26
A simple Python module to upload files to Google Drive file upload. Needs a file 'client_secrets.json' in the directory . The file can be obtained from https://console.developers.google.com/ -- under APIs&Auth/Credentials/Create Client ID for native application
## Simple Python module to upload files to Google Drive
# Needs a file 'client_secrets.json' in the directory
# The file can be obtained from https://console.developers.google.com/
# under APIs&Auth/Credentials/Create Client ID for native application
# To test usage:
# import google_drive_util
# google_drive_util.login()
# google_drive_util.test()
@macieksk
macieksk / background.multicore.r
Created June 16, 2014 09:36
R CRAN code. Parallel execution - helper functions for the "multicore" library. Run jobs (expressions) in the background without blocking. Consider using "source.gist" http://cran.r-project.org/web/packages/source.gist/index.html
################
################ Parallel execution - helper functions for multicore library
################ Run jobs (expressions) in the background without blocking
################
library(multicore) #better to be loaded last of all libraries
inpar<-function(name,expr){
#Runs named expression in parallel with main thread - non-blocking
name<-deparse(substitute(name))
@macieksk
macieksk / kdegrid.sh
Last active December 1, 2020 14:13
Grid window placement in KDE, Plasma. To use create appropriate keyboard shortcuts to KDE and enjoy quick window placement. Originally created by Anpu and posted on KDE forum https://forum.kde.org/viewtopic.php?f=111&t=108024
#!/bin/bash
# number of monitors
MONITORS=`xrandr | grep -w connected | wc -l`
# make a gap because of top panel
GAP_TOP=0
GAP_BOTTOM=15
#find x position of active window