This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://gist.github.com/kmatt/71603170556ef8ffd14984af77ff10c5 | |
# prompt ">" indicates Powershell commands | |
# prompt "$" are Linux shell commands | |
# https://learn.microsoft.com/en-us/windows/wsl/install | |
> dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart | |
> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart | |
# No need for Windows 11, but for Windows 10 install https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# RPM license exporter | |
# Copyright 2022 [email protected] | |
extract_file() { | |
# echo "$1" | |
# echo "$2" | |
rpm2cpio "$1" | cpio -iv --to-stdout ".$2" 1> license.tmp 2> /dev/null | |
ENCODING=$(uchardet license.tmp) | |
# echo "$ENCODING" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo port -v install intltool py27-pygtk py27-gobject3 libvirt gtk3 libvirt | |
cd $HOME | |
# Sources: | |
# compile what you need from here https://github.com/jeffreywildman/homebrew-virt-manager | |
cd $HOME | |
git clone https://github.com/virt-manager/virt-manager | |
# Change destination install directory instead of /usr, due to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from StringIO import StringIO as StringBuffer | |
logger = logging.getLogger('basic_logger') | |
logger.setLevel(logging.DEBUG) | |
### Setup the console handler with a StringIO object | |
log_capture_string = StringBuffer() | |
# log_capture_string.encoding = 'cp1251' | |
ch = logging.StreamHandler(log_capture_string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use InvalidArgumentException; | |
use ReflectionClass; | |
/** | |
* Base Enum class | |
* Require PHP >= 5.3 | |
* | |
* @author Ton Sharp <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace MyNamespace; | |
use Symfony\Component\HttpKernel\Bundle\Bundle; | |
use Doctrine\DBAL\Types\Type; | |
class DataBundle extends Bundle | |
{ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace MyNamespace; | |
/** | |
* @author Ton Sharp <[email protected]> | |
*/ | |
class DateTime extends \DateTime | |
{ | |
/** | |
* @param int|null $year |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Server version 5.5.20 | |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
/*!40101 SET NAMES utf8 */; | |
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; | |
/*!40103 SET TIME_ZONE='+00:00' */; | |
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; | |
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(['"A-z\)])(?!;) ?\?> | |
$1;?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delimiter $$ | |
create procedure drop_tables_like(pattern varchar(255), db varchar(255)) | |
begin | |
select @str_tables:=group_concat(table_name) | |
from information_schema.tables | |
where table_schema=db and table_name like pattern; | |
IF @str_tables IS NOT NULL THEN | |
SET @str_sql := concat('drop table ', @str_tables); | |
prepare stmt from @str_sql; |
NewerOlder