Skip to content

Instantly share code, notes, and snippets.

var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@younesbelkada
younesbelkada / finetune_llama_v2.py
Last active April 24, 2024 02:14
Fine tune Llama v2 models on Guanaco Dataset
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@taurusxin
taurusxin / optimize.sh
Created October 30, 2022 18:59
Linux Optimization Script
#!/usr/bin/env bash
echo=echo
for cmd in echo /bin/echo; do
$cmd >/dev/null 2>&1 || continue
if ! $cmd -e "" | grep -qE '^-e'; then
echo=$cmd
break
fi
done
@imneonizer
imneonizer / how-to-download-from-pan-baidu.md
Created October 28, 2021 08:59
How to download from pan.baidu without account

How to download from pan.baidu.com

Disclaimer:

  • This methods uses a 3rd party website: https://baidu.kinh.cc/.
  • I don't know chinese and after one day of searching for a method I finally found this. I don't know how safe this website is but it does the job.
  • Do it on your own responsibility. I have no idea about possible copyright (if there is such a thing in China) and other stuff regarding to this.

Steps

1. Open the website mentioned above and fill out fields as following:

@invictus-ir
invictus-ir / CloudTrail.csv
Last active April 24, 2024 02:12
An overview of CloudTrail events that are interesting from an Incident Response perspective
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 10 columns, instead of 9. in line 7.
"Initial Access","Execution","Persistence","Privilege Escalation","Defense Evasion","Credential Access","Discovery","Lateral Movement","Exfiltration","Impact"
ConsoleLogin,StartInstance,CreateAccessKey,CreateGroup,StopLogging,GetSecretValue,ListUsers,AssumeRole,CreateSnapShot,PutBucketVersioning
PasswordRecoveryRequested,StartInstances,CreateUser,CreateRole,DeleteTrail,GetPasswordData,ListRoles,SwitchRole,ModifySnapshotAttributes ,RunInstances
,Invoke,CreateNetworkAclEntry,UpdateAccessKey,UpdateTrail,RequestCertificate,ListIdentities,,ModifyImageAttribute,DeleteAccountPublicAccessBlock
,SendCommand,CreateRoute,PutGroupPolicy,PutEventSelectors,UpdateAssumeRolePolicy,ListAccessKeys,,SharedSnapshotCopyInitiated,
,,CreateLoginProfile,PutRolePolicy,DeleteFlowLogs,,ListServiceQuotas,,SharedSnapshotVolumeCreated,
,,AuthorizeSecurityGroupEgress,PutUserPolicy,DeleteDetector,,ListInstanceProfiles,,ModifyDBSnapshotAttribute,
,,AuthorizeSecurityGroupIngress,AddRoleToInstanceProfile,DeleteMembers,,ListBuckets,,PutBucketP
@peng-huang-ch
peng-huang-ch / encrypt.ts
Last active April 24, 2024 02:08
encrypt and decrypt the text using the password.
/**
* This file is used to encrypt and decrypt the text using the password.
* The password is used to derive the key using PBKDF2.
* The key is used to encrypt and decrypt the text using AES-GCM.
* The salt is used to derive the key using PBKDF2.
* The nonce is used to encrypt and decrypt the text using AES-GCM.
* The ciphertext is the encrypted text.
* The salt, nonce, and ciphertext are concatenated and converted to Base64.
* inspire by https://github.com/MetaMask/metamask-extension/blob/develop/app/scripts/controllers/user-storage/encryption.ts
*/
@sindresorhus
sindresorhus / esm-package.md
Last active April 24, 2024 02:07
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@matyunin
matyunin / linux_tune.md
Last active April 24, 2024 02:05
Linux network performance tuning

###Tuning

$ netstat -nao | grep 8080 | grep TIME_WAIT | wc -l

To achieve the top most performance you should tune the source server system limits:

net.ipv4.tcp_max_tw_buckets = 65536
@metajiji
metajiji / install-megacli.md
Last active April 24, 2024 02:04 — forked from fxkraus/debian-install-megacli.md
Install LSI MegaCli

download

wget https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip

or

curl -LO https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip