Skip to content

Instantly share code, notes, and snippets.

View xaratustrah's full-sized avatar
🎲
What were the chances?

xaratustrah

🎲
What were the chances?
View GitHub Profile
@xaratustrah
xaratustrah / make_permut.sh
Last active August 27, 2018 12:08
make_permut.sh
ruby -e '"make".chars.permutation.map(&:join).each {|str| puts "alias "+str.to_s+"=\"make\""}' | cat >> .bash_profile
@xaratustrah
xaratustrah / root_gui_application.md
Last active January 22, 2019 10:55
root_gui_application.md

Stand alone GUI OSX Application Bundle using ROOT Libraries

Here is how you can deploy a truly stand alone OSX application bundle out of a stand alone ROOT GUI application which you can distribute to other colleagues without a ROOT installation.

Libraries

First get ROOT from git and compile it as described in http://root.cern.ch/drupal/content/installing-root-source. You don't need to install it. After that make clean and make a duplicate copy of the whole root directory and name it e.g. root_runtime. In root_runtime, delete everything except the directories lib, icons, fonts, etc and bin. In the bin directory delete everything except the script thisroot.sh and root-config. Then go inside the lib directory and check for the dependencies of all libs to see if anyone depends on some library other than those in the /ur/lib, which come automatically with OSX. Specifically you can grep for any dependency that is in /opt/ for systems that have macports installed.

otool -L *

@xaratustrah
xaratustrah / c_cpp_tricks.md
Last active August 27, 2018 12:07
c_cpp_tricks.md

C/C++ tips & tricks

Pair in C++

#include <utility>
#include <iostream>
#include <math.h>
 
std::pair<double, double> cart2pol(double real, double imag)

{

@xaratustrah
xaratustrah / shell_scripts_and_one_liners.md
Last active January 26, 2023 10:03
shell_scripts_and_one_liners.md

Shell scripts and one liners

Snippets, tips and tricks in no particular order. FOR ADVANCED USERS ONLY. Some of these one liners may be dangerous since they might delete files in loops. Please pay attention and make backups. :-)

Extracting a column from a text file

Extract the 10th column while skipping the first line:

awk -F ' ' 'NR!=1{print $10}' filename.txt

@xaratustrah
xaratustrah / pypi_upload.md
Last active August 27, 2018 12:06
pypi_upload.md
@xaratustrah
xaratustrah / python_win_osx_raspbian.md
Last active August 27, 2018 12:05
python_win_osx_raspbian.md

Python installation

Table of contents

Under Windows

Using WinPython

WinPython is a convenient python distribution package which contains most needed packages for Windows. After downloading you may start by installing the version with PyQt5 included and it in:

@xaratustrah
xaratustrah / package_management_commands.md
Last active May 5, 2020 12:31
package_management_commands.md

Common commands used in package management systems

Pacman

Archlinux Debian / Ubuntu
pacman -Sy apt-get update
pacman -Syu apt update + apt distpgrade
pacman -Ss like apt-cache search
pacman -S PAKETNAME apt-get install PAKETNAME
@xaratustrah
xaratustrah / cuda_debian.md
Last active August 27, 2018 12:04
cuda_debian.md
@xaratustrah
xaratustrah / cst_debian_installation.md
Last active September 2, 2023 20:08
cst_debian_installation.md

CST on Ubuntu

Installing 3DS CST Microwave Studio Suite Distributed Computing Node on Ubunntu

Tested on: Ubuntu 20.04.2 LTS nvidia version 470

nvidia + cuda installation

@xaratustrah
xaratustrah / simple-https-server.py
Last active August 27, 2018 12:04 — forked from dergachev/simple-https-server.py
simple-https-server.py
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
# Changed for python 3
import http.server