Skip to content

Instantly share code, notes, and snippets.

View khanhicetea's full-sized avatar
😎
solving human problems

KhanhIceTea khanhicetea

😎
solving human problems
View GitHub Profile
@khanhicetea
khanhicetea / gmail_imap_dump_eml.py
Last active November 5, 2018 17:13 — forked from robulouski/gmail_imap_dump_eml.py
Gmail IMAP Exporter Tool
#!/usr/bin/env python
#
# Very simple Python script to dump all emails in an IMAP folder to files.
# This code is released into the public domain.
#
# RKI Nov 2013
#
import sys
import imaplib
import getpass
@khanhicetea
khanhicetea / auto_recovery_network.md
Last active August 29, 2015 14:05
Auto recovery network settings CentOS if it fails.

Step 1 : Backup working settings folder

cp -R /etc/sysconfig/network-scripts /etc/sysconfig/network-scripts_bak

Step 2 : Create bash file at /root/network.sh with below content

#!/usr/bin/env bash
@khanhicetea
khanhicetea / bit-field-permission.php
Created June 20, 2014 16:11
Bit Field Permission Sample PHP
<?php
// Class BitField
class BitField
{
protected $roles = array();
protected $permission;
public function __construct()
{
$this->setPermission(0);
}