Skip to content

Instantly share code, notes, and snippets.

View Sayegh7's full-sized avatar
🎮

Sayegh Sayegh7

🎮
View GitHub Profile
@Sayegh7
Sayegh7 / sentry.sh
Last active October 14, 2020 05:17
Setup sentry on a vm
sudo apt install git curl
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
curl -fsSL https://get.docker.com/ | sh
sudo groupadd docker
sudo usermod -aG docker $USER
@Sayegh7
Sayegh7 / dst.sh
Created March 16, 2020 12:02
Don't starve together
wget -qO- https://get.docker.com/ | sh
sudo docker run -v ${HOME}:/data -p 10999-11000:10999-11000/udp -p 12346-12347:12346-12347/udp -it jamesits/dst-server:latest
@Sayegh7
Sayegh7 / docker.sh
Created November 28, 2019 14:14
Install docker and docker compose (assumes sudo)
wget -qO- https://get.docker.com/ | sh
# Install docker-compose
COMPOSE_VERSION=`git ls-remote https://github.com/docker/compose | grep refs/tags | grep -oP "[0-9]+\.[0-9][0-9]+\.[0-9]+$" | tail -n 1`
sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
chmod +x /usr/local/bin/docker-compose
sh -c "curl -L https://raw.githubusercontent.com/docker/compose/${COMPOSE_VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose"
# Install docker-cleanup command
cd /tmp
@Sayegh7
Sayegh7 / add.sh
Last active October 24, 2019 23:20
add.sh
#!/bin/bash
readonly INTERFACE="wg0"
# Generate peer keys
readonly PRIVATE_KEY=$(wg genkey)
readonly PUBLIC_KEY=$(echo ${PRIVATE_KEY} | wg pubkey)
readonly IPV4="$(curl http://checkip.amazonaws.com)"
# Read server key from interface
readonly SERVER_PUBLIC_KEY=$(wg show ${INTERFACE} public-key)
@Sayegh7
Sayegh7 / wg.sh
Last active December 10, 2022 10:46
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "You need to run this script as root"
exit 1
fi
if [ "$(systemd-detect-virt)" == "openvz" ]; then
echo "OpenVZ is not supported"
exit
@Sayegh7
Sayegh7 / main.dart
Created April 17, 2019 00:54
Image picker
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@Sayegh7
Sayegh7 / references.json
Created March 21, 2018 10:46
References
{
"Multiple Firebase Apps in Angularfire2": "https://stackblitz.com/edit/angular-aw3pyc?file=app%2Fapp.component.ts"
}