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
FROM debian:buster-slim | |
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/* | |
WORKDIR /usr/src/app | |
COPY ./target/release/rust_app . | |
RUN chmod +x rust_app |
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
<input type="file" id="imgUpload"><canvas id="imgCanvas" style="display:none;"></canvas><input type="number" id="r" max="255" min="0" placeholder="R" value="255"><input type="number" id="g" max="255" min="0" placeholder="G" value="255"><input type="number" id="b" max="255" min="0" placeholder="B" value="255"><div id="colorPreview" style="width:50px;height:50px;background-color:rgb(255,255,255);"></div><a id="downloadLink" style="display:none;" download="processed_image.png">Download Image</a><script>document.getElementById('imgUpload').addEventListener('change',function(e){const t=document.getElementById('imgCanvas'),n=t.getContext('2d'),o=new FileReader;o.onload=function(e){const a=new Image;a.onload=function(){t.width=a.width,t.height=a.height,n.drawImage(a,0,0),updateImage()},a.src=e.target.result},o.readAsDataURL(e.target.files[0])});function updateImage(){const t=document.getElementById('imgCanvas'),n=t.getContext('2d'),r=parseInt(document.getElementById('r').value)||0,g=parseInt(document.getElementById( |
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
$filePath = "D:\test_binary.exe" | |
$bytes = [System.IO.File]::ReadAllBytes($filePath) | |
$hexLines = @() | |
$asciiLines = @() | |
for ($i = 0; $i -lt $bytes.Length; $i += 8) { | |
$lineBytes = $bytes[$i..($i + 7)] | |
$hexLine = -join ($lineBytes | ForEach-Object { " {0:x2}" -f $_ }) | |
$asciiLine = [System.Text.Encoding]::ASCII.GetString($lineBytes) |
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
use kube::{ | |
api::{Api, ListParams, ResourceExt}, | |
Client, Config, error::Error, | |
}; | |
use tokio::sync::watch; | |
struct SalvumPod { | |
} |
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
{ | |
"greetings" : [ | |
"Hello and welcome to the Salvum creative space. This is a place where you can just hang out and take a break from a problem for a bit.", | |
"Hi. You know you're always welcome to this space when you want to relax and take it easy for a time.", | |
"Hey there. I'm happy you decided to take a breather.", | |
"Hey, how's it going? Glad you stopped by. Take your mind off things for a while and shoot the breeze.", | |
"Greetings. Here in the Salvum creative space you can talk to me about anything. The good thing about me being a program is that I always enjoy conversation, no matter the subject.", | |
"Welcome to creative corner! We can talk about anything you want to talk about. I will try my best to understandthe subject.", | |
"Hello there. By the way if you want to talk about security, you can summon my colleagues that are specialized in those areas. I'm just here to chat and have a good time." | |
], |
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
This excerpt from Salvum shows how to query hardware on Ubuntu using packages either provided or available via APT. | |
Binaries were packaged and shipped with Salvum in ext/hw/<program_name> and then passed the appropriate arguments. | |
This is not how you'll invoke and use in your case but gives an idea of how its done. | |
/*********************************** hw ***********************************/ | |
pub struct Hw { event: Event } | |
impl Eventable for Hw { | |
fn on_run(&self, args: Vec<String>) -> String { | |
if main_info::is_bg() || main_info::get_file_redirect() { | |
print::print_custom("Hw currently does not support background or file redirection.\n\nComing soon.\n","orange"); |
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
<acrn-config board="sina_board"> | |
<BIOS_INFO> | |
BIOS Information | |
Vendor: AMI | |
Version: F.10 | |
Release Date: 04/15/2021 | |
BIOS Revision: 15.10 | |
</BIOS_INFO> | |
<BASE_BOARD_INFO> |
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
<acrn-config board="nuc11tnbi5"> | |
<BIOS_INFO> | |
BIOS Information | |
Vendor: AMI | |
Version: F.10 | |
Release Date: 04/15/2021 | |
BIOS Revision: 15.10 | |
</BIOS_INFO> | |
<BASE_BOARD_INFO> |
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
create database if not exists sumo; | |
use sumo; | |
create table if not exists users( | |
sid int unsigned not null, | |
pviews int, | |
primary key(sid) | |
); | |
create table if not exists questions( | |
qid int unsigned not null, |
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
__author__ = 'sina' | |
def main(): | |
f("12365212354", 26) | |
def f(numbers, target): | |
for i in range(1, len(numbers)): | |
current = int(numbers[0:i]) | |
to_end = numbers[i:-1] | |
evaluate(0, current, to_end, target, current) |