git clone --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
cd linux/tools/perf
make
cp perf /usr/bin
sudo apt-get install libpython3.11-dev
perf -v
perf version 6.7.rc1.gc42d9eeef8e5
git clone --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
cd linux/tools/perf
make
cp perf /usr/bin
sudo apt-get install libpython3.11-dev
perf -v
perf version 6.7.rc1.gc42d9eeef8e5
use std::collections::VecDeque; | |
#[derive(Debug, PartialEq)] | |
pub struct BinaryTree<T> { | |
pub value: T, | |
pub left: Option<Box<BinaryTree<T>>>, | |
pub right: Option<Box<BinaryTree<T>>>, | |
} | |
impl<T> BinaryTree<T> |
#!/bin/bash | |
if [ "${CODESPACES}" != "true" ]; then | |
echo 'Not in a codespace. Aborting.' | |
exit 0 | |
fi | |
WORKSPACE_PATH_IN_CONTAINER=${1:-"$HOME/workspace"} | |
WORKSPACE_PATH_ON_HOST=${1:-"/var/lib/docker/vsonlinemount/workspace"} | |
VM_CONTAINER_WORKSPACE_PATH=/vm-host/$WORKSPACE_PATH_IN_CONTAINER | |
VM_CONTAINER_WORKSPACE_BASE_FOLDER=$(dirname $VM_CONTAINER_WORKSPACE_PATH) |
const puppeteer = require('puppeteer'); | |
const prettier = require('prettier'); | |
const atob = require('atob'); | |
const btoa = require('btoa'); | |
const scriptUrlPatterns = [ | |
'*' | |
] | |
const requestCache = new Map(); |
#!/bin/bash | |
rm -rf /home/yen3/ubuntu.qcow2 | |
qemu-img create -f qcow2 /home/yen3/ubuntu.qcow2 10G | |
virsh undefine ubuntu1604arm64 --nvram | |
install_from_localtion() { | |
virt-install -n ubuntu1604arm64 --memory 1024 --arch aarch64 --vcpus 1 \ | |
--disk /home/yen3/ubuntu.qcow2,device=disk,bus=virtio \ |
let callback: CGEventTapCallBack = { (tapProxy, eventType, event, refcon) -> Unmanaged<CGEvent>? in | |
debugPrint("we are monitoring the mouse event here") | |
return nil | |
} | |
let eventMask = (1 << CGEventType.leftMouseDown.rawValue) | (1 << CGEventType.leftMouseUp.rawValue) | |
let machPort = CGEvent.tapCreateForPid(pid: 40529, place: .tailAppendEventTap, options: .defaultTap, eventsOfInterest: CGEventMask(eventMask), callback: callback, userInfo: nil)! | |
let runLoopSource = CFMachPortCreateRunLoopSource(kCFAllocatorDefault, machPort, 0) |
Some MacOS users have very cluttered Docks & wish they could organize them without removing any App icons from the mix.
This snippet will add an empty "spacer" that you can drag around and use to separate icons into groups! See example.
Paste this into your Terminal. Run the command for additional placeholders!
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <err.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> |