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
# Should be run under SYSTEM user | |
$Devs = Get-PnpDevice -class net | ? Status -eq Error | Select FriendlyName,InstanceId | |
ForEach ($Dev in $Devs) { | |
Write-Host "Incorrect device $($Dev.FriendlyName) $($Dev.InstanceId)" -ForegroundColor Yellow | |
$RemoveKey = "HKLM:\SYSTEM\CurrentControlSet\Enum\$($Dev.InstanceId)" | |
Write-Host "Removing ${RemoveKey}..." -ForegroundColor White | |
Get-Item $RemoveKey | Select-Object -ExpandProperty Property | %{ Remove-ItemProperty -Path $RemoveKey -Name $_ -Verbose } | |
} |
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 | |
/** | |
* A copy of WordPress' sanitize_file_name function that doesn't replace | |
* spaces with dashes. Use on the sanitize_file_name filter to stop WordPress | |
* replacing filenames with dashes. | |
* | |
* ...Or don't. It's probably a bad idea. | |
* | |
* @param string $sanitized_filename The previously sanitized filename. | |
* @param string $filename The original unsanitized filename. |
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
/ip firewall address-list add list=MStelemetry address=111.221.29.177 | |
/ip firewall address-list add list=MStelemetry address=111.221.29.253 | |
/ip firewall address-list add list=MStelemetry address=131.253.40.37 | |
/ip firewall address-list add list=MStelemetry address=134.170.30.202 | |
/ip firewall address-list add list=MStelemetry address=134.170.115.60 | |
/ip firewall address-list add list=MStelemetry address=134.170.165.248 | |
/ip firewall address-list add list=MStelemetry address=134.170.165.253 | |
/ip firewall address-list add list=MStelemetry address=134.170.185.70 | |
/ip firewall address-list add list=MStelemetry address=137.116.81.24 | |
/ip firewall address-list add list=MStelemetry address=137.117.235.16 |
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
try { | |
$db = new PDO($config['db_driver'] . ":dbname=" . $config['db_name'] . ";host=" . $config['db_host'], $config['db_user'], $config['db_pass']); | |
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_NUM); | |
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); | |
$db->query("SET NAMES '{$config['db_charset']}'"); | |
} catch (PDOException $e) { | |
exit("Database connection error!"); | |
} |
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{ | |
listen [port]; | |
server_name [url] [www.url]; | |
access_log [access_log_location]; | |
error_log [error_log]; | |
root [where_to_serve_from]; | |
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last; | |
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last; |
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 { | |
listen [port]; | |
server_name [web url]; | |
access_log [access_log_location]; | |
error_log [error_log_location]; | |
root [where_to_serve from]; | |
index index.html index.php; | |
# If file is an asset, set expires and break |
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 | |
/** | |
* The list of countries and dependent territories based on ISO 3166 standard. | |
* | |
* Source: http://en.wikipedia.org/wiki/ISO_3166-1 ISO 3166-1 | |
*/ | |
class Listo_Countries implements Listo { | |
private static $items = array( | |
'rus' => "Российская Федерация", |
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 | |
/* vars for export */ | |
// database record to be exported | |
$db_record = 'XXXXXXXXX'; | |
// optional where query | |
$where = 'WHERE 1 ORDER BY 1'; | |
// filename for export | |
$csv_filename = 'db_export_'.$db_record.'_'.date('Y-m-d').'.csv'; | |
// database variables |
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
# I like how Rails has each controller in it's own file and it's automatically loaded and I'm trying to do the same for my Sinatra site. | |
# I have, for example, my "Users" pages, which is users/login, users/logout and so on, what I'd like to do is seperate all these, and other pages, like news, admincp, and so on into their own files. | |
# This is how I accomplished this with my project. | |
# I put all the "controllers" in a directory, I then created a file named init.rb with the following code: | |
Dir.glob(File.dirname(__FILE__) + '/*.rb').each do |controller| | |
require(controller) | |
end |
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
vlc.exe "inputVideo.mp4" --fullscreen --no-mouse-events --loop --no-osd --no-audio |
NewerOlder