Skip to content

Instantly share code, notes, and snippets.

@nanusdad
nanusdad / bitnami_wordpress_admin_passwd_change.md
Last active Mar 6, 2018
Bitnami Wordpress Admin Password Change
View bitnami_wordpress_admin_passwd_change.md
cd /opt/bitnami/apps/wordpress/
sudo ./bnconfig --userpassword YOUR_NEW_PASSWORD
View Rails_console_output.md
$stdout = File.new('console.out', 'w')

#You may also need to call this once:

$stdout.sync = true
@nanusdad
nanusdad / ionic_android_build_on_mac.md
Last active Nov 16, 2017
Android APK with Ionic and Mac
View ionic_android_build_on_mac.md

Using Ionic to build Android APK on Mac

  • Install NodeJS
  • Install ionic and cordova
npm install -g ionic cordova
  • Might need to install node-sass
  • Requires CocoaPods
sudo gem install cocoapods
@nanusdad
nanusdad / expressjs_with_godaddy_certs.md
Last active Dec 15, 2020
Express JS with GoDaddy SSL Certificates
View expressjs_with_godaddy_certs.md

How to use GoDaddy SSL certs with Express JS

  • Node requires each certificate in the CA chain to be passed separately in an array.
  • GoDaddy provides a cerficate file (gd_bundle.crt) probably looks like this:
-----BEGIN CERTIFICATE-----
MIIE3jCCA...
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
@nanusdad
nanusdad / building_with_openssl.md
Last active Mar 30, 2017
Building with openssl
View building_with_openssl.md

Commandline:

make dclean
make clean
./config --openssldir=/home/locallinux/lib/openssl no-zlib no-shared
make depend
make test
make all
make install
@nanusdad
nanusdad / readingURLquerydetails.html
Created Dec 8, 2016
HTML / JS code to read and process URL query details
View readingURLquerydetails.html
<html>
<head>
<title>Confirmation Form</title>
</head>
<body>
<p id="demo">
</p>
@nanusdad
nanusdad / watermarking.md
Last active Nov 4, 2016
Watermarking with ImageMagick
View watermarking.md

From StackOverflow

Watermarking with an image is as simple as

composite -dissolve 30% -gravity south watermark.jpg input-file.jpg output-file.jpg

Using the above command as an example, a Bash command for doing this to all files in folder would be:

@nanusdad
nanusdad / mongo_insert_from_json_file.md
Last active Jan 30, 2019
Inserting data from JSON files into mongo
View mongo_insert_from_json_file.md

Inserting data into mongo collection from JSON file

var file = cat('./20-new.json');  # file name
use testdb                        # db name
var o = JSON.parse(file);         # convert string to JSON
db.forms.insert(o)                # collection name

Inserting data using 'meteor mongo' into collection from JSON file

@nanusdad
nanusdad / excel_to_csv_to_mysql.md
Last active Nov 28, 2015
Excel to CSV to MySQL
View excel_to_csv_to_mysql.md
  1. Save Excel worksheet as .csv file
  • might need to change new line characters
  • if saving on Mac - open in vi and run %s/^M/\r/g ( ctrl+M )
  1. Use the following example to load in CSV file from mysql prompt -
    load data infile '/tmp/tc_t.csv' 
    into table new_test_categories 
    fields terminated by ','    
@nanusdad
nanusdad / APK_signing
Last active Apr 28, 2016
APK file signing and zipping for Play Store upload
View APK_signing
cd ~/build-output-directory/android/
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 unaligned.apk your-app-name
$ANDROID_HOME/build-tools/23.0.0/zipalign 4 unaligned.apk production.apk
# To unsign APK
zip -d yourapp.apk "META-INF*"
# Creating keystore and then signing app for Play Store