Skip to content

Instantly share code, notes, and snippets.

View axi92's full-sized avatar

axi92 axi92

  • Vienna
View GitHub Profile
@martinsik
martinsik / chat-frontend.js
Last active December 19, 2023 10:23
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
@wandernauta
wandernauta / sp
Last active July 10, 2024 07:57
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

mkfs.vfat -n config-2 -I /dev/sdc
mkdir -p /media/config-drive
mount /dev/sdc /media/config-drive
mkdir -p /media/config-drive/openstack/latest
cp cloud-config.yml /media/config-drive/openstack/latest/user_data
umount /media/config-drive

NOTE mkfs.vfat is provided by the dosfstools package

@rponte
rponte / get-latest-tag-on-git.sh
Last active July 4, 2024 10:55
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@up1
up1 / Hello.java
Last active January 3, 2020 20:28
Robotframework + Google Chrome headless
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setBinary("/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary");
chromeOptions.addArguments("--headless");
WebDriver Driver = new ChromeDriver(chromeOptions);
@ujwalp1994
ujwalp1994 / BrowserStack.robot
Created July 4, 2017 14:34
Sample Test to run Robot tests on BrowserStack
*** Settings ***
Library Selenium2Library
Library Collections
Library Collections
Library String
Library BuiltIn
*** Variables ***
${SITE_URL} = https://sprint-005-origin.levi-site.com/CA/en_CA/
${SELENIUM_TIME_OUT} = 120
@ninapavlich
ninapavlich / sort.js
Last active April 19, 2024 09:02
Deep Sort Javascript Object
function sortObject(object) {
//Thanks > http://whitfin.io/sorting-object-recursively-node-jsjavascript/
if (!object) {
return object;
}
const isArray = object instanceof Array;
var sortedObj = {};
if (isArray) {
sortedObj = object.map((item) => sortObject(item));
@s3rj1k
s3rj1k / HowTo
Last active July 13, 2024 08:05
Ubuntu 20.04.3 AutoInstall
# For recent versions of Ubuntu:
- https://www.pugetsystems.com/labs/hpc/ubuntu-22-04-server-autoinstall-iso/
# Docs:
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference
- https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
- https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/53
# Download ISO Installer: