Skip to content

Instantly share code, notes, and snippets.

View skinzor's full-sized avatar
🎯
Focusing

skinzor

🎯
Focusing
  • Bucharest, Romania
View GitHub Profile
@premasagar
premasagar / google-chrome-restore.sh
Created March 29, 2010 10:29
Restore Google Chrome on Linux (Ubuntu), when it starts with "Could not restore your profile"
#!/bin/sh
# Restore Google Chrome on Linux (Ubuntu), when it
# starts with "Could not restore your profile"
# $ ./google-chrome-restore.sh
rm -rf ~/.config/google-chrome/Backup
mv ~/.config/google-chrome/Default ~/.config/google-chrome/Backup
rm -rf ~/.config/google-chrome/Default
cp -R ~/.config/google-chrome/Backup ~/.config/google-chrome/Default
rm -rf ~/.config/google-chrome/Backup
@HungYuHei
HungYuHei / gist:2132090
Created March 20, 2012 06:51
convert file-encoding from gb2312 to utf-8
perl -MEncode -pi -e '$_=encode_utf8(decode(gb2312=>$_))' FILE_NAME
@nicferrier
nicferrier / gist:2277987
Created April 1, 2012 19:34
Clone a git repo if it does not exist, or pull into it if it does exist
#!/bin/sh
REPOSRC=$1
LOCALREPO=$2
# We do it this way so that we can abstract if from just git later on
LOCALREPO_VC_DIR=$LOCALREPO/.git
if [ ! -d $LOCALREPO_VC_DIR ]
then
@JosefJezek
JosefJezek / how-to-use-pelican.md
Last active May 12, 2024 11:19
How to use Pelican on GitHub Pages
@tom--
tom-- / bash_prompt_fancy.sh
Last active June 8, 2018 23:54
A fancy bash prompt. Put it in your .bashrc
red=$(tput setaf 1)
green=$(tput setaf 2)
yellow=$(tput setaf 3)
bold=$(tput bold)
dim=$(tput dim)
off=$(tput sgr0)
thumb () {
case $1 in
0) printf "\xF0\x9F\x91\x8d" ;;
*) printf "\xF0\x9F\x91\x8e $red($1)$off" ;;
@jaimergp
jaimergp / config-highlight.cfg
Last active May 27, 2024 12:16
Dark highlighting theme for Python IDLE based on SublimeText's Monokai color scheme
# Place this file inside your ~/.idlerc/ folder
# or paste its contents inside
# /path/to/python/idlelib/config-highlight.def
# Adapted from SublimeText's Monokai
[monokai]
normal-foreground= #F8F8F2
normal-background= #272822
keyword-foreground= #F92672
keyword-background= #272822
@jasonkeene
jasonkeene / python_scripting.rst
Last active April 21, 2024 20:09
Get started with writing your own python scripts to automate system tasks.

Python for System Admins / Operators

Installing Python

Most Unix/Linux systems come with python pre-installed:

$ python -V
@raelgc
raelgc / Install MSOffice on Ubuntu.md
Last active February 26, 2024 03:10
Install MSOffice on Ubuntu

Install Microsoft Office 2010 on Ubuntu

Requirements

We'll install MSOffice using the PlayOnLinux wizard. Additionally, MSOffice requires samba and winbind to properly work.

So, if not installed, install them:

sudo apt-get install playonlinux samba winbind
@jrmolin
jrmolin / initialize-local-repo.sh
Created June 28, 2014 00:55
initialize a local git repository with a default.xml, and then `repo init` based on that repository
!/bin/bash
REPO=`which repo`
if test "x$REPO" = "x"; then
mkdir -pv $HOME/bin
# get the repo script
curl https://storage.googleapis.com/git-repo-downloads/repo > $HOME/bin/repo
chmod a+x $HOME/bin/repo
@scue
scue / logcat_all.sh
Created May 10, 2015 06:39
Cat all android logs
#!/system/bin/sh
#===============================================================================
#
# FILE: logcat_all.sh
#
# USAGE: ./logcat_all.sh
#
# DESCRIPTION: DEBUG版时,打印所有日志(包括时间)到指定文件,方便后期排查问题
#
# OPTIONS: ---