#!/bin/bash
val=$(defaults read com.apple.Finder AppleShowAllFiles)
if [ "$val" == "1" ]; then
defaults write com.apple.Finder AppleShowAllFiles -string 0
killall Finder
fi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Getopt for GNU. | |
| NOTE: getopt is now part of the C library, so if you don't know what | |
| "Keep this file name-space clean" means, talk to drepper@gnu.org | |
| before changing it! | |
| Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001 | |
| Free Software Foundation, Inc. | |
| This file is part of the GNU C Library. | |
| The GNU C Library is free software; you can redistribute it and/or | |
| modify it under the terms of the GNU Lesser General Public |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| use strict; | |
| use warnings; | |
| my $numArgs = $#ARGV + 1; | |
| my @types = qw/nat mangle filter/; | |
| if ($numArgs > 0) {@types = @ARGV;} | |
| $SIG{INT} = sub{print "\e[?25h\e[u"; exit}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # bash script to generate tree structure of a directory | |
| # Pravendra Singh (@hackpravj) | |
| pwd=$(pwd) | |
| find $pwd -print | sed -e "s;$pwd;\.;g;s;[^/]*\/;|__;g;s;__|; |;g" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Will scan a github repo to compute some statistics on PR | |
| # requires curl and bc (presents on most unix like system) | |
| # PARAMETERS ---------------------------- | |
| # Github repo to scan | |
| GITHUB_REPO="status-im/status-react" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://stackoverflow.com/a/28776166 | |
| sourced=0 | |
| if [ -n "$ZSH_EVAL_CONTEXT" ]; then | |
| case $ZSH_EVAL_CONTEXT in *:file) sourced=1;; esac | |
| elif [ -n "$KSH_VERSION" ]; then | |
| [ "$(cd $(dirname -- $0) && pwd -P)/$(basename -- $0)" != "$(cd $(dirname -- ${.sh.file}) && pwd -P)/$(basename -- ${.sh.file})" ] && sourced=1 | |
| elif [ -n "$BASH_VERSION" ]; then | |
| [ "$0" != "$BASH_SOURCE" ] && sourced=1 | |
| else # All other shells: examine $0 for known shell binary filenames | |
| # Detects `sh` and `dash`; add additional shell filenames as needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| A note about using gmail as a relay | |
| Gmail by default does not allow email clients that don't use OAUTH 2 for authentication (like Thunderbird or Outlook). | |
| First you need to enable access to "Less secure apps" on your google settings. | |
| Serveur de courrier entrant (IMAP) imap.gmail.com | |
| SSL requis : oui | |
| Port : 993 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Copy FOLDER_1 into PATH_B and preserve all attributes | |
| sudo rsync -avihXP --info=progress2 --stats /PATH_A/FOLDER_1/ /PATH_B/ | |
| * use --dry-run to test | |
| * for encoding char problems between Mac/Linux : https://serverfault.com/questions/638316/rsync-iconv-option-on-mac-not-working-sync-from-remote-linux-server-to-local | |
| ** rsync initiated from Mac : --iconv=utf-8-mac,utf-8 | |
| ** rsync initiated from Linux : --iconv=utf-8,utf-8-mac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #https://stackoverflow.com/a/10965292 | |
| [ -n "$var" ] && echo "var is set and not empty" | |
| [ -z "$var" ] && echo "var is unset or empty" | |
| [ "${var+x}" = "x" ] && echo "var is set" # may or may not be empty | |
| [ -n "${var+x}" ] && echo "var is set" # may or may not be empty | |
| [ -z "${var+x}" ] && echo "var is unset" | |
| [ -z "${var-x}" ] && echo "var is set and empty" |
OlderNewer