Skip to content

Instantly share code, notes, and snippets.

View llccing's full-sized avatar
🎯
Focusing

Rowan Liu llccing

🎯
Focusing
View GitHub Profile

Before this clear the old proxy git config --global --unset http.proxy git config --global --unset https.proxy

To access GitHub from a Ubuntu server in China, you may need to configure your system to bypass potential restrictions. Here are some steps you can follow:

  1. Update your hosts file:

#!/bin/bash
# 定义数据库相关变量
DB_USER="newxxx"
DB_PASSWORD="newxxx"
DB_NAME="newxxx"
# 确保 PostgreSQL 服务正在运行
sudo systemctl start postgresql
#!/bin/bash
# 数据库配置变量
DB_USER="xxx"
DB_PASSWORD="xxx"
DB_NAME="xxx"
DB_HOST="0.0.0.0" # 监听所有 IP 地址,根据需要可以修改为特定的外部 IP 地址
# 安装 PostgreSQL
echo "Installing PostgreSQL..."
#!/bin/bash
# 脚本用于自动化配置 Nginx 以支持 HTTPS 和 WebSocket (WSS)
# 新子域名
new_domain=$1
# 检查参数
if [ -z "$new_domain" ]; then
echo "Usage: $0 <newdomain.xindamate.com>"
#!/bin/bash
# 确保脚本以 root 权限运行
if [ "$EUID" -ne 0 ]
then echo "请以 root 权限运行"
exit
fi
# 更新系统包列表
echo "更新系统包列表..."
#!/bin/bash
# 更新系统软件包列表
sudo apt update
# 安装必需的软件包
for pkg in curl wget git vim; do
if ! command -v $pkg &> /dev/null; then
echo "Installing $pkg..."
sudo apt install -y $pkg
#!/bin/bash
# 确保脚本以 root 权限运行
if [ "$EUID" -ne 0 ]
then echo "请以 root 权限运行"
exit
fi
# 同步磁盘数据,确保所有缓存数据写入磁盘
echo "正在同步磁盘数据..."
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<meta charset="UTF-8">
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
@llccing
llccing / postgresInit.sh
Created April 11, 2024 00:18
初始化一个 postgres 数据库,使用随机密码,并且将连接字符串打印到当前server的一个文件中
#!/bin/bash
# 生成随机密码
POSTGRES_PASSWORD=$(openssl rand -base64 12)
# 数据库名称
DATABASE_NAME=server
# 创建 Docker 卷
docker volume create postgres_data
@llccing
llccing / setup.sh
Created April 11, 2024 00:17
用于在 Ubuntu 上初始化开发环境,包含了zip, git, java, nodejs, sdkman, pm2, docker, docker-compose 这些常用的工具,以及初始化 ssh key Ed25519
i#!/bin/bash
# 更新系统软件包列表
sudo apt update
# 安装必需的软件包
for pkg in curl wget git vim; do
if ! command -v $pkg &> /dev/null; then
echo "Installing $pkg..."
sudo apt install -y $pkg