Skip to content

Instantly share code, notes, and snippets.

View hasusuf's full-sized avatar

Hassan Youssef hasusuf

View GitHub Profile
kubectl run myubuntu --image ubuntu --rm -ti --restart=Never --overrides='
{
"metadata": {
"labels": {
"diditwork": "itdid"
}
},
"spec": {
"containers": [
{
@jeremyje
jeremyje / install-docker.sh
Last active October 31, 2022 01:09
Install Docker
#!/bin/bash
# curl https://gist.githubusercontent.com/jeremyje/5d2b3746f4454ef24aaa723e208b7a50/raw/install-docker.sh | bash
# Based on https://docs.docker.com/install/linux/docker-ce/debian/
function InstallForDebian {
sudo apt-get update
sudo apt-get -y remove docker docker-engine docker.io
sudo apt-get -y install \
apt-transport-https \
@jakedsouza
jakedsouza / ubuntu.sh
Created February 17, 2018 00:44
Minimal ubuntu setup
#!/bin/bash
require_root() {
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
}
update_apt() {
@zburgermeiszter
zburgermeiszter / envsubst-multi.sh
Created December 14, 2017 11:28
Envsubst render multiple files.
for f in $(find deploy/templates -regex '.*\.ya*ml'); do envsubst < $f > "./deploy/generated/$(basename $f)"; done
@styblope
styblope / docker-api-port.md
Last active April 26, 2024 10:19
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@paulund
paulund / css-purge-webpack-config.js
Last active April 7, 2023 10:02
Using CSS Purge With Laravel Mix. Tutorial on how to use the following can be found https://paulund.co.uk/reduce-css-file-size-with-css-purge reduced a production ready CSS file from 179kb to 7.9kb.
mix.webpackConfig({
plugins: [
new purgeCss({
paths: glob.sync([
path.join(__dirname, 'resources/views/**/*.blade.php'),
path.join(__dirname, 'resources/assets/js/**/*.vue')
]),
extractors: [
{
extractor: class {
@bsodmike
bsodmike / README.md
Last active March 13, 2023 05:04
OC Nvidia GTX1070s in Ubuntu 16.04LTS for Ethereum mining

Following mining and findings performed on EVGA GeForce GTX 1070 SC GAMING Black Edition Graphics Card cards.

First run nvidia-xconfig --enable-all-gpus then set about editing the xorg.conf file to correctly set the Coolbits option.

# /etc/X11/xorg.conf
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
@xueshanf
xueshanf / extract_kubecfg_cert.sh
Last active February 13, 2023 13:45
Extract kubernetes cluster credentials from kubecfg
#!/bin/bash
# Input: ./extract_kubecfg_cert.sh my-cluster-name username
# Output: ./my-cluster-name-ca.crt ./username.crt ./username.key
# Exit on error
abort(){
echo $1 && exit 1
}
# Prerequistes
@epcim
epcim / webex-ubuntu.md
Created April 27, 2017 08:42 — forked from mshkrebtan/webex-ubuntu.md
Run Cisco Webex on 64-bit Ubuntu 16.04

Run Cisco Webex on 64-bit Ubuntu 16.04

With Audio and Screen Sharing Enabled

Enable support for 32-bit executables

Add the i386 architecture to the list of dpkg architectures :

sudo dpkg --add-architecture i386
@Mikulas
Mikulas / Dockerfile
Last active March 11, 2022 12:34
Docker image PHP 7.1 alpine with extensions
FROM php:7.1-fpm-alpine
RUN apk add --update \
autoconf \
g++ \
libtool \
make \
&& docker-php-ext-install mbstring \
&& docker-php-ext-install mysqli \