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 / init.rb
Last active August 29, 2015 14:17 — forked from lintaonz/init.rb
#
# vendor/plugins/redmine_wiki_html_util/init.rb
#
require 'redmine'
require 'open-uri'
Redmine::Plugin.register :redmine_gist do
name 'Redmine Wiki HTML Util'
author 'Arlo Carreon'
author_url 'http://www.arlocarreon.com/'
name = MyModule
description = My Module
core = 7.x
package = MyModule
php = 5.2.4
dependencies[] = views
files[] = mymodule_handler_filter_fulltext.inc
@thelebster
thelebster / drupal-test.js
Created September 30, 2015 04:25 — forked from rupl/drupal-test.js
This sample accompanies a blog post series about CasperJS found at http://fourword.fourkitchens.com/article/testing-drupal-casperjs
/**
* @file
* Testing a demo of Drupal. The script will log in and check for various
* features in Drupal core. This demo was inspired by a similar script for
* a Wordpress site. The original script was written by Henrique Vicente.
*
* @see https://github.com/henvic/phantom-casper-simple-talk/blob/master/wordpress.js
*/
// Set up variables to visit a URL and log in.
@thelebster
thelebster / hook_menu_block_blocks
Created October 30, 2015 05:09 — forked from jeffam/hook_menu_block_blocks
Default Menu Blocks
<?php
/**
* Implements hook_menu_block_blocks().
*/
function sidebar_menu_menu_block_blocks() {
// The array key is the block delta used by menu block.
return array(
'sidebar_subnav' => array(
'title_link' => TRUE,
'admin_title' => 'Current Menu Children',
@thelebster
thelebster / resend.php
Created November 19, 2015 18:51 — forked from gavinblair/resend.php
Drupal - resend activation email
<?php
$uid = 120;
$user = user_load(array('uid' => $uid));
$op = 'status_activated';
_user_mail_notify($op, $user);
@thelebster
thelebster / resend.php
Created November 19, 2015 18:51 — forked from signalpoint/resend.php
Drupal - resend welcome e-mails on users administration form.
<?php
/**
* Implements hook_user_operations().
*/
function example_user_operations() {
$operations = array(
'example_resend_welcome_email' => array(
'label' => t('Re-send welcome e-mail'),
'callback' => 'example_resend_welcome_email',
@thelebster
thelebster / fix-drupal-permissions.sh
Created January 20, 2016 13:07
Drupal - Bash shell script to fix Drupal permissions
#!/bin/bash
path=${1%/}
user=${2}
group="www-data"
help="nHelp: This script is used to fix permissions of a drupal installationnyou need to provide the following arguments:nt 1) Path to your drupal installationnt 2) Username of the user that you want to give files/directories ownershipnNote: "www-data" (apache default) is assumed as the group the server is belonging to, if this is different you need to modify it manually by editing this scriptnnUsage: (sudo) bash ${0##*/} drupal_path user_namen"
if [ -z "${path}" ] || [ ! -d "${path}/sites" ] || [ ! -f "${path}/modules/system/system.module" ]; then
echo "Please provide a valid drupal path"
echo -e $help
Installation Steps
PART 1: INSTALLING & CONFIGURING APACHE, MYSQL, & PHP ON WINDOWS (WAMP)
----------------------------------------------------------------------------------
1. Download WampServer from http://www.wampserver.com/en/ & install.
C:\wamp is a good location. Do not run WampServer yet.
2. Configure MySQL. The default MySQL configuration file is very limiting. Choose one
of the model config files that best suits your system and copy & paste it to "wampserver.conf".
@thelebster
thelebster / RecordMyDesktop
Created February 11, 2016 14:08 — forked from Mouad-BGD/RecordMyDesktop
RecordMyDesktop for Fedora
yum install recordmydesktop gtk-recordmydesktop
It shows what you can do to make a user use SFTP only and disallow SSH usage for that user. All you have to do is change the user's login shell to /usr/lib/openssh/sftp-server ,e.g.:
usermod -s /usr/lib/openssh/sftp-server username
/usr/lib/openssh/sftp-server must be listed in /etc/shells as a valid login shell, so if it isn't already listed, please add it to /etc/shells as follows:
echo '/usr/lib/openssh/sftp-server' >> /etc/shells
************************************************************************************************************************
or