본문 바로가기

script8

Docker Desktop 불필요한 이미지 삭제하는 배치 스크립트 Windows Docker Desktop에서 이미지 목록을 가져와서 태그 값이 'none'인 이미지를 삭제하는 배치 스크립트를 작성하겠습니다. 이 스크립트는 Docker 명령어를 사용하여 'none' 태그가 있는 이미지를 찾아 삭제합니다. 아래의 스크립트를 참고하세요. @echo off SETLOCAL ENABLEDELAYEDEXPANSION REM 이미지 목록을 가져옵니다. FOR /f "tokens=*" %%i IN ('docker images -f "dangling=true" -q') DO ( SET imageId=%%i REM 태그가 'none'인 이미지를 삭제합니다. docker rmi !imageId! ) echo Done ENDLOCAL 이 스크립트는 다음과 같이 동작합니다. docker i.. 2024. 3. 1.
Bash Script: How read file line by line (best and worst way) Input: $ cat sample.txt This is sample file This is normal text file Source: $ cat readfile.sh #!/bin/bash i=1; FILE=sample.txt # Wrong way to read the file. # This may cause problem, check the value of 'i' at the end of the loopecho "###############################" cat $FILE | while read line; do echo "Line # $i: $line" ((i++)) done echo "Total number of lines in file: $i" # The worst way to r.. 2014. 9. 19.
JJEncode Script Leads to Drive-By The use of JJEncode in a drive-by download has been around for a couple of years but has been popping up a lot recently. A couple of readers have asked how to deobfuscate this so here’s a walkthrough with a live script.Here’s an automobile forum that’s been compromised:Viewing the source code, this link kicks off the infection:Then from alnera.eu, you end up getting this strange looking Javascri.. 2014. 4. 8.
NMAP을 사용한 Conficker 탐지(Scanning) ■ Install 1. 다운/패키지설치(소스설치-비추천 : http://nmap.org/download.html) wget http://nmap.org/dist/nmap-5.00-1.i386.rpm rpm -vhU nmap-5.00-1.i386.rpm 2. nmap 사용 ( 콘피커 관련 설정 ) nmap -PN -T4 -p139,445 -n -v --script smb-check-vulns,smb-os-discovery --script-args safe=1 10.1.1.10 * 맨끝에 10.1.1.10을 타겟이 될 Windows 관련IP로 변경하시면 됩니다. ■ 사용 예제 1-1. 콘피커 비감염시 - 간편모드(grep만 줫을뿐입니다) [root@localhost /]# nmap -PN -T4 -p139,.. 2013. 8. 5.
Best Cacti Templates for Windows Thoses templates are very interesting to have a global overview of your infrastructure base with windows 2000 and 2003 server .Windows ServerWindows uptime statistics Download and Documentationhttp://forums.cacti.net/about10514.htmlMonitor Windows Service stats from Linux Download and Documentationhttp://forums.cacti.net/about11232.htmlWindows 2000 / 2k3 Disk Statistics Download and Documentatio.. 2012. 9. 8.