Forwarded from duangsuse Throws
#music #Dev #Learn SuperTux歌单:
🌚
bash, zsh均可使用. duangsuse写这个东西花了一个上午( 看来shell虽然博大精深但依然不能拿来谈笑风生 ...🙈
#cd&&git clone https://github.com/SuperTux/supertux.git #如果你没有st的话
cd /usr/share/games/supertux2/music #cd supertux/data/music
🌚
#!/bin/bash
for m in `ls|grep .music` ;do
file_name=`grep -e '".*ogg' -h -o $m|cut -d '"' -f2`
loop_start=`grep -e "loop-begin *" -h $m|awk -F"[ ]" '{print $4}'|cut -d ')' -f 1`
#顺便介绍一下GNU coreutils的tac和rev, 能对行和行内容字符序反转.
loop_end=`grep -e "loop-at *" -h $m|cut -c 12-|cut -d ")" -f1`
printf "\033[32mPlaying SuperTux music \033[36m$file_name \033[0m: \033[0m";echo
printf "\033[34m[*] \033[0m";printf "\033[31mLoop starts at \033[33m$loop_start\\033[0m, ends at \033[35m$loop_end\033[0m \033[0m";echo
mpv $file_name --ab-loop-a $loop_start --ab-loop-b $loop_end ;sleep 0.1
done
unset file_name loop_start loop_end
bash, zsh均可使用. duangsuse写这个东西花了一个上午( 看来shell虽然博大精深但依然不能拿来谈笑风生 ...🙈
duangsuse Throws
#music #Dev #Learn SuperTux歌单: #cd&&git clone https://github.com/SuperTux/supertux.git #如果你没有st的话 cd /usr/share/games/supertux2/music #cd supertux/data/music 🌚 #!/bin/bash for m in `ls|grep .music` ;do file_name=`grep -e '".*ogg' -h -o $m|cut -d '"' -f2` …
使用函数定义重购了一遍🌚
print_color(){
red=31;green=32;yellow=33;blue=34;purple=35;cyan=36
printf "\033[$1m$2\033[0m"
}
for m in `ls|grep .music` ;do
file_name=`grep -e '".*ogg' -h -o $m|cut -d '"' -f2`
loop_start=`grep -e "loop-begin *" -h $m|awk -F"[ ]" '{print $4}'|cut -d ')' -f 1`
loop_end=`grep -e "loop-at *" -h $m|cut -c 12-|cut -d ")" -f1`
print_color $green "Playing SuperTux Music ";print_color $red $file_name;echo
print_color $blue "[*] ";print_color $purple "Loop starts at ";print_color $cyan $loop_start
print_color $purple ", ends at ";print_color $cyan $loop_end
mpv $file_name --ab-loop-a $loop_start --ab-loop-b $loop_end;sleep 0.1
done
unset file_name loop_start loop_endForwarded from 五黄鼠的毛绒绒实验室 (LabRat)
This media is not supported in your browser
VIEW IN TELEGRAM
Retweeted: https://t.co/cVoka51CYS
Forwarded from 五黄鼠的毛绒绒实验室 (LabRat)
Forwarded from 科技圈的日常 (Jimmy Tian)
macOS 上知名下载工具 Folx 与播放器 Elmedia Player 被植入后门。
https://www.welivesecurity.com/2017/10/20/osx-proton-supply-chain-attack-elmedia/
https://www.welivesecurity.com/2017/10/20/osx-proton-supply-chain-attack-elmedia/
WeLiveSecurity
OSX/Proton spreading again through supply‑chain attack
ESET experts noticed that the makers of the Elmedia Player software have been distributing a version of their app trojanized with the OSX/Proton malware.
#Lowlvl_backend 🌚 Linux 1.0
/*
* linux/kernel/panic.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
/*
* This function is used through-out the kernel (includeinh mm and fs)
* to indicate a major problem.
*/
#include <stdarg.h>
#include <linux/kernel.h>
#include <linux/sched.h>
asmlinkage void sys_sync(void); /* it's really int */
extern int vsprintf(char * buf, const char * fmt, va_list args);
NORET_TYPE void panic(const char * fmt, ...)
{
static char buf[1024];
va_list args;
va_start(args, fmt);
vsprintf(buf, fmt, args);
va_end(args);
printk(KERN_EMERG "Kernel panic: %s\n",buf);
if (current == task[0])
printk(KERN_EMERG "In swapper task - not syncing\n");
else
sys_sync();
for(;;);
}