Skip to content

Instantly share code, notes, and snippets.

View jjanczur's full-sized avatar

Jacek Janczura jjanczur

View GitHub Profile
@jjanczur
jjanczur / EC2_volume_increase.md
Last active February 22, 2023 21:55
How to increase EC2 volume size without downtime

How to increase volume without downtime

  1. Take a snapshot of your volume - wait 5 min
  2. open the main volume, click modify and increase the size from e.g. 30 GB to e.g. 40 GB
  3. Exted OS filesystem
  • SSH into you instance.
  • Type df -h to check volume size; You will still have 30GB of volume size.
  • Type lsblk Your increased volume will be shown just above your current volume, e.g. xvda1 is your current volume with 30GB size and xvda with 40GB size.
  • Extend the partition by typing sudo growpart /dev/xvda 1 ; Note that dev/xvda is the partition name and 1 is the partition number.
  • Extend the volume by typing sudo xfs_growfs /dev/xvda1 or sudo resize2fs /dev/xvda1 If you see error try the other one.
@jjanczur
jjanczur / foldingAhome.txt
Created October 7, 2022 16:00
config.xml configuration for Folding@Home
fah@Sithis:~/fahclient-smp$ ./fahsmp --help
20:10:57:INFO(1):Read GPUs.txt
Usage: ./fahsmp [[--config] <filename>] [OPTIONS]...
Command line options:
--chdir <string>
Change directory before starting server. All files opened after this
point, such as the configuration file, must have paths relative to the new
directory.
--config <string=config.xml>
@jjanczur
jjanczur / run_image_from_dockerhub.sh
Created February 16, 2022 19:00
Run the image deployed to the Docker Hub
rm -rf output
docker run \
--rm \
-e IEXEC_IN=/iexec_in \
-e IEXEC_OUT=/iexec_out \
-e IEXEC_INPUT_FILES_NUMBER=1 \
-e IEXEC_INPUT_FILES_FOLDER=/iexec_in \
-e IEXEC_INPUT_FILE_NAME_1=data_set_full.csv \
-v $(pwd)/output:/iexec_out \
-v $(pwd)/sample_data:/iexec_in \
@jjanczur
jjanczur / run_local_container.sh
Created February 16, 2022 18:54
Run localdocker container
rm -rf output && \
docker run \
--rm \
-e IEXEC_IN=/iexec_in \
-e IEXEC_OUT=/iexec_out \
-e IEXEC_INPUT_FILES_NUMBER=1 \
-e IEXEC_INPUT_FILES_FOLDER=/iexec_in \
-e IEXEC_INPUT_FILE_NAME_1=data_set_full.csv \
-v $(pwd)/output:/iexec_out \
-v $(pwd)/sample_data:/iexec_in \
@jjanczur
jjanczur / run_loccally.sh
Created February 16, 2022 18:44
How to run loccaly template_app.py
$ IEXEC_INPUT_FILES_NUMBER=1 \
IEXEC_IN=sample_data \
IEXEC_INPUT_FILES_FOLDER=sample_data \
IEXEC_INPUT_FILE_NAME_1=data_set_full.csv \
IEXEC_OUT=output \
python3 src/template_app.py
@jjanczur
jjanczur / your_python_code.py
Last active February 17, 2022 08:49
template function for pythoncode
def your_python_code(arg, input_path, output_path):
"""
Paste there your code you want to execute in iExec worker
"""
# Open input file
signal = pd.read_csv(input_path)
# Run computation
algo = rpt.Pelt(model="rbf").fit(signal)
result = algo.predict(pen=10)
@jjanczur
jjanczur / port_check.md
Created July 28, 2020 16:02
Verify which pid is on port 8080

Verify which pid is on port 8080

netstat -vanp tcp | grep 8080

@jjanczur
jjanczur / remove_from_git.md
Last active February 19, 2020 15:15
Instruction to remove file permamently from the git and all branches

In Terminal

git filter-branch --index-filter 'git rm --cached --ignore-unmatch [file path/name]' --prune-empty --tag-name-filter cat -- --all

Example:

git filter-branch --index-filter 'git rm --cached --ignore-unmatch config/.env' --prune-empty --tag-name-filter cat -- --all

Add file to .gitignore

@jjanczur
jjanczur / clean.sh
Created February 17, 2020 16:37
Script to quickly free up some space in ubuntu
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
do
> $i
done
@jjanczur
jjanczur / mint_test.sol
Created January 6, 2020 13:54
Gist for mintable tokens
// Test of minting
describe('minted crowdsale', function() {
it('mints tokens after purchase', async function() {
const originalTotalSupply = await this.token.totalSupply();
await this.crowdsale.sendTransaction({ value: ether(1), from: investor1 });
const newTotalSupply = await this.token.totalSupply();
assert.isTrue(newTotalSupply > originalTotalSupply);
});
});