Skip to content

Instantly share code, notes, and snippets.

View soplwang's full-sized avatar

Wang Wenlin soplwang

View GitHub Profile
@rokiden
rokiden / fedora_to_usb.sh
Created August 31, 2023 13:19
Script for converting Fedora LiveCD to LiveUSB with persistence
#!/bin/bash
# Script for converting Fedora (and maybe other dracut-based) LiveCD to LiveUSB
# with persistence. Only UEFI boot supported. Tested with Fedora 37.
#
# Usage:
# ./fedora_to_usb.sh path/to/mounted/livecd /dev/sdX
#
# Result USB partitioning:
# GPT, 2 partitions:
# - "EFI" (vfat 256MB) for GRUB and kernel
@queerviolet
queerviolet / block-transactions.ts
Last active May 25, 2024 04:38
Handling Database Transactions with Apollo Server
/**
* If your database provides block transactions, (like Sequelize,
* here: https://sequelize.org/master/manual/transactions.html) here's how to
* use them in Apollo Server:
*/
import { ApolloServerPlugin, GraphQLRequestContext } from 'apollo-server-plugin-base'
export interface Transactable<Txn> {
transact?: Transact<Txn>
@marc-hanheide
marc-hanheide / ssh.vpn.sh
Created May 27, 2015 20:27
ssh-vpn via ppp (OSX)
#
# You will need to change these variables...
#
# The host name or IP address of the SSH server that we are
# sending the connection request to:
SERVER_HOSTNAME=harek

WebRTC negotiation over IRC

Copyright (c) 2015 Patrick Cloke clokep@instantbird.org

Unlimited redistribution and modification of this document is allowed provided that the above copyright notice and this permission notice remains intact.

WebRTC

@Kentzo
Kentzo / CFSocket.c
Created October 21, 2012 12:35
NEW_SOCKET from
#include <CoreFoundation/CFSocket.h>
#include "CFInternal.h"
#include <dispatch/dispatch.h>
#include <dispatch/private.h>
#include <netinet/in.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <unistd.h>