This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Change the file name. and the part the file to 1000 lines in each part file. | |
split -d -l 1000 --additional-suffix=.csv filename.csv files-part- | |
# Add the heading of the csv file to each parted file. | |
for file in files-part-*.csv; do | |
printf '%s\n' 0a file_id,title_text_en,alt_text_en,title_text_ar,alt_text_ar . w | ed -s "$file" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before you start make sure to run below commands as a root user | |
# switching to root user | |
sudo su - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Thanks to this page: http://chris-allen-lane.com/2012/12/phonegap-compiling-a-release-apk-without-using-phonegap-build/ | |
#USAGE! | |
# 1. Replace <AndroidKeyName> with the filename of the keyfile generated (see url) | |
# 2. Replace <ProjectName> with the project name in the generated file form cordova, see path/to/my/project/platforms/android/bin and look for an APK if you need help | |
# 3. Replace <AndroidKeyNameAlias> from the alias used when generating the key (see url again!) | |
# 4. Edit path/to/my/project/platforms/android/AndroidManifest.xml and change "debuggable=false" (search for it!) | |
# 5. Check path/to/my/project/Release/android for your sparkling new apk! | |
# | |
# This worked and was uploadable to the google play store. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /proc/mounts | |
OR | |
cat /proc/self/mounts | |
mount | |
mount -l | |
df -aTh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# CORS header support | |
# | |
# One way to use this is by placing it into a file called "cors_support" | |
# under your Nginx configuration directory and placing the following | |
# statement inside your location block(s): | |
# | |
# include cors_support; | |
# | |
# A limitation to this method is that Nginx doesn't currently send headers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## On Development | |
# NOTE: make sure that you commented variables with force override in local.settings.php for Varbase 7.x-3.x | |
# ------------------------------------------------------------ | |
# One line commands. | |
# ------------------------------------------------------------ | |
drush vset error_level 2;drush vset preprocess_js 0;drush vset preprocess_css 0;drush vset cache 0;drush vset page_compression 0;drush vset block_cache 0;drush vset file_temporary_path '/tmp';drush en field_ui views_ui context_ui ds_ui dblog -y; | |
## On Development | |
# ------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# The MySQL database server configuration file. | |
# | |
# You can copy this to one of: | |
# - "/etc/mysql/my.cnf" to set global options, | |
# - "~/.my.cnf" to set user-specific options. | |
# | |
# One can use all long options that the program supports. | |
# Run program with --help to get a list of available options and with | |
# --print-defaults to see which it would actually understand and use. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($, Drupal, window, document, undefined) { | |
// Bootstrap Remove empty cols in rows. | |
Drupal.behaviors.removeEmptyCols = { | |
attach: function (context, settings) { | |
// Remove empty col-sm-4 and extend col-sm-8 with col-sm-12. | |
// You will need to add the parent class . like node-teaser to limit the each function. | |
$(".row").each(function() { | |
if ($(this).children('.col-sm-4').html().trim().length === 0) { | |
$(this).children('.col-sm-8').addClass('col-sm-12'); |
OlderNewer