Forum Index


Board index » All Posts




debian / ubuntu 为 APT 设置代理
#1
Just can't stay away
Just can't stay away


为 APT 设置代理

如果要从 Ubuntu 存储库安装软件包,则需要为 APT 设置代理。您可以通过在 /etc/apt/apt.conf.d/ 创建一个新的配置文件来做到这一点:

nano /etc/apt/apt.conf.d/proxy.conf

添加以下行:

Acquire::http::Proxy "http://username::8181/";
Acquire::https::Proxy "https://username::8182/";

完成后保存并关闭文件。您现在可以在系统中安装 Ubuntu 存储库中的任何软件包

Posted on: 9/23 17:18
Top


docker 被墙 http_proxy docker使用http_proxy配置代理解决方法
#2
Just can't stay away
Just can't stay away


sudo mkdir -/etc/systemd/system/docker.service.d/

sudo nvim /etc/systemd/system/docker.service.d/http-proxy.conf 

 cat  
/etc/systemd/system/docker.service.d/http-proxy.conf 
[Service]
Environment="HTTP_PROXY=http://127.0.0.1:9981"
Environment="HTTPS_PROXY=http://127.0.0.1:9981"
Environment="NO_PROXY=localhost,127.0.0.1"

sudo systemctl daemon-reload
sudo systemctl restart docker

Posted on: 9/22 21:03
Top


Re: kubernetes k8s halo blog
#3
Just can't stay away
Just can't stay away


application.yaml

server:
  
port8090
  
# Response data gzip.
  
compression:
    
enabledfalse
spring
:
  
datasource:
   
# MySQL database configuration.
    
driver-class-namecom.mysql.cj.jdbc.Driver
    url
jdbc:mysql://mysql:3306/halo_test_db?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
    
usernamehalo_test_user
    password
123456

##  redis:
##    # Redis cache configuration.
##    port: 6379
##    database: 9
##    host: 10.1.133.64
##    password: 123456
##

halo:

  
# Your admin client path is https://your-domain/{admin-path}
  
admin-pathadmin

  
# memory or level
  
cachememory

Posted on: 2023/11/24 23:23
Top


Re: kubernetes k8s halo blog
#4
Just can't stay away
Just can't stay away


mysql/mysql-pv.yaml

apiVersionv1
kind
PersistentVolume
metadata
:
  
namemysql-pv-volume
  labels
:
    
typelocal
spec
:
  
storageClassNamemanual
  capacity
:
    
storage20Gi
  accessModes
:
    - 
ReadWriteOnce
  hostPath
:
    
path"/mnt/data"
---
apiVersionv1
kind
PersistentVolumeClaim
metadata
:
  
namemysql-pv-claim
spec
:
  
storageClassNamemanual
  accessModes
:
    - 
ReadWriteOnce
  resources
:
    
requests:
      
storage20Gi



mysql/mysql-deployment.yaml


apiVersionv1
kind
Service
metadata
:
  
namemysql
spec
:
  
ports:
  - 
port3306
  selector
:
    
appmysql
  clusterIP
None
---
apiVersionapps/v1
kind
Deployment
metadata
:
  
namemysql
spec
:
  
selector:
    
matchLabels:
      
appmysql
  strategy
:
    
typeRecreate
  template
:
    
metadata:
      
labels:
        
appmysql
    spec
:
      
containers:
      - 
imagemysql:8.2
        name
mysql
        env
:
          
# Use secret in real usage
        
nameMYSQL_ROOT_PASSWORD
          value
password
        ports
:
        - 
containerPort3306
          name
mysql
        volumeMounts
:
        - 
namemysql-persistent-storage
          mountPath
: /var/lib/mysql
      volumes
:
      - 
namemysql-persistent-storage
        persistentVolumeClaim
:
          
claimNamemysql-pv-claim

Posted on: 2023/11/24 23:21
Top


Re: php webshell 安全配置
#5
Just can't stay away
Just can't stay away


location / {

include fastcgi_params;

fastcgi_pass docker_lnmp-8.1-fpm-1:9000;
fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_param SCRIPT_NAME /index.php;
fastcgi_param PATH_INFO $request_uri;
}

Posted on: 2023/11/19 15:17
Top


php webshell 安全配置
#6
Just can't stay away
Just can't stay away


禁止php webshell配置
网络安全攻防之webshell安全配置

server {

    
listen             80;
    
listen             [::]:80;



    
server_name        www.flarum.web;

    
set                $base /home/_www_home/www_site/www.flarum.web/src;
    
root               $base/public;

    
index              index.html index.htm index.php;
    
# php file deny
    
location ~ .php$ {
        return 
500;
    }

    
location /assets/ {
        
expires        7d;
        
root           $base/public/;
    }

    
location / {

        include        
fastcgi_params;

        
fastcgi_pass   docker_lnmp-8.1-fpm-1:9000;
        
fastcgi_index  index.php;

        
fastcgi_param  SCRIPT_FILENAME $document_root/index.php;
        
fastcgi_param  SCRIPT_NAME /index.php;
        
fastcgi_param  PATH_INFO $request_uri;
    }


}


Posted on: 2023/11/12 20:26
Top


Re: ffmpeg vp9 dash av1 dash
#7
Just can't stay away
Just can't stay away


#!/bin/bash

filepath=$1




ffmpeg -i "$filepath" -vn -acodec copy a.m4a

ffmpeg -i "$filepath" -c:v libaom-av1 -keyint_min 150 -g 150 -tile-columns 2 -cpu-used 8 -frame-parallel 1 -f mp4 \
-an -vf scale=320:180 -b:v 180k -dash 1 180.mp4

ffmpeg -i "$filepath" -c:v libaom-av1 -keyint_min 150 -g 150 -tile-columns 2 -cpu-used 8 -frame-parallel 1 -f mp4 \
-an -vf scale=640:360 -b:v 300k -dash 1 360.mp4

ffmpeg -i "$filepath" -c:v libaom-av1 -keyint_min 150 -g 150 -tile-columns 2 -cpu-used 8 -frame-parallel 1 -f mp4 \
-an -vf scale=1280:720 -b:v 500k -dash 1 720.mp4

ffmpeg -i "$filepath" -c:v libaom-av1 -keyint_min 150 -g 150 -tile-columns 2 -cpu-used 8 -frame-parallel 1 -f mp4 \
-an -vf scale=1920:1080 -b:v 800k -dash 1 1080.mp4

ffmpeg -i "$filepath" -c:v libaom-av1 -keyint_min 150 -g 150 -tile-columns 2 -cpu-used 8 -frame-parallel 1 -f mp4 \
-an -vf scale=3840:2160 -b:v 1200k -dash 1 2160.mp4

##################################################


docker run -v `pwd`:/media -it --net=host --rm google/shaka-packager:v2.5.1

packager \
in=a.m4a,stream=audio,init_segment='myvideo/a/init.mp4',segment_template='myvideo/a/$Number%03d$.m4s' \
in=2160.mp4,stream=video,init_segment='myvideo/2160/init.mp4',segment_template='myvideo/2160/$Number%03d$.m4s' \
in=1080.mp4,stream=video,init_segment='myvideo/1080/init.mp4',segment_template='myvideo/1080/$Number%03d$.m4s' \
in=720.mp4,stream=video,init_segment='myvideo/720/init.mp4',segment_template='myvideo/720/$Number%03d$.m4s' \
in=360.mp4,stream=video,init_segment='myvideo/360/init.mp4',segment_template='myvideo/360/$Number%03d$.m4s' \
in=180.mp4,stream=video,init_segment='myvideo/180/init.mp4',segment_template='myvideo/180/$Number%03d$.m4s' \
--segment_duration 10 \
--generate_static_live_mpd \
--mpd_output myvideo/manifest.mpd

Posted on: 2023/11/7 20:57

Edited by eyex on 2024/3/28 13:18:36
Top


debian docker
#8
Just can't stay away
Just can't stay away


1, Set up Docker's apt repository.

# Add Docker's official GPG key:
sudo apt-get update
sudo apt
-get install ca-certificates curl gnupg
sudo install 
-m 0755 -/etc/apt/keyrings
curl 
-fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+/etc/apt/keyrings/docker.gpg

# Add the repository to Apt sources:
echo 
  
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian 
  "
$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" 
  
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt
-get update

2, Install the Docker packages.

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin


3, Verify that the installation is successful by running the hello-world image:

sudo docker run hello-world






Posted on: 2023/10/31 15:09
Top


microk8s ufw 防火墙
#9
Just can't stay away
Just can't stay away


I've tried allowing based on MicroK8s subnets with the following:
sudo ufw allow in from 10.1.0.0/16 to 10.152.183.0/24
sudo ufw allow in from 10.152.183.0
/24 to 10.1.0.0/16  
sudo ufw allow out from 10.1.0.0
/16 to 10.152.183.0/24
sudo ufw allow out from 10.152.183.0
/24 to 10.1.0.0/16

but that did not work. @Cynerva mentioned this is likely due to the kube-proxy managing rules that forward that traffic to , and that traffic is then filtered by ufw rules. I have not been successful in getting this to work.

The best option I have at the moment is:
sudo ufw allow in on cali+
sudo ufw allow out on cali+
sudo ufw default allow routed



sudo ufw allow in on cni0
sudo ufw allow out on cni0
sudo ufw 
default allow routed

Posted on: 2023/10/6 0:43
Top


Re: linux split 分割文件
#10
Just can't stay away
Just can't stay away


split -b 400M video.avi

Posted on: 2023/9/21 18:48
Top



TopTop
1 2 3 4 ... 11 »



friend links
Themes

(2 themes)
Login
Username:

Password:


Lost Password?
Register now!
Categories
Xoops (11)
--Modules (2)
--Themes (0)
Article (8)