Skip to content

Instantly share code, notes, and snippets.

View alincc's full-sized avatar

Alin Capitanescu alincc

View GitHub Profile
@alincc
alincc / docker_on_ubuntu.sh
Created December 4, 2021 08:54 — forked from amitavroy/docker_on_ubuntu.sh
Installing Docker on a new Ubuntu Server
sudo apt update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@alincc
alincc / gist:cb59c136e39561748664924223251886
Created August 16, 2020 17:45
Remove unused linux images
dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e "$(uname -r | cut -f1,2 -d"-")" | grep -e "[0-9]" | grep -E "(image|headers)" | xargs sudo apt-get -y purge
@alincc
alincc / ovpn_autostart
Last active March 15, 2020 14:11 — forked from unique1984/ovpn_autostart
ovpn_autostart
#!/bin/sh
OVPNCONF="/root/ovpn/client.ovpn"
RUNNING=$(ps aux | grep -o "openvpn \-\-config" | wc -l)
case "$1" in
start)
if [ $RUNNING -eq 0 ]; then
echo -n > /var/log/ovpn_autostart.log
nohup openvpn --config "$OVPNCONF" > /var/log/ovpn_autostart.log 2>&1 &
else
@alincc
alincc / ovpn_autostart
Created March 15, 2020 13:58 — forked from unique1984/ovpn_autostart
ovpn_autostart
#!/bin/sh
OVPNCONF="/root/ovpn/client.ovpn"
RUNNING=$(ps aux | grep -o "openvpn \-\-config" | wc -l)
case "$1" in
start)
if [ $RUNNING -eq 0 ]; then
echo -n > /var/log/ovpn_autostart.log
nohup openvpn --config "$OVPNCONF" > /var/log/ovpn_autostart.log 2>&1 &
else
@alincc
alincc / split-mp3.py
Last active January 2, 2020 20:49
mp3 split based on input file
import subprocess
import sys
def main():
"""split a music track into specified sub-tracks by calling ffmpeg from the shell"""
# check command line for original file and track list file
if len(sys.argv) != 3:
print 'usage: split <original_track> <track_list>'
@alincc
alincc / redis_cheatsheet.bash
Created September 19, 2019 16:49 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@alincc
alincc / git-pull-recursive.rb
Created August 20, 2019 07:53 — forked from jonpugh/git-pull-recursive.rb
Lots of repos? Try "git-pull-recursive" to run "git pull" on all subfolders with a .git folder inside. Thanks to http://snipplr.com/view/62314/perform-git-pull-on-subdirectory-recursive/
# For use in Chef:
# Adds a command: git-pull-recursive
file "/usr/local/bin/git-pull-recursive" do
owner "root"
group "root"
mode "0755"
action :create
content 'find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git pull" \;'
end
@alincc
alincc / classifier_from_little_data_script_3.py
Created September 24, 2018 09:02 — forked from fchollet/classifier_from_little_data_script_3.py
Fine-tuning a Keras model. Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats