Skip to content

Instantly share code, notes, and snippets.

Mladen Đurić macmladen

Block or report user

Report or block macmladen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@macmladen
macmladen / redirect.js
Created Aug 19, 2019
JavaScriptp HTTP like redirect
View redirect.js
// similar behavior as an HTTP redirect
// window. object can be omitted
window.location.replace("https://nisville.com/");
@macmladen
macmladen / OSX Secure Disk Wipe.md
Last active Jul 6, 2019 — forked from joeblau/OSX Secure Disk Wipe.md
Securely erase an external disk using dd on OSX
View OSX Secure Disk Wipe.md

Securely erase an external disk using dd on OSX

  1. Plug in your SD card, HDD, or other block device and then use the following command to see which /dev/diskN node it's located on:
diskutil list
  1. Unmount the disk where N is the number of the disk taken from the above command:
@macmladen
macmladen / remove-all-followers.js
Created Mar 11, 2016
Remove all Twitter followers.
View remove-all-followers.js
/**
* Removes all followers on Twitter, usually added by profile breach.
* Usage: just copy code bellow (triple click on line & CTRL+C ) to the
* Developer console in browser, press ENTER and watch them being deleted.
*/
setInterval(function(){t=$('.following').find('.follow-button');if(!t[0]){window.scrollTo(0,$(document).height());}else{console.log(t.attr('class')); t.trigger('click');}},100)
@macmladen
macmladen / dps.sh
Created Nov 23, 2015
Build local environment for development
View dps.sh
## Always, before performing any installation, make sure that system is up to date:
# Freshen information on versions of system software packages
sudo apt-get update
# Perform upgrade of packages
sudo apt-get upgrade
# Perform upgrade of system (kernel)
sudo apt-get dist-upgrade
## Getting to know system
@macmladen
macmladen / logging_in.md
Last active Sep 13, 2016
Linux and Mac interactive shell script loading
View logging_in.md

Order of script loading for interactive login shell

User can have multiple ways to login and different OSes, different shells have different approach. As I always search for same information, I decided to collect them here.

Ubuntu

To understand what's going on here, you need to understand a little background information about how shells (bash in this case) are run.

  • When you open a terminal emulator (gnome-terminal for example), you are executing what is known as an interactive, non-login shell.
  • When you log into your machine from the command line, via ssh, or run a command such as su username, you are running an interactive login shell.
View .gitconfig
[user]
name = MacMladen iMac
email = mladen@bluefish.rs
[color]
ui = on
[core]
excludesfile = /Users/mladen/.gitignore_global
whitespace= fix,-indent-with-non-tab,-indent-with-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore_global
[difftool "sourcetree"]
@macmladen
macmladen / .barracuda.cnf
Last active Dec 27, 2015
BOA full procedure for server upgrade
View .barracuda.cnf
###
### Configuration created on 151219-0247
###
_LOCAL_NETWORK_HN=""
_LOCAL_NETWORK_IP=""
_MY_FRONT="aegir.dx.rs"
_MY_HOSTN="dx.rs"
_MY_OWNIP="5.9.90.162"
_SMTP_RELAY_HOST=""
_SMTP_RELAY_TEST=YES
@macmladen
macmladen / phjs-screencapture.js
Created Sep 18, 2015
Script to capture screen using phantomjs.org headless
View phjs-screencapture.js
// Copyright: (C) 2015 MacMladen <macmladen@gmail.com>
// License: GPL-2.0
// Prequisite:
// having installed phantomjs from http://phantomjs.org
// You have to change variables to suit your needs
// Usage:
// $ phantomsj script.js
// it will produce capture file in same folder
// you can figure out the rest ;)
var
@macmladen
macmladen / drush-si.sh
Created Aug 30, 2015
drush site-install template
View drush-si.sh
dr si standard \
--account-mail=lucar_loc@bluefish.rs \
--account-name=admin \
--account-pass=plavac \
\
# --db-su=lokalni \
# --db-su-pw=lokalni \
--db-url=mysql://lokalni:lokalni@localhost/lucar \
# --locale=<en-GB> \
\
@macmladen
macmladen / .gitconfig
Last active Sep 11, 2018
Git hints, .gitconfig and .gitignore files - should be moved to 'dotfiles' repo
View .gitconfig
[user]
name = MacMladen iMac
email = mladen@bluefish.rs
[color]
ui = on
[core]
excludesfile = /Users/mladen/.gitignore_global
whitespace= fix,-indent-with-non-tab,-indent-with-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore_global
[difftool "sourcetree"]
You can’t perform that action at this time.