Skip to content

Instantly share code, notes, and snippets.

View icarrr's full-sized avatar
🚴
Cycling anywhere and Work from everywhere

Faizar Septiawan icarrr

🚴
Cycling anywhere and Work from everywhere
View GitHub Profile
" Automatic reloading of .vimrc
autocmd! bufwritepost ~/.vimrc source %
" Show whitespace
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
au InsertLeave * match ExtraWhitespace /\s\+$/
filetype off
filetype plugin indent on
syntax on
@maciakl
maciakl / gist:4531580
Last active April 20, 2021 11:17
Adding Ubuntu PPA repository behind a firewall. When you are behind a corporate firewall that only allows outbound traffic on ports 80 and 433 the usual apt-add-repository command will not work. To get around it. Here is the workaround.
# trying to install PPA behind firewall fails:
$ sudo add-apt-repository ppa:chris-lea/node.js
gpg: requesting key C7917B12 from hkp server keyserver.ubuntu.com
gpgkeys: HTTP fetch error 7: couldn't connect to host
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
recv failed
# this is how you get around it (use the key from the command above)
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C7917B12
@deepak365
deepak365 / How to install redash in mac.
Last active May 27, 2022 05:38
How to install redash in mac.
What is redash?
Redash is database viewer included BI tool inside. Redash has support for querying multiple databases, including: Redshift, Google BigQuery, PostgreSQL, MySQL, Graphite, Presto, Google Spreadsheets, Cloudera Impala, Hive and custom scripts.
Prerequisite :
1. Install docker
2. Install git
git clone https://github.com/getredash/redash.git
docker-compose -f docker-compose.production.yml run --rm server create_db
docker-compose -f docker-compose.production.yml up
@antoviaque
antoviaque / gist:0b6cc931290881de546319cf673186f6
Last active June 16, 2022 15:58
Open edX - SSO Doc - Draft

Third Party Authentication Features in Open edX: Technical Knowledge Transfer

Part 1: Background / Notes

  • Open edX has full, integrated support for three different types of third party auth provider:
    1. OAuth based providers (OAuth2 and the older OAuth v1). Google, Facebook, LinkedIn, and Azure Active Directory are available by default. Any other OAuth backends supported by python-social-auth v0.2.12 can be enabled by changing a configuration setting. Contributed by Google (John Cox).
    2. SAML / Shibboleth. SAML is an SSO standard mostly used by universities and corporations. Shibboleth is the name of a particular implementation of SAML, commonly used by higher ed. institutions.
    3. LTI. Users can use Learning Tools Interoperability® (LTI®) to authenticate. Support for this was contributed by UBC.
  • The Open edX platform also includes limited support for the following SSO providers.
  1. [
@funzoneq
funzoneq / simplehttp.service
Created May 25, 2016 13:24
A systemd file for a python SimpleHTTPServer
[Unit]
Description=Job that runs the python SimpleHTTPServer daemon
Documentation=man:SimpleHTTPServer(1)
[Service]
Type=simple
WorkingDirectory=/tmp/letsencrypt
ExecStart=/usr/bin/python -m SimpleHTTPServer 80 &
ExecStop=/bin/kill `/bin/ps aux | /bin/grep SimpleHTTPServer | /bin/grep -v grep | /usr/bin/awk '{ print $2 }'`
@oxlb
oxlb / xcode-uninstall.sh
Created July 23, 2020 06:25
SH file to uninstall Xcode from MacOS
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf /Applications/Xcode.app
rm -rf ~/Library/Caches/com.apple.dt.Xcode
rm -rf ~/Library/Developer
rm -rf ~/Library/MobileDevice
rm -rf ~/Library/Preferences/com.apple.dt.Xcode.plist
@sv99
sv99 / How can I replace a newline (\n) using sed.md
Last active December 5, 2023 13:43
How can I replace a newline (\n) using sed?

stackoverflow (hdorio)

Fast answer:

sed ':a;N;$!ba;s/\n/ /g' file
  1. :a create a label 'a'
  2. N append the next line to the pattern space
  3. $! if not the last line, ba branch (go to) label 'a'
  4. s substitute, /\n/ regex for new line, / / by a space, /g global match (as many times as it can)
@shrayasr
shrayasr / fu-garmin-bulk-delete.js
Created March 28, 2018 06:03
Bulk delete activities in Garmin Connect
function foo() {
console.log("foo - start")
$("button.search-button").click()
setTimeout(function() {
var li = $(".list-item")[0]
var delButton = $(li).find("button.js-activity-delete")
var confirmDelButton = $(li).find("button.delete-yes")
console.log(delButton, confirmDelButton)
@mingfang
mingfang / convert id_rsa to pem
Last active March 3, 2024 08:46
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 600 id_rsa.pem
@y-yoi
y-yoi / query_export.py
Created April 16, 2019 04:18
Redash query export/import command
import click
import requests
template = u"""/*
Name: {name}
Description: {description}
Data source: {data_source}
Created By: {created_by}
Last Update At: {last_updated_at}
*/