Skip to content

Instantly share code, notes, and snippets.

View Temikus's full-sized avatar

Artem Yakimenko Temikus

View GitHub Profile
@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@mattiaslundberg
mattiaslundberg / Ansible Let's Encrypt Nginx setup
Last active April 19, 2024 16:03
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@halberom
halberom / opt1_template.j2
Last active April 12, 2024 11:33
ansible - example of template if else
{# style 1 - long form #}
{% if filepath == '/var/opt/tomcat_1' %}
{% set tomcat_value = tomcat_1_value %}
{% else %}
{% set tomcat_value = tomcat_2_value %}
{% endif %}
{# style 2 - short form #}
{% set tomcat_value = tomcat_1_value if (filepath == '/var/opt/tomcat_1') else tomcat_2_value %}
actions :write
attribute :magic_line, :kind_of => String, :default => "# Managed by Chef, dont write below"
attribute :host_file, :kind_of => String, :default => "/etc/hosts", :name_attribute => true
attribute :lines, :kind_of => Array
#!/bin/sh
# Clone OpenSSL repository
# Credits to https://github.com/robertdavidgraham/heartleech
git clone git://git.openssl.org/openssl.git
cd openssl
# Build 64-bit library on Mac OS
./configure darwin64-x86_64-cc
make depend
make
@faresd
faresd / gist:5661253
Created May 28, 2013 08:14
AppleScript restore multiple files from trash Mac os
try
delay 15 -- adjust delay as needed
repeat 40000 times
try
tell application "Finder" to close every window
delay 0.09 -- adjust delay as needed
set theDigit to func(37)
on error
do shell script "killall Finder"
delay 10 -- adjust delay as needed
@collindonnell
collindonnell / Octopress Publish.applescript
Created January 8, 2013 02:28
Generate and deploy Octopress blog from LaunchBar or other script launcher.
(*
Generate and deploy Octopress site from Launchbar
Author: Collin Donnell
Website: http://collindonnell.com
Date: 01/07/2013
*)
-- Set to the location on disk of your site
set octopressLocation to ((path to home folder as text) & "Code:blog:") as alias
@dosiecki
dosiecki / gist:3353977
Last active October 8, 2015 15:48
User Style: NewsBlur But Better
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("newsblur.com") {
/* These user styles clean up the UI of the
otherwise awesome NewsBlur website.
Updated 16 April 2014
*/
/* remove all text shadowing to increase readability */
@Janiczek
Janiczek / sinfest_downloader.py
Created May 29, 2012 22:33
Sinfest downloader
# NOTE: some of these will be 404s (30th of February, days with no comics, etc.)
# 404s can be removed with `find . -type f -size -1000c -iname "*.gif" -exec rm {} \;`
from urllib import urlretrieve
for y in range(2000, 2013):
for m in range(1, 13):
print "starting", y, m