Skip to content

Instantly share code, notes, and snippets.

View Daniel-M's full-sized avatar
💻
Coding

Daniel Mejía Raigosa Daniel-M

💻
Coding
View GitHub Profile
@Daniel-M
Daniel-M / update_pip_packages.sh
Last active August 22, 2016 20:30
Update all installed packages installed via pip and pip3 in Debian
#!/bin/bash
# Simplified forms using awk
pip install --upgrade $(pip list | awk '{printf(" %s ",$1)}')
pip3 install --upgrade $(pip3 list | awk '{printf(" %s ",$1)}')
# Alternative forms using sed
#pip install --upgrade $(pip list | awk -F" " '{print $1}' | sed ':a;N;s/\n/ /g;ba') # Alternative form
#pip3 install --upgrade $(pip3 list | awk -F" " '{print $1}' | sed ':a;N;s/\n/ /g;ba') # Alternative form
@Daniel-M
Daniel-M / BuildMathGL2.3.5.bash
Last active August 16, 2017 20:34
Build MathGL 2.3.5 for installation
# Install Prerequisites for MathGL 2.3.5 in Debian
apt-get update
apt-get install libqt5webkit5-dev libhpdf-dev libgsl-dev libopenmpi-dev libhdf5-dev libwxgtk3.0-dev libpng-dev texinfo
# Inside mathgl-2.3.5 source directory
mkdir build
cd build
cmake -D enable-qt5=ON -D enable-pdf=ON -D enable-png=ON -D enable-jpeg=ON -D enable-openmp=ON -D enable-gsl=ON -D enable-hdf5=ON -D enable-wx=ON enable-mpi=ON -D enable-doc-pdf-en=ON ..
make -j 4
@Daniel-M
Daniel-M / InstallNeovimNightly.bash
Last active March 11, 2020 15:27
Installing Neovim in Debian testing. This follows the rules for Ubuntu/Debian suggested in Neovim wiki
# As 17 July 2018 in Debian Testing upgraded 3 days ago.
# As root install the following:
# apt-get update
# apt-get install libtool libtool-bin autoconf automake cmake g++ pkg-config unzip gettext
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Get inside the neovim-nightly directory and let the fun begin
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# As regular user then run this to build the third-party dependencies.
@Daniel-M
Daniel-M / generate_script_clone-github-public_repos.sh
Created March 16, 2017 04:58
Generates a script to clone all the public repositories from a given user
user=""
script="clone_github_"$user"_public_repos.sh"
curl -i https://api.github.com/users/$user/repos | awk 'index($line,"ssh_url") { print $line}' | sed '{s/"//g;s/,$//g;s/ *ssh_url\:/git clone/}' > $script
@Daniel-M
Daniel-M / generate_script_clone-github-repos.sh
Created March 16, 2017 05:00
Clone all user repositories at github using the simple autentication method with the github API. User needs to be authenticated
#!/bin/bash
username="" # The user to be autenticated
script="clone_github_"$username"_repos.sh"
curl -i -u $username https://api.github.com/user/repos | awk 'index($line,"ssh_url") { print $line}' | sed '{s/"//g;s/,$//g;s/ *ssh_url\:/git clone/}' > $script
@Daniel-M
Daniel-M / scipy.integrate.ode_example.py
Last active March 31, 2017 21:13
Solving a damped oscillator system with Scipy.Odeint
from matplotlib import pyplot as plt
from scipy.integrate import ode
# Model Parameters
y0, t0 = [5.0,0.0], 0
kappa = 2.0
eta = 0.1
def f(t, y, arg1,arg2):
# Sistem
@Daniel-M
Daniel-M / last_call_log.txt
Created May 17, 2017 14:07
Telegram Call Log (crashed incoming call)
---------------
libtgvoip v0.4 on Linux 4.9.0-2-amd64 (#1 SMP Debian 4.9.18-1 (2017-03-30)) x86_64
Log started on 17/05/2017 at 9:05:43
---------------
05-17 09:05:43 I: update data saving mode, config 0, enabled 0, reqd by peer 0
05-17 09:05:43 W: Starting voip controller
05-17 09:05:43 V: trying bind to port 21963
05-17 09:05:43 D: Bound to local UDP port 21963
05-17 09:05:43 I: Receive thread starting
05-17 09:05:43 E: can't set thread priority: Operación no permitida
@Daniel-M
Daniel-M / last_call_log.txt
Created May 17, 2017 14:07
Telegram Call Log (crashed outgoing call)
---------------
libtgvoip v0.4 on Linux 4.9.0-2-amd64 (#1 SMP Debian 4.9.18-1 (2017-03-30)) x86_64
Log started on 17/05/2017 at 8:59:27
---------------
05-17 08:59:27 I: update data saving mode, config 0, enabled 0, reqd by peer 0
05-17 08:59:27 W: Starting voip controller
05-17 08:59:27 V: trying bind to port 22121
05-17 08:59:27 D: Bound to local UDP port 22121
05-17 08:59:27 E: can't set thread priority: Operación no permitida
05-17 08:59:27 I: Receive thread starting
@Daniel-M
Daniel-M / last
Created May 17, 2017 16:30
Telegram alpha 1.1.1 outgoing call log - crashed
---------------
libtgvoip v0.4 on Linux 4.9.0-2-amd64 (#1 SMP Debian 4.9.18-1 (2017-03-30)) x86_64
Log started on 17/05/2017 at 11:27:23
---------------
05-17 11:27:23 I: update data saving mode, config 0, enabled 0, reqd by peer 0
05-17 11:27:23 W: Starting voip controller
05-17 11:27:23 V: trying bind to port 22847
05-17 11:27:23 D: Bound to local UDP port 22847
05-17 11:27:23 I: Receive thread starting
05-17 11:27:23 E: can't set thread priority: Operación no permitida (translation: can't set thread priority: operation not allowed)
@Daniel-M
Daniel-M / asound.conf
Created May 17, 2017 17:12
Alsa sound configuration in /etc/asound.conf
# virtual PCM pointed to by !default
pcm.plugequal {
type equal;
# Software mixing through dmix. All sources played at once
slave.pcm "plug:dmix";
}
# The sounds are processed with an equalizer
# another alsa plugin
pcm.!default {