Skip to content

Instantly share code, notes, and snippets.

View joukhar's full-sized avatar
💭
nothing

joukhar

💭
nothing
View GitHub Profile
@pavellauko
pavellauko / timezones_array.php
Created July 10, 2012 10:35
Time zones as arrays (PHP)
<?php
$timezones = array(
'America/Adak' => '(GMT-10:00) America/Adak (Hawaii-Aleutian Standard Time)',
'America/Atka' => '(GMT-10:00) America/Atka (Hawaii-Aleutian Standard Time)',
'America/Anchorage' => '(GMT-9:00) America/Anchorage (Alaska Standard Time)',
'America/Juneau' => '(GMT-9:00) America/Juneau (Alaska Standard Time)',
'America/Nome' => '(GMT-9:00) America/Nome (Alaska Standard Time)',
'America/Yakutat' => '(GMT-9:00) America/Yakutat (Alaska Standard Time)',
'America/Dawson' => '(GMT-8:00) America/Dawson (Pacific Standard Time)',
@mwhite
mwhite / git-aliases.md
Last active July 14, 2024 14:47
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
/*
* jQuery Double Tap
* Developer: Sergey Margaritov (github.com/attenzione)
* License: MIT
* Date: 22.10.2013
* Based on jquery documentation http://learn.jquery.com/events/event-extensions/
*/
(function($){
@karlcow
karlcow / stupid-copy-protection.html
Created May 22, 2014 22:27
People trying to put copy protection on their content.
<!-- WP Content Copy Protection script by Rynaldo Stoltz Starts - http://securiilock.com -->
<div align="center"><noscript>
<div style="position:fixed; top:0px; left:0px; z-index:3000; height:100%; width:100%; background-color:#FFFFFF">
<div style="font-family: Tahoma; font-size: 14px; background-color:#FFF000; padding: 10pt;">Please enable your Javascript to see this page as it is meant to appear!</div></div>
</noscript></div>
<script type="text/javascript">
window.onload = function() {
disableSelection(document.body)
@colmarius
colmarius / git-aliases.md
Created September 23, 2014 09:50
A list of useful git aliases

Intro

Bellow follows a list of aliases, split between beginner and advanced.

To start using them right away you should place the aliases you like most in a file like ~/.zsh/git. Now all that remains is to add the following line to your ~/.zshrc or ~/.bashrc:

. ~/.zsh/git # git aliases
@stevenswafford
stevenswafford / google-dorks
Created June 6, 2015 05:57
Listing of a number of useful Google dorks.
" _ _ "
" _ /|| . . ||\ _ "
" ( } \||D ' ' ' C||/ { % "
" | /\__,=_[_] ' . . ' [_]_=,__/\ |"
" |_\_ |----| |----| _/_|"
" | |/ | | | | \| |"
" | /_ | | | | _\ |"
It is all fun and games until someone gets hacked!
@eighteyes
eighteyes / new_gist_file
Last active October 5, 2023 19:27
Big List of Git Aliases
# git
alias glm='log --graph --abbrev-commit --decorate --date=relative --format=format:"%C(yellow)%h%C(reset) - %C(blue)(%ar)%C(reset)%C(dim white) %an%C(reset) %C(white)%s%C(reset) %C(auto)%d%C(reset)" --all'
#this branch story
function __gbstory(){
git log --graph --oneline --decorate --all $1 HEAD;
}
alias gbstory=__gbstory
@CodeWire
CodeWire / BackRe_ubuntu_server.md
Last active December 20, 2023 04:06
Backup & Restore Ubuntu Server The Simple Way

How I Backup My Ubuntu Server & Restore To Another Ubuntu Instance

How to backing up Ubuntu server and restoring to another Ubuntu instance

It is adviced to make TWO backups. 1 for / and 1 for /home if they are on different partition. If you want one you will have to add a lot of exceptions to that one command. Example:

1. Open Terminal

sudo -i cd /

@ruyadorno
ruyadorno / Secure Linux Server.md
Last active July 23, 2023 00:16
Tips on how to secure a linux server

SSH:

  • Disable root login
  • Disable password authentication
  • Use sudo-based privilege separation
  • Use public key authentication (ECDSA, Ed25519, etc...)
  • (Optional) Store key on smartcard
  • (Optional) Use a two-factor system such as Duo
  • (Optional) Change port of SSH to non-default (this is security by obscurity, but it deters most automated attacks, although this shouldn't matter if you're using key-based auth).

Firewall:

@SveinErik
SveinErik / CryptoLocker-ScanAndRestore.ps1
Last active August 6, 2022 23:51
Powershell script to scan for encrypted files, and restore them from "previous version" in Windows. Uses QuickIO.NET to avoid PathTooLong
<#
A bit info first:
This script uses QuickIO.NET (https://quickio.net/)
The function Get-FilesQuickIO is made by "Frekac" (http://psfredrik.chiloma.com/2016/12/15/using-quickio-net-with-powershell/)
And the script itself is downloaded from here: https://gist.github.com/frekac/337b8d1b2abddffb2803f36d34d56b27#file-get-filesquickio-ps1
I downloaded "nuget Windows x86 Commandline" from here: https://dist.nuget.org/index.html
Then i used cmd to browse to my folder where nuget.exe is located, and i typed: nuget.exe install QuickIO.net
It's then downloaded in a subdir in the same dir as nuget.exe is located.