Skip to content

Instantly share code, notes, and snippets.

View chreniuc's full-sized avatar

Hreniuc Cristian-Alexandru chreniuc

View GitHub Profile
@chreniuc
chreniuc / ufw_utils.sh
Created June 4, 2019 19:06
Install and configure ufw on debian server
# Install ufw:
apt install ufw
# Set rules back to default:
ufw default deny incoming
ufw default allow outgoing
# Allow ssh:
@chreniuc
chreniuc / interfaces
Created June 4, 2019 18:26
Public and private ip on the same interface, debian
# Restart the networking daemon:
# systemctl restart networking
# Shutdown an interface: ifdown eth0
# Enable an interface: ifup eth0
# The loopback network interface (localhost)
# Localhost
auto lo
iface lo inet loopback
@chreniuc
chreniuc / open_vpn_run.sh
Created June 4, 2019 17:41
Start vpn conainer
# Script to start a openvpn server
IP="1.1.1.1" # Public ip
PORT="7777" # External port
USER="chreniuc" # User for vpn
OPEN_VPN_MOUNT="$(pwd)/home_test/" # Where open vpn should store all its data. This should exist.
@chreniuc
chreniuc / docker_debian_install.sh
Created June 4, 2019 17:14
Script to install docker on debian
# Install docker-ce on debian
# Run as root
# Change this to your user to be added to docker group
user="chreniuc"
apt-get update
apt-get install \
apt-transport-https \
@chreniuc
chreniuc / xcr.c
Created March 3, 2019 18:05 — forked from luser-dr00g/xcr.c
xcb+cairo hello world window
//xcr.c
//cc -o xcr $(pkg-config --cflags --libs cairo xcb xcb-icccm) xcr.c -lcairo -lxcb -lxcb-icccm
#include <stdlib.h>
#include <string.h>
#include <cairo.h>
#include <cairo-xcb.h>
#include <xcb/xcb.h>
#include <xcb/xcb_image.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_icccm.h>
@chreniuc
chreniuc / Install i3 on arch.sh
Last active April 17, 2024 18:45
Steps i followed to install arch + i3
timedatectl set-ntp true
timedatectl set-timezone Europe/Bucharest
fdisk /dev/sda
########################################
n 1G pentru /boot /dev/sda1
a - Flag it as bootable
n - 4G pentru swap /dev/sda3
n - 70G pentru / /dev/sda2
@chreniuc
chreniuc / configure_artix_part_2.sh
Created April 30, 2018 20:45
Configure Artix Linux Part 2
#!/bin/bash
# Source https://paul.grozav.info/2018/04/13/artix-linux/
# By now you should have done everything from `Configure Artix Linux Part 1`:
# Set timezone:
ln -sf /usr/share/zoneinfo/Europe/Bucharest /etc/localtime
hwclock --systohc
# Set locale
echo "LANG=en_US.UTF-8" > /etc/locale.conf
@chreniuc
chreniuc / configure_artix_part_1.sh
Last active April 30, 2018 20:41
Configure Artix Linux Part 1
#!/bin/bash
# Source https://paul.grozav.info/2018/04/13/artix-linux/
# By now you should have done those steps:
# 1. You boot the iso, then check that you have a working internet connection(ping google.com or something).
# 2. You use fdisk to partition you hdd. I created only one partition
# 3. You format it using mkfs.ext4
# 4. And mount it to /mnt: mount /dev/sda1 /mnt
# 5. I’ve commented all servers in /etc/pacman.d/mirrorlist and added: https://mirrors.dotsrc.org/artix-linux/repos/$repo/os/$arch.
echo "Configuring Artix linux..."