This file contains hidden or 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
exports.handler = async (req) => { | |
return new Response("Hello World"); | |
} |
This file contains hidden or 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
bun run build-layer -- \ | |
--arch x64 \ | |
--release canary \ | |
--output /path/to/layer.zip |
This file contains hidden or 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 type { Server, ServerWebSocket } from "bun"; | |
import { AwsClient } from "aws4fetch"; | |
type Lambda = { | |
fetch: (request: Request, server: Server) => Promise<Response | undefined>; | |
error?: (error: unknown) => Promise<Response>; | |
websocket?: { | |
open?: (ws: ServerWebSocket) => Promise<void>; | |
message?: (ws: ServerWebSocket, message: string) => Promise<void>; | |
close?: (ws: ServerWebSocket, code: number, reason: string) => Promise<void>; |
This file contains hidden or 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
#! /bin/sh | |
export BUN_INSTALL_CACHE_DIR=/tmp/bun/cache | |
exec /opt/bun --cwd $LAMBDA_TASK_ROOT /opt/runtime.ts |
This file contains hidden or 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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This file contains hidden or 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
#!/bin/sh | |
# For debugging use iptables -v. | |
IPTABLES="/sbin/iptables" | |
IP6TABLES="/sbin/ip6tables" | |
MODPROBE="/sbin/modprobe" | |
RMMOD="/sbin/rmmod" | |
ARP="/usr/sbin/arp" | |
SECONDS=1 |
This file contains hidden or 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
const process = require("process"); | |
const fs = require("fs"); | |
//Error.log dosyasına hatayı yazar | |
process.on('uncaughtException', (err, reason) => { | |
fs.appendFileSync( | |
'error.log', | |
`\n[${new Date().toISOString()}] ${reason}: ${err}\n` + | |
`Stack: ${err.stack}\n`, | |
{ flag: 'a+' } |
This file contains hidden or 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
process.on('unhandledRejection', (reason, promise) => { | |
console.log('Unhandled Rejection:', promise, `${err.message} ${err.stack}`) | |
process.exit(1) | |
}) |
This file contains hidden or 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
process.on('uncaughtException', err => { | |
console.log(`Uncaught Exception: ${err.message} ${err.stack}`) | |
process.exit(1) | |
}) |
This file contains hidden or 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
cd /var/named |
NewerOlder