This file contains 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
first we have to edit sources.list file using gedit | |
remember this method is using terminal! | |
To open up terminal hit "ctrl+alt+T" | |
then type "gedit /etc/apt/sources.list" | |
delete all text inside, then replace with the new one, | |
#repo ITB : | |
deb ftp://ftp.itb.ac.id/pub/ubuntu oneiric main restricted universe multiverse |
This file contains 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
As we knew that 'let & const' are not coming in ES5, those are coming in ES6 since 2015. | |
So to make these work like in latest version ECMA Scripts 2015, we can define it by ourself. | |
'const' - ES6 | |
const a = 1; | |
'const' - ES5 | |
var a = (function(){ | |
var a = 1; | |
return function(){ |
This file contains 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
based on tutorial in http://stackoverflow.com/a/12800042 | |
and this tutorial to upload existing project into github. | |
so, you need to create new repository first | |
Steps: | |
- make sure you have installed git in your computer | |
- open the directory project then open CMD in it | |
- type 'git init'. This will say "Initialized empty git repository in ....git" (... is the path). | |
- type 'git add .' Dont forget 'pull stop' mark in the end of add after 'space'. I assume you wanna upload a whole file inside the directory. | |
- type 'git commit -m "massage here for commit" |
This file contains 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
This gonna be usefull when U have some pattern actvities to done continously wo/ doing it manually | |
1. Problem: need to execute `arp -d` continously, the command to delete host on arp table to reset it to first time connect to wifi or other connection gateway. This could even be prevent the user in same connection's gateway which use `internet cut` software (might be myth). Every time the command execute, your computer delete the inet_addr that already chaced to your computer then re-request to gateway point to give you new chace. This usually used when your computer have problem to connect to internet, so your computer need to refresh the chace inet_addr. (I might be wrong sorry, I'm not expert) | |
#!/bin/bash | |
echo 'Running command' | |
set -x #echo on everything the command executed | |
while true; |
This file contains 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
private static <E> List<E> pickNRandomElements(List<E> list, int n, Random r) { | |
int length = list.size(); | |
if (length < n) return null; | |
//don't need to shuffle the whole list | |
for (int i = length - 1; i >= length - n; --i) { | |
Collections.swap(list, i, r.nextInt(i + 1)); | |
} | |
return list.subList(length - n, length); |
This file contains 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
#!/bin/bash | |
mongo --eval "db.stats()" # do a simple harmless command of some sort | |
RESULT=$? # returns 0 if mongo eval succeeds | |
if [ $RESULT -ne 0 ]; then | |
echo "MongoDB service is not running, try to run with admin" | |
sleep 3 #3 secs | |
exit 1 | |
else |
This file contains 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
#!/bin/bash | |
echo 'Trying to STOP service MongoDB' | |
set -x #for echo on | |
net stop MongoDB | |
echo 'Done STOP service MongoDB' | |
sleep 3 #3 secs |
This file contains 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
package com.common.utils | |
import org.koin.KoinContext | |
import org.koin.standalone.StandAloneContext | |
import kotlin.jvm.internal.Reflection | |
/** | |
* @author @fredy_mederos | |
*/ |
This file contains 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
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/ | |
// See also: http://www.paulund.co.uk/change-url-of-git-repository | |
$ cd to old repo folder | |
$ git remote rename origin bitbucket | |
$ git remote add origin https://github.com/account/new-repo.git | |
$ git push origin master | |
$ git remote rm bitbucket |
This file contains 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
- take a look git repo [over here](https://github.com/coreybutler/nvm-windows/releases) | |
- or you can see mine I've downloaded [here](https://bit.ly/nvmSetup) version 1.1.17 | |
- finished downloaded, execute & follow installation as regular | |
- finished installation, check with command `nvm --version` if doesn't show anything try to restart windows | |
- check again till version `nvm --version` shown | |
- install node version you wanna use with command `nvm install node_version` it will download required files node js along with NPM | |
- finished installed node_version, then type `nvm use node_version` you just installed | |
- type `nvm list` to see node version installed you able to use directly | |
- or `nvm list available` to see all list you ready to install with version LTS and latest version | |
- DONE |
OlderNewer