Skip to content

Instantly share code, notes, and snippets.

View maxsvetlik's full-sized avatar

Max Svetlik maxsvetlik

View GitHub Profile
@chfritz
chfritz / aaai_script.sh
Last active April 21, 2022 12:55
This shell script produces the latex source-package of a paper as required by AAAI, in preparation for printed proceedings.
#!/bin/bash
# ----------------------------------------------------------------------
# This shell script produces the latex source-package of a paper
# as required by AAAI, in preparation for printed proceedings.
# Copyright (C) 2009 Christian Fritz "fritz at cs dot toronto dot
# edu"
#
# I thank Jorge Baier for his contributions and Shirin Sohrabi for her
# feedback that has lead to improvements to the script. Thanks also
@alexlee-gk
alexlee-gk / configure_cuda_p70.md
Last active November 1, 2024 06:09
Use integrated graphics for display and NVIDIA GPU for CUDA on Ubuntu 14.04

This was tested on a ThinkPad P70 laptop with an Intel integrated graphics and an NVIDIA GPU:

lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM204GLM [Quadro M3000M] (rev a1)

A reason to use the integrated graphics for display is if installing the NVIDIA drivers causes the display to stop working properly. In my case, Ubuntu would get stuck in a login loop after installing the NVIDIA drivers. This happened regardless if I installed the drivers from the "Additional Drivers" tab in "System Settings" or the ppa:graphics-drivers/ppa in the command-line.

@standy66
standy66 / audio_from_spectrogram.py
Created July 12, 2017 14:47
A small snippet that helps reconstruct audio from spectrogram in Python
from scipy.signal import stft, istft
def reconstruct(spectrogram, sample_rate, nperseg, iters=100):
length = istft(spectrogram, sample_rate, nperseg=nperseg)[1].shape[0]
x = np.random.normal(size=length)
for i in range(iters):
# Code based on the answer here: https://dsp.stackexchange.com/a/3410
X = stft(x, sample_rate, nperseg=nperseg)[2]
Z = spectrogram * np.exp(np.angle(X) * 1j)
x = istft(Z, sample_rate, nperseg=nperseg)[1]
@mohamadaliakbari
mohamadaliakbari / ubuntu-run-dhclient-on-startup.md
Last active July 31, 2024 08:46
Run dhclient on Startup in Ubuntu 18.04

dhclient is the Dynamic Host Configuration Protocol (DHCP) Client one would use to allow a client to connect to a DHCP server.

$ sudo nano /etc/rc.local

#!/bin/bash
dhclient
exit 0
@LysandreJik
LysandreJik / cuda_10_install.sh
Created October 24, 2019 13:37
Uninstall cuda 10.1 and install cuda 10.0 instead on Ubuntu 18.04
sudo apt remove cuda
wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda_10.0.130_410.48_linux
sudo sh cuda_10.0.130_410.48_linux.run
export PATH=$PATH:/usr/local/cuda/bin
nvcc --version