Skip to content

Instantly share code, notes, and snippets.

View skylens's full-sized avatar
🎯
Focusing

skylens

🎯
Focusing
View GitHub Profile
@skylens
skylens / init.gradle.kts
Created March 16, 2024 03:21 — forked from wuseal/init.gradle.kts
国内全局加速Gradle依赖下载速度配置,把这个文件放到~/.gradle目录下既可
/**
* Created by Seal.Wu on 2020/7/11
* Description: Set up mirrors for Gradle Globally
*/
val MAVEN_REPOSITORY_URL = "https://maven.aliyun.com/repository/central"
val JCENTER_REPOSITORY_URL = "https://maven.aliyun.com/repository/jcenter"
val GOOGLE_REPOSITORY_URL = "https://maven.aliyun.com/repository/google"
val GRADLE_PLUGIN_REPOSITORY_URL = "https://maven.aliyun.com/repository/gradle-plugin"
gradle.settingsEvaluated {
@skylens
skylens / Create-Jenkins-Master-On-Windows-Server-Core.ps1
Created January 11, 2024 15:44 — forked from PlagueHO/Create-Jenkins-Master-On-Windows-Server-Core.ps1
Create a Jenkins Master on a Windows Server 2012 R2 Core install
# Configure the settings to use to setup this Jenkins Executor
$Port = 80
$IPAddress = '192.168.1.96'
$SubnetPrefixLength = 24
$DNSServers = @('192.168.1.1')
$DefaultGateway = '192.168.1.1'
# Install .NET Framework 3.5
Install-WindowsFeature -Name NET-Framework-Core
#!/bin/bash
# /ect/profile.d/history.sh
USER_IP=`who -u am i 2>/dev/null| awk '{print $NF}'|sed -e 's/[()]//g'`
if [ "$USER_IP" = "" ]; then
USER_IP=`hostname`
fi
export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "
shopt -s histappend
export PROMPT_COMMAND="history -n;history -a"

使用 ansible 部署 ssh 公钥

安装 ansible

mkdir ansible-init && cd ansible-init
pip3 install virtualenv
virtualenv -p /usr/bin/python3 venv
source venv/bin/activate
pip3 install ansible

cobbler install

yum install -y cobbler cobbler-web xinetd syslinux pykickstart dhcp dnsmasq debmirror fence-agents
systemctl enable cobblerd httpd xinetd rsyncd dhcpd
systemctl start cobblerd httpd xinetd rsyncd dhcpd
systemctl status httpd
systemctl status cobblerd
systemctl status xinetd
systemctl status dhcpd

列出当前路径下最占用磁盘空间的前十个文件

du -a | sort -n -r | head -n 10

du - 计算目录的磁盘空间占用的大小,及文件大小 sort - 排序 head - 取出多少行

CentOS 6 上编译安装 openssh 7.9p1

准备

yum groupinstall 'Development Tools' -y
yum install wget vim nano mosh -y

下载对应的软件包

CentOS 7 安装 iptables

停用 firewalld 服务

systemctl stop firewalld
systemctl disable firewalld
systemctl mask firewalld

selinux 开启关闭

网上找到的脚本

#!/bin/bash  
#  -------------+--------------------   
# * Filename    :       selinux.sh           
# * Revision    :       2.0             
# * Date        :       2017-09-02

Linux 下进程相关操作

查看进程号,进程名为 'name'

ps -ef | grep "name" | grep -v grep | awk '{print $2}'

ps -ef | awk '/[n]ame/{print $2}'

ps x | awk '/[n]ame/{print $1}'