Skip to content

Instantly share code, notes, and snippets.

View rlam3's full-sized avatar

rlam3

View GitHub Profile
import os
fullpath = os.path.join(os.sys.path[0],'path/to/file/or/folder'
# size of folder or file
# reminder: folder size does not include content within folder
os.stat(fullpath).st_size
@rlam3
rlam3 / ElasticSearch.sh
Created April 12, 2016 14:48 — forked from ricardo-rossi/ElasticSearch.sh
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
@rlam3
rlam3 / .swift
Last active August 31, 2016 21:32
let endpoint = Endpoint<ApiRouter>(
URL: target.baseURL.URLByAppendingPathComponent(target.path).absoluteString,
sampleResponseClosure: EndpointSampleResponse.NetworkResponse(200, NSData()), /// ERROR HERE .SUCCESS does not exists
method: target.method,
parameters: target.parameters,
parameterEncoding: self.parameterEncoding(target),
httpHeaderFields: [:]
)
@rlam3
rlam3 / nginx.conf
Created March 31, 2017 14:35 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@rlam3
rlam3 / letsencrypt_2016.md
Created April 3, 2017 23:06 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two modes when you don't want Certbot to edit your configuration:

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80) to renew certificates.

In the following, we're setting up mydomain.com to be served from /var/www/mydomain, and challenges will be served from /var/www/letsencrypt.

@rlam3
rlam3 / letsencrypt_2016.md
Created April 3, 2017 23:06 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two modes when you don't want Certbot to edit your configuration:

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80) to renew certificates.

In the following, we're setting up mydomain.com to be served from /var/www/mydomain, and challenges will be served from /var/www/letsencrypt.

<template>
<q-layout view="lHh Lpr lFf">
<q-layout-header>
<q-toolbar
color="primary"
:glossy="$q.theme === 'mat'"
:inverted="$q.theme === 'ios'"
>
<q-toolbar-title>
Quasar App 02
<template>
<q-page padding>
<!-- content -->
<q-card inline @click.native="handler1">
<q-card-media>
<img src="~assets/quasar-logo-full.svg">
</q-card-media>
<q-card-title>
Cafe Basilico
<div slot="right" class="row items-center">
@rlam3
rlam3 / Fastfile
Created December 5, 2018 04:31
increment build number
default_platform(:ios)
platform :ios do
before_all do |lane|
increment_build_number
end
# Beta TestFlight Lane
lane :testflight do
@rlam3
rlam3 / .git_ignore
Created January 12, 2019 22:33
2019_01_12_ios_swift_newbie_gotcha_medium_001
*.ipa
*.app.dSYM.zip