首页
统计
壁纸
留言板
友情链接
更多
直播
实用工具
Search
1
浏览器 | 开启Chrome和Edge的多线程下载功能(Parallel downloading)
1,150 阅读
2
给孙小姐的一封情书
462 阅读
3
LabVIEW | 各版本及开发工具模块下载
265 阅读
4
armUbuntu系统构建
247 阅读
5
OpenWRT | 作为 旁路由/单臂路由/透明网关 设置 DDNS
247 阅读
取次花丛懒回顾
默认分类
C#
MySQL
LabVIEW
Java
Android
PHP
Python
handsome
相册
百度地图
嵌入式
嵌入式Ubuntu
I.MX6ULL
linux
Unity
Golang
Rust
OpenHD
教学计划
Search
标签搜索
C#
handsome
Git
动态壁纸
开源
Unity3d
Unity
csharp
Moao
累计撰写
183
篇文章
累计收到
25
条评论
首页
栏目
取次花丛懒回顾
默认分类
C#
MySQL
LabVIEW
Java
Android
PHP
Python
handsome
相册
百度地图
嵌入式
嵌入式Ubuntu
I.MX6ULL
linux
Unity
Golang
Rust
OpenHD
教学计划
页面
统计
壁纸
留言板
友情链接
直播
实用工具
搜索到
183
篇与
的结果
2023-09-19
Ubuntu | 安装aria2
安装sudo apt-get install aria2配置mkdir /etc/aria2 #新建文件夹 touch /etc/aria2/aria2.session #新建session文件 chmod 777 /etc/aria2/aria2.session #设置aria2.session可写 vim /etc/aria2/aria2.conf #创建配置文件aria2.conf: ## 全局设置 ## ============================================================ # 日志 #log-level=warn #log=/PATH/.aria2/aria2.log # 后台运行 #daemon=true # 下载位置, 默认: 当前启动位置 dir=/home/Aria2/Downloads/ # 从会话文件中读取下载任务 都用绝对路径 input-file=/etc/aria2/aria2.session # 在Aria2退出时保存`错误/未完成`的下载任务到会话文件 save-session=/etc/aria2/aria2.session # 定时保存会话, 0为退出时才保存, 需1.16.1以上版本, 默认:0 save-session-interval=30 # 断点续传 continue=true # 启用磁盘缓存, 0为禁用缓存, 需1.16以上版本, 默认:16M #disk-cache=32M # 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc # 预分配所需时间: none < falloc ? trunc < prealloc # falloc和trunc则需要文件系统和内核支持 # NTFS建议使用falloc, EXT3/4建议trunc, MAC 下需要注释此项 file-allocation=none # 客户端伪装 user-agent=netdisk;5.2.6;PC;PC-Windows;6.2.9200;WindowsBaiduYunGuanJia referer=http://pan.baidu.com/disk/home # 禁用IPv6, 默认:false disable-ipv6=true # 其他 always-resume=true check-integrity=true ## 下载位置 ## ============================================================ # 最大同时下载任务数, 运行时可修改, 默认:5 max-concurrent-downloads=10 # 同一服务器连接数, 添加时可指定, 默认:1 max-connection-per-server=10 # 最小文件分片大小, 添加时可指定, 取值范围1M -1024M, 默认:20M # 假定size=10M, 文件为20MiB 则使用两个来源下载; 文件为15MiB 则使用一个来源下载 min-split-size=10M # 单个任务最大线程数, 添加时可指定, 默认:5 split=5 # 整体下载速度限制, 运行时可修改, 默认:0 #max-overall-download-limit=0 # 单个任务下载速度限制, 默认:0 #max-download-limit=0 # 整体上传速度限制, 运行时可修改, 默认:0 #max-overall-upload-limit=0 # 单个任务上传速度限制, 默认:0 #max-upload-limit=0 ## RPC设置 ## ============================================================ # 启用RPC, 默认:false enable-rpc=true # 允许所有来源, 默认:false rpc-allow-origin-all=true # 允许非外部访问, 默认:false rpc-listen-all=true # 事件轮询方式, 取值:[epoll, kqueue, port, poll, select], 不同系统默认值不同 #event-poll=select # RPC监听端口, 端口被占用时可以修改, 默认:6800 rpc-listen-port=6800 # 设置的RPC授权令牌, v1.18.4新增功能, 取代 --rpc-user 和 --rpc-passwd 选项 #rpc-secret=<TOKEN> # 是否启用 RPC 服务的 SSL/TLS 加密, # 启用加密后 RPC 服务需要使用 https 或者 wss 协议连接 #rpc-secure=true # 在 RPC 服务中启用 SSL/TLS 加密时的证书文件, # 使用 PEM 格式时,您必须通过 --rpc-private-key 指定私钥 #rpc-certificate=/path/to/certificate.pem # 在 RPC 服务中启用 SSL/TLS 加密时的私钥文件 #rpc-private-key=/path/to/certificate.key ## BT/PT下载相关 ## ============================================================ # 当下载的是一个种子(以.torrent结尾)时, 自动开始BT任务, 默认:true #follow-torrent=true # BT监听端口, 当端口被屏蔽时使用, 默认:6881-6999 listen-port=51413 # 单个种子最大连接数, 默认:55 #bt-max-peers=55 # 打开DHT功能, PT需要禁用, 默认:true enable-dht=false # 打开IPv6 DHT功能, PT需要禁用 #enable-dht6=false # DHT网络监听端口, 默认:6881-6999 #dht-listen-port=6881-6999 dht-file-path=/opt/var/aria2/dht.dat dht-file-path6=/opt/var/aria2/dht6.dat # 本地节点查找, PT需要禁用, 默认:false #bt-enable-lpd=false # 种子交换, PT需要禁用, 默认:true enable-peer-exchange=false # 每个种子限速, 对少种的PT很有用, 默认:50K #bt-request-peer-speed-limit=50K # 设置 peer id 前缀 peer-id-prefix=-TR2770- # 当种子的分享率达到这个数时, 自动停止做种, 0为一直做种, 默认:1.0 seed-ratio=0 # 强制保存会话, 即使任务已经完成, 默认:false # 较新的版本开启后会在任务完成后依然保留.aria2文件 #force-save=false # BT校验相关, 默认:true #bt-hash-check-seed=true # 继续之前的BT任务时, 无需再次校验, 默认:false bt-seed-unverified=true # 保存磁力链接元数据为种子文件(.torrent文件), 默认:false bt-save-metadata=true bt-max-open-files=16 # Http/FTP 相关 connect-timeout=120 启动aria2aria2c --conf-path=/etc/aria2/aria2.conf如果没有提示错误,按ctrl+c停止运行命令,转为后台运行:aria2c --conf-path=/etc/aria2/aria2.conf -D参数使用使用 aria2 下载文件,只需在命令后附加地址即可。注意:命令是aria2c。比如我们下载ubuntu如:aria2c http://www.mirror.tw/pub/ubuntu/releases/jaunty/ubuntu-9.04-desktop-i386.iso分段下载利用 aria2 的分段下载功能可以加快文件的下载速度,对于下载大文件时特别有用,为了使用 aria2 的分段下载功能,你需要在命令中指定 s 选项。如:aria2c -s 2 http://www.mirror.tw/pub/ubuntu/releases/jaunty/ubuntu-9.04-desktop-i386.iso这将使用 2 个连接来下载该文件,s 后面的参数值介于 1~5 之间,你可以根据实际情况选择。使用 c 选项可以断点续传文件如:aria2c -c http://www.mirror.tw/pub/ubuntu/releases/jaunty/ubuntu-9.04-desktop-i386.iso下载 torrent 文件你也可以使用 aria2 下载 BitTorrent 文件。如: aria2c -o gutsy.torrent http://cdimage.ubuntu.com/daily-live/current/gutsy-desktop-i386.iso.torrent服务模式开机启动增加开机启动脚本sudo vim /etc/init.d/aria2c添加如下内容:#!/bin/sh ### BEGIN INIT INFO # Provides: aria2 # Required-Start: $remote_fs $network # Required-Stop: $remote_fs $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Aria2 Downloader ### END INIT INFO case "$1" in start) echo -n "已开启Aria2c" sudo aria2c --conf-path=/home/***/.aria2/aria2.conf -D ;; stop) echo -n "已关闭Aria2c" killall aria2c ;; restart) killall aria2c sudo aria2c --conf-path=/home/***/.aria2/aria2.conf -D ;; esac exit修改文件权限为755 (a+x)sudo chmod 755 /etc/init.d/aria2c添加aria2c服务到开机启动sudo update-rc.d aria2c defaults启动服务sudo service aria2c start查看服务状态sudo systemctl status aria2c
2023年09月19日
110 阅读
0 评论
0 点赞
2023-09-19
Ubuntu 22.04.6 | QEMU KVM 安装 macOS虚拟机
参考https://github.com/kholia/OSX-KVM拷贝备份仓库https://gitee.com/y141111/OSX-KVM更新软件源sudo apt-get update环境要求A modern Linux distribution. E.g. Ubuntu 22.04 LTS 64-bit or later.QEMU >= 6.2.0A CPU with Intel VT-x / AMD SVM support is required (grep -e vmx -e svm /proc/cpuinfo)A CPU with SSE4.1 support is required for >= macOS SierraA CPU with AVX2 support is required for >= macOS Mojavepython3软连接到pythonsudo ln -s /usr/bin/python3.8 /usr/bin/python如果已存在则先删除在创建sudo rm /usr/bin/python安装需要的软件包安装 QEMU 和其他软件包。sudo apt-get install qemu uml-utilities virt-manager git \ wget libguestfs-tools p7zip-full make dmg2img tesseract-ocr \ tesseract-ocr-eng genisoimage -y克隆OSX-KVM代码(macOS运行的虚拟机)首先进入当前用户目录下cd ~然后克隆仓库代码国外(二选一)git clone --depth 1 --recursive https://github.com/y141111/OSX-KVM.git国内(二选一)git clone --depth 1 --recursive https://gitee.com/y141111/OSX-KVM.git进入克隆的代码目录cd OSX-KVM获取macOS安装包./fetch-macOS-v2.py将下载的dmg文件转换为img文件dmg2img -i BaseSystem.dmg BaseSystem.img创建将在其中安装 macOS 的虚拟硬盘映像。如果将 磁盘映像的名称 从 到其他内容,引导脚本 将需要更新以指向新的映像名称。mac_hdd_ng.imgqemu-img create -f qcow2 mac_hdd_ng.img 128G安装CLI 方法(主要)。只需运行脚本即可启动 安装过程。OpenCore-Boot.sh./OpenCore-Boot.sh注意:此脚本适用于所有最新的 macOS 版本。使用 macOS 安装程序中的工具进行分区,以及 格式化附加到 macOS 虚拟机的虚拟磁盘。Disk Utility继续,并安装 macOS 🙌提示:建议使用非 APFS 文件系统。(可选)将此macOS VM磁盘与libvirt(virt-manager / virsh stuff)一起使用。编辑macOS-libvirt-Catalina.xml文件并更改各种文件路径(在该文件中搜索CHANGEME字符串)sed "s/CHANGEME/$USER/g" macOS-libvirt-Catalina.xml > macOS.xml virt-xml-validate macOS.xml通过运行以下命令创建 VM。virsh --connect qemu:///system define macOS.xml如果需要,向 libvirt-qemu 用户授予必要的权限,sudo setfacl -m u:libvirt-qemu:rx /home/$USER sudo setfacl -R -m u:libvirt-qemu:rx /home/$USER/OSX-KVM启动virt-manager并启动macOS虚拟机。Headless macOS使用提供的 boot-macOS-headless.sh脚本。./boot-macOS-headless.shSetting Expectations RightNice job on setting up a Virtual Hackintoshsystem! Such a system can be used for a variety of purposes (e.g. software builds, testing, reversing work), and it may be all you need, along with some tweaks documented in this repository.However, such a system lacks graphical acceleration, a reliable sound sub-system, USB 3 functionality and other similar things. To enable these things, take a look at our notes. We would like to resume our testing and documentation work around this area. Please reach out to us if you are able to fund this area of work.It is possible to have 'beyond-native-apple-hw' performance but it does require work, patience, and a bit of luck (perhaps?).Post-InstallationSee networking notes on how to setup networking in your VM, outbound and also inbound for remote access to your VM via SSH, VNC, etc.To passthrough GPUs and other devices, see these notes.Need a different resolution? Check out the notes included in this repository.Trouble with iMessage? Check out the notes included in this repository.Highly recommended macOS tweaks - https://github.com/sickcodes/osx-optimizerIs This Legal?The "secret" Apple OSK string is widely available on the Internet. It is also included in a public court document available here. I am not a lawyer but it seems that Apple's attempt(s) to get the OSK string treated as a trade secret did not work out. Due to these reasons, the OSK string is freely included in this repository.Please review the 'Legality of Hackintoshing' documentation bits from Dortania's OpenCore Install Guide.Gabriel Somlo also has some thoughts on the legal aspects involved in running macOS under QEMU/KVM.You may also find this 'Announcing Amazon EC2 Mac instances for macOS' article interesting.Note: It is your responsibility to understand, and accept (or not accept) the Apple EULA.Note: This is not legal advice, so please make the proper assessments yourself and discuss with your lawyers if you have any concerns (Text credit: Dortania)MotivationMy aim is to enable macOS based educational tasks, builds + testing, kernel debugging, reversing, and macOS security research in an easy, reproducible manner without getting 'invested' in Apple's closed ecosystem (too heavily).These Virtual Hackintoshsystems are not intended to replace the genuine physical macOS systems.Personally speaking, this repository has been a way for me to 'exit' the Apple ecosystem. It has helped me to test and compare the interoperability of Canon CanoScan LiDE 120scanner, and Brother HL-2250DNlaser printer. And these devices now work decently enough on modern versions of Ubuntu (Yay for free software). Also, a long time back, I had to completely wipe my (then) brand new MacBook Pro (Retina, 15-inch, Late 2013)and install Xubuntu on it - as the OS X kernel kept crashing on it!Backstory: I was a (poor) student in Canada in a previous life and Apple made my work on cracking Apple Keychains a lot harder than it needed to be. This is how I got interested in Hackintosh systems.
2023年09月19日
105 阅读
0 评论
0 点赞
2020-12-14
Java_swing | JButton监听按钮点击事件
// 创建登录按钮 JButton loginButton = new JButton("login"); loginButton.setBounds(10, 80, 80, 25); // 添加按钮的点击事件监听器 loginButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // 获取到的事件源就是按钮本身 // JButton btn = (JButton) e.getSource(); System.out.println("按钮被点击"); } }); panel.add(loginButton);
2020年12月14日
100 阅读
0 评论
0 点赞
2020-12-14
Java_Swing
package com.okk.hextostring;/* * ┏┓ ┏┓ + + * ┏━┛┻━━━━━┛┻━┓ + + * ┃ ┃ + + + * ┃ ━ ┃ + + + + * ████━████ ┃ + + + * ┃ ┃ + + * ┃ ━┻ ┃ + * ┃ ┃ + * ┗━━┓ ┏━━┛ + * ┃ ┃ + + + + * ┃ ┃ + + + + + + + + * ┃ ┃ + Code is far away from bug with the animal protecting * ┃ ┃ + 神兽保佑,代码无bug * ┃ ┃ + @author shy @date:2020-12-12 15:43 * ┃ ┃ + + + + + + + + + + + + + + + + + + + + + + + + + + + + * ┃ ┗━━━━━━━━━┓ + * ┃ ┣━┓ + * ┃ ┏━┛ + + * ┗━┓ ┓ ┏━━┳ ┓ ┏━━┛ + + * ┃ ┫ ┫ ┃ ┫ ┫ + + * ┗━┻━┛ ┗━┻━┛ + */ import javax.swing.*; import java.awt.*; public class Main { /** * 创建并显示GUI。出于线程安全考虑, * 这个方法在事件调用线程中调用 */ public static void createAndShowGUI(){ //确保一个漂亮的外观风格 JFrame.setDefaultLookAndFeelDecorated(true); //创建及设置窗口 JFrame jFrame = new JFrame("test"); jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Setting the width and height of frame jFrame.setSize(350, 200); /* * 总结: * 1、单独使用setSize()时,是按照设置的大小显示的;此时不能使用pack(),否则按照pack()自动适配 * 2、单独使用pack()时,是按照组件的大小自动适配的 * 3、单独使用setPreferredSize()时,设置的大小无效,必须在后面添加pack()配合显示 * * pack() 调整此窗口的大小,以适合其子组件的首选大小和布局 * 就算JFrame用setSize来设定框体大小,用了pack()一样会改变成刚好能包含全部组件的框体。 * * 当使用setPreferredSize()时需要配合pack()显示,否则setPreferredSize()的设置效果不生效 * * */ // this.setSize(800, 600); /* * 总结: * 1、单独使用setSize()时,是按照设置的大小显示的;此时不能使用pack(),否则按照pack()自动适配 * 2、单独使用pack()时,是按照组件的大小自动适配的 * 3、单独使用setPreferredSize()时,设置的大小无效,必须在后面添加pack()配合显示 * * pack() 调整此窗口的大小,以适合其子组件的首选大小和布局 * 就算JFrame用setSize来设定框体大小,用了pack()一样会改变成刚好能包含全部组件的框体。 * * 当使用setPreferredSize()时需要配合pack()显示,否则setPreferredSize()的设置效果不生效 * * */ jFrame.setPreferredSize(new Dimension(800, 600)); // //添加helloworld标签 // JLabel label = new JLabel("HD"); // jFrame.getContentPane().add(label); /* 创建面板,这个类似于 HTML 的 div 标签 * 我们可以创建多个面板并在 JFrame 中指定位置 * 面板中我们可以添加文本字段,按钮及其他组件。 */ JPanel panel = new JPanel(); // 添加面板 jFrame.add(panel); /* * 调用用户定义的方法并添加组件到面板 */ placeComponents(panel); /** * JFrame.pack() * pack() 调整此窗口的大小,以适合其子组件的首选大小和布局 * 单独使用setSize()时,不能使用pack(),否则按照pack()自动适配 * * 单独使用pack()时,是按照组件的大小自动适配的 * * 单独使用setPreferredSize()时,设置的大小无效,必须在后面添加pack()配合显示,否则设置效果不生效 */ jFrame.pack(); //显示窗口 jFrame.setVisible(true); } private static void placeComponents(JPanel panel) { /* 布局部分我们这边不多做介绍 * 这边设置布局为 null */ panel.setLayout(null); // 创建 JLabel JLabel userLabel = new JLabel("User:"); /* 这个方法定义了组件的位置。 * setBounds(x, y, width, height) * x 和 y 指定左上角的新位置,由 width 和 height 指定新的大小。 */ userLabel.setBounds(10,20,80,25); panel.add(userLabel); /* * 创建文本域用于用户输入 */ JTextField userText = new JTextField(20); userText.setBounds(100,20,165,25); panel.add(userText); // 输入密码的文本域 JLabel passwordLabel = new JLabel("Password:"); passwordLabel.setBounds(10,50,80,25); panel.add(passwordLabel); /* *这个类似用于输入的文本域 * 但是输入的信息会以点号代替,用于包含密码的安全性 */ JPasswordField passwordText = new JPasswordField(20); passwordText.setBounds(100,50,165,25); panel.add(passwordText); // 创建登录按钮 JButton loginButton = new JButton("login"); loginButton.setBounds(10, 80, 80, 25); panel.add(loginButton); } public static void main(String[] args) { //显示GUi javax.swing.SwingUtilities.invokeLater(new Runnable() { @Override public void run() { createAndShowGUI(); } }); } }
2020年12月14日
91 阅读
0 评论
0 点赞
2020-12-09
Android-RadioButton || 设置button图片居中,
<RadioGroup android:id="@+id/rg_1" android:layout_width="match_parent" android:layout_height="60dp" android:orientation="horizontal"> <RadioButton android:id="@+id/btn_1" android:text="@string/form_map" android:checked="true" android:layout_width="0dp" android:layout_weight="1" android:layout_height="match_parent" android:button="@null" android:textSize="0sp" android:drawableTop="@drawable/radio_button"/>
2020年12月09日
94 阅读
0 评论
0 点赞
1
...
29
30
31
...
37