Skip to content

Instantly share code, notes, and snippets.

Step 1: Install LVM

First, you need to make sure that LVM is installed on your Ubuntu server. You can do this by running the following command:

sudo apt-get update
sudo apt-get install lvm2

Step 2: Create a Physical Volume

@EnisBerk
EnisBerk / unblockip.sh
Created March 28, 2024 01:59
bash script to unblock IP from iptables and denyhosts
#!/bin/bash
# Check if an IP address is provided
if [ -z "$1" ]; then
echo "Usage: $0 <IP>"
exit 1
fi
# Check if the provided argument is a valid IP address
if ! echo "$1" | grep -Pq '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'; then
@EnisBerk
EnisBerk / prompts.py
Last active March 6, 2024 17:13
prompts for the inference experiments
# source for Grouse description: https://birdsoftheworld.org/bow/species/wilpta/cur/introduction#vocal
{
'default':
'write an audio caption describing the sound',
'label_in_prompt':
'',
'grouse01':
"""provide labels for the audio file, could it be a Grouse?
here is detailed information on Grouse call types:
Both Sexes. (1) Kok is a short (50 ms) clucking call; \
@EnisBerk
EnisBerk / wand2csv.py
Last active February 16, 2024 20:03
Export WAMD metadata from wav files to csv.
#!/usr/bin/env python3
"""
Export WAMD metadata from wav files to csv.
usage:
python3 wamd2csv.py --folder /path/to/folder --csv_file /path/to/output.csv
Adopted from https://github.com/riggsd/guano-py/blob/master/bin/wamd2guano.py
"""
@EnisBerk
EnisBerk / sound_speed.py
Last active June 14, 2023 02:32
Utilities to calculate the speed of sound relative to temperature, humidity, and pressure.
"""
Original Code from: Dr Richard Lord - http://resource.npl.co.uk/acoustics/techguides/speedair/
Based on the approximate formula found in
Cramer, Owen. "The variation of the specific heat ratio and the speed of sound
in air with temperature, pressure, humidity, and CO2 concentration."
The Journal of the Acoustical Society of America 93.5 (1993): 2510-2516.
Saturation vapour pressure found in Richard S. Davis, "Equation for the
Determination of the Density of Moist Air (1981/91)", Metrologia,
def delete_samples_by_shapley(dataset,
shapley_values,
percentage,
strategy='best2worst'):
'''
select samples according to shapley
Args:
dataset: audio_dataset
shapley_values: shapley values dict {'Clip Path': shapley_value}
@EnisBerk
EnisBerk / .zsh_history
Last active April 27, 2021 10:00
commands I used to setup a new mac from zsh_history
: 1619210991:0;/usr/sbin/softwareupdate --install-rosetta --agree-to-license
: 1619210991:0;xcode-select --install
: 1619210991:0;/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
: 1619210991:0;brew analytics off
: 1619210991:0;mkdir -p ~/Documents/screenshots
: 1619210991:0;defaults write com.apple.screencapture location /Users/berk/Documents/screenshots && killall SystemUIServer
: 1619210991:0;sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
: 1619210991:0;echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/berk/.zprofile
: 1619210991:0;eval "$(/opt/homebrew/bin/brew shellenv)"
: 1619210991:0;brew update
@EnisBerk
EnisBerk / final_exam.ipynb
Created May 20, 2020 07:01
Final Exam Questions
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@EnisBerk
EnisBerk / copy-of-dcgan.ipynb
Created April 27, 2020 01:55
Copy of dcgan.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import random
print(random.rand(1))