<p>{{ if not .PriceDate.IsZero }}{{ .PriceDate.Format "02.01.2006 15:04:05" }}{{ end }}</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
#!/bin/bash | |
# Recursive file convertion utf-8 --> windows-1251 | |
# Place this file in the root of your site, add execute permission and run | |
# Converts *.php, *.html, *.css, *.js files. | |
# To add file type by extension, e.g. *.cgi, add '-o -name "*.cgi"' to the find command | |
find ./ -name "*.php" -o -name "*.html" -o -name "*.css" -o -name "*.js" -type f | | |
while read file | |
do |
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
v := reflect.ValueOf(client) | |
for i := 0; i < v.NumField(); i++ { | |
key := v.Type().Field(i).Name | |
value := "" | |
switch v.Field(i).Type().String() { | |
case "int64": | |
value = strconv.Itoa(int(v.Field(i).Int())) |
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/bash | |
#Assign existing hostname to $hostn | |
hostn=$(cat /etc/hostname) | |
#Display existing hostname | |
echo "Existing hostname is $hostn" | |
#Ask for new hostname $newhost | |
echo "Enter new hostname: " | |
read newhost |
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
echo "Start" && \ | |
curl -fsSL https://get.docker.com -o get-docker.sh && \ | |
sh get-docker.sh && \ | |
curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && \ | |
chmod +x /usr/local/bin/docker-compose && \ | |
echo "Finish" |
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
CREATE OR REPLACE FUNCTION card_section_after_delete_func() | |
RETURNS trigger AS | |
$BODY$ | |
DECLARE | |
_skew_tree INTEGER; | |
BEGIN | |
PERFORM lock_card_section(OLD.tree); | |
-- Проверяем, стоит ли выполнять триггер: | |
IF OLD.trigger_for_delete = TRUE THEN RETURN OLD; END IF; | |
-- Помечаем на удаление дочерние узлы: |
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
OVPN_DATA="ovpn-data" && \ | |
YOUR_IP="8.8.8.8" && \ | |
CLIENTNAME="x1" && \ | |
docker volume create --name $OVPN_DATA && \ | |
docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm kylemanna/openvpn ovpn_genconfig -u udp://$YOUR_IP && \ | |
docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm -it kylemanna/openvpn ovpn_initpki && \ | |
docker run -v $OVPN_DATA:/etc/openvpn -d -p 1194:1194/udp --cap-add=NET_ADMIN kylemanna/openvpn | |
# Generate a client certificate without a passphrase | |
# docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm -it kylemanna/openvpn easyrsa build-client-full $CLIENTNAME nopass |
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
-- Create a group | |
CREATE ROLE readaccess; | |
-- Grant access to existing tables | |
GRANT USAGE ON SCHEMA public TO readaccess; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; | |
-- Grant access to future tables | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; |
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 main | |
import ( | |
"fmt" | |
"time" | |
) | |
var chExit chan struct{} | |
const TimeSleepRecover = 10 |
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
for fn in $(docker ps -aqf "name=php"); do | |
docker exec $fn /usr/lib/php/sessionclean | |
done |
OlderNewer