Java Tools Cheatsheet

I have always neglected to write down java tools and commands that I use for troubleshooting. I will try to put in on this page. Memory and Threads There are many tools to measure java memory. In my experience, the easiest way to troubleshoot locally is to hook your development environment up to VisualVM. There are even plugins for it in e.g. IntelliJ. It is probably possible to do this to a production server as well, but that would likely impact performance....

Powershell Cheatsheet

Collection of powershell stuff. Curl replacement Invoke-WebRequest -Uri http://localhost Invoke-WebRequest -Uri http://localhost -Method POST $cred = Get-Credential Invoke-WebRequest -Uri http://localhost -Method POST -Credential $cred -UseBasicParsing

MySQL Cheatsheet

Starting mysql # Same username, no password mysql -p # Password protected mysql -u user mysql -h hostname Create user CREATE USER me GRANT ALL PRIVILEGES ON database_name.* TO 'me'@'%'; ALTER USER 'me'@'%' IDENTIFIED BY 'newPass'; Connect to databaes SHOW DATABASES; SHOW DATABASES LIKE 'ok%'; USE mysql; See database tables SHOW TABLES; SHOW TABLES LIKE 'ok%'; SELECT * FROM important_stuffs; Extend tables ALTER TABLE important_stuffs ADD description VARCHAR(100); ALTER TABLE important_stuffs ADD description VARCHAR(100) AFTER severity; ALTER TABLE important_stuffs ADD description VARCHAR(100) FIRST; Delete from tables SELECT * FROM important_stuffs WHERE severity="low"; DELETE FROM important_stuffs WHERE severity="low"; Insert into tables INSERT INTO important_stuffs VALUES("Wow, so important", "high"); INSERT INTO important_stuffs SET description="Wow, so important", severity="high"; Show access rights SHOW GRANTS; Change all email addresses to my (when mailserver is activated) UPDATE users SET email= CONCAT('me+', id, '@iix....