Skip to content

Instantly share code, notes, and snippets.

View VladRassokhin's full-sized avatar

Vladislav Rassokhin VladRassokhin

View GitHub Profile
@skarllot
skarllot / bashrc.sh
Last active January 4, 2023 22:44
Default Bash prompt (bashrc PS1)
# Each distribution default Bash prompts
# Gentoo (/etc/bash/bashrc)
if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
else
PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
fi
@VladRassokhin
VladRassokhin / gravatar.tag
Created June 8, 2012 23:15
Simple gravatar.tag for JSP
<%@ tag import="java.util.Formatter"
%><%@ tag import="java.security.MessageDigest"
%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ attribute name="email" required="true" type="java.lang.String"
%><%@ attribute name="sz" required="false" type="java.lang.Integer"
%><c:if test="${empty sz}"><c:set var="sz">20</c:set></c:if><c:choose
><c:when test="${empty email}"><c:set var="hash">00000000000000000000000000000000</c:set></c:when><c:otherwise
><c:set var="hash"><%=javax.xml.bind.DatatypeConverter.printHexBinary(MessageDigest.getInstance("MD5").digest(email.toLowerCase().trim().getBytes("UTF-8"))).trim().toLowerCase()%></c:set></c:otherwise
></c:choose><img class="gravatarimg${sz}" src="http://www.gravatar.com/avatar/${hash}?s=${sz}&d=mm" alt="">
@4ndrej
4ndrej / SSLPoke.java
Last active January 3, 2024 09:50
Test of java SSL / keystore / cert setup. Check the comment #1 for howto.
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@joemiller
joemiller / raid_ephemeral.sh
Last active October 23, 2023 21:53
detect all ephemeral disks on EC2 then stripe together in a raid-0 vol mounted at /mnt
#!/bin/bash
#
# this script will attempt to detect any ephemeral drives on an EC2 node and create a RAID-0 stripe
# mounted at /mnt. It should be run early on the first boot of the system.
#
# Beware, This script is NOT fully idempotent.
#
METADATA_URL_BASE="http://169.254.169.254/2012-01-12"
@ismell
ismell / README.md
Last active July 20, 2018 09:52
Ubuntu Upstart Script for Team City

Ubuntu Upstart Script for Team City

  1. Install TeamCity.conf and TeamCityAgent.conf in /etc/init/

  2. Create TeamCity in /etc/default/TeamCity

  3. Make sure TEAMCITY_DATA_PATH and TEAMCITY_SERVER_PATH are owned by www-data

  4. Start TeamCity

     sudo service TeamCity start
    
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@wernerb
wernerb / genssh.scala
Created July 15, 2014 15:46
Generate SSH public keypair from SSH RSA/DSA/EC private key in Scala
import java.io.{DataOutputStream, ByteArrayOutputStream, StringReader}
import java.security.interfaces.{ECPublicKey, DSAParams, DSAPublicKey, RSAPublicKey}
import java.security._
import java.security.spec.X509EncodedKeySpec
import org.apache.commons.codec.binary.Base64
import org.bouncycastle.openssl.{PEMKeyPair, PEMParser}
object genPubSSHKey {
/**
@ianblenke
ianblenke / upgrade-coreos.md
Last active July 7, 2021 03:49
How to upgrade CoreOS manually

Before upgrading, make sure you are allowing insecure registry access, or your newer docker won't be able to talk to the Deis registry:

sudo bash -c 'mkdir -p /etc/systemd/system/docker.service.d/; cat <<EOF > /etc/systemd/system/docker.service.d/50-insecure-registry.conf
[Service]
Environment="DOCKER_OPTS=--insecure-registry 10.0.0.0/8 --insecure-registry 172.16.0.0/12 --insecure-registry 192.168.0.0/16"
EOF
'
@phrawzty
phrawzty / 2serv.py
Last active April 7, 2024 13:57
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):