Skip to content

Instantly share code, notes, and snippets.

View thelebster's full-sized avatar
:octocat:
Do nothing, it is ok.

Anton Lebedev thelebster

:octocat:
Do nothing, it is ok.
View GitHub Profile
@thelebster
thelebster / Modules
Created February 11, 2016 14:10 — forked from Mouad-BGD/Modules
drupal
Multi-language
Language icons
Translation Management
translation table
@thelebster
thelebster / Errors
Created February 11, 2016 14:12 — forked from Mouad-BGD/Errors
LAMP server
MySQL errors
-------------
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’
start mysql deamon
phpMyAdmin
----------
Forbidden
You donEdit the /etc/httpd/conf.d/phpmyadmin.conf and uncomment the line deny from all.
@thelebster
thelebster / linux--tar
Created February 11, 2016 14:13 — forked from Mouad-BGD/linux--tar
tar commands
tar
---
tar -zxvf {file.tar.gz}
another distenation
tar -zxvf tarball.tar.gz -C <directory>
or move to ur destination and use:
tar -zxvf {path to file.tar.gz}
@thelebster
thelebster / image_assist_fix.php
Created March 22, 2016 07:33 — forked from olleolleolle/image_assist_fix.php
PHP script to convert Image Assist Tag into HTML tags
<?php
/**
* PHP script to convert Image Assist Tag into HTML tags.
*
* Drupal 6-to-7 conversion
*
* This script must be run on D7 database (after the update from D6 to D7).
* http://drupal.org/node/841568
*/
@thelebster
thelebster / newsite
Created April 8, 2016 03:04 — forked from tsi/newsite
Bash script to create virtual hosts and prepare your drupal directory.
#!/bin/bash
# This script creates virtual hosts and prepares your mysql DB and drupal directory.
# you should put it under /usr/local/bin/
# and run it with sudo newsite
# Set the path to your localhost
www=/var/www
echo "Enter directory name under $www"
read sn
@thelebster
thelebster / Dockerfile
Created April 12, 2016 13:15 — forked from MoriTanosuke/Dockerfile
Simple docker file to install and run IntelliJ Upsource
FROM debian:stable
EXPOSE 8080
RUN apt-get -y update && apt-get -y upgrade && apt-get -y install unzip wget openjdk-7-jdk
RUN wget -q http://download.jetbrains.com/upsource/upsource-1.0.12551.zip && unzip upsource-1.0.12551.zip
RUN cd Upsource && ./bin/upsource.sh start
@thelebster
thelebster / check-files-exist-from-list.sh
Created April 14, 2016 09:27 — forked from HelenaEksler/check-files-exist-from-list.sh
Bash script to check files in list exist in directory
#!/usr/bin/env bash
#Check Files in list from file exist or doesn't exist in directory.
if [ $# -eq 0 ] || [ $# -eq 1 ]
then
echo "You must pass the path to file with the list and the path to directory to check files. \nsh check-file-exist-from-list.sh path/to/file path/to/directory"
exit 1
fi
while read -r file; do
@thelebster
thelebster / MigrateBase.php
Created April 14, 2016 09:30 — forked from HelenaEksler/MigrateBase.php
Function to add translation object to the migrated entity.
<?php
public function addLanguagesToEntityTranslations($entity_type, $entity) {
// Get the basic information about the entity.
$entity_info = entity_get_info($entity_type);
// Get the existing site languages.
$languages = array_keys(language_list());
// Add to the entity translation object. Set the original language to
// the entity's default language.
@thelebster
thelebster / Field formatter view
Created April 14, 2016 09:32 — forked from HelenaEksler/Field formatter view
Custom field formatter view for the body field.
/**
* Implements hook_field_formatter_info().
*/
function c4m_message_field_formatter_info() {
return array(
'summary_with_image' => array(
'label' => t('Summary or trimmed with image'),
'field types' => array('text_with_summary'),
)
);
@thelebster
thelebster / README.md
Created April 19, 2016 12:45 — forked from AndreasStokholm/README.md
Auto-deploy with php and github on an Ubuntu Amazon EC2 box

##Auto-deploy with php and github on an Ubuntu Amazon EC2 box

Fork from other gist Build auto-deploy with php and git(hub) on an EC2 AMAZON AMI instance - Covers a basic Ubuntu isntall

When ever it says www-data below, it's the user Apache runs under. So if your apache user is called something else, change it to that.

##Install git

sudo aptitude install git-core