Skip to content

Instantly share code, notes, and snippets.

View ttys3's full-sized avatar
💭
sad, ttyS0 has been taken by other user

ttys3

💭
sad, ttyS0 has been taken by other user
View GitHub Profile
@ttys3
ttys3 / README.md
Created November 27, 2020 08:32 — forked from magnetikonline/README.md
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script to:

  • Iterate all commits made within a Git repository.
  • List every object at each commit.
@ttys3
ttys3 / arch-chroot
Created July 25, 2020 18:16 — forked from systemdarena/arch-chroot
arch-chroot for fedora
#!/bin/bash
shopt -s extglob
# generated from util-linux source: libmount/src/utils.c
declare -A pseudofs_types=([anon_inodefs]=1
[autofs]=1
[bdev]=1
[binfmt_misc]=1
[cgroup]=1
@ttys3
ttys3 / chroot.sh
Created July 25, 2020 18:15 — forked from uglide/chroot.sh
Chroot to Installed system on LVM
#!/bin/bash
fdisk -lu
pvscan
vgscan
vgchange -a y
lvscan
mount /dev/ubuntu-vg/root /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
@ttys3
ttys3 / navicat.desktop.sh
Last active July 15, 2020 02:13 — forked from argilzar/navicat.desktop
Create navicat desktop entry ubuntu
cat > ~/.local/share/applications/navicat.desktop <<EOL
[Desktop Entry]
Type=Application
Name=Navicat Premium 15
GenericName=Database Development Tool
Icon=/home/ttys3/.icons/navicat-icon.png
Exec=/home/ttys3/Apps/navicat15-premium-en-patched.AppImage
Categories=Development;
Keywords=database;sql;
Terminal=false
@ttys3
ttys3 / .phpstorm.meta.php
Created June 12, 2020 18:17 — forked from barryvdh/.phpstorm.meta.php
Laravel PhpStorm Meta file
<?php
namespace PHPSTORM_META {
/**
* PhpStorm Meta file, to provide autocomplete information for PhpStorm
* Generated on 2017-09-28.
*
* @author Barry vd. Heuvel <[email protected]>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
@ttys3
ttys3 / hugofastsearch.md
Created June 3, 2020 10:40 — forked from cmod/hugofastsearch.md
Fast, instant client side search for Hugo static site generator

Super fast, keyboard-optimized, client side Hugo search

This is a fork of and builds upon the work of Eddie Webb's search and Matthew Daly's search explorations.

It's built for the Hugo static site generator, but could be adopted to function with any json index compatible with Fuse fuzzy search library.

To see it in action, go to craigmod.com and press CMD-/ and start typing.

Fast Search

Cache Latency CPU cycles Size
L1 access ~1.2 ns ~4 Between 32 KB and 512 KB
L2 access ~3 ns ~10 Between 128 KB and 24 MB
L3 access ~12 ns ~40 Between 2 MB and 32 MB
@ttys3
ttys3 / CentOS-Docker
Created March 26, 2020 19:00 — forked from silveraid/CentOS-Docker
Creating minimal CentOS docker image from scratch
# Create a folder for our new root structure
$ export centos_root='/centos_image/rootfs'
$ mkdir -p $centos_root
# initialize rpm database
$ rpm --root $centos_root --initdb
# download and install the centos-release package, it contains our repository sources
$ yum reinstall --downloadonly --downloaddir . centos-release
$ rpm --root $centos_root -ivh centos-release*.rpm
$ rpm --root $centos_root --import $centos_root/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
# install yum without docs and install only the english language files during the process
@ttys3
ttys3 / post-receive-redmine.sh
Last active March 22, 2020 06:36 — forked from colinmollenhour/post-receive-redmine.sh
gitolite update hooks to reject CRLF line endings and require formatted commit messages
#!/bin/bash
#
# see https://github.com/kahseng/redmine_gitolite_hook/blob/master/README.rdoc
#
# The "post-receive" script is run after receive-pack has accepted a pack
# and the repository has been updated. It is passed arguments in through
# stdin in the form
# <oldrev> <newrev> <refname>
# For example:
# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
@ttys3
ttys3 / absolutePosition.js
Created March 10, 2020 12:18 — forked from LiamChapman/absolutePosition.js
Absolute Position of Element in Javascript
if (typeof absolutePosition == "undefined") {
// Discovered here: http://stackoverflow.com/a/32623832/867154
// Many thanks to @RoboCat!
function absolutePosition (el) {
var found, left = 0, top = 0, width = 0, height = 0, offsetBase = absolutePosition.offsetBase;
if (!offsetBase && document.body) {
offsetBase = absolutePosition.offsetBase = document.createElement('div');
offsetBase.style.cssText = 'position:absolute;left:0;top:0';