Skip to content

Instantly share code, notes, and snippets.

View zwongeer's full-sized avatar
🉑

Ruzey Onairelav zwongeer

🉑
View GitHub Profile
#!/usr/bin/env bash
SHELL_FOLDER=$(dirname $(readlink -f "$0"))
#cd $SHELL_FOLDER
error_trap () {
local lc="$BASH_COMMAND" rc=$?
echo "Failed:Command [$lc] exited with code [$rc]"
}
exit_trap() {
true
}
#!/usr/bin/env bash
# on ubuntu 18.04
cat << EOF >/etc/apt/source.list
deb http://archive.ubuntu.com/ubuntu bionic main multiverse restricted universe
deb http://archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse restricted universe
EOF
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
cat << EOF > /etc/apt/sources.list.d/clang.list
#!/usr/bin/env bash
# !pip install colab_ssh --upgrade
# from colab_ssh import launch_ssh_cloudflared, init_git_cloudflared
# launch_ssh_cloudflared(password="<PUT_YOUR_PASSWORD_HERE>")
# Optional: if you want to clone a Github or Gitlab repository
# repository_url="<PUT_YOUR_REPOSITORY_URL_HERE>"
# init_git_cloudflared(repository_url)
SHELL_FOLDER=$(dirname $(readlink -f "$0"))
// https://leetcode-cn.com/problems/guess-number-higher-or-lower/
/**
* Forward declaration of guess API.
* @param num your guess
* @return -1 if num is lower than the guess number
* 1 if num is higher than the guess number
* otherwise return 0
* int guess(int num);
*/

https://askubuntu.com/questions/17791/can-i-downmix-stereo-audio-to-mono 1.Find the name of your audio sink by running

pacmd list-sinks | grep name:

2.Then run this command (taking care to remove the angled brackets from the result of previous command):

pacmd load-module module-remap-sink sink_name=mono master=NAME_OF_AUDIO_SINK_GIVEN_BY_PREVIOUS_COMMAND channels=2 channel_map=mono,mono

or add

Debian KVM virtual machine

First, download the qcow2 file from https://cloud.debian.org/images/cloud/.

Next, remove the root password.

guestfish --rw -a debian.qcow2
><fs> launch
&gt; list-filesystems
import random
for i in range(7):
t = random.uniform(36.0,36.6)
m = str(t)[:4]
t = random.uniform(36.4,36.9)
n = str(t)[:4]
print(f'早:{m} 晚:{n}')
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Random;
class UniqueInts implements Iterable<Integer> {
private int imin;
private int emax;
private Random rand;
private Map<Integer, Integer> trans;
/*
The teacher asked us to use the stack to turn the recursive algorithm into non-recursive, so I wrote this.🤣
#1
*/
#include <algorithm>
#include <iostream>
#include <memory>
#include <cstdlib>
#include <stack>
using namespace std;
/*
The teacher asked us to use the stack to turn the recursive algorithm into non-recursive, so I wrote this.🤣
#1 https://gist.github.com/zwongeer/1def202a5ab8bb44b25c05f470681621
#2
*/
#include <algorithm>
#include <iostream>
#include <memory>
#include <cstdlib>
#include <stack>