This file contains hidden or 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
import asyncio | |
# Async operation definition remains the same | |
async def async_operation(): | |
print("Starting async operation") | |
await asyncio.sleep(1) | |
print("Async operation completed") | |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# standard python imports | |
import logging | |
from rich.logging import RichHandler | |
from rich.traceback import install | |
import os | |
install() | |
This file contains hidden or 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
#!/usr/bin/env bash | |
# ex: set fdm=marker | |
# usage {{{1 | |
#/ Usage: | |
#/ ./build.sh -r "REGISTRY/NAME" [OPTIONS] | |
#/ | |
#/ -c|--context) | |
#/ the context in which to do the `docker build` | |
#/ | |
#/ -r|--registry) |
This file contains hidden or 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
const puppeteer = require("puppeteer"); | |
const opn = require("opn"); | |
const nodemailer = require("nodemailer"); | |
const timeout = 5000; | |
const waitForTimeout = 1000; | |
const cartLink = | |
"https://store.nvidia.com/store/nvidia/en_US/buy/productID.5438481700/clearCart.yes/nextPage.QuickBuyCartPage"; |
This file contains hidden or 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
#!/usr/bin/env bash | |
# ex: set fdm=marker | |
# usage {{{1 | |
#/ Usage: | |
#/ -h|-?|--help) | |
#/ show this help and exit | |
#/ | |
# 1}}} | |
# environment {{{1 | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
This file contains hidden or 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
Install pyenv on Ubuntu 18.04 + fish shell | |
- Install the packages required to compile Python | |
$ sudo apt-get update; sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev | |
- Download pyenv code from github | |
$ git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
- Define environment variable PYENV_ROOT to point to the path where pyenv repo is cloned | |
$ echo "set --export PYENV_ROOT $HOME/.pyenv" > ~/.config/fish/conf.d/pyenv.fish |
This file contains hidden or 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
################################################################## | |
## Native hdfs access (only on the cluster) | |
# conda install -c conda-forge libhdfs3=2.3.0=1 hdfs3 --yes | |
import hdfs3 | |
import pandas as pd | |
nameNodeHost = 'hadoopnn1.localdomain' | |
nameNodeIPCPort = 8020 | |
hdfs = hdfs3.HDFileSystem(nameNodeHost, port=nameNodeIPCPort) |
This file contains hidden or 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 | |
# put your instance id here | |
instance="dev######" | |
# make sure your password doesn't have shell operators in it | |
credentials="admin:password" | |
while true; do | |
entropy=`rand` | |
outdata="{\"short_description\":\"Automated incident $entropy\"}" |
This file contains hidden or 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
// See this for important info : | |
http://docs.geoserver.org/stable/en/user/_sources/rest/examples/curl.txt | |
// Get all workspaces | |
curl -v -u admin:geoserver -GET http://localhost:8080/geoserver/rest/workspaces.xml | |
// Create a new WORKSPACE | |
curl -u admin:geoserver -v -XPOST -H 'Content-type:text/xml' |
This file contains hidden or 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/sh | |
### BEGIN INIT INFO | |
# Provides: GeoServer | |
# Required-Start: $local_fs $network $named $time $syslog | |
# Required-Stop: $local_fs $network $named $time $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Description: Starts and stops the GeoServer, which should be located at /usr/share/geoserver | |
### END INIT INFO |
NewerOlder