Skip to content

Instantly share code, notes, and snippets.

View yugaego's full-sized avatar
🌻
Let the flowers grow.

YE yugaego

🌻
Let the flowers grow.
View GitHub Profile
@yugaego
yugaego / gist:a5ebe71139d925d5790a
Last active August 29, 2015 14:04
APCu configuration
[apc]
apc.coredump_unmap=0
apc.enable_cli=0
apc.enabled=1
apc.entries_hint=1024
apc.gc_ttl=600
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.preload_path=""
apc.rfc1867=0
apc.rfc1867_freq=0
@yugaego
yugaego / gist:79c7dedbd1f9a71e558b
Created July 25, 2014 13:58
OPCache configuration
[OPCache]
opcache.enable=1
opcache.enable_cli=0
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=2000
opcache.max_wasted_percentage=5
opcache.use_cwd=1
opcache.validate_timestamps=0
opcache.revalidate_freq=0
@yugaego
yugaego / gist:339cf00d1c0e3ec814b6
Created October 9, 2014 02:35
curl post request from cli
curl -v -3 -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"data1": "data1", "data2":"data2"}' https://domain.com/path
@yugaego
yugaego / gist:7018f1f8fc4859193f24
Created December 19, 2014 01:52
Source env vars for a cron job
30 01 * * * cd /home/username; /bin/bash -l -c -x 'source .bash_profile; path/to/command/command.sh' > /dev/null 2>&1
@yugaego
yugaego / gist:f45193114b279804fb44
Created January 11, 2015 08:19
Bootstrap 3 Sticky Footer
/* Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
@yugaego
yugaego / gist:2e08ad56f9ed128d1e18
Last active August 29, 2015 14:13
SSL virtual hosts example Config
LoadModule ssl_module modules/mod_ssl.so
Listen 443
SSLPassPhraseDialog exec:/usr/bin/ssl_passphrase.sh
SSLSessionCache shmcb:/var/cache/mod_ssl/scache(512000)
SSLSessionCacheTimeout 300
SSLMutex default
SSLRandomSeed startup file:/dev/urandom 256
SSLRandomSeed connect builtin
SSLCryptoDevice builtin
NameVirtualHost *:443
@yugaego
yugaego / gist:eb0b62a5ba4bae361edf
Created January 14, 2015 04:15
CLI find files/dirs and add permissions
find . -type f -print0 | xargs -0 chmod 664 -- add group write permission for files
find . -type d -print0 | xargs -0 chmod 775 -- add group write permission for directories
@yugaego
yugaego / gist:7b3e7ef6e03831e5f75d
Created January 14, 2015 06:19
Facebook Login Channel File
<?php
$cache_expire = 60*60*24*365;
header("Pragma: public");
header("Cache-Control: max-age=".$cache_expire);
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$cache_expire) . ' GMT');
?>
<script type="text/javascript">document.domain = "domain.com";</script>
<script src="//connect.facebook.net/en_US/all.js"></script>
@yugaego
yugaego / gist:97597dc4234ab3afdbd8
Created January 16, 2015 08:45
USA states php array
$usaStates = array(
'' => 'Select State',
'AL' => "Alabama",
'AK' => "Alaska",
'AZ' => "Arizona",
'AR' => "Arkansas",
'CA' => "California",
'CO' => "Colorado",
'CT' => "Connecticut",
'DE' => "Delaware",
@yugaego
yugaego / gist:9ad75212f7799971a654
Created April 6, 2015 11:39
Apache web site performance optimisations
<Directory />
<IfModule mod_deflate.c>
# Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
# Compress all output labeled with one of the following MIME-types