Skip to content

Instantly share code, notes, and snippets.

@persianyagami90xs
persianyagami90xs / PowerShell Customization.md
Created July 29, 2021 12:34 — forked from jchandra74/PowerShell Customization.md
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@persianyagami90xs
persianyagami90xs / clearRAM.sh
Created June 23, 2021 00:09 — forked from pklaus/clearRAM.sh
A Script to Clear Cached RAM on Linux
#!/bin/bash
## Bash Script to clear cached memory on (Ubuntu/Debian) Linux
## By Philipp Klaus
## see <http://blog.philippklaus.de/2011/02/clear-cached-memory-on-ubuntu/>
if [ "$(whoami)" != "root" ]
then
echo "You have to run this script as Superuser!"
exit 1
fi
@persianyagami90xs
persianyagami90xs / install-apps.sh
Created June 22, 2021 18:58 — forked from aamnah/install-apps.sh
Bash script to install packages [Git, s3cmd] on a new system. For Debian and Ubuntu. To run, copy the script to the server and run ``bash install-apps.sh``
#!/bin/bash/
#######################################
# Bash script to install apps on a new system (Ubuntu)
# Written by @AamnahAkram from http://aamnah.com
#######################################
## Update packages and Upgrade system
sudo apt-get update -y
## Git ##
@persianyagami90xs
persianyagami90xs / get_go.sh
Created June 22, 2021 16:21 — forked from Zate/get_go.sh
Shell script to download and install latest golang
#! /bin/bash
# [get_golang.sh](https://gist.github.com/n8henrie/1043443463a4a511acf98aaa4f8f0f69)
# Download latest Golang release for AMD64
# https://dl.google.com/go/go1.10.linux-amd64.tar.gz
set -euf -o pipefail
# Install pre-reqs
sudo apt-get install python3 git -y
o=$(python3 -c $'import os\nprint(os.get_blocking(0))\nos.set_blocking(0, True)')
# Go to home directory
cd ~
# You can change what anaconda version you want at
# https://repo.continuum.io/archive/
wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh
bash Anaconda3-5.0.1-Linux-x86_64.sh -b -p ~/anaconda
rm Anaconda3-5.0.1-Linux-x86_64.sh
echo 'export PATH="~/anaconda/bin:$PATH"' >> ~/.bashrc
@persianyagami90xs
persianyagami90xs / bootiso
Created April 4, 2021 23:23 — forked from jsamr/bootiso
A bash script to very easily create a bootable USB device from one ISO file. Just curl it, chmod it and go!
#!/bin/bash
# Author: jules randolph <[email protected]> https://github.com/jsamr
# License: MIT
#
# Usage: [<options>] <file.iso>
#
# Create a bootable FAT32 USB device from a linux-GNU/unix ISO.
#
# Options
@persianyagami90xs
persianyagami90xs / gist:f19470a4ce1585b619ee074523ae0550
Created April 2, 2021 03:09 — forked from madrobby/gist:9476733
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl -H 'Authorization: token INSERTACCESSTOKENHERE' -H 'Accept: application/vnd.github.v3.raw' -O -L https://api.github.com/repos/owner/repo/contents/path
#!/bin/bash
if [[ -s //etc/profile ]]; then
source //etc/profile
fi
if [[ -s $HOME/.bash_profile ]] ; then
source $HOME/.bash_profile
fi
ANSI_RED="\033[31;1m"
@persianyagami90xs
persianyagami90xs / home-travis-build.sh
Created March 27, 2021 04:21 — forked from beatak/home-travis-build.sh
travis works like this…?
#!/bin/bash
export TRAVIS_ROOT=/
export TRAVIS_HOME=${HOME}
export TRAVIS_BUILD_DIR=${HOME}/build
export TRAVIS_INTERNAL_RUBY_REGEX=\^ruby-\(2\\.\[0-4\]\\.\[0-9\]\|1\\.9\\.3\)
export TRAVIS_APP_HOST=build.travis-ci.com
export TRAVIS_APT_PROXY=
export TRAVIS_ENABLE_INFRA_DETECTION=true
travis_preamble() {
if [[ -s "${TRAVIS_ROOT}/etc/profile" ]]; then
apt-get install build-essential
git clone http://evilpiepirate.org/git/linux-bcache.git
git checkout origin/bcache-3.2
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
git checkout v3.2.28
diff -Nru -x .git ./linux-stable/ ./linux-bcache/ > bcache.patch
patch -p1 < /usr/src/bcache.patch