Skip to content

Instantly share code, notes, and snippets.

View qyvlik's full-sized avatar

qyvlik qyvlik

  • China
View GitHub Profile
@492162921
492162921 / ubuntu-bionic-openldap-mysql.sh
Last active August 18, 2023 07:11 — forked from mahirrudin/ubuntu-bionic-openldap-mysql.sh
OpenLDAP with MySQL Backend - Ubuntu 18.04
## installation openldap with backend mysql
sudo apt update && sudo apt upgrade -y && sudo reboot
sudo apt install mysql-server unixodbc make gcc libmysqlclient-dev unixodbc-dev groff ldap-utils
## mysql login as root
sudo mysql -u root
CREATE DATABASE ldap
CREATE USER 'ldap'@'%' IDENTIFIED BY 'S3cureP4ssw0rd$';
GRANT ALL PRIVILEGES ON ldap.* TO 'ldap'@'%';
@mcnaveen
mcnaveen / check_authorization.php
Created April 3, 2021 15:39 — forked from anonymous/check_authorization.php
PHP Telegram Authorization
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@ashrafsharif
ashrafsharif / xtrabackup.sh
Created January 11, 2021 05:17
A bash script to create xtrabackup full and incremental backups using cron.
#!/bin/bash
# Create a full or incremental xtrabackup
# In the cron job, set it like below:
## xtrabackup weekly full backup (Saturday, 9 PM UTC == Sunday, 5 AM MYT)
## 0 21 * * 6 /root/backups/scripts/xtrabackup.sh full > /dev/null
## xtrabackup daily incremental backup (Sunday->Friday, 9 PM UTC == Monday->Saturday, 5 AM MYT)
## 0 21 * * 0-5 /root/backups/scripts/xtrabackup.sh incremental > /dev/null
# Note:
## - For every full backup taken, all created incremental backups will be deleted.
@FreddieOliveira
FreddieOliveira / docker.md
Last active June 17, 2024 12:15
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@mrpeardotnet
mrpeardotnet / PVE-host-backup.md
Created December 17, 2019 18:03
Proxmox PVE Host Config Backup Script

Proxmox PVE Host Config Backup Script

This script can be used to backup essential configuration files from the Proxmox Virtual Enivronment (PVE) host.

The script will create backups using tar with specified backup prefix and date and time stamp in the file name. Script will also delete backups that are older then number of days specified.

Create backup script file

To create backup script that will be executed every day we can create backup script in /etc/cron.daily/ folder. We need to make it writeable by root (creator) only, but readable and executable by everyone:

touch /etc/cron.daily/pvehost-backup
@arno01
arno01 / docker-on-android.md
Last active June 1, 2024 16:24
Docker on Android

WORK IN PROGRESS

Docker on Android

Setup:

Samsung Galaxy Tab S5e SM-T720
Android Pie on Linux 4.9.112 (not rooted)
Termux
@marvin-marvin
marvin-marvin / change_swap_proxmox.txt
Last active March 20, 2024 15:35
extend swapfile proxmox
# Change Swapfile:
swapoff -v /dev/pve/swap
lvm lvresize /dev/pve/swap -L +48G
mkswap /dev/pve/swap
swapon -va
dd if=/dev/zero of=/dev2/swap bs=1M count=49152
mkswap /dev2/swap
swapon -v /dev2/swap
@usbuild
usbuild / jit_calculator.c
Last active December 18, 2023 09:11
A naive calculator with interpreter and jit. Just for teaching and demo.
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <assert.h>
#define STACK_MAX 100
#define CODE_SIZE (2 * 1024 * 1024)
pragma solidity ^0.4.24;
contract Tree {
struct Node {
bytes32 name;
bytes32 parent;
bytes32 data;
bytes32[] nodes;
}
@mahirrudin
mahirrudin / ubuntu-bionic-openldap-mysql.sh
Created June 17, 2018 15:12
OpenLDAP with MySQL Backend - Ubuntu 18.04
## installation openldap with backend mysql
sudo apt update && sudo apt upgrade -y && sudo reboot
sudo apt install mysql-server unixodbc make gcc libmysqlclient-dev unixodbc-dev groff ldap-utils
## mysql login as root
sudo mysql -u root
CREATE DATABASE ldap
CREATE USER 'ldap'@'%' IDENTIFIED BY 'S3cureP4ssw0rd$';
GRANT ALL PRIVILEGES ON ldap.* TO 'ldap'@'%';