Skip to content

Instantly share code, notes, and snippets.

View wkhayrattee's full-sized avatar

Wasseem Khayrattee wkhayrattee

View GitHub Profile
@wkhayrattee
wkhayrattee / gist:5161f607ac116cddeb5f
Last active August 29, 2015 14:22
Composer Hanging after extracting symfony/http-kernel (v2.7.0)
root@e2c2b31affb9:/var/www/khayrattee/sample_project# composer.phar -o -vvv update -v
Reading ./composer.json
Loading config file ./composer.json
Executing command (CWD): git describe --exact-match --tags
Executing command (CWD): git branch --no-color --no-abbrev -v
Executing command (CWD): hg branch
Executing command (CWD): svn info --xml
Failed to initialize global composer: Composer could not find the config file: /root/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
@wkhayrattee
wkhayrattee / gist:c18a78e11bb8d14f3fd2
Last active August 29, 2015 14:22
7PHP Temptative Interview for #20yearsofphp
>> The first PHP Person that you met & that probably played a vital part in your PHP life
>> If you look back at the previous 20yrs, what is the one lesson that you've learned:
- by using PHP as a language
- by sticking to PHP as a community
>> One reason why PHP has survived and even transcend itself into success since the last 20yrs
>> Your message to New PHPers who will join us now looking forward for the next 20yrs
@wkhayrattee
wkhayrattee / TheBadCode
Last active December 28, 2015 01:25
Wrongly Positioning a 'Return' Statement Inside An Inner 'Finally' Block Can Be Lethal
<?php
/**
* To demonstrate the effect of a return in a finally
*
* @author Khayrattee Wasseem <[email protected]>
* @link http://7php.com (blog)
* @link http://Khayrattee.com (website)
* @copyright 2007-2015 Khayrattee.com
*/
--
-- Table structure for table `country_t`
--
CREATE TABLE IF NOT EXISTS `country_t` (
`country_id` int(5) NOT NULL AUTO_INCREMENT,
`iso2` char(2) DEFAULT NULL,
`short_name` varchar(80) NOT NULL DEFAULT '',
`long_name` varchar(80) NOT NULL DEFAULT '',
`iso3` char(3) DEFAULT NULL,
@wkhayrattee
wkhayrattee / APACHE_content-security-policy.conf
Last active April 18, 2017 15:00
APACHE to NGINX | content-security-policy.conf
# REF: https://github.com/h5bp/server-configs-apache/blob/master/src/security/content-security-policy.conf
<IfModule mod_headers.c>
Header set Content-Security-Policy "script-src 'self'; object-src 'self'"
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
Header unset Content-Security-Policy
</FilesMatch>
</IfModule>
@wkhayrattee
wkhayrattee / keybase.md
Last active October 16, 2023 21:12
Keybase verification

Keybase proof

I hereby claim:

  • I am wkhayrattee on github.
  • I am khayrattee (https://keybase.io/khayrattee) on keybase.
  • I have a public key whose fingerprint is CA66 BA9E 57FA 1EFD 20E6 8B31 D05D A6F9 0D93 872C

To claim this, I am signing this object:

@wkhayrattee
wkhayrattee / varnish.service
Created May 13, 2020 13:02 — forked from ThijsFeryn/varnish.service
varnish systemd service
[Unit]
Description=Varnish Cache Plus, a high-performance HTTP accelerator
After=network-online.target
[Service]
Type=forking
KillMode=process
# Maximum number of open files (for ulimit -n)
LimitNOFILE=131072

Background

While I'm learning how to use Nginx, I was instructed to update the server_names_hash_bucket_size (/etc/nginx/nginx.conf) value from 32 to 64, but I don't understand why should I increase the value to 64.

References

References that have been read so far:

@wkhayrattee
wkhayrattee / gist:b01b71a0b19aa5ffa9ee01618c59f53d
Created August 16, 2024 21:51
Wasseem Khayrattee Tez profile verification
I am attesting that this GitHub handle wkhayrattee is linked to the Tezos account tz1WpGA4E1vEFb86537L1GUKS2dY1jVeX6kt for tzprofiles
sig:edsigu1DUzjZCXC1xNprV1a72XGPh3bGuVC59hmfCHkcABLcgHYCA6v3gwBd273wBUJTvHRWYjkiDjV9Ry39DhAWCpCJtefTHxd