This gist was created based on the following guide: upgrading to postgresql 11 on centos 7
Create a backup:
sudo -Hiu postgres pg_dumpall > mybackup.sqlInstall PostgreSQL 11:
This gist was created based on the following guide: upgrading to postgresql 11 on centos 7
Create a backup:
sudo -Hiu postgres pg_dumpall > mybackup.sqlInstall PostgreSQL 11:
| /** | |
| Decode a php serialized value to json. This function only supports basic | |
| data types: | |
| - arrays (will always become a json object) | |
| - booleans | |
| - integers | |
| - floats | |
| - strings | |
| - NULL | |
| The php_unserialize(text) function is a helper function which extracts the first value |
| CREATE OR REPLACE FUNCTION slugify(str text) RETURNS text AS $$ | |
| BEGIN | |
| RETURN regexp_replace( | |
| lower(translate(str, | |
| 'äëïöüáéíóúâêîûôåãõàèìòùřšěčůńýśćłęążźĄŃÝŚĆŁĘÄËÏÖÜÁÉÍÓÚÂÊÎÛÔÅÃÕÀÈÌÒÙŘŠĚČŮŻŹß ²ø®', | |
| 'aeiouaeiouaeiouaaoaeioursecunyscleazzANYSCLEAEIOUAEIOUAEIOUAAOAEIOURSECUZzs-2dR' | |
| -- missing chars will be removed | |
| )), | |
| -- strip all others chars than [^a-z0-9 \-] | |
| '[^a-z0-9 \-]', |
| .text-xs-left { text-align: left; } | |
| .text-xs-right { text-align: right; } | |
| .text-xs-center { text-align: center; } | |
| .text-xs-justify { text-align: justify; } | |
| @media (min-width: @screen-sm-min) { | |
| .text-sm-left { text-align: left; } | |
| .text-sm-right { text-align: right; } | |
| .text-sm-center { text-align: center; } | |
| .text-sm-justify { text-align: justify; } |
| # Assumptions: easyrsa3 available in current dir, and functional openssl. | |
| # This basic example puts the "offline" and "sub" PKI dirs on the same system. | |
| # A real-world setup would use different systems and transport the public components. | |
| # Build root CA: | |
| EASYRSA_PKI=offline ./easyrsa init-pki | |
| EASYRSA_PKI=offline ./easyrsa build-ca nopass | |
| # Build sub-CA request: | |
| EASYRSA_PKI=sub ./easyrsa init-pki |
| <?php | |
| /** | |
| * Calculate a unique integer based on two integers (cantor pairing). | |
| */ | |
| function cantor_pair_calculate($x, $y) { | |
| return (($x + $y) * ($x + $y + 1)) / 2 + $y; | |
| } | |
| /** |
Original article: http://www.blue-bag.com/blog/excluding-common-requests-your-apache-logs
Log files can get filled up with repeated calls to files such as favicon, robots.txt, images, css js etc
Mostly you want to log the initial request for a page and not all of the resources subsequently requested.
Troubleshooting other issues may mean you would log files such as favicon, images etc - but generally they needlessly fill up your logs.
Do it ocassionally to look for missing images etc.
| server { | |
| index index.php; | |
| set $basepath "/var/www"; | |
| set $domain $host; | |
| # check one name domain for simple application | |
| if ($domain ~ "^(.[^.]*)\.dev$") { | |
| set $domain $1; | |
| set $rootpath "${domain}"; |
| <?php | |
| //**NOTE**: This has *NOT* been tested yet; please provide feedback in the comments | |
| //Drop-in replacement for PHP's SoapClient class supporting connect and response/transfer timeout and authentication | |
| //Usage: Exactly as PHP's SoapClient class, except that some new options are available: | |
| // timeout The response/transfer timeout in milliseconds; 0 == default SoapClient / CURL timeout | |
| // connecttimeout The connection timeout; 0 == default SoapClient / CURL timeout | |
| // sslverifypeer FALSE to stop SoapClient from verifying the peer's certificate | |
| // sslversion The SSL version (2 or 3) to use. By default PHP will try to determine this itself, although in some cases this must be set manually | |
| // sslverifyhost 1 to check the existence of a common name in the SSL peer certificate. 2 to check the existence of a common name and also verify that |