Skip to content

Instantly share code, notes, and snippets.

View mhamlet's full-sized avatar

Hamlet mhamlet

View GitHub Profile
@mhamlet
mhamlet / check_xz_vulnerability.sh
Last active March 30, 2024 11:32
Bulk check XZ version for list linux servers using SSH
#!/bin/bash
# Function to print message in red
print_red() {
echo -e "\033[0;31m$1\033[0m"
}
# Function to print message in green
print_green() {
echo -e "\033[0;32m$1\033[0m"
@mhamlet
mhamlet / regexp.js
Created December 6, 2016 08:54
Armenian regexp
// JavaScript
/[\u{0531}-\u{0556}\u{0561}-\u{0587}]{1,}/gu
// PHP
/[\p{Armenian}]{1,}/g
@mhamlet
mhamlet / phone.php
Last active June 6, 2024 15:31
Validation and normalization of Armenian Phone numbers
<?php
/**
* Class Phone
*/
class Phone {
/**
* Phone number
*
<?php
/*
Author: Petr Bondarenko
E-mail: [email protected]
Date: 31 May 2012
License: BSD
Description: Class for create UNIX-daemon
*/
class DaemonException extends Exception {}