User Setup
Add a User
Run the following command to add a new user on a system.
sudo adduser <username>
public final class SpinWords { | |
public String spinWords(String sentence) { | |
String[] words = sentence.split(" "); | |
for (int i = 0; i < words.length; i++) { | |
// for each word | |
String word = words[i]; | |
if (word.length() >= 5) { |
Run the following command to add a new user on a system.
sudo adduser <username>
<?php | |
return [ | |
'*1000_Item_HalcyonPotion*' => 'halcyon-potion', | |
'Mulled Wine' => 'halcyon-potion', | |
'*1002_Item_WeaponBlade*' => 'weapon-blade', | |
'Weapon Blade' => 'weapon-blade', | |
'*1003_Item_CrystalBit*' => 'crystal-bit', | |
'Crystal1' => 'crystal-bit', |
<?php | |
return [ | |
'*Adagio*' => 'Adagio', | |
'*Alpha*' => 'Alpha', | |
'*Ardan*' => 'Ardan', | |
'*Baron*' => 'Baron', | |
'*Blackfeather*' => 'Blackfeather', | |
'*Catherine*' => 'Catherine', |
<?php | |
# To run this script use the following command on cli (we assume you have all dependencies installed) | |
# only checks for mysql for now | |
# $ php -f db-connect-check.php | |
$dbhost = 'host'; | |
$dbport = '3306' | |
$dbname = 'name'; | |
$dbuser = 'user'; | |
$dbpass = 'pass'; |
<?php | |
phpinfo(); | |
?> |
# how to generate a dump for postgres | |
pg_dump --file "dmp.filename.ext" --host "hostname" --port "5432" --username "myusername" --password "changeme" --verbose --role "dbname" --format=c | |
Alt+F3 |
scp -i folder/where/private/key/is/placed/key-name.ppk -r source/folder/in/local.machine/* username@host:/folder/in/remote/machine/ |
@Aspect | |
public class ProfilingAspect { | |
@Around("methodsToBeProfiled()") | |
public Object profile(ProceedingJoinPoint pjp) throws Throwable { | |
StopWatch sw = new StopWatch(getClass().getSimpleName()); | |
try { | |
sw.start(pjp.getSignature().getName()); | |
return pjp.proceed(); | |
} finally { |