This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <ctype.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <math.h> | |
#include "expcalc.h" | |
enum | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stddef.h> | |
#include <stdlib.h> | |
struct point { | |
int t; | |
double R; | |
}; | |
const struct point NCP18XH103F03RB_10K[]={ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
IFACE_NAME="p2p1" | |
IFACE_IP="192.168.1.1" | |
RES=`ping -I ${IFACE_NAME} ${IFACE_IP} -c 3 | grep "100%" |wc -l` | |
if ! [ ${RES} -ne "1" ]; | |
then | |
echo "${IFACE_NAME} is not working" | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#1. сhange CWD to / | |
cd / | |
#2. disconnect from current terminal | |
exec >/dev/null | |
exec 2>/dev/null | |
#3. forked and leave in background |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# recursive rights setup for files and directories (instead of chmod -R) | |
find ${DIR} -type d -exec chmod 755 {} \; | |
find ${DIR} -type f -exec chmod 644 {} \; | |
# in the case of blocking by seLinux: | |
# restorecon -rv /var/www/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Copyright (C) 2010 Matthias Buecher (http://www.maddes.net/) | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# http://www.gnu.org/licenses/gpl-2.0.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for line in $(seq 996 1086) ; do history -d 996; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main (int argc, char *argv[]) | |
{ | |
int i; | |
int j; | |
int n=2; | |
int size = 2*n+1; | |
int (*data)[size] = malloc(sizeof(int[size][size])); | |
memset(data, 0, sizeof(int[size][size])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eux | |
if [[ "$DESKTOP" =~ ^(true|yes|on|1|TRUE|YES|ON])$ ]]; then | |
exit | |
fi | |
echo "==> Disk usage before minimization" | |
df -h | |
echo "==> Installed packages before cleanup" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#sort | |
ps -eo size,pid,user,command | awk '{ hr=$1/1024 ; printf("%13.6f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | sort | |
# memory statistics | |
cat /proc/meminfo | |
# drop cache (but not for VPS) | |
sync |
OlderNewer