๐—ข๐˜‡๐—ผ๐—ฑ๐—ฏ๐—ฒ๐—ธ๐——๐—ฒ๐˜ƒ
370 subscribers
136 photos
65 videos
76 files
117 links
Dasturlash | Kiberxavfsizlik | Shaxsiy blog
.............................................................................
Build Break Secure

@ozodbekdevv | @dasturchichoyxonasi
Download Telegram
๐—ข๐˜‡๐—ผ๐—ฑ๐—ฏ๐—ฒ๐—ธ๐——๐—ฒ๐˜ƒ
maqola.ozodbekdev.uz/linux-bildirishnomalari
๐Ÿง LINUX BILDIRISHNOMALAR QO'LLANMASI

๐Ÿ“š .sh skriptlar orqali Desktop Notifications

Nima o'rganasiz:
โœ… notify-send to'liq ishlatish
โœ… Amaliy misollar: monitoring, backup, pentesting
โœ… Cron va systemd avtomatlashtirish
โœ… DISPLAY/DBUS muammolarini hal qilish
โœ… Xavfsizlik va best practices

๐ŸŽฏ Kimlar uchun:
Linux adminlar | DevOps | Pentesterlar

๐Ÿ”– #Linux #BashScripting #Notifications

Muallif: @ozodbekdevv | claude
โค8
Doim endigina buglar yo'qolib kod ishlay boshlaganda Telegram beliga tepadi

Go hamma Telegramga spam bossin. Uni ham frozen qilamiz
๐Ÿคฃ7๐Ÿ˜3โค2๐Ÿ’‹1
Forwarded from Sardor Dushamov | PHP
O'qib bo'lganingizdan keyin Leonardio Dikaprioni anu giftini ko'z oldingizga keltiring: ana, ana deb barmog'ini ko'rsatadiyu)
๐Ÿ’ฏ7221
DevPanel.uz da yangilik

Endilikda dasturlash bilimlarisiz va 100% bepul shaxsiy vebsaytingizni quring. Bu imkoniyat devpanel.uz ning Vizitka Website boสปlimida, 7xil dizayn mavjud va xohlagancha url link kiritish mumkin


๐Ÿ”— namuna
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
5111
Koโ€˜p loyihalarda kod ishlayapti โ€” demak hammasi joyida, degan xulosa qilinadi.

Aslida esa kod bugungi talabni yopayotgandir, lekin ertangi oโ€˜zgarishga tayyor emas.
Men koโ€˜rgan muammolarning 70%:
โ€ขnotoโ€˜gโ€˜ri abstraction
โ€ขvaqtida qilinmagan refactor
โ€ขโ€œkeyin koโ€˜ramizโ€ deb qoldirilgan qarorlar

Kod ishlashi yetarli emas, u qarorlarni koโ€˜tara olishi kerak.

๐Ÿ‘‰ Savol: Sizda hozir ishlayotgan, lekin ichingizga sigโ€˜mayotgan kod bormi?
1๐Ÿ”ฅ4
Real hayotdan olingan....๐Ÿ˜Ž
Please open Telegram to view this post
VIEW IN TELEGRAM
1๐Ÿ˜64
Forwarded from Ilhomjon Iskandarov
image check.zip
24.5 KB
rasm ai yoki haqiqiy ekanligini tekshiruvchi kichik dasturcha )

ishlatilish: file zip dan ochilib file ichiga kirilgan holda terminal ochilishi va terminalda quydagi kodlar yozilishi kerak.

1
npm i --force

2
npm start 

2
localhost:5000
port da run bo'ladi
ping-pong๐Ÿ“
Please open Telegram to view this post
VIEW IN TELEGRAM
#include <stdio.h>

\#define WIDTH 80
#define HEIGHT 25
#define PADDLE_HEIGHT 3
#define WIN_SCORE 21

typedef struct {
int x, y;
} Paddle;

typedef struct {
int x, y;
int dx, dy;
} Ball;

typedef struct {
int score1, score2;
Paddle p1, p2;
Ball ball;
} GameState;

void init_game(GameState *game);
void draw_board(const GameState *game);
void player_input(GameState *game);
void update_ball(GameState *game);
int check_winner(const GameState *game);
void draw_winner(int player);

int main(void) {
GameState game;
init_game(&game);

while (!check_winner(&game)) {
draw_board(&game);
player_input(&game);
update_ball(&game);
}

draw_winner(check_winner(&game));
return 0;
}


void init_game(GameState *game) {
game->score1 = 0;
game->score2 = 0;

game->p1.x = 1;
game->p2.x = WIDTH - 2;

game->p1.y = (HEIGHT - PADDLE_HEIGHT) / 2;
game->p2.y = (HEIGHT - PADDLE_HEIGHT) / 2;

game->ball.x = WIDTH / 2;
game->ball.y = HEIGHT / 2;
game->ball.dx = 1;
game->ball.dy = 1;
}

void draw_board(const GameState *game) {
// ANSI clear screen (allowed, not a system call)
printf("\033[2J\033[H");

printf("Player 1: %d", game->score1);
printf("%*s", WIDTH - 20, "");
printf("Player 2: %d\n", game->score2);

for (int y = 0; y < HEIGHT; y++) {
for (int x = 0; x < WIDTH; x++) {
if (y == 0 || y == HEIGHT - 1) {
putchar('#');
} else if (x == game->p1.x && y >= game->p1.y && y < game->p1.y + PADDLE_HEIGHT) {
putchar('|');
} else if (x == game->p2.x && y >= game->p2.y && y < game->p2.y + PADDLE_HEIGHT) {
putchar('|');
} else if (x == game->ball.x && y == game->ball.y) {
putchar('O');
} else {
putchar(' ');
}
}
putchar('\n');
}
}

void player_input(GameState *game) {
char c;

do {
c = getchar();
} while (c == '\n');

const int MIN_Y = 1;
const int MAX_Y = HEIGHT - 2 - PADDLE_HEIGHT;

if (c == ' ') return;

if ((c == 'a' || c == 'A') && game->p1.y > MIN_Y)
game->p1.y--;
else if ((c == 'z' || c == 'Z') && game->p1.y < MAX_Y)
game->p1.y++;

else if ((c == 'k' || c == 'K') && game->p2.y > MIN_Y)
game->p2.y--;
else if ((c == 'm' || c == 'M') && game->p2.y < MAX_Y)
game->p2.y++;
}

void update_ball(GameState *game) {
game->ball.x += game->ball.dx;
game->ball.y += game->ball.dy;

if (game->ball.y <= 1 || game->ball.y >= HEIGHT - 2) {
game->ball.dy = -game->ball.dy;
}

if (game->ball.dx < 0 && game->ball.x == game->p1.x + 1 && game->ball.y >= game->p1.y &&
game->ball.y < game->p1.y + PADDLE_HEIGHT) {
game->ball.dx = -game->ball.dx;
}

if (game->ball.dx > 0 && game->ball.x == game->p2.x - 1 && game->ball.y >= game->p2.y &&
game->ball.y < game->p2.y + PADDLE_HEIGHT) {
game->ball.dx = -game->ball.dx;
}

if (game->ball.x <= 0) {
game->score2++;
} else if (game->ball.x >= WIDTH - 1) {
game->score1++;
} else {
return;
}

game->ball.x = WIDTH / 2;
game->ball.y = HEIGHT / 2;
game->ball.dx = (game->ball.dx > 0) ? -1 : 1;
game->ball.dy = 1;
}

int check_winner(const GameState *game) {
if (game->score1 >= WIN_SCORE) return 1;
if (game->score2 >= WIN_SCORE) return 2;
return 0;
}

void draw_winner(int player) {
printf("\033[2J\033[H\n");
printf("Player %d wins!\n", player);
}