Skip to content

Instantly share code, notes, and snippets.

View juliend2's full-sized avatar

Julien Desrosiers juliend2

View GitHub Profile
#!/bin/sh
#
# nginx – this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /opt/nginx/conf/nginx.conf
# pidfile: /opt/nginx/logs/nginx.pid
> cap staging deploy
* executing `staging'
* executing "svn delete http://svn.lelait.com/www.lafamilledulait.com/branches/staging --force -m 'Delete branches Staging'"
servers: ["174.142.68.86"]
Password:
[174.142.68.86] executing command
** [out :: 174.142.68.86] svn: PROPFIND request failed on '/www.lafamilledulait.com/branches/staging'
** [out :: 174.142.68.86] svn: PROPFIND of '/www.lafamilledulait.com/branches/staging': 301 Moved Permanently (http://svn.lelait.com)
command finished in 1408ms
failed: "sh -c 'svn delete http://svn.lelait.com/www.lafamilledulait.com/branches/staging --force -m '\\''Delete branches Staging'\\'''" on 174.142.68.86
<?php
$host = "julien.local";
$port = 25003;
// print_r($argv);
$message = $argv[1]; # || "Hello Server";
echo "Message To server :".$message;
// create socket
$socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n");
// connect to server
$result = socket_connect($socket, $host, $port) or die("Could not connect to server\n");
@juliend2
juliend2 / git-status.txt
Last active December 11, 2015 01:49
`git diff` output of a hacked WordPress site
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
#21modified: index.php
# modified: wp-config.php
# modified: wp-content/plugins/advanced-custom-fields/core/controllers/options_page.php
# modified: wp-content/plugins/advanced-custom-fields/core/controllers/settings.php
# modified: wp-content/plugins/advanced-custom-fields/core/fields/page_link.php
@juliend2
juliend2 / gist:4131848
Created November 22, 2012 15:59
SQL queries
-- Tu peux mettre ceci pour avoir la liste de tous les annonceurs (ID et email):
SELECT DISTINCT u.ID, u.user_email
FROM `eswp_users` AS u, `eswp_usermeta` AS um
WHERE u.ID = um.user_ID
AND um.meta_key = 'eswp_capabilities'
AND um.meta_value LIKE '%job_lister%';
-- Pour avoir les membres (chercheurs d'emplois):
@juliend2
juliend2 / .slate
Created October 3, 2012 19:53
My slate config file
# Configs
# --------------------------------------------------
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Aliases
# --------------------------------------------------
alias push-full-screen push up bar-resize:screenSizeY | push right bar-resize:screenSizeX
alias push-full-screen-top throw 0 resize
@juliend2
juliend2 / gist:3670148
Created September 7, 2012 22:08
post category to body class
<body <?php
body_class(
join(' ',
wp_get_post_categories(
get_the_ID(),
array('fields'=>'slugs')
)
)
)
?>>
@juliend2
juliend2 / gist:3557226
Created August 31, 2012 18:46
erreurs lors de l'installation
erreur lors du `sudo php bin/vendors install --reinstall`
remote: Total 11321 (delta 7529), reused 10747 (delta 7047)
Receiving objects: 100% (11321/11321), 1.43 MiB | 938 KiB/s, done.
Resolving deltas: 100% (7529/7529), done.
28d83c32e3dfcb0b3b6b4f16233cbe374b4d55a6
HEAD is now at cc4a6b1 Merge pull request #639 from widop/patch-1
sh: /var/www/poison14/vendor/bundles/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php: not found
PHP Fatal error: Class 'Sensio\Bundle\DistributionBundle\SensioDistributionBundle' not found in /var/www/poison14/app/AppKernel.php on line 29
@juliend2
juliend2 / gist:3409100
Created August 20, 2012 23:16
styles page for WP
Cette page montre tous les styles possibles dans ce blog.
<h1>Titre h1</h1>
<h2>Titre h2</h2>
<h3>Titre h3</h3>
<h4>Titre h4</h4>
<h5>Titre h5</h5>
<h6>Titre h6</h6>
Texte en <strong>Bold</strong>.
Texte en <em>Italique</em>. (NewsCycle ne comporte pas de variante italique)
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/Applications/XAMPP/htdocs/wp_fanclub"
ServerName fanclub.dev.eis5.com
ErrorLog "/Applications/XAMPP/logs/fanclub.localhost-error_log.txt"
CustomLog "/Applications/XAMPP/logs/fanclub.localhost-access_log.txt" common
<Directory "/Applications/XAMPP/xamppfiles/htdocs/wp_fanclub">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Order allow,deny