Skip to content

Instantly share code, notes, and snippets.

View coderua's full-sized avatar
🇺🇦
Stand with Ukraine

Volodymyr Chumak coderua

🇺🇦
Stand with Ukraine
View GitHub Profile
@coderua
coderua / curl_compiling_debian.sh
Last active July 19, 2021 17:30
Compile latest curl from source code with HTTP2 support (Debian Linux)
# Tested on Debian 10 (Buster)
wget https://curl.se/download/curl-7.77.0.zip
unzip curl-7.77.0.zip
cd curl-7.77.0
sudo apt-get build-dep curl
sudo apt-get install build-essential
sudo apt-get install libcunit1-dev libssl-dev libev-dev libevent-dev libjansson-dev libjemalloc-dev
sudo apt-get install libssh2-1-dev
sudo apt-get install zlib1g zlib1g-dev
@coderua
coderua / l2tpclient.sh
Last active December 6, 2018 09:37 — forked from danielv99/l2tpclient.sh
L2TP VPN client on Linux Debian
# Requirements
# debian/ubuntu
apt-get -y update && apt-get -y upgrade
apt-get -y install strongswan xl2tpd libstrongswan-standard-plugins libstrongswan-extra-plugins
# Setup variables for L2TP connestion
VPN_SERVER_IP=''
VPN_IPSEC_PSK=''
VPN_USER=''
@coderua
coderua / curl_stub.php
Created February 13, 2016 11:01
Curl testing stub
<?php
/**
* Curl testing stub
*/
$url = '';
$userAgent = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36';
$headers = array();
@coderua
coderua / DisablesForeignKeys.php
Created February 5, 2016 20:41
PHP Trait for Disable/Enable foreign key checkin for different drivers in Laravel
<?php
/**
* Disable/Enable foreign key checkin for different drivers
*
* Usage:
* 1. Save the trait to app/Traits/DisablesForeignKeys.php
* 2. Add use statement in database/seeds/DatabaseSeeder.php:
* use App\Traits\DisablesForeignKeys;
* 3. Add use to class definition:
* class DatabaseSeeder extends Seeder
#!/bin/bash
#
# Automate mysql secure installation for debian-baed systems
#
# - You can set a password for root accounts.
# - You can remove root accounts that are accessible from outside the local host.
# - You can remove anonymous-user accounts.
# - You can remove the test database (which by default can be accessed by all users, even anonymous users),
# and privileges that permit anyone to access databases with names that start with test_.
@coderua
coderua / sudoers
Created December 11, 2012 23:40
Unix: Sudo without password
# Чтобы не вводить пароль при каждом повышении привилигей (sudo -s) необходимо
# 1. В файл sudoers нужно добавить стоку.
# 2. Изменить <username> на реальное имя пользователя в системе
# Примечание. В FreeBSD полный путь к файлу — /usr/local/etc/sudoers, в Linux Ubuntu — /etc/sudoers.
<username> ALL=(ALL) NOPASSWD: ALL