Skip to content

Instantly share code, notes, and snippets.

@dungam
dungam / Dark Custom.xml
Created June 26, 2018 21:31
Programmer's Notepad - Customized Dark Theme
<UserSettings>
<override-colours caret="e6e6fa" indentGuides="282828" />
<override-classes>
<style-class name="default" font="Monaco" back="272828" fore="fafafa" />
<style-class back="222222" fore="666666" name="linenumbers"></style-class>
<style-class name="comment" fore="d500d5"/>
<style-class name="keyword" fore="f47a00" bold="true"/>
<style-class name="string" fore="5fff61" />
<style-class name="number" fore="fafafa" />
<style-class name="identifier" fore="fddf39" />
@dungam
dungam / class-phpmailer.php
Last active August 2, 2016 16:12
Maitrap.io settings in PHPMailer
<?php
/**
* Constructor
* @param boolean $exceptions Should we throw external exceptions?
*/
public function __construct($exceptions = false)
{
$this->exceptions = ($exceptions == true);
// Mailtrap settings
@dungam
dungam / mysql_loging.sql
Last active July 26, 2016 19:29
Enable MySQL general log
-- you can enable the log by change my.cnf settings (not recommended)
-- you can make changes on demand via your sql program, e.g workbench (recommended)
-- run the following commands to enable logging on demand.
# specify location for your log. Mysql needs write access to the folder specified
set global general_log_file = '/var/log/mysql/mysql.log';
# turn on login (1), turn off logging (0)
set global general_log = 1;
@dungam
dungam / delete-audio-by-bitrate.sh
Created July 20, 2016 23:16
Delete audio files by bitrate
#!/bin/bash
## Paste on the command line to delete 256K bitrate mp3 files.
## /bin/bash at the top is here only to assist syntax highlighting
for i in *.mp3; do exiftool -audiobitrate "$i" | perl -ne 's,.*: (\d+).*,\1,g ; $rate=$1; if ($rate==256000) { print "rate: $rate\n"; }'; done
#!/bin/bash
## --------------
## Important notes
##
## * Run script as root or sudo
## * home.server is defined in ~/.ssh/config. Sample ~/.ssh/config is attached.
## * modify /etc/hosts to map home.server to correct IP address on your network
##
## * create an exclusion-list.txt file make sure the scripts point to its location correctly
#!/bin/bash
## -------------------------------
##
## IMPORTANT NOTES
##
## Don't use this script blindly. Some instructions may not be compatible with your distribution or version
##
## Run this script as root or sudo privileged account