Skip to content

Instantly share code, notes, and snippets.

View Nklya's full-sized avatar

Nicolai Antiferov Nklya

View GitHub Profile
@arguile-
arguile- / gist:2510227
Created April 27, 2012 15:36
Basic Curl deploy file to Nexus
#!/bin/sh
SERVER="http://localhost:8081"
URL="$SERVER/nexus/service/local/artifact/maven/content"
REPO="sandbox"
USER="admin:admin123"
group=$1
artifact=$2
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 27, 2024 16:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 27, 2024 13:28
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@Kartones
Kartones / postgres-cheatsheet.md
Last active July 25, 2024 09:09
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@rocket-ron
rocket-ron / gist:bf7d7ce3e5b8b7cd9197
Created August 3, 2015 05:21
Resize (increase) Root Partition on AWS EBS Volume Linux LVM
This is a resize of the actual EBS volume as opposed to adding additional disks using LVM
1. Follow the steps here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/storage_expand_partition.html
2. Use the instructions for gdisk further down the page to set the new partition table, not gparted or fdisk.
3. Reboot the instance once the partition table is written.
4. On the instance, execute:
sudo pvresize /dev/xvda2 (or whatever the device name is)
sudo pvdisplay
@olih
olih / jq-cheetsheet.md
Last active July 16, 2024 23:02
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@parasyte
parasyte / README.md
Last active April 27, 2017 16:07
How to delete Apple Java on OS X 10.11 El Capitan

Warning: Use at your own risk

I assume no responsibility for the use of these instructions, or any negative impact they may have. You probably shouldn't do this. (Unless you really, truly hate vile cruftware like Java.)

Let the games begin

  1. Reboot into Recovery Mode.
  2. Power-on and hold ⌘ + R until Apple Logo appears.
  3. If your hard drive is encrypted:
  4. Start "Restore From Time Machine Backup"

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@alkrauss48
alkrauss48 / Dockerfile
Last active November 10, 2022 16:24
Running a docker container as a non-root user
# By default, Docker containers run as the root user. This is bad because:
# 1) You're more likely to modify up settings that you shouldn't be
# 2) If an attacker gets access to your container - well, that's bad if they're root.
# Here's how you can run change a Docker container to run as a non-root user
## CREATE APP USER ##
# Create the home directory for the new app user.
RUN mkdir -p /home/app