A step by step cheat sheet on how I usually deploy my fullstack application to a linux server for the initial alpha test.
sudo apt update
| { | |
| resolve: `gatsby-plugin-layout`, | |
| options: { | |
| component: require.resolve(`./src/components/Layout.tsx`), | |
| }, | |
| }, |
| .eq-container { | |
| pointer-events: none; | |
| } | |
| .bar { | |
| display: inline-block; | |
| position: relative; | |
| margin-right: 3px; | |
| width: 10px; | |
| height: 1px; |
| const SpotifyCurrentlyPlaying: React.FC = () => { | |
| const [playingItem, fetching] = useCurrentlyPlaying(); | |
| const isPlaying = playingItem && playingItem.isPlaying; | |
| return isPlaying ? ( | |
| <div className="fixed bottom-4 right-4 bg-white rounded p-2 drop-shadow-md flex justify-start items-center dark:bg-brand-dark min-w-[250px]"> | |
| <div className="relative"> | |
| <div className="pr-2"> | |
| <a href={playingItem.item.uri}> | |
| <img |
| const fetchSpotifyPlayer = async () => { | |
| const URL = "./.netlify/functions/CurrentlyPlaying"; | |
| const OPTIONS = { | |
| method: "GET", | |
| headers: { | |
| Accept: "application/json", | |
| "Content-Type": "application/json;charset=UTF-8", | |
| }, | |
| }; | |
| const response = await fetch(URL, OPTIONS); |
| type PollingMode = "STATIC" | "CALCULATED"; | |
| const BUFFER_TIME = 5000; | |
| const WAIT_ON_ERROR = 60000; | |
| const POLLING_RATE = 10000; | |
| const POLLING_MODE: PollingMode = "CALCULATED"; | |
| const useCurrentlyPlaying = () => { | |
| const [playingItem, setPlayingItem] = useState<SpotifyPlayer>(); | |
| const [fetching, setFetching] = useState(false); |
| export interface SpotifyImage { | |
| height: number; | |
| width: number; | |
| url: string; | |
| } | |
| export interface SpotifyAlbum { | |
| images: Array<SpotifyImage>; | |
| name: string; | |
| } |
| query CurrentlyPlaying { | |
| me { | |
| spotify { | |
| player { | |
| progressMs | |
| isPlaying | |
| repeatState | |
| shuffleState | |
| item { | |
| name |
| import requests | |
| import math | |
| flag = [] | |
| bytestocrunch = 32 # Get it with a block_size long pattern. bytes to crunch will be the (responce - (block_size*2))/2. *2 because we get a hexstring | |
| block_size = 16 # Get it by appending n bytes until the output increases. Ater it increased count the bytes until it increases again | |
| apattern = [0x61] * math.ceil(bytestocrunch/block_size) * block_size # Any byte will be sufficient | |
| for y in range(1, bytestocrunch+1): | |
| pattern = ''.join([hex(b)[2:].zfill(2) for b in apattern[:-y]]) # Convert 0:-y to a hex string | |
| message = [67594220461269, 501237540280788, 718316769824518, 296304224247167, 48290626940198, 30829701196032, 521453693392074, <...> ] | |
| p = 1007621497415251 | |
| exponent = int((p-1)/2) | |
| bresult = [1 if pow(m, exponent, p) == 1 else 0 for m in message] | |
| bresultgroup = [''.join(str(y) for y in bresult[x:x+8]) for x in range(0, len(bresult), 8)] | |
| ''.join([chr(int(x, 2)) for x in bresultgroup]) |