Skip to content

Instantly share code, notes, and snippets.

@BitbeyHub
BitbeyHub / setup.sh
Created June 13, 2023 15:46 — forked from typelogic/setup.sh
SSL server/client in socat
#!/bin/sh
#
if [ $# -eq 0 ];then
echo "Supply client|server"
exit 1
fi
FILENAME=$1
openssl genrsa -out $FILENAME.key 1024
@BitbeyHub
BitbeyHub / .Cloud.md
Created January 2, 2023 10:06 — forked from imba-tjd/.Cloud.md
☁️ 一些免费的云资源

IaaS指提供系统(可以自己选)或者储存空间之类的硬件,软件要自己手动装;PaaS提供语言环境和框架(可以自己选);SaaS只能使用开发好的软件(卖软件本身);BaaS一般类似于非关系数据库,但各家不通用,有时还有一些其它东西。

其他人的集合

@BitbeyHub
BitbeyHub / service.md
Created July 29, 2020 02:18 — forked from tniessen/service.md
Using the "service" tool with ADB and why to avoid it

As it turns out, it is not trivial to control the audio volume of an Android device using ADB. At the time of writing, the only way appears to be using the service tool. Actually, the service command allows to "connect" to a number of services (104 on Android 6.0.1) and invoke functions. Not knowing much about this tool, I managed to completely mute all sounds and speakers of my Nexus 5, and I was stuck without any sound for quite some time. I did not find a way to unmute the sound from within the system UI, so I got to dive a little deeper into this.

If you know which service you want to use, you then need to find its interface declaration. The command

service list

gives you a list of all services with the associated interfaces, if applicable:

...

26 backup: [android.app.backup.IBackupManager]

@BitbeyHub
BitbeyHub / extract_all.ps1
Created December 22, 2019 14:23
Extract all its frames from a video according to its native frame rate using ffmpeg with Powershell script languague as example.
[string]$your_video = Read-Host 'Plz enter the fullpath of your video to extract.'
[string]$fps = ffprobe -v error -select_streams v:0 -show_entries stream=avg_frame_rate -of default=nokey=1:noprint_wrappers=1 -i $your_video # This will return a string like '30/1'
[int]$fps = Invoke-Expression $fps # Let's try to run the string directly as an expression somehow like a trick.
[string]$frame_count = ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 -i $your_video
[string]$out_path = Read-Host 'Choose a fullpath to extract all its frames. (e.g., C:\Users\xxx\Desktop)'
@BitbeyHub
BitbeyHub / uppercase_initial.ps1
Last active December 22, 2019 11:28
A simple method to uppercase the initial character of a word or sentence with the example of Powershell script language.
$example_string = 'github'
$upper_initial = $example_string -replace "^$($example_string[0])", $example_string[0].ToString().ToUpper()
Write-Host $upper_initial