Skip to content

Instantly share code, notes, and snippets.

View KristofferRisa's full-sized avatar

Kristoffer Risa KristofferRisa

View GitHub Profile
show collections
show users
show roles
show profile
show databases
db.collection.find()
insert()
update()
save()
@KristofferRisa
KristofferRisa / Hosts.md
Last active July 26, 2021 22:03
Hosts.ps1 is a PowerShell script for searching, adding, removing, and viewing the windows hosts file.

HOSTS

Hosts.ps1 is a PowerShell script for searching, adding, removing, and viewing the windows hosts file from the terminal.

Exmaple


Usage: hosts add  
       hosts remove 
       hosts show
 hosts search 
@KristofferRisa
KristofferRisa / get-set-executionpolicy
Created September 14, 2015 08:54
Get and set Exectuion policy in PowerShell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
get-executionPolicy -list
@KristofferRisa
KristofferRisa / nmap commands
Last active January 22, 2016 12:42
Some basic nmap commands
nmap -il (input list) [filename]
nmap -a (aggressive) [ip/dns]
nmap --traceroute [ip/dns]
nmap -O (OS info) [ip/dns]
nmap -sV (service version) [ip/dns]
#Note
#nmap scan the 1000 most used ports
nmap -F (fast scan) [ip/dns]
nmap -p (specify ports) 80,808,900-999 or by name http,mysql [ip/dns]
javascript:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document.documentElement.scrollTop,document.body.scrollTop)}funct
@KristofferRisa
KristofferRisa / signature-student.htm
Last active March 28, 2016 13:26
Html signature code used in my student mail
<p style="font-family: Helvetica, Arial, sans-serif; font-size: 12px; line-height: 14px; color: rgb(33, 33, 33); margin-bottom: 10px;">
<span style="font-weight: bold; color: rgb(33, 33, 33); display: inline;">Kristoffer Risa</span>
<span style="display: inline;">/</span>
<span style="color: rgb(33, 33, 33); display: inline;">Student</span>
<span style="display: inline;"><br></span>
<a href="mailto:[email protected]" style="color: rgb(71, 124, 204); text-decoration: none; display: inline;">[email protected]</a>
<span style="display: inline;"> / </span><span style="color: rgb(33, 33, 33); display: inline;">+47 98 28 94 99 </span></p>
<p style="font-family: Helvetica, Arial, sans-serif; font-size: 12px; line-height: 14px; margin-bottom: 10px;">
<span style="font-weight: bold; color: rgb(33, 33, 33); display: inline;">Høyskolen i Sørøst-Norge</span>
@KristofferRisa
KristofferRisa / choco-install-apps.ps1
Last active November 14, 2024 02:42
Choco install scripts
# Install script for Kristoffer
# Created 06.08.2015
ECHO Installing apps
ECHO Configure chocolatey
choco feature enable -n allowGlobalConfirmation
#choco install visualstudiocode
choco install notepadplusplus
(function() {
// your page initialization code here
// the DOM will be available here
})();
<p style="font-family: Helvetica, Arial, sans-serif; font-size: 12px; line-height: 14px; color: rgb(33, 33, 33); margin-bottom: 10px;">
<span style="font-weight: bold; color: rgb(33, 33, 33); display: inline;">Kristoffer Risa</span>
<span style="display: inline;"><br></span>
<a href="mailto:[email protected]" style="color: rgb(71, 124, 204); text-decoration: none; display: inline;">[email protected]</a>
<span style="display: inline;"> / </span><span style="color: rgb(33, 33, 33); display: inline;">+47 98 28 94 99 </span>
</p>
<p style="font-family: Helvetica, Arial, sans-serif; font-size: 12px; line-height: 14px; margin-bottom: 10px;">
<a href="http://www.kristofferrisa.no" style="color: rgb(71, 124, 204); text-decoration: none; display: inline;">http://www.kristofferrisa.no</a>
</p>
<p style="font-size: 0px; line-height: 0; font-family: Helvetica, Arial, sans-serif;">
@KristofferRisa
KristofferRisa / AppsUseLightThemeOnWindows10.reg
Created March 9, 2016 20:25
Use Light Theme on Windows 10
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize]
"ColorPrevalence"=dword:00000000
"EnableTransparency"=dword:00000001
"AppsUseLightTheme"=dword:00000001