RNAtlance203 发布的帖子
发布在 Hardware 阅读更多

Mac strafe


2022年年末的时候,我获得了我的第一台MacBook Pro。
my macbook
只有可怜的8 Cores和16GB RAM
配置
到手折腾了差不多两个星期,加上一点点学习成本,算是凑齐了用的还算舒服的布局。
替代文字


Prerequisite: Security

安全是一切的重中之重,关闭SIP对于系统安全性的削弱是无可置疑的,但是出于某些软件的使用便利,我选择降低安全性(停用)。
关机状态下按住command+R启动直到进度条出现,选择恢复模式,选择实用工具,输入csrutil disable, 回车重启。


Utilities

包管理器:Homebrew。无定制配置。可选Macports但是没试过。
代理工具:Stash,默认配置,设置iCloud云同步配置文件,默认发行版本。
浏览器:Google Chrome, Arc Browser以及专用开发的ungoogled chromium
邮件:Apple邮件,默认配置
远程桌面:ParSec,默认配置


DevEnv

终端模拟器:Alacritty,modified icon,配色文件,位于 /Users/<username>/.config/alacritty/

Powerline字体Hack Nerd

Shell:Zsh,安装Oh-My-Zsh,主题选择 021011
安装Z-Plugins:

plugins=(git
	macos
	thefuck
	zsh-autosuggestions
	zsh-syntax-highlighting
	autojump
	mac-zsh-completions
	)

安装The fuck,绑定双击ESC触发;
安装eza,zshrc中加入
alias ls="eza --color=always --icons=always --long";
安装Zinit。

终端复用器:TMUX
配置过程极其繁琐并且已迭代若干版本。核心功能:Tmux Plugin Manager
/ Tmux Continuum / T Resurrect / tmux-copycat

.tmux.conf.local

发布在 Hardware 阅读更多

Mac on


Mac产品线一直有一种神秘的吸引力,它有巨大的历史包袱,每个路过的PC玩家都会向它吐一口口水,因为他是性能孱弱的花瓶,烧熊掌的铁板,高昂的售价和及其扭曲的配置构成一个神秘的城堡,但是几乎所有从在堡垒里的人都会说这玩意真不赖,嘴里念着离电性能和Unix兼容性、便利的程序开发环境等等玄乎其玄的经文。2020年苹果开始将Mac产品线全面转型ARM指令集架构,它的高功耗比才终于让我有理由花重金购入体验一番。

My dogshit mainframe


8GB运存?伙计你在开玩笑吧

8GB RAM?
是的没错,这正是达特利版本的M1 Mac mini,也是我的第一台Mac,看着我手头的其他设备迭代了四五次,而他依然稳坐头把交椅,静静的待在桌上偷吃电力和灰尘。

一开始给他的定位是做iOS的逆向开发,所以安装了Xcode和一些必要组件,结果256G的小硬盘没一会就满了。格机了两三次后现在只好让它安心的当家用服务器和路由器使用。

远程设置
局域网SSH
终端使用默认终端,默认描述文件,安装ohmyzsh,一切默认。
目前只负责处理代理流量转发和局域网文件服务器。

发布在 Games 阅读更多

因为 意识形态 决定 思想高度

发布在 Software 阅读更多

@rnatlance203C++中流重载使用方法 中说:

还有个问题,就是如果私有或者受保护成员是字符串或者数组的话怎么整
(史前大坑)

我发现我就是个人才,就算挖坑都不会把自己坑到

class blu {
protected:
	char s[100];
	char c[100];
	char p;
public:
	blu() {
		strcpy(s, "fsk");
		strcpy(c, "fkb");
		p = 'z';
	}
	~blu() {

	}
	friend istream & operator>>(istream & in, blu &cu) {
		in >> cu.s >> cu.c >> cu.p;
		return in;
	}
	friend ostream & operator<<(ostream & out, blu &cu) {
		out << cu.s << '\t' << cu.c << '\t' << cu.p;
		return out;
	}
};

这不是跟上面的整型变量一样了吗 成员函数都不用写了,爽死

发布在 Software 阅读更多

@rnatlance203C++中流重载使用方法 中说:

还可以拓展一下 虽然用了臭名昭著的goto,(但是)对于这种规模的东西也没必要上那些高端操作其实就是偷懒
codelist_2.cpp

// codelist_2.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include<iostream>
#include<iomanip>
#include<fstream>
#include<string>
#include<stdlib.h>
#include<set>

using namespace std;
class type
{
protected:
	int str1;
	int str2;
	int str3;
	
public:
	type() {
		str1 = 0, str2 = 0, str3 = 0;
	}
	~type() {};
	friend istream & operator>>(istream & in, type &cu ) {
		in >> cu.str1 >> cu.str2 >> cu.str3;
		return in;
	}
	friend ostream & operator<<(ostream & out, const type &st) {
		out << st.str1 << st.str2 << st.str3 << endl;
		return out;
	}
	int getstr1() {
		return str1;
	}
	int getstr2() {
		return str2;
	}
	int getstr3() {
		return str3;
	}
};

void readFile() {
	type type0;
	ifstream fkb("fkb.txt");
	fkb >> type0;
	cout << type0 << endl;
	fkb.close();
}

void writeFile() {
	type type0;
	ofstream fkb("fkb.txt");
	cin >> type0;
	fkb << type0 << endl;
	fkb.close();
}



int main() {
	int choice;
MAIN: {
	system("cls");
	cout << "1=read/2=write/0=exit" << endl;
	cin >> choice;
	if (choice == 1) goto READ;
	else
	{
		if (choice == 2) goto WRITE;
		else return 0;
		}
	}

READ: {
	  readFile();
	  system("pause");
	  goto MAIN;
	}

WRITE:{
	  writeFile();
	  system("pause");
	  goto MAIN;
	}
	return 0;
}

我是不知道我拓展了个什么玩意,我只知道大半夜很容易出错

函数void readFile()只能读第一行而且会把所有数据连在一起,一眼就能看出;
函数void writeFile()写入的时候会把所有数据都连在一起,再读取的话就gg;

修复的方法也很简单

//在class type里的插入流重载中--------------------
friend ostream & operator<<(ostream & out, blu &cu) {
	out << cu.s << '\t' << cu.c << '\t' << cu.p;
	return out;
}
//-----------------------------------------------

void readFile() {
	char str[100];
	ifstream fkb("fkb.txt");
	while (fkb.getline(str, 100)) {
		cout << str << endl;
	}
}

void writeFile() {
	type type0;
	ofstream fkb("fkb.txt", ios::app);
	cin >> type0;
	fkb << type0 << endl;
	fkb.close();
}
发布在 Software 阅读更多

下一个实例就决定做这个了

发布在 Software 阅读更多

我记得c++还是哪门语言有在提供的标准库/标准方法里的某个整好的函数/方法可以实现类似的功能

发布在 Software 阅读更多

还有,我是不写注释人,自己的代码只要自己看得懂即可

发布在 Software 阅读更多

还有个问题,就是如果私有或者受保护成员是字符串或者数组的话怎么整
(史前大坑)

发布在 Software 阅读更多

还可以拓展一下 虽然用了臭名昭著的goto,(但是)对于这种规模的东西也没必要上那些高端操作其实就是偷懒
codelist_2.cpp

// codelist_2.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include<iostream>
#include<iomanip>
#include<fstream>
#include<string>
#include<stdlib.h>
#include<set>

using namespace std;
class type
{
protected:
	int str1;
	int str2;
	int str3;
	
public:
	type() {
		str1 = 0, str2 = 0, str3 = 0;
	}
	~type() {};
	friend istream & operator>>(istream & in, type &cu ) {
		in >> cu.str1 >> cu.str2 >> cu.str3;
		return in;
	}
	friend ostream & operator<<(ostream & out, const type &st) {
		out << st.str1 << st.str2 << st.str3 << endl;
		return out;
	}
	int getstr1() {
		return str1;
	}
	int getstr2() {
		return str2;
	}
	int getstr3() {
		return str3;
	}
};

void readFile() {
	type type0;
	ifstream fkb("fkb.txt");
	fkb >> type0;
	cout << type0 << endl;
	fkb.close();
}

void writeFile() {
	type type0;
	ofstream fkb("fkb.txt");
	cin >> type0;
	fkb << type0 << endl;
	fkb.close();
}



int main() {
	int choice;
MAIN: {
	system("cls");
	cout << "1=read/2=write/0=exit" << endl;
	cin >> choice;
	if (choice == 1) goto READ;
	else
	{
		if (choice == 2) goto WRITE;
		else return 0;
		}
	}

READ: {
	  readFile();
	  system("pause");
	  goto MAIN;
	}

WRITE:{
	  writeFile();
	  system("pause");
	  goto MAIN;
	}
	return 0;
}
发布在 Software 阅读更多

那么有什么实用价值呢

如下
codelist_1.cpp

// codelist_1.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include<iostream>
#include<iomanip>
#include<fstream>
#include<string>
#include<stdlib.h>
#include<set>

using namespace std;
class type
{
private:
	int str1;
	int str2;
	int str3;
	
public:
	type() {
		str1 = 0, str2 = 0, str3 = 0;
	}
	~type() {};
	friend istream & operator>>(istream & in, type &cu ) {
		in >> cu.str1 >> cu.str2 >> cu.str3;
		return in;
	}
	friend ostream & operator<<(ostream & out, const type &st) {
		out << st.str1 << st.str2 << st.str3 << endl;
		return out;
	}
	int getstr1() {
		return str1;
	}
	int getstr2() {
		return str2;
	}
	int getstr3() {
		return str3;
	}
};

int main() {
	type type0;
	ofstream fkb("fkb.txt");
	cin >> type0;
	fkb << type0.getstr1() << type0.getstr2() << type0.getstr3() << endl;
	return 0;
}

实际作用大概是省下了从键盘cin到文件整个过程的文字量,而且这份代码是示例,class只有3个私有成员,如果是大型工程,一个一个cin写那必然是要出人命的

发布在 Software 阅读更多

codelist_0.cpp

#include<iostream>
#include<iomanip>
#include<fstream>
#include<string>
#include<stdlib.h>
#include<set>

using namespace std;
class type
{
private:
	int str1;
	int str2;
	int str3;
	
public:
	type() {
		str1 = 0, str2 = 0, str3 = 0;
	}
	~type() {};
	friend istream & operator>>(istream & in, type &cu ) {
		in >> cu.str1 >> cu.str2 >> cu.str3;
		return in;
	}
	friend ostream & operator<<(ostream & out, const type &st) {
		out << st.str1 << st.str2 << st.str3 << endl;
		return out;
	}
};

int main() {
	type type0;
	cin >> type0;
	cout << type0;
}

这应该是最简单的重载流示例了

发布在 Hardware 阅读更多

反正我是不敢对显卡下手的

发布在 General Discussion 阅读更多

您好 宋体了解一下
0_1551104108658_71f25365-4605-47c7-9b7f-c5df130542fe-image.png

发布在 Software 阅读更多

总结

反正我是笑不出来,眼泪都在肚子里
巨硬偷懒技术实属一流大厂风范
但是
Convenience
考虑到Hyper-V,潜力巨大但是却少被用到(指一般电脑用户)以及Sandbox的特点(隐私保护,全新环境)现在越来越多的被需要,这也算是废物利用"重新发现",主要是微软肯做,想到了用户这方面的需要。

发布在 Software 阅读更多

可以被锁定
0_1548703987166_1cb639e2-e119-46b8-abbe-aeee792a5568-image.png
那就进不去了,重开一个

发布在 Software 阅读更多

存储方面

0_1548701838061_7ef91c35-f893-4cd8-9b9c-c17a29d5f325-image.png

右边是Primary Machine,频率是浮动的
0_1548701945350_263e2288-0774-482a-bad2-d44117a4e936-image.png

右下角有个设备标识
0_1548702422315_5fb3ea05-b082-468a-af1c-35f0beb6dd1c-image.png

用户名
0_1548702596799_87cad9bb-52b3-4725-8f23-b53cc2cf84c3-image.png
我想了一下WD可能是指Windows Defender,然后查证
0_1548702784858_03ddd2f5-e75f-49b9-ae2a-f7fbb874afaa-image.png
运行就直接是以管理员运行0_1548702855062_50a00d85-91e7-4b91-8236-0625ec064837-image.png 那UAC自然是最后一级(从不通知)

许可是自然没许可的
0_1548702989972_b4cc253a-bc91-4bdf-81e3-7b1bb2d4192f-image.png

我去网上找了一些激活码,输入确认后立即返回
0_1548703070570_dc757565-c8ef-40b2-ae6a-b4b95f79315f-image.pngGoogle了一圈,没有相关解答

程序和功能是空白的
0_1548703633753_8e8ad164-cf34-4fd9-89d8-4e76493ff96d-image.png

发布在 Software 阅读更多

接下来就是看看一些有意思的细节

说实话也没什么好说的,跟Hyper-V完全一致的东西,傻瓜式的一键打开

那么那些需要名字的地方random就好了

0_1548701504467_48c538b4-6801-44e9-981b-89260bb9ef9b-image.png

发布在 Software 阅读更多

为了节省不看细节的水友时间,我就直接说原理了

很简单,Windows Hyper-V虚拟机+本机映射+远程桌面
(其实当Windows提示打开Sandbox这项功能需要打开硬件虚拟化的时候我就差不多明白了)

0_1548700912194_24d46b42-44b0-40ae-98a4-7103cd5698b7-image.png

0_1548700998585_9ea96b7e-746f-410d-8f3b-af18ee4b1f8f-image.png

0_1548701595463_be1e1194-3f26-4752-8a31-bd10df82b197-image.png

0_1548701044750_e1b6dbaa-0776-4214-8bd8-a330dcdd70ea-image.png

0_1548701178382_4286f0e5-2838-4185-9e97-e1c66f4af7a4-image.png