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
#!/bin/sh | |
# ada3 new drive where migration intended | |
gpart add -t efi -s10G -lEFI /dev/ada3 | |
gpart add -t freebsd-swap -s64G -lSWAP /dev/ada3 | |
gpart add -t freebsd-zfs -lSYS /dev/ada3 | |
zfs snapshot -r zsys@full # create snapshot in source pool | |
zfs list -t snapshot # check |
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
package psql | |
import ( | |
"database/sql" | |
"encoding/csv" | |
"fmt" | |
"io" | |
"os" | |
"regexp" | |
"sync" |
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
SELECT (regexp_match(m.file_url, '^.+/(.+)$'))[1] FROM media m WHERE m.file_url LIKE 'http%'; | |
UPDATE media | |
SET file_url = (regexp_match(file_url, '^.+/(.+)$'))[1] | |
WHERE file_url LIKE 'http%'; | |
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
#!/bin/sh | |
zone_base_path='/usr/local/etc/nsd/' | |
update_serial() { | |
acme_fqdn=$1 | |
zone_full_path=$2 | |
# get serial number |
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
#!/bin/sh - | |
# | |
# $FreeBSD$ | |
# | |
if [ -r /etc/defaults/periodic.conf ]; then | |
. /etc/defaults/periodic.conf | |
source_periodic_confs | |
fi |
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
format PE64 GUI 5.0 | |
include 'WIN64WX.INC' | |
section '.data' data readable writeable | |
_start TCHAR 'lets start the game...',0 | |
_ring0 TCHAR 'We are in ring 0',0 | |
_system_lstar dq 0 | |
section '.code' code readable executable |
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
public abstract class BranchNode | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } | |
public string Path { get; set; } | |
[NotMapped] | |
public string ParentPath | |
{ | |
get | |
{ |
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
--- in database of ФИАС get address records recursively until root record | |
WITH RECURSIVE parent AS | |
( SELECT a.* | |
FROM addrobj a | |
WHERE a.aoguid = @locality | |
AND a.actstatus = 1 | |
UNION ALL | |
SELECT ao.* | |
FROM parent p |
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
------------------- HIERARCHYID => MERCID --------------------------- | |
select lpad(' ', 6 * level) || h.displayname as Tree, | |
hd.value mercid, | |
h.hierarchyid, | |
h.authid, | |
h.searchkey, | |
ad.dataid | |
from AUTHHIERARCHY h | |
left join hierarchydata hd | |
on hd.hierarchyid = h.hierarchyid |
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
void Main() | |
{ | |
string sDomain = "ad.microsoft.com"; | |
string sServiceUser = "username"; | |
string sServicePassword = "account_old_password"; | |
string sNewServicePassword = "account_new_password"; | |
var pc = new PrincipalContext(ContextType.Domain, sDomain, sServiceUser, sServicePassword); |
NewerOlder