Skip to content

Instantly share code, notes, and snippets.

View alierkan's full-sized avatar

Ali Erkan alierkan

  • Bogazici University
View GitHub Profile
@alierkan
alierkan / upgrade-debian-wsl.md
Created April 5, 2024 12:25 — forked from bramtechs/upgrade-debian-wsl.md
Upgrade Debian 9, (current WSL) to Debian 12 (bookworm testing)

Upgrade Debian 9 (current WSL) to Debian 12 (bookworm testing)

Note: I do not maintain this gist anymore, but people report that it still works. Please check the comments for any revisions or extra things you should take into consideration.

As of writing, the Debian distro for WSL (Windows Subsystem for Linux) is quite old.

You can get more up-to-date package managers, text-editors and compilers by upgrading WSL to Debian 12 (current testing).

  • Root required
  • Use at your own risk, preferably on a fresh installation.
@alierkan
alierkan / Spotify_Connect.markdown
Last active March 14, 2024 22:26 — forked from danelowe/README.markdown
Mopidy and librespot (spotify connect)

Method taken from https://github.com/pimusicbox/pimusicbox

Assuming mopidy and Iris etc are already installed, we need to install mpc, so that we can stop playback on mopidy when we use spotify connect

sudo apt-get install mpc 

Then we install the easiest librespot spotify connect system

@alierkan
alierkan / create_hr_schema.sql
Created February 13, 2024 14:35 — forked from gourab5139014/create_hr_schema.sql
Script to create Oracle XE's HR schema in Postgres
-- Best used for learning purposes. Original developer also has an ER diagram available at https://dbseminar.r61.net/node/32
--create tables
BEGIN;
CREATE TABLE regions
( region_id SERIAL primary key,
region_name VARCHAR(25)
);
CREATE TABLE countries
@alierkan
alierkan / birnn.ipynb
Created April 11, 2023 11:18 — forked from ceshine/birnn.ipynb
Figuring How Bidirectional RNN works in Pytorch
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alierkan
alierkan / sources.list
Created February 23, 2023 13:17 — forked from h0bbel/sources.list
/etc/apt/sources.list for Ubuntu 18.04.1 LTS Bionic Beaver
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
@alierkan
alierkan / autoencoder-pytorch.ipynb
Created May 17, 2021 11:49 — forked from AFAgarap/autoencoder-pytorch.ipynb
PyTorch implementation of an autoencoder.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alierkan
alierkan / autoencoder.py
Created December 25, 2020 18:34 — forked from AFAgarap/autoencoder.py
PyTorch implementation of a vanilla autoencoder model.
class AE(nn.Module):
def __init__(self, **kwargs):
super().__init__()
self.encoder_hidden_layer = nn.Linear(
in_features=kwargs["input_shape"], out_features=128
)
self.encoder_output_layer = nn.Linear(
in_features=128, out_features=128
)
self.decoder_hidden_layer = nn.Linear(
@alierkan
alierkan / posdef.py
Created December 25, 2020 18:26 — forked from fasiha/posdef.py
Python/Numpy port of John D’Errico’s implementation (https://www.mathworks.com/matlabcentral/fileexchange/42885-nearestspd) of Higham’s 1988 paper (https://doi.org/10.1016/0024-3795(88)90223-6), including a built-in unit test. License: whatever D’Errico’s license, since this is a port of that.
from numpy import linalg as la
def nearestPD(A):
"""Find the nearest positive-definite matrix to input
A Python/Numpy port of John D'Errico's `nearestSPD` MATLAB code [1], which
credits [2].
[1] https://www.mathworks.com/matlabcentral/fileexchange/42885-nearestspd
@alierkan
alierkan / main.py
Created December 24, 2020 12:41 — forked from ammani-prop/main.py
# Import the recording process
from camera_record import record_video
# set recording duration
record_time = 20
# To run this as part of a bigger program, use mutltiprocessing to create a seperate process
# for video recording using the following lines.
from multiprocessing import Process
# The line above can go to the top of your file and the following lines should be placed
# where ever you need to record a video
# Create the process thread object
import cv2
# Import the video capturing function
from video_capture import VideoCaptureAsync
import time
#Specify width and height of video to be recorded
vid_w = 1280
vid_h = 720
#Intiate Video Capture object
capture = VideoCaptureAsync(src=0, width=vid_w, height=vid_h)