Skip to content

Instantly share code, notes, and snippets.

@nanusdad
nanusdad / excel_to_csv_to_mysql.md
Last active November 28, 2015 07:16
Excel to CSV to MySQL
  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 / mongo_insert_from_json_file.md
Last active January 30, 2019 19:00
Inserting data from JSON files into mongo

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 / watermarking.md
Last active November 4, 2016 15:17
Watermarking with ImageMagick

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 / readingURLquerydetails.html
Created December 8, 2016 07:02
HTML / JS code to read and process URL query details
<html>
<head>
<title>Confirmation Form</title>
</head>
<body>
<p id="demo">
</p>
@nanusdad
nanusdad / building_with_openssl.md
Last active March 30, 2017 19:05
Building with openssl

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 / expressjs_with_godaddy_certs.md
Last active November 15, 2024 10:25
Express JS with GoDaddy SSL Certificates

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 / ionic_android_build_on_mac.md
Last active November 16, 2017 13:27
Android APK with Ionic and Mac

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
$stdout = File.new('console.out', 'w')

#You may also need to call this once:

$stdout.sync = true
@nanusdad
nanusdad / bitnami_wordpress_admin_passwd_change.md
Last active March 6, 2018 09:51
Bitnami Wordpress Admin Password Change
cd /opt/bitnami/apps/wordpress/
sudo ./bnconfig --userpassword YOUR_NEW_PASSWORD
@nanusdad
nanusdad / .gitignore
Created April 18, 2018 19:06 — forked from smebberson/.gitignore
Express simple authentication example
node_modules
*.swp