Last active
August 29, 2015 14:04
-
-
Save bitIO/fdd63d6571b32b0cfb41 to your computer and use it in GitHub Desktop.
Linux common tasks
This file contains hidden or 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 | |
# posts a file named body.json to url | |
curl -H "Content-Type: application/json" --data-binary @body.json http://localhost:8080/ui/webapp/conf |
This file contains hidden or 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 | |
USER_DATE=JUN-08-2011 | |
# first day of the month | |
FIRST_DAY_OF_MONTH=$(date -d "$USER_DATE" +%b-01-%Y) | |
PREVIOUS_DAY=$(date -d "$USER_DATE -1 days" +%b-%d-%Y) | |
# last day of the month | |
FIRST_DAY_NEXT_MONTH=$(date -d "$USER_DATE +1 month" +%b-01-%Y) | |
LAST_DAY_OF_MONTH=$(date -d "$FIRST_DAY_NEXT_MONTH -1 day" +%b-%d-%Y) | |
echo "User date: $USER_DATE" | |
echo "1. First day of the month: $FIRST_DAY_OF_MONTH" | |
echo "2. Previous day: $PREVIOUS_DAY" | |
echo "3. Last day of the month: $LAST_DAY_OF_MONTH" |
This file contains hidden or 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 | |
kernel="2.6.39"; | |
distro="xyz"; | |
cat > /etc/myconfig.conf << EOL | |
${kernel} | |
${distro} | |
EOL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment