Posts

SIP call using linphone CLI and voipbuster

Purpose: make a SIP call to my phone in CLI. I used voipbuster as VOIP service provider. Solution: linphone CLI (command line) 1. install $ sudo apt install linphone-nogtk this will install linphone v3.12.0 (at the time of writing) 2. config 2.1. run command "linphonec"  (note the "c" at the end) $ linphonec 2.2. add voipbuster (red bold letters are input) linphonec> proxy add Adding new proxy setup. Hit ^D to abort. Enter proxy sip address: sip:XXX@voipbuster.com Your identity for this proxy: sip:XXX@voipbuster.com Do you want to register on this proxy (yes/no): yes Specify register expiration time in seconds (default is 600): <ENTER> Expiration: 600 seconds Specify route if needed: <ENTER> No route specified. -------------------------------------------- sip address: sip:XXX@voipbuster.com route: identity: sip:XXX@voipbuster.com register: yes expires: 600 registered: no -------------------------------------------- Accept the above proxy configuration...

X

 坐庄的原理 在大街上,有时可以看到一种玩38的临时赌局。一个人拿着一个小酒杯,酒杯里有一个白色的小片,小片的一面写着3,另一面写着8,他一面快速地在地上转着酒杯,一面口中念念有词,不外是解说规则招呼围观者下注。随着酒杯旋转,杯中的小片也跟着翻滚,转上一阵后,他突然用一块硬纸板把杯口盖上,周围的人开始压钱。由于小片一直在晃动,看清上面的字多少是有些困难的,所以有人压3有人压8。压完之后一开盖,压对的一赔一,压错的压多少全输掉。 这个游戏看似对压钱的人有利,因为只要眼力好,仔细看,就算不是每一次都能看准,至少能对多错少,只要看的仔细些,应该是只赢不输。但一玩就知道了,有时候看的清清楚楚是3,可一开盖却是8。玩的人只以为是自己没看清,于是更仔细的看,看清楚了再压,结果还是有时对有时错,等玩一段时间再看,肯定是输钱多赢钱少。 道理何在呢?原来在小片中夹有一小片磁铁,聚赌者手中拿着另一块磁铁。他悄悄的把磁铁N极S极往上一凑,要它是8就是8,要它是3就是3,和他玩的人有输没赢。 从这个例子包括了坐庄的基本原理。坐庄有两个要点,第一,庄家要下场直接参与竞局,也就是这样才能赢;第二,庄家还得有办法控制局面的发展,让自己稳操胜券。 股市做庄也是如此,股市做庄庄家要把仓位分成两部分,一部分用于建仓,部分资金的作用是直接参与竞局;另一部分用于控制股价。与38游戏不同,38游戏中靠作弊控制局面,而在股市中庄家必须通过实际买卖来控制股价;38游戏中用一块磁铁就可以控制局面了,完全没有成本,而股市中必须用一部分资金控盘,而且控盘这部分资金风险较大,一圈庄做下来,这部分资金获利很低甚至可能会赔,庄家赚钱主要还是要靠建仓资金。 股市控盘是有成本的,所以,要做庄必须进行成本核算,看控盘所投入的成本和建仓资金的获利相比如何,如果控盘成本超出了获利,则这个庄就不能再做下去了。一般来说,坐庄是必赢的,控盘成本肯定比获利少。因为做庄控盘虽然没有超越于市场之外的手段无成本的控制局面,但股市存在一些规律可以为庄家所利用,可以保证控盘成本比建仓获利要低。 控盘的依据是股价的运行具有非线形,快速集中大量的买卖可以使股价迅速涨跌,而缓慢的买卖即使量已经很大,对股价的影响仍然很小。只要市场的这种性质继续存在下去,庄家就可以利用这一点来获利。股价之所以会有这种运动规律,是因为市场上存在大量对行情缺乏分析判断能力...

kde ksshaskpass ssh-agent plasma

Kubuntu 20.04 LTS 0. keys. put keys in $HOME/key folder (optional) make sure private key files permission is 400 or 600. (required), and file extension is ".key". 1. install ksshaskpass (mine is installed) $ sudo apt install ksshaskpass 2. add keys $HOME/.config/autostart-scripts/load-keys.sh file content: #!/bin/bash export SSH_ASKPASS=/usr/bin/ksshaskpass SSH_ASKPASS=/usr/bin/ksshaskpass ssh-add ~/key/*.key </dev/null Run this script manually once. It will ask for password if key file is password-protected, and it can save the password in kwallet so you won't need to input it again. 3. make load-keys.sh executable $ chmod +x $HOME/.config/autostart-scripts/load-keys.sh 4. load ssh-agent (not required on mine) (make it executable too) $ cat ~/.config/plasma-workspace/env/ssh-agent-startup.sh #!/bin/bash [ -n "$SSH_AGENT_PID" ] || eval "$(ssh-agent -s)" Reference https://newbedev.com/using-ssh-agent-with-kde https://dev.to/manekenpix/kde-plasma-s...

Xbox one controller Linux rpcs3 PS3

1. install xpadneo driver/utilities $ sudo apt install dkms git linux-headers-`uname -r` $ git clone https://github.com/atar-axis/xpadneo.git $ cd xpadneo/ $ sudo ./install.sh  $ sudo apt install joystick $ sudo aptitude install jstest-gtk $ jstest-gtk  2. memlock setting add these two lines to /etc/security/limits.conf or /etc/security.conf, reboot. * hard memlock unlimited * soft memlock unlimited 3. download rpcs3 4. download PS3 firmware

DELL U4320Q ddccontrol in Linux switch input

Device i2c number $ sudo ddccontrol -p | grep /dev/  - Device: dev:/dev/i2c-8 this is the device i2c number. switch input source $ sudo ddccontrol -r 0x60 -w 4883 dev:/dev/i2c-8 -r 0x60: this is the input source switch. 4883: target port. DP1  15 or 4879 DP2  16 or 4883 HDMI1  17 or 4881 HDMI2  18 or 4882 USB-C 4891 read current value $ sudo ddccontrol -r 0x60 dev:dev/i2c-8 you can get the current value this way, if you have a different monitor model. Reference https://github.com/ddccontrol/ddccontrol-db/blob/master/doc/how-to-add-a-monitor.md https://askubuntu.com/questions/860761/ubuntu-command-line-to-change-input-source-on-a-display-monitor

UEFI boot.

GPT: GUID分区表。 ESP: EFI System Partition. It is the place where UEFI will look for a boot loader. 一个专用分区,UEFI 会从这类分区搜索boot loader。 NVRAM: 是BIOS ROM中的一段区域,一般定义为64k byte, 现在EFI把所有的变量都存在这里。 boot loader: 启动引导器。让机器知道真正的要启动的系统所在。GRUB (grubx64.efi),Windows (bootmgfw.efi),SYSLINUX (syslinux.efi),都属于boot loader。 /EFI/Boot/bootx64.efi: UEFI fallback boot loader path,默认引导器路径。完整路径是\EFI\BOOT\BOOT{machine type short-name}.efi。当计算机没有引导条目或已存条目均无效时,尝试加载此文件。LiveCD和安装盘等就会用到这个文件。本文件其实就是grubx64.efi或者bootmgfw.efi,区别就是默认和指定的。 efibootmgr/Bcdedit: manipulate the UEFI Boot Manager。 创建和修改引导条目,保存在NVRAM。一般用于永久安装的系统,如安装好的Windows 10,而非安装盘或者LiveCD系统等。 常用路径 \EFI\boot\bootx64.efi \EFI\Miscosoft\Boot\bootmgfw.efi \EFI\Ubuntu\grubx64.efi \EFI\Ubuntu\shimx64.efi (secure boot) 查看NVRAM引导设置的命令: Linux: sudo efibootmgr -v Win10: bcdedit /enum firmware 参考: https://www.jianshu.com/p/a35d42daf010 https://www.happyassassin.net/posts/2014/01/25/uefi-boot-how-does-that-actually-work-then/ https://wiki.syslinux.org/wiki/index.php?...

Organize my music files.

FLAC to ALAC: $ ffmpeg -y -i source.flac -acodec alac -vcodec copy dest.m4a APE to ALAC: $ ffmpeg -y -i source.ape -acodec alac -vcodec copy dest.m4a cut using CUE $ ffcuesplit.py album.cue .py file is in https://gist.github.com/frabad/5e4505b9f6e6c0ffb29e4fdb5a05c76e ReplayGain $ rgbpm2 folder1 executables are in this git repo:  https://github.com/Moonbase59/loudgain